|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jcms.context.JcmsContext com.jalios.jcms.context.JcmsJspContext com.jalios.jcms.handler.JcmsFormHandler com.jalios.jcms.handler.EditDataHandler
public abstract class EditDataHandler
This class is the super class of all FormHandler which manage stored data.
Data
Field Summary | |
---|---|
protected EditTypeExtensionHandler |
extFormHandler
|
protected int |
formStep
|
protected String |
id
|
protected boolean |
isDeleteForced
|
protected boolean |
op
|
protected boolean |
opCancel
|
protected boolean |
opCreate
|
protected boolean |
opDelete
|
protected boolean |
opFinish
|
protected boolean |
opNext
|
protected boolean |
opPrevious
|
protected boolean |
opRefresh
|
protected boolean |
opUpdate
|
protected boolean |
resultOpCreate
|
protected boolean |
resultOpDelete
|
protected boolean |
resultOpUpdate
|
static String |
REVISION
|
Fields inherited from class com.jalios.jcms.handler.JcmsFormHandler |
---|
contextMap, editFieldSet, noRedirect, noSendRedirect, popupEdition, redirect, redirectOnClosePopup, workspaceForced |
Fields inherited from class com.jalios.jcms.context.JcmsJspContext |
---|
AJAX_REQUEST_ATTRIBUTES, BODY_HEADER, CSS_HEADER, cssboMap, cssfoMap, CUSTOM_HEADER, editIcon, HTTPEQUIV_HEADER, httpequivMap, HTTPNAME_HEADER, httpnameMap, initEditIcon, JAVASCRIPT_CODE_SET_ATTRIBUTE, JAVASCRIPT_SET_ATTRIBUTE, jsboSet, jsfoSet, out, pageContext, SHOW_EDIT_ICON, STYLE_HEADER |
Fields inherited from class com.jalios.jcms.context.JcmsContext |
---|
browser, caddy, channel, inFO, initDone, initWorkspace, isAdmin, isAjaxRequest, isDBMember, isDebug, isLogged, loggedMember, request, response, userCountry, userLang, userLocale, workspace |
Fields inherited from interface com.jalios.util.JaliosConstants |
---|
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR |
Constructor Summary | |
---|---|
EditDataHandler()
|
Method Summary | ||
---|---|---|
protected boolean |
afterValidation(boolean result)
|
|
protected boolean |
createUploadedFileDocument(Data[] datas,
Map dataML,
Member author,
Workspace ws)
Performs create on given array of data if it is a FileDocument that have just been uploaded. |
|
protected boolean |
createUploadedFileDocument(Data[] datas,
Member author,
Workspace ws)
Performs create on given array of data if it is a FileDocument that have just been uploaded. |
|
protected boolean |
createUploadedFileDocument(Data data,
Map dataML,
Member author,
Workspace ws)
Performs create on given array of data if it is a FileDocument that have just been uploaded. |
|
protected boolean |
createUploadedFileDocument(Data data,
Member author,
Workspace ws)
Performs create on given data if it is a FileDocument that have just been uploaded. |
|
Data |
getAvailableData(Data data,
Data dataField,
Data field,
Map mlMap,
String lang)
Generic method to get available ML field for a given data in a given language. |
|
Data[] |
getAvailableDataArray(Data data,
Data[] dataField,
Data[] field,
Map mlMap,
String lang)
Generic method to get available ML field for a given array of data in a given language. |
|
Map<String,String> |
getAvailableExtraDataMap()
Returns a Map of available extra data. |
|
Map<String,String> |
getAvailableExtraDBDataMap()
Returns a Map of available extra db data. |
|
protected HashMap<String,Object> |
getControllerContext()
Build a controller context. |
|
abstract Class<? extends Data> |
getDataClass()
|
|
EditTypeExtensionHandler |
getExtFormHandler()
|
|
int |
getFormStep()
Retrieve the current step of edition when invoking this form handler. |
|
int |
getFormStepCount()
Retrieve the total number of steps used for edition when invoking this form handler. |
|
String |
getId()
|
|
protected void |
handleRestResponse()
|
|
boolean |
isFirstAccess()
Returns true if this is the first access to this form (no previous submission). |
|
boolean |
performCancel()
|
|
protected DataExtension |
performCreateExtension()
|
|
protected boolean |
performFinish()
|
|
protected boolean |
performNext()
|
|
protected boolean |
performPrevious()
|
|
boolean |
performRefresh()
|
|
protected DataExtension |
performUpdateExtension(DataExtension extension)
|
|
boolean |
processAction()
Method to be implemented to check/validate action to be performed and process them. |
|
protected Data |
processDataId(String fieldName,
String dataId,
Class<? extends Data> clazz)
Computes given dataid, trim and retrieve associated data. |
|
protected
|
processDataIds(String fieldName,
String[] ids,
Class<T> clazz)
Computes link array to retrieve Data of the given Class. |
|
protected
|
processDataIds(String fieldName,
String[] ids,
Class<T> clazz,
boolean trim)
Computes link array to retrieve Data of the given Class. |
|
Data |
processMLData(String fieldName,
Class clazz,
String[] values,
Map mlMap)
Process the given ML values (data ids) |
|
|
processMLDataArray(String fieldName,
Class<T> clazz,
String[] values,
Map mlMap)
Process the given ML values (data ids) |
|
protected boolean |
restValidation(boolean result)
|
|
protected void |
sendRedirect()
|
|
void |
setExtFormHandler(EditTypeExtensionHandler handler)
|
|
void |
setExtraDBKeys(String[] extraDBKeys)
Convenient methods to update ExtraDBDataMap from bean |
|
void |
setExtraDBValues(String[] extraDBValues)
Convenient methods to update ExtraDBDataMap from bean |
|
void |
setExtraKeys(String[] extraKeys)
Convenient methods to update ExtraDataMap from bean |
|
void |
setExtraValues(String[] extraValues)
Convenient methods to update ExtraDataMap from bean |
|
void |
setFields(Data data)
Set the common (Data) fields. |
|
void |
setForceDelete(String v)
|
|
void |
setFormStep(int step)
Set the current step of edition when invoking this form handler. |
|
void |
setId(String id)
|
|
void |
setOpCancel(String v)
|
|
void |
setOpCreate(String v)
|
|
void |
setOpDelete(String v)
|
|
void |
setOpFinish(String v)
|
|
void |
setOpNext(String v)
|
|
void |
setOpPrevious(String v)
|
|
void |
setOpRefresh(String v)
|
|
void |
setOpUpdate(String v)
|
|
boolean |
showCancelButton()
Check if the "Cancel" button should be displayed in step modal form. |
|
boolean |
showFinishButton()
Check if the "Finish" button should be displayed in step modal form. |
|
boolean |
showNextButton()
Check if the "Next" button should be displayed in step modal form. |
|
boolean |
showPreviousButton()
Check if the "Previous" button should be displayed in step modal form. |
|
boolean |
validateCancel()
|
|
protected boolean |
validateCreateExtension(Data extendedData)
|
|
protected boolean |
validateFinish()
|
|
protected boolean |
validateNext()
|
|
protected boolean |
validatePrevious()
|
|
boolean |
validateRefresh()
|
|
protected boolean |
validateUpdateExtension(DataExtension extension,
Data extendedData)
|
|
protected boolean |
validateUploadedFileDocument(Data[] datas,
Map dataML,
Member author,
Workspace ws)
Performs create on given data if it is a FileDocument that have just been uploaded. |
|
protected boolean |
validateUploadedFileDocument(Data[] datas,
Member author,
Workspace ws)
Performs validate on given array of data if it is a FileDocument that have just been uploaded. |
|
protected boolean |
validateUploadedFileDocument(Data data,
Map dataML,
Member author,
Workspace ws)
Performs create on given data if it is a FileDocument that have just been uploaded. |
|
protected boolean |
validateUploadedFileDocument(Data data,
Member author,
Workspace ws)
Performs create on given data if it is a FileDocument that have just been uploaded. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
protected boolean op
protected boolean opCreate
protected boolean resultOpCreate
protected boolean opUpdate
protected boolean resultOpUpdate
protected boolean opDelete
protected boolean resultOpDelete
protected boolean opCancel
protected boolean opRefresh
protected boolean opPrevious
protected boolean opNext
protected boolean opFinish
protected String id
protected EditTypeExtensionHandler extFormHandler
protected boolean isDeleteForced
protected int formStep
Constructor Detail |
---|
public EditDataHandler()
Method Detail |
---|
protected void sendRedirect() throws IOException
IOException
protected boolean afterValidation(boolean result) throws IOException
afterValidation
in class JcmsFormHandler
IOException
public boolean processAction() throws IOException
JcmsFormHandler
Default implementation is to return false. No need to call super method.
This method may NOT be invoked at all if security validation are not met.
You must ensure your handler and JSP can work properly without any code invoked
in this method.
processAction
in class JcmsFormHandler
IOException
protected boolean validatePrevious() throws IOException
IOException
protected boolean performPrevious() throws IOException
IOException
protected boolean validateNext() throws IOException
IOException
protected boolean performNext() throws IOException
IOException
protected boolean validateFinish() throws IOException
IOException
protected boolean performFinish() throws IOException
IOException
protected HashMap<String,Object> getControllerContext()
JcmsFormHandler
getControllerContext
in class JcmsFormHandler
public void setFields(Data data)
data
- the publication to set the fieldspublic abstract Class<? extends Data> getDataClass()
protected boolean validateCreateExtension(Data extendedData) throws IOException
IOException
protected DataExtension performCreateExtension() throws IOException
IOException
protected boolean validateUpdateExtension(DataExtension extension, Data extendedData) throws IOException
IOException
protected DataExtension performUpdateExtension(DataExtension extension) throws IOException
IOException
public boolean validateCancel()
public boolean performCancel() throws IOException
IOException
public boolean validateRefresh()
public boolean performRefresh() throws IOException
IOException
public void setOpCreate(String v)
public void setOpUpdate(String v)
public void setOpDelete(String v)
public void setOpCancel(String v)
public void setOpRefresh(String v)
public void setOpPrevious(String v)
public void setOpNext(String v)
public void setOpFinish(String v)
public String getId()
public void setId(String id)
public void setForceDelete(String v)
public EditTypeExtensionHandler getExtFormHandler()
public void setExtFormHandler(EditTypeExtensionHandler handler)
public boolean showCancelButton()
The default implementation of this method is to always return true.
You can provide a custom FormHandler to override this behavior.
See jcore/doStepButtons.jspf for use of this method.
public boolean showNextButton()
The default implementation of this method is to return true
unless the finish button is being displayed
by method showFinishButton()
.
You can provide a custom FormHandler to override this behavior.
See jcore/doStepButtons.jspf for use of this method.
public boolean showPreviousButton()
The default implementation of this method is to return true
if the current step (as returned by getFormStep()
is higher than 0.
You can provide a custom FormHandler to override this behavior.
See jcore/doStepButtons.jspf for use of this method.
public boolean showFinishButton()
The default implementation of this method is to return true
if the current step (as returned by getFormStep()
is
the last one (as compared with getFormStepCount()
.
You can provide a custom FormHandler to override this behavior.
See jcore/doStepButtons.jspf for use of this method.
public int getFormStepCount()
The default implementation of this method is to return 1, corresponding to one step (which means only 1 screen being displayed).
You can provide a custom FormHandler to override this behavior.
See jcore/doSteps.jspf for use of this method.
public int getFormStep()
See jcore/doSteps.jspf for use of this method.
getFormStepCount()
- 1
)public void setFormStep(int step)
step
- the current step (0 being the first one and getFormStepCount()
- 1
being the last one)public void setExtraKeys(String[] extraKeys)
extraKeys
- the extraKeypublic void setExtraValues(String[] extraValues)
extraValues
- the extraValuespublic Map<String,String> getAvailableExtraDataMap()
public void setExtraDBKeys(String[] extraDBKeys)
extraDBKeys
- the extraDBKeypublic void setExtraDBValues(String[] extraDBValues)
extraDBValues
- the extraDBValuespublic Map<String,String> getAvailableExtraDBDataMap()
protected <T extends Data> List<T> processDataIds(String fieldName, String[] ids, Class<T> clazz)
fieldName
- the field nameids
- arrays of idsclazz
- the class of links
protected <T extends Data> List<T> processDataIds(String fieldName, String[] ids, Class<T> clazz, boolean trim)
fieldName
- the field nameids
- arrays of idsclazz
- the class of linkstrim
- if true, trim the end of the returned list.
protected Data processDataId(String fieldName, String dataId, Class<? extends Data> clazz)
fieldName
- The field namedataId
- the id of the dataclazz
- the class of the data
protected boolean validateUploadedFileDocument(Data data, Member author, Workspace ws)
EditPublicationHandler#validateBeforeOp()
data
- the data to work withauthor
- the author of the dataws
- the workspace of the data
EditPublicationHandler.validateBeforeOp()
protected boolean validateUploadedFileDocument(Data data, Map dataML, Member author, Workspace ws)
EditPublicationHandler#validateBeforeOp()
data
- the data to work withdataML
- the other languagesauthor
- the author of the dataws
- the workspace of the data
EditPublicationHandler.validateBeforeOp()
protected boolean validateUploadedFileDocument(Data[] datas, Member author, Workspace ws)
EditPublicationHandler#validateBeforeOp()
datas
- an array of data to work withauthor
- the author of the dataws
- the workspace of the data
EditPublicationHandler.validateBeforeOp()
protected boolean validateUploadedFileDocument(Data[] datas, Map dataML, Member author, Workspace ws)
EditPublicationHandler#validateBeforeOp()
datas
- an array of data to work withdataML
- the other languagesauthor
- the author of the dataws
- the workspace of the data
EditPublicationHandler.validateBeforeOp()
protected boolean createUploadedFileDocument(Data data, Member author, Workspace ws)
EditPublicationHandler#validateBeforeOp()
data
- the data to work withauthor
- the author of the dataws
- the workspace of the data
EditPublicationHandler.validateBeforeOp()
protected boolean createUploadedFileDocument(Data data, Map dataML, Member author, Workspace ws)
EditPublicationHandler#validateBeforeOp()
data
- the data to work with (main languagedataML
- the other languagesauthor
- the author of the dataws
- the workspace of the data
EditPublicationHandler.validateBeforeOp()
protected boolean createUploadedFileDocument(Data[] datas, Member author, Workspace ws)
EditPublicationHandler#validateBeforeOp()
datas
- an array of data to work withauthor
- the author of the dataws
- the workspace of the data
EditPublicationHandler.validateBeforeOp()
protected boolean createUploadedFileDocument(Data[] datas, Map dataML, Member author, Workspace ws)
EditPublicationHandler#validateBeforeOp()
datas
- an array of data to work withdataML
- the other languagesauthor
- the author of the dataws
- the workspace of the data
EditPublicationHandler.validateBeforeOp()
public Data processMLData(String fieldName, Class clazz, String[] values, Map mlMap)
fieldName
- the field nameclazz
- the classvalues
- the idsmlMap
- the mlMap
public <T extends Data> Data[] processMLDataArray(String fieldName, Class<T> clazz, String[] values, Map mlMap)
fieldName
- the field nameclazz
- the classvalues
- the idsmlMap
- the mlMap
public Data getAvailableData(Data data, Data dataField, Data field, Map mlMap, String lang)
data
- the object (eg a Publication)dataField
- the current value of the field (may be null)field
- the proposed value for this fieldmlMap
- the ML maplang
- the langugage value
public Data[] getAvailableDataArray(Data data, Data[] dataField, Data[] field, Map mlMap, String lang)
data
- the object (eg a Publication)dataField
- the current value of the field (may be null)field
- the proposed value for this fieldmlMap
- the ML maplang
- the langugage value
public boolean isFirstAccess()
protected void handleRestResponse() throws IOException
IOException
protected boolean restValidation(boolean result) throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |