|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.olat.core.logging.LogDelegator
org.olat.core.gui.components.form.flexible.impl.Form
public class Form
This Form is the Component which gets dispatched by the framework. It then dispatches further to the really clicked FormComponent. The Form implements the following phases:
FormComponent and FormContainer form the same composite pattern as already
used for the core.Component and core.Container, and take notice that the
FormComponent itself is also a core.Component!
As a consequence of this, each element which want to live inside of a form
must be a FormComponent but has also a Component side to the rendering
framework.
The goals of the new form infrastructure are
Therefore it is important to always use the form.getParameter() methods and not the getParameter() methods from the user request directly. Normally you don't have to deal with this because the implemented form elements already take care of this issue.
All submitted files are saved to a temporary location in the userdata/tmp/ directory. During the dispatch phase in evalFormRequest() this files can be access using the getMultipartFilesSet() and getMultipartFile() methods. The files must be moved to another location within the execution of the evalFormRequest() because at the end of the method call, the temporary files will be removed. The temporary files have a random file name, use the getMultipartFileName() to retrieve the original file name.
When using the FileElement this is all already encapsulated, see the documentation there.
Initial Date: 27.11.2006
| Field Summary | |
|---|---|
static java.lang.String |
FORM_UNDEFINED
|
static java.lang.String |
FORMCMD
|
static java.lang.String |
FORMID
|
static int |
REQUEST_ERROR_FILE_EMPTY
|
static int |
REQUEST_ERROR_GENERAL
|
static int |
REQUEST_ERROR_NO_ERROR
|
static int |
REQUEST_ERROR_UPLOAD_LIMIT_EXCEEDED
|
| Method Summary | |
|---|---|
void |
addListener(Controller listener)
add another listener then the default listener, which is added at construction time. |
void |
addSubFormListener(FormBasicController formBasicController)
|
static Form |
create(java.lang.String name,
FormItemContainer formLayout,
Controller listener)
create a new form, where the caller is attached as component listener. |
void |
evalFormRequest(UserRequest ureq)
|
void |
fireFormEvent(UserRequest ureq,
FormEvent event)
|
int |
getAction()
|
java.lang.String |
getDispatchFieldId()
|
java.lang.String |
getEventFieldId()
|
java.lang.String |
getFormName()
|
Container |
getInitialComponent()
|
int |
getLastRequestError()
Check if there was an error while parsing this request. |
long |
getReplayableDispatchID(Component comp)
Get the replayableID for a component, for use only in urlReplay mode. |
java.io.File |
getRequestMultipartFile(java.lang.String key)
Return the multipart file for this key |
java.lang.String |
getRequestMultipartFileMimeType(java.lang.String key)
Return the multipart file mime type (content type) for this key: |
java.lang.String |
getRequestMultipartFileName(java.lang.String key)
Return the multipart file name for this key: |
java.util.Set<java.lang.String> |
getRequestMultipartFilesSet()
|
java.lang.String |
getRequestParameter(java.lang.String key)
Return the form parameter for a certain key. |
java.util.Set<java.lang.String> |
getRequestParameterSet()
Return the form parameter set. |
java.lang.String[] |
getRequestParameterValues(java.lang.String key)
Return the form parameter values for a certain key. |
boolean |
isDirtyMarking()
true if the form should not loose unsubmitted changes, if another link is clicked which throws away the changes. |
boolean |
isMultipartEnabled()
|
boolean |
isSubmittedAndValid()
|
void |
reset(UserRequest ureq)
|
void |
setDirtyMarking(boolean isDirtyMarking)
|
void |
setMultipartEnabled(boolean multipartEnabled,
int multipartUploadMaxSizeKB)
|
void |
submit(UserRequest ureq)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FORMCMD
public static final java.lang.String FORMID
public static final java.lang.String FORM_UNDEFINED
public static final int REQUEST_ERROR_NO_ERROR
public static final int REQUEST_ERROR_GENERAL
public static final int REQUEST_ERROR_FILE_EMPTY
public static final int REQUEST_ERROR_UPLOAD_LIMIT_EXCEEDED
| Method Detail |
|---|
public static Form create(java.lang.String name,
FormItemContainer formLayout,
Controller listener)
name - translator - rootFormContainer - if null the default layout is choosen, otherwise
the given layouting container is taken.listener - the component listener of this form, typically the caller
public void evalFormRequest(UserRequest ureq)
ureq - public int getLastRequestError()
public void submit(UserRequest ureq)
ureq - public void reset(UserRequest ureq)
ureq - public Container getInitialComponent()
public void addListener(Controller listener)
listener - public java.lang.String getRequestParameter(java.lang.String key)
LiveCycle scope: only within one call of evalFormRequest() !
key -
public java.lang.String[] getRequestParameterValues(java.lang.String key)
key -
public java.util.Set<java.lang.String> getRequestParameterSet()
LiveCycle scope: only within one call of evalFormRequest() !
public java.io.File getRequestMultipartFile(java.lang.String key)
LiveCycle scope: only within one call of evalFormRequest() !
key -
public java.lang.String getRequestMultipartFileName(java.lang.String key)
LiveCycle scope: only within one call of evalFormRequest() !
key -
public java.lang.String getRequestMultipartFileMimeType(java.lang.String key)
LiveCycle scope: only within one call of evalFormRequest() !
key -
public java.util.Set<java.lang.String> getRequestMultipartFilesSet()
public java.lang.String getDispatchFieldId()
public java.lang.String getFormName()
public void fireFormEvent(UserRequest ureq,
FormEvent event)
public java.lang.String getEventFieldId()
public int getAction()
public boolean isSubmittedAndValid()
public boolean isDirtyMarking()
public void setDirtyMarking(boolean isDirtyMarking)
public void addSubFormListener(FormBasicController formBasicController)
public void setMultipartEnabled(boolean multipartEnabled,
int multipartUploadMaxSizeKB)
public boolean isMultipartEnabled()
public long getReplayableDispatchID(Component comp)
component -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||