|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.cocoon.forms.formmodel.AbstractWidget
org.apache.cocoon.forms.formmodel.Upload
A file-uploading Widget. This widget gives access via Cocoon Forms, to Cocoon's file upload functionality.
This widget accepts value-changed listeners, but the event raised does not hold the previous value, as uploads are heavyweight resources that must be released as soon as possible.
| Field Summary |
| Fields inherited from class org.apache.cocoon.forms.formmodel.AbstractWidget |
wasValid |
| Fields inherited from interface org.apache.cocoon.forms.formmodel.Widget |
PATH_SEPARATOR |
| Constructor Summary | |
Upload(UploadDefinition uploadDefinition)
|
|
| Method Summary | |
void |
addValueChangedListener(ValueChangedListener listener)
Adds a ValueChangedListener to this widget instance. |
void |
broadcastEvent(WidgetEvent event)
Broadcast an event previously queued by this widget to its event listeners. Abstract implementation throws a UnsupportedOperationException.
Concrete subclass widgets need to override when supporting event broadcasting.
Abstract implementation throws a UnsupportedOperationException. |
void |
generateItemSaxFragment(ContentHandler contentHandler,
Locale locale)
Generates nested additional content nested inside the main element for this widget which is generated by AbstractWidget.generateSaxFragment(ContentHandler, Locale)
The implementation on the AbstractWidget level inserts no additional XML. |
WidgetDefinition |
getDefinition()
Concrete subclasses should allow access to their underlaying Definition through this method. |
UploadDefinition |
getUploadDefinition()
|
ValidationError |
getValidationError()
Returns the validation error, if any. |
Object |
getValue()
Get the value of a widget. |
org.apache.cocoon.xml.AttributesImpl |
getXMLElementAttributes()
Adds attributes @required, @mime-types |
String |
getXMLElementName()
The XML element name used in AbstractWidget.generateSaxFragment(ContentHandler, Locale)
to produce the wrapping element for all the XML-instance-content of this Widget. |
boolean |
hasValueChangedListeners()
|
void |
readFromRequest(FormContext formContext)
Lets this widget read its data from a request. |
void |
removeValueChangedListener(ValueChangedListener listener)
|
void |
setValidationError(ValidationError error)
Set a validation error on this field. |
void |
setValue(Object object)
Sets the value of this widget. |
boolean |
validate()
Validates this widget and returns the outcome. |
| Methods inherited from class org.apache.cocoon.forms.formmodel.AbstractWidget |
addValidator, generateDisplayData, generateLabel, generateSaxFragment, getAttribute, getChild, getCombinedState, getForm, getFullName, getId, getLocation, getName, getParent, getRequestParameterName, getState, getWidget, initialize, isRequired, isValid, lookupWidget, removeAttribute, removeValidator, setAttribute, setParent, setState, toString, widgetNameChanged |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Upload(UploadDefinition uploadDefinition)
| Method Detail |
public WidgetDefinition getDefinition()
AbstractWidgetnull they should also organize
own implementations of AbstractWidget.getId(), AbstractWidget.getLocation(),
AbstractWidget.validate(), AbstractWidget.generateLabel(ContentHandler) and
AbstractWidget.generateDisplayData(ContentHandler) to avoid NPE's.
getDefinition in interface WidgetgetDefinition in class AbstractWidgetWidgetDefinition.createInstance())public UploadDefinition getUploadDefinition()
public Object getValue()
Widget
Not all widgets do have a value (notably ContainerWidgets,
but this method is provided here as a convenience to ease writing and avoiding casts.
getValue in interface WidgetgetValue in class AbstractWidgetpublic void setValue(Object object)
Widget
Not all widgets do have a value (notably ContainerWidgets,
but this method is provided here as a convenience to ease writing and avoiding casts.
setValue in interface WidgetsetValue in class AbstractWidgetpublic void readFromRequest(FormContext formContext)
Widget
readFromRequest in interface Widgetpublic boolean validate()
WidgetWidget.generateSaxFragment(ContentHandler, Locale) method.
validate in interface Widgetvalidate in class AbstractWidgetWidget.validate()public ValidationError getValidationError()
validate() method returned false.
getValidationError in interface ValidationErrorAwarepublic void setValidationError(ValidationError error)
setValidationError in interface ValidationErrorAwareerror - the validation errorpublic void addValueChangedListener(ValueChangedListener listener)
addValueChangedListener in interface ValueChangedListenerEnabledpublic void removeValueChangedListener(ValueChangedListener listener)
removeValueChangedListener in interface ValueChangedListenerEnabledpublic boolean hasValueChangedListeners()
hasValueChangedListeners in interface ValueChangedListenerEnabledpublic void broadcastEvent(WidgetEvent event)
AbstractWidgetUnsupportedOperationException.
Concrete subclass widgets need to override when supporting event broadcasting.
broadcastEvent in interface WidgetbroadcastEvent in class AbstractWidgetpublic String getXMLElementName()
AbstractWidgetAbstractWidget.generateSaxFragment(ContentHandler, Locale)
to produce the wrapping element for all the XML-instance-content of this Widget.
getXMLElementName in class AbstractWidgetpublic org.apache.cocoon.xml.AttributesImpl getXMLElementAttributes()
getXMLElementAttributes in class AbstractWidget
public void generateItemSaxFragment(ContentHandler contentHandler,
Locale locale)
throws SAXException
AbstractWidgetAbstractWidget.generateSaxFragment(ContentHandler, Locale)
The implementation on the AbstractWidget level inserts no additional XML.
Subclasses need to override to insert widget specific content.
generateItemSaxFragment in class AbstractWidgetcontentHandler - to send the SAX events tolocale - in which context potential content needs to be put.
SAXException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||