@Component public class LongFreeTextTextareaHandler extends java.lang.Object implements WebDatatypeHandler<LongFreeTextDatatype,java.lang.String>, DownloadableDatatypeHandler<java.lang.String>
LongFreeTextDatatype
that displays as a textarea.Constructor and Description |
---|
LongFreeTextTextareaHandler() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType(CustomDatatype<java.lang.String> dt,
java.lang.String valueReference) |
java.lang.String |
getFilename(CustomDatatype<java.lang.String> dt,
java.lang.String valueReference) |
java.lang.String |
getValue(LongFreeTextDatatype datatype,
javax.servlet.http.HttpServletRequest request,
java.lang.String formFieldName)
Handles a form submission including a widget generated by this handler
|
java.lang.String |
getWidgetHtml(LongFreeTextDatatype datatype,
java.lang.String formFieldName,
java.lang.String widgetId,
java.lang.String startingValue)
Generates the HTML for a widget
|
void |
setHandlerConfiguration(java.lang.String handlerConfig)
An
AttributeType will typically be configured with a handler and a configuration. |
java.lang.String |
toHtml(CustomDatatype<java.lang.String> datatype,
java.lang.String valueReference)
Renders the full view of a custom value, as HTML.
|
CustomDatatype.Summary |
toHtmlSummary(CustomDatatype<java.lang.String> datatype,
java.lang.String valueReference)
Renders an HTML-formatted summary view of the custom value, that does not take a lot of space.
|
void |
writeToStream(CustomDatatype<java.lang.String> dt,
java.lang.String valueReference,
java.io.OutputStream os)
Writes the custom value to os.
|
public void setHandlerConfiguration(java.lang.String handlerConfig)
CustomDatatypeHandler
AttributeType
will typically be configured with a handler and a configuration. The framework
takes care of constructing a handler, and setting its configuration (if any)setHandlerConfiguration
in interface CustomDatatypeHandler<CustomDatatype<java.lang.String>,java.lang.String>
CustomDatatypeHandler.setHandlerConfiguration(java.lang.String)
public CustomDatatype.Summary toHtmlSummary(CustomDatatype<java.lang.String> datatype, java.lang.String valueReference)
HtmlDisplayableDatatypeHandler
toHtmlSummary
in interface HtmlDisplayableDatatypeHandler<java.lang.String>
HtmlDisplayableDatatypeHandler.toHtmlSummary(org.openmrs.customdatatype.CustomDatatype, java.lang.String)
public java.lang.String toHtml(CustomDatatype<java.lang.String> datatype, java.lang.String valueReference)
HtmlDisplayableDatatypeHandler
toHtml
in interface HtmlDisplayableDatatypeHandler<java.lang.String>
HtmlDisplayableDatatypeHandler.toHtml(org.openmrs.customdatatype.CustomDatatype, java.lang.String)
public java.lang.String getWidgetHtml(LongFreeTextDatatype datatype, java.lang.String formFieldName, java.lang.String widgetId, java.lang.String startingValue)
WebDatatypeHandler
getWidgetHtml
in interface WebDatatypeHandler<LongFreeTextDatatype,java.lang.String>
datatype
- the underlying datatype for this widgetformFieldName
- the name the widget should submit withwidgetId
- a unique id, generated by the web framework, that the widget should usestartingValue
- the initial value for the generated HTMLWebDatatypeHandler.getWidgetHtml(org.openmrs.customdatatype.CustomDatatype, java.lang.String, java.lang.String, java.lang.Object)
public java.lang.String getValue(LongFreeTextDatatype datatype, javax.servlet.http.HttpServletRequest request, java.lang.String formFieldName) throws InvalidCustomValueException
WebDatatypeHandler
getValue
in interface WebDatatypeHandler<LongFreeTextDatatype,java.lang.String>
datatype
- the underlying datatype for this widgetrequest
- the submitted HTTP requestformFieldName
- the same value passed to WebDatatypeHandler.getWidgetHtml(CustomDatatype, String, String, Object)
when generating this widgetInvalidCustomValueException
WebDatatypeHandler.getValue(org.openmrs.customdatatype.CustomDatatype, javax.servlet.http.HttpServletRequest, java.lang.String)
public java.lang.String getContentType(CustomDatatype<java.lang.String> dt, java.lang.String valueReference)
getContentType
in interface DownloadableDatatypeHandler<java.lang.String>
dt
- the datatype this handler handlesvalueReference
- custom value to be downloadedDownloadableDatatypeHandler.getContentType(org.openmrs.customdatatype.CustomDatatype, java.lang.String)
public java.lang.String getFilename(CustomDatatype<java.lang.String> dt, java.lang.String valueReference)
getFilename
in interface DownloadableDatatypeHandler<java.lang.String>
dt
- the datatype this handler handlesvalueReference
- custom value to be downloadedDownloadableDatatypeHandler.getFilename(org.openmrs.customdatatype.CustomDatatype, java.lang.String)
public void writeToStream(CustomDatatype<java.lang.String> dt, java.lang.String valueReference, java.io.OutputStream os) throws java.io.IOException
DownloadableDatatypeHandler
writeToStream
in interface DownloadableDatatypeHandler<java.lang.String>
dt
- the datatype this handler handlesvalueReference
- custom value to be written to osos
- the output stream to be written tojava.io.IOException
- if there is an IO error writing to the streamDownloadableDatatypeHandler.writeToStream(org.openmrs.customdatatype.CustomDatatype, java.lang.String, java.io.OutputStream)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.