T
- the type of the value being boxedpublic abstract class EditDataFormHandler<T extends Data> extends JcmsUploadFormHandler
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FORM_HANDLER_ATTR |
contextMap, editFieldSet, noRedirect, noSendRedirect, popupEdition, redirect, redirectOnClosePopup, REVISION, workspaceForced
AJAX_REQUEST_ATTRIBUTES, BODY_HEADER, CSS_FOOTER, 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
browser, caddy, channel, inFO, initDone, initWorkspace, isAdmin, isAjaxRequest, isDBMember, isDebug, isLogged, loggedMember, request, response, userCountry, userLang, userLocale, workspace
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, AJAX_MODE_ATTR, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, COUNTRY_SPRITE, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, GLYPH_ICON_PREFIX, ICON_ARCHIVE, ICON_ICON_PREFIX, ICON_LOCK, ICON_LOCK_STRONG, ICON_PREFIX_PROP, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JCMS_TOASTR_COLLECTION, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LANG_SPRITE, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, ORGANIZATION_ROOT_GROUP_PROP, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_PROP_PREFIX, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_PROP_PREFIX, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_PROP_PREFIX, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_PROP_PREFIX, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_PROP_PREFIX, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, SPRITE_ICON_PREFIX, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, SUCCESS_MSG, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TTCARD_MEDIA_HEIGHT, TTCARD_MEDIA_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
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 and Description |
---|
EditDataFormHandler() |
EditDataFormHandler(java.lang.Class<T> dataClass) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
doCreateData(javax.servlet.http.HttpServletRequest request)
Create a new Data object.
|
protected void |
doInitData(T data,
javax.servlet.http.HttpServletRequest request)
Prepare the temporary extra(DB)Data maps, it's possible to initialize the given data before calling the setters of the request parameters.
|
protected boolean |
doPerformCancel() |
protected boolean |
doPerformCreate(T data,
Member member)
Creates the specified
Data . |
protected boolean |
doPerformDelete(T data,
Member member)
Deletes the specified
Data . |
protected boolean |
doPerformFinish()
Method used to save or update the Data.
|
protected boolean |
doPerformMandatoryRequirements() |
protected boolean |
doPerformNext() |
protected boolean |
doPerformPrevious() |
protected boolean |
doPerformRefresh() |
protected boolean |
doPerformUpdate(T data,
Member member)
Updates the specified
Data . |
protected boolean |
doProcessAction()
Override this method to add custom actions.
|
java.lang.String |
getAvailableMainLanguage() |
protected T |
getData() |
protected java.lang.Class<T> |
getDataClass() |
protected T |
getDataFromRequest(javax.servlet.http.HttpServletRequest request) |
protected java.lang.String |
getDataParamId()
Returns the parameter name used to get the Data id from the request.
|
protected java.lang.String |
getExtraData(java.lang.String name)
Returns the extraData value from the specified name, stored in the temporary extraData map with the
setExtraData(String, String) method. |
protected java.lang.String |
getExtraDBData(java.lang.String name)
Returns the extraDBData value from the specified name, stored in the temporary extraDBData map with the
setExtraDBData(String, String) method. |
protected java.lang.String |
getFormHandlerRequestAttributeKey()
Override this method to set another request attribute key for the FormHandler than the default.
If it returns null , the form handler will not be stored in request attribute. |
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.
|
protected java.lang.String |
getHiddenField(java.lang.String name,
java.lang.Object value) |
protected java.lang.String |
getHiddenFieldML(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String[]> map)
Adds hidden multivalued multilingual field.
|
protected java.util.HashMap<java.lang.String,java.lang.String[]> |
getMLMapArray(java.lang.String[] array,
boolean trim,
boolean escape)
Returns the ML map (i.e.
|
protected boolean |
isOpCancel() |
protected boolean |
isOpDelete() |
protected boolean |
isOpFinish() |
protected boolean |
isOpNext() |
protected boolean |
isOpPrevious() |
protected boolean |
isOpRefresh() |
void |
prepare(javax.servlet.http.HttpServletRequest request)
Prepare the form handler before calling
JcmsFormHandler.validate() method. |
boolean |
processAction()
Method to be implemented to check/validate action to be performed and process them.
|
protected java.lang.String |
removeExtraData(java.lang.String name)
Removes an extraData from the temporary extraData map.
|
protected java.lang.String |
removeExtraDBData(java.lang.String name)
Removes an extraDBData from the temporary extraDBData map.
|
void |
setData(javax.servlet.http.HttpServletRequest request)
Initialize the Data Object
|
protected void |
setExtraData(java.lang.String name,
java.lang.String value)
Stores a new extraData in the temporary extraData map.
|
protected void |
setExtraDBData(java.lang.String name,
java.lang.String value)
Stores a new extraData in the temporary extraDBData map.
|
void |
setFormStep(int step)
Set the current step of edition when invoking this form handler.
|
void |
setFormStepCount(int formStepCount)
Set the total number of steps used for edition when invoking this form handler.
|
protected void |
setOpCancel(boolean opCancel) |
void |
setOpCancel(java.lang.String v) |
protected void |
setOpDelete(boolean opDelete) |
void |
setOpDelete(java.lang.String v) |
protected void |
setOpFinish(boolean opFinish) |
void |
setOpFinish(java.lang.String opFinish) |
protected void |
setOpNext(boolean opNext) |
void |
setOpNext(java.lang.String v) |
protected void |
setOpPrevious(boolean opPrevious) |
void |
setOpPrevious(java.lang.String v) |
protected void |
setOpRefresh(boolean opRefresh) |
void |
setOpRefresh(java.lang.String v) |
void |
setRequest(javax.servlet.http.HttpServletRequest request)
Setter for the request.
|
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.
|
protected boolean |
supportsExtraData(java.lang.String name)
Override this method to specify the supported extraData, and remove the others.
|
protected boolean |
supportsExtraDBData(java.lang.String name)
Override this method to specify the supported extraDBData, and remove the others.
By default, this method has the same behavior as supportsExtraData(String) . |
protected boolean |
validateCancel() |
protected abstract boolean |
validateData(T data)
Validates the Data fields.
|
protected boolean |
validateDelete() |
protected boolean |
validateFinish() |
protected boolean |
validateMandatoryRequirements()
Override this method whether any mandatory requirements must be defined and checked before any actions.
If the this method return false , doPerformMandatoryRequirements() is called, and the processing stops at the end of the call to this
latter. |
protected boolean |
validateNext() |
protected boolean |
validatePrevious() |
protected boolean |
validateRefresh() |
createUploadedFileDocument, createUploadedFileDocument, doPrepareFileDocuments, getFakeUniqueId, getFileDocument, getFileDocumentClass, getFileDocuments, getFileDocuments, getFileDocumentsML, getFormHiddenFields, getFormStepHiddenFields, getFormUniqueId, getTemporaryDir, isFakeUniqueId, removeFileDocuments, setFileDocuments, setFileDocuments, setFileDocumentsML, setFormUniqueId, validateUploadedFileDocument, validateUploadedFileDocument
afterValidation, checkMissingField, getClosePopupUrl, getControllerContext, getEditFieldSet, getFormStepFinishLabel, getFormStepLabels, getFormStepPrefixProp, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenFieldML, getMainLangValue, getMainLangValueArray, getMLMap, getModalRedirect, getMonolingualValue, getMonolingualValueArray, getMultilingualMainValue, getMultilingualMainValueArray, getMultilingualMLMap, getMultilingualMLMapArray, getRedirect, getRedirectOnClosePopup, getWorkspace, init, isFieldEdition, isFieldMissing, isPartialFieldEdition, isPopupEdition, isWorkspaceForced, mapStringArrayToMapStringList, mapStringListToMapStringArray, processStatus, sanitize, sanitize, sendRedirect, sendRedirect, setEditField, setNoRedirect, setNoSendRedirect, setPopupEdition, setRedirect, setRedirectOnClosePopup, setWorkspace, setWs, updateUploadedField, updateUploadedFields, validate
addBodyAttributes, addCSSHeader, addCSSHeader, addCSSHeader, addCSSHeader, addCustomHeader, addHttpEquivHeader, addHttpNameHeader, addJavaScript, addJavaScript, addJavaScript, addJavaScriptCode, addPrefetchHeader, addStyleHeader, addStyleHeader, checkAccess, checkAccess, checkCSRF, debugDisplayContext, disablePacker, forceEditIcon, forceUpdate, getAjaxRequestAttribute, getAjaxRequestId, getAllHeadersDiffMap, getAllHeadersMap, getBackOfficeCSSHeader, getBackOfficeJavaScriptSet, getBodyAttributes, getContentForm, getCSSHeaders, getCtxCategories, getCurrentCategory, getCustomHeaders, getDocType, getFinalCSSFooterMap, getFinalCSSMap, getFinalJavaScriptSet, getFrontOfficeCSSHeader, getFrontOfficeJavaScriptSet, getHttpEquivHeaders, getHttpNameHeaders, getJavaScriptCodeSet, getJavaScriptSet, getJSONBridge, getPageContext, getPageTitle, getPageZone, getPortal, getPortalCategory, getPortlet, getPublication, getStyleHeaders, getTemplateUsage, internalSetupEmptyHeader, isEditIcon, isEditIcon, isEditIconForPublish, isEditIconForPublish, isPrintView, registerDisplayContext, removeAjaxRequestAttribute, setAjaxRequestAttribute, setAjaxRequestId, setAllHeadersDiffMap, setDocType, setEditIcon, setPageContext, setPageTitle, setPageZone, setShowEditIcon, setTemplateUsage, showEditIcon, showEditIcon, showEditIcon, workaroundBrowserBaseHrefBug
addCookie, addMsg, addMsg, addMsgSession, addMsgSession, addToastr, addToastr, addToastrSession, addToastrSession, applySelector, forceWorkspaceUpdate, getBaseUrl, getBrowser, getCaddy, getContextPath, getErrorMsg, getErrorMsgList, getErrorMsgSession, getErrorMsgSessionList, getInfoMsg, getInfoMsgList, getInfoMsgSession, getInfoMsgSessionList, getLoggedMember, getMsgList, getMsgSessionList, getRequest, getResponse, getSession, getSuccessMsg, getSuccessMsgList, getSuccessMsgSession, getSuccessMsgSessionList, getToastrCollection, getToastrSessionCollection, getUploadedFile, getUploadedFileList, getUrlWithCommonUpdatedParams, getUserCountry, getUserLang, getUserLocale, getWarningMsg, getWarningMsgList, getWarningMsgSession, getWarningMsgSessionList, glp, isAdmin, isAjaxRequest, isDBMember, isDebug, isInFrontOffice, isLogged, isWebdavAccess, removeMessage, removeMessage, retrieveUploadedFile, select, sendForbidden, sendForbidden, sendRedirect, sendRedirect, sendRedirect, setErrorMsg, setErrorMsg, setErrorMsgSession, setErrorMsgSession, setInfoMsg, setInfoMsg, setInfoMsgSession, setInfoMsgSession, setLoggedMember, setResponse, setSuccessMsg, setSuccessMsg, setSuccessMsgSession, setSuccessMsgSession, setWarningMsg, setWarningMsg, setWarningMsgSession, setWarningMsgSession, validateRegexp, validateSchedule
public static final java.lang.String FORM_HANDLER_ATTR
public EditDataFormHandler()
public EditDataFormHandler(java.lang.Class<T> dataClass)
protected java.lang.Class<T> getDataClass()
protected T getData()
public void setRequest(javax.servlet.http.HttpServletRequest request)
Setter for the request. Will initialize all the variable of the JcmsContext if available in the request. (Therefore, it must be called after all the treatements done in doInitPage)
Overridden to set form handler in the Request Attribute 'formHandler'.
setRequest
in class JcmsContext
request
- the HttpServletRequest from twhich to retrieve all jcms context
information.protected java.lang.String getFormHandlerRequestAttributeKey()
null
, the form handler will not be stored in request attribute.public void setData(javax.servlet.http.HttpServletRequest request)
request
- HttpServletRequest
protected T getDataFromRequest(javax.servlet.http.HttpServletRequest request)
protected abstract T doCreateData(javax.servlet.http.HttpServletRequest request)
setData(HttpServletRequest)
when the Data is initialized.request
- HttpServletRequest
Data
protected void doInitData(T data, javax.servlet.http.HttpServletRequest request)
data
- Data
request
- HttpServletRequest
protected java.lang.String getExtraData(java.lang.String name)
setExtraData(String, String)
method.name
- extraData nameprotected void setExtraData(java.lang.String name, java.lang.String value)
name
- extraData namevalue
- extraData valueprotected java.lang.String removeExtraData(java.lang.String name)
name
- extraData nameprotected boolean supportsExtraData(java.lang.String name)
name
- extraData nametrue
if the given extraData name is supported, false
insteadprotected java.lang.String getExtraDBData(java.lang.String name)
setExtraDBData(String, String)
method.name
- extraDBData nameprotected void setExtraDBData(java.lang.String name, java.lang.String value)
name
- extraDBData nameprotected java.lang.String removeExtraDBData(java.lang.String name)
name
- extraData nameprotected boolean supportsExtraDBData(java.lang.String name)
supportsExtraData(String)
.name
- extraDBData nametrue
if the given extraDBData name is supported, false
insteadprotected java.lang.String getDataParamId()
setData(HttpServletRequest)
when we get the Data from its id found in the request.public void prepare(javax.servlet.http.HttpServletRequest request)
JcmsFormHandler.validate()
method.
Call this method in the JSP before calling the JcmsFormHandler.validate()
method.request
- HttpServletRequest
public final boolean processAction() throws java.io.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
java.io.IOException
- IO Exceptionpublic java.lang.String getAvailableMainLanguage()
getAvailableMainLanguage
in class JcmsFormHandler
protected boolean validateMandatoryRequirements()
false
, doPerformMandatoryRequirements() is called, and the processing stops at the end of the call to this
latter.true
mandatory requirements are all valids, false
. Default method returns true
protected boolean doPerformMandatoryRequirements()
protected boolean isOpPrevious()
protected void setOpPrevious(boolean opPrevious)
public void setOpPrevious(java.lang.String v)
protected boolean validatePrevious()
protected boolean doPerformPrevious()
protected boolean isOpNext()
protected void setOpNext(boolean opNext)
public void setOpNext(java.lang.String v)
protected boolean validateNext()
protected boolean doPerformNext()
protected boolean isOpCancel()
protected void setOpCancel(boolean opCancel)
public void setOpCancel(java.lang.String v)
protected boolean validateCancel()
protected boolean doPerformCancel()
protected boolean isOpFinish()
protected void setOpFinish(boolean opFinish)
public void setOpFinish(java.lang.String opFinish)
protected boolean validateFinish()
protected boolean doPerformFinish()
doPerformCreate(Data, Member)
to save and doPerformUpdate(Data, Member)
to update.true
if the save/update action was performed successfullyprotected boolean doPerformCreate(T data, Member member)
Data
.protected boolean doPerformUpdate(T data, Member member)
Data
.protected boolean isOpDelete()
protected void setOpDelete(boolean opDelete)
public void setOpDelete(java.lang.String v)
protected boolean validateDelete()
protected boolean doPerformDelete(T data, Member member)
Data
.protected boolean isOpRefresh()
protected void setOpRefresh(boolean opRefresh)
public void setOpRefresh(java.lang.String v)
protected boolean validateRefresh()
protected boolean doPerformRefresh() throws java.io.IOException
java.io.IOException
protected boolean doProcessAction()
true
if the action was performed successfully, false
insteadpublic boolean showCancelButton()
Check if the "Cancel" button should be displayed in step modal form.
The default implementation of this method is to always return true.
showCancelButton
in class JcmsFormHandler
public boolean showNextButton()
Check if the "Next" button should be displayed in step modal form.
showNextButton
in class JcmsFormHandler
public boolean showPreviousButton()
Check if the "Previous" button should be displayed in step modal form.
The default implementation of this method is to return true if the current step (as returned by getFormStep()
is higher than 0.
showPreviousButton
in class JcmsFormHandler
public boolean showFinishButton()
Check if the "Finish" button should be displayed in step modal form.
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()
.
showFinishButton
in class JcmsFormHandler
public int getFormStepCount()
Retrieve the total number of steps used for edition when invoking this form handler.
The default implementation of this method is to return 1, corresponding to one step (which means only 1 screen being displayed).
getFormStepCount
in class JcmsFormHandler
public void setFormStepCount(int formStepCount)
Set the total number of steps used for edition when invoking this form handler.
formStepCount
- the total number of steps in this form handlerpublic int getFormStep()
getFormStep
in class JcmsFormHandler
getFormStepCount()
- 1
)public void setFormStep(int step)
setFormStep
in class JcmsFormHandler
step
- the current step (0 being the first one and getFormStepCount()
- 1
being the last one)protected java.util.HashMap<java.lang.String,java.lang.String[]> getMLMapArray(java.lang.String[] array, boolean trim, boolean escape)
JcmsFormHandler
getMLMapArray
in class JcmsFormHandler
array
- the arraytrim
- if true trim the valuesescape
- if true escape the valuesprotected java.lang.String getHiddenFieldML(java.lang.String name, java.util.Map<java.lang.String,java.lang.String[]> map)
name
- field namemap
- map of valuesprotected java.lang.String getHiddenField(java.lang.String name, java.lang.Object value)
Copyright © 2001-2017 Jalios SA. All Rights Reserved.