Package com.jalios.jcms.handler
Class EditDataHandler
- java.lang.Object
-
- com.jalios.jcms.context.JcmsContext
-
- com.jalios.jcms.context.JcmsJspContext
-
- com.jalios.jcms.handler.JcmsFormHandler
-
- com.jalios.jcms.handler.EditDataHandler
-
- All Implemented Interfaces:
JcmsConstants
,JaliosConstants
- Direct Known Subclasses:
AbstractEditWorkspaceHandler
,AttachPublicationHandler
,AttachWorkspaceHandler
,EditAccessTokenHandler
,EditAclHandler
,EditCatHandler
,EditDataIdHandler
,EditExtraDataHandler
,EditGroupHandler
,EditMemberHandler
,EditNotificationCriteriaHandler
,EditNotificationHandler
,EditPublicationHandler
,EditPublicLinkHandler
,EditTypeExtensionHandler
,EditWorkflowInstanceHandler
,EditWSTypeEntryHandler
,MemberCsvImportHandler
public abstract class EditDataHandler extends JcmsFormHandler
This class is the super class of all FormHandler which manage stored data.- See Also:
Data
-
-
Field Summary
Fields Modifier and Type Field Description protected EditTypeExtensionHandler
extFormHandler
protected java.lang.String
id
protected boolean
isDeleteForced
protected boolean
opCancel
protected boolean
opCreate
protected boolean
opDelete
protected boolean
opRefresh
protected boolean
opUpdate
protected boolean
resultOpCreate
protected boolean
resultOpDelete
protected boolean
resultOpUpdate
-
Fields inherited from class com.jalios.jcms.handler.JcmsFormHandler
contextMap, csrfValidationEnabled, editFieldSet, formStep, noRedirect, noSendRedirect, op, opFinish, opNext, opPrevious, popupEdition, redirect, redirectOnClosePopup, workspaceForced
-
Fields inherited from class com.jalios.jcms.context.JcmsJspContext
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
-
Fields inherited from class com.jalios.jcms.context.JcmsContext
browser, caddy, channel, inFO, initDone, initWorkspace, isAdmin, isAjaxRequest, isDBMember, isDebug, isDebugTemplatePath, isLogged, loggedMember, request, response, userCountry, userLang, userLocale, userZoneId, 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
-
Fields inherited from interface com.jalios.jcms.JcmsConstants
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, AJAX_MODE_ATTR, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, CLASS_PROPERTY, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, COUNTRY_SPRITE, CS_TYPOLOGY_ROOT_CAT_VID, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DATA_DIRECTORY, DEFAULT_PHOTO_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, IS_IN_FRONT_OFFICE, 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_MINI, PHOTO_MINI_HEIGHT, PHOTO_MINI_PROP_PREFIX, PHOTO_MINI_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, RAW_CONTENT_ICON_PREFIX, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SECURITY_LOG_FILE, SESSION_AUTHORIZED_FILENAMES_SET, SPRITE_ICON_PREFIX, STATS_REPORT_DIR, STATUS_PROP, STORE_DIR, STORE_XML, SUCCESS_MSG, SVG_ICON_PREFIX, SVGINLINE_ICON_PREFIX, 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, UPLOAD_PERMISSION_COUNT_PROP_PREFIX, UPLOAD_PERMISSION_SIZE_PROP_PREFIX, URL_REGEXP, VID_LOGGED_MEMBER, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
-
-
Constructor Summary
Constructors Constructor Description EditDataHandler()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
afterValidation(boolean result)
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[] datas, java.util.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.protected boolean
createUploadedFileDocument(Data data, java.util.Map dataML, Member author, Workspace ws)
Performs create on given array of data if it is a FileDocument that have just been uploaded.Data
getAvailableData(Data data, Data dataField, Data field, java.util.Map mlMap, java.lang.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, java.util.Map mlMap, java.lang.String lang)
Generic method to get available ML field for a given array of data in a given language.java.util.Map<java.lang.String,java.lang.String>
getAvailableExtraDataMap()
Returns a Map of available extra data.java.util.Map<java.lang.String,java.lang.String>
getAvailableExtraDBDataMap()
Returns a Map of available extra db data.java.lang.Object
getAvailableField(java.lang.String field)
Get value of the given field calling getAvailable{field}().protected java.util.HashMap<java.lang.String,java.lang.Object>
getControllerContext()
Build a controller context.abstract java.lang.Class<? extends Data>
getDataClass()
static java.lang.String
getDeleteRedirect(Data data, java.util.Locale userLocale)
Get the redirect value to be used by default in the ctx menus for delete action.java.lang.Object
getEnumLabels(java.lang.String field, java.lang.String userLang)
Get enum values of the given field calling clazz.get{field}Labels().java.lang.Object
getEnumValues(java.lang.String field)
Get enum values of the given field calling clazz.get{field}Values().EditTypeExtensionHandler
getExtFormHandler()
java.lang.String
getId()
java.lang.String
getModalRedirect()
Get the redirect value to be used in the modals with modalRedirect.jspf and the request attribute 'modal.redirect'.int
getTabGroupMaxCount(java.lang.String tabGroupName)
Returns the max value of the given tab group from the fields defining this tab group.protected void
handleRestResponse()
boolean
isFirstAccess()
Returns true if this is the first access to this form (no previous submission).boolean
performCancel()
protected DataExtension
performCreateExtension()
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(java.lang.String fieldName, java.lang.String dataId, java.lang.Class<? extends Data> clazz)
Computes given dataid, trim and retrieve associated data.protected <T extends Data>
java.util.List<T>processDataIds(java.lang.String fieldName, java.lang.String[] ids, java.lang.Class<T> clazz)
Computes link array to retrieve Data of the given Class.protected <T extends Data>
java.util.List<T>processDataIds(java.lang.String fieldName, java.lang.String[] ids, java.lang.Class<T> clazz, boolean trim)
Computes link array to retrieve Data of the given Class.Data
processMLData(java.lang.String fieldName, java.lang.Class clazz, java.lang.String[] values, java.util.Map mlMap)
Process the given ML values (data ids)<T extends Data>
Data[]processMLDataArray(java.lang.String fieldName, java.lang.Class<T> clazz, java.lang.String[] values, java.util.Map mlMap)
Process the given ML values (data ids)protected boolean
restValidation(boolean result)
protected void
sendRedirect()
void
setExtFormHandler(EditTypeExtensionHandler handler)
void
setExtraDBKeys(java.lang.String[] extraDBKeys)
Convenient methods to update ExtraDBDataMap from beanvoid
setExtraDBValues(java.lang.String[] extraDBValues)
Convenient methods to update ExtraDBDataMap from beanvoid
setExtraKeys(java.lang.String[] extraKeys)
Convenient methods to update ExtraDataMap from beanvoid
setExtraValues(java.lang.String[] extraValues)
Convenient methods to update ExtraDataMap from beanvoid
setFields(Data data)
Set the common (Data) fields.void
setForceDelete(java.lang.String v)
void
setId(java.lang.String id)
void
setOpCancel(java.lang.String v)
void
setOpCreate(java.lang.String v)
void
setOpDelete(java.lang.String v)
void
setOpRefresh(java.lang.String v)
void
setOpUpdate(java.lang.String v)
boolean
validateCancel()
protected boolean
validateCreateExtension(Data extendedData)
boolean
validateRefresh()
protected boolean
validateUpdateExtension(DataExtension extension, Data extendedData)
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[] datas, java.util.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.protected boolean
validateUploadedFileDocument(Data data, java.util.Map dataML, Member author, Workspace ws)
Performs create on given data if it is a FileDocument that have just been uploaded.-
Methods inherited from class com.jalios.jcms.handler.JcmsFormHandler
canStartProcess, checkMissingField, getAvailableMainLanguage, getBackgroundProcess, getClosePopupUrl, getEditFieldSet, getFormStep, getFormStepCount, getFormStepFinishLabel, getFormStepHiddenFields, getFormStepLabels, getFormStepPrefixProp, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenField, getHiddenFieldML, getMainLangValue, getMainLangValueArray, getMLMap, getMLMapArray, getMonolingualValue, getMonolingualValueArray, getMultilingualMainValue, getMultilingualMainValueArray, getMultilingualMLMap, getMultilingualMLMapArray, getRedirect, getRedirectOnClosePopup, getWorkspace, init, isFieldEdition, isFieldMissing, isFormStepClickable, isPartialFieldEdition, isPopupEdition, isWorkspaceForced, mapStringArrayToMapStringList, mapStringListToMapStringArray, mustSendForbiddenOnCSRF, performFinish, performNext, performPrevious, processStatus, sanitize, sanitize, sendRedirect, sendRedirect, setEditField, setFormStep, setNoRedirect, setNoSendRedirect, setOpFinish, setOpNext, setOpPrevious, setPopupEdition, setRedirect, setRedirectOnClosePopup, setWorkspace, setWs, showCancelButton, showFinishButton, showNextButton, showPreviousButton, startProcess, updateUploadedField, updateUploadedFields, updateUploadedFields, validate, validateCSRF, validateFinish, validateNext, validatePrevious
-
Methods inherited from class com.jalios.jcms.context.JcmsJspContext
addAvoidanceLink, addBodyAttributes, addCSSHeader, addCSSHeader, addCSSHeader, addCSSHeader, addCustomHeader, addHandlebarTemplate, addHttpEquivHeader, addHttpNameHeader, addJavaScript, addJavaScript, addJavaScript, addJavaScriptCode, addPrefetchHeader, addStyleHeader, addStyleHeader, addWebAssets, checkAccess, checkAccess, checkCSRF, debugDisplayContext, disablePacker, forceEditIcon, forceUpdate, getAjaxRequestAttribute, getAjaxRequestId, getAllHeadersDiffMap, getAllHeadersMap, getAvoidanceLinks, getBackOfficeCSSHeader, getBackOfficeJavaScriptSet, getBodyAttributes, getContentForm, getCSSHeaders, getCtxCategories, getCurrentCategory, getCustomHeaders, getDocType, getFinalCSSFooterMap, getFinalCSSMap, getFinalJavaScriptSet, getFrontOfficeCSSHeader, getFrontOfficeJavaScriptSet, getHandlebarTemplates, 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
-
Methods inherited from class com.jalios.jcms.context.JcmsContext
addCookie, addMsg, addMsg, addMsgSession, addMsgSession, addToastr, addToastr, addToastrSession, addToastrSession, applySelector, copyMsgListToMsgSessionList, 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, getUploadedFiles, getUploadedFiles, getUrlWithCommonUpdatedParams, getUserCountry, getUserLang, getUserLocale, getUserZoneId, getWarningMsg, getWarningMsgList, getWarningMsgSession, getWarningMsgSessionList, glp, isAdmin, isAdminZone, isAjaxRequest, isDBMember, isDebug, isDebugTemplate, isInFrontOffice, isLogged, isWebdavAccess, isWorkZone, removeMessage, removeMessage, removeMsg, retrieveUploadedFile, select, sendError, sendError, sendForbidden, sendForbidden, sendRedirect, sendRedirect, sendRedirect, setErrorMsg, setErrorMsg, setErrorMsgSession, setErrorMsgSession, setInfoMsg, setInfoMsg, setInfoMsgSession, setInfoMsgSession, setLoggedMember, setRequest, setResponse, setSuccessMsg, setSuccessMsg, setSuccessMsgSession, setSuccessMsgSession, setWarningMsg, setWarningMsg, setWarningMsgSession, setWarningMsgSession, updateWorkspace, validateRegexp, validateSchedule
-
-
-
-
Field Detail
-
opCreate
protected boolean opCreate
-
resultOpCreate
protected boolean resultOpCreate
-
opUpdate
protected boolean opUpdate
-
resultOpUpdate
protected boolean resultOpUpdate
-
opDelete
protected boolean opDelete
-
resultOpDelete
protected boolean resultOpDelete
-
opCancel
protected boolean opCancel
-
opRefresh
protected boolean opRefresh
-
id
protected java.lang.String id
-
extFormHandler
protected EditTypeExtensionHandler extFormHandler
-
isDeleteForced
protected boolean isDeleteForced
-
-
Method Detail
-
sendRedirect
protected void sendRedirect() throws java.io.IOException
- Throws:
java.io.IOException
-
afterValidation
protected boolean afterValidation(boolean result) throws java.io.IOException
- Overrides:
afterValidation
in classJcmsFormHandler
- Throws:
java.io.IOException
-
processAction
public boolean processAction() throws java.io.IOException
Description copied from class:JcmsFormHandler
Method to be implemented to check/validate action to be performed and process them.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.
- Overrides:
processAction
in classJcmsFormHandler
- Returns:
- false if no redirection is needed, true otherwise
- Throws:
java.io.IOException
- IO Exception
-
getControllerContext
protected java.util.HashMap<java.lang.String,java.lang.Object> getControllerContext()
Description copied from class:JcmsFormHandler
Build a controller context. I.E. add request, response and loggedMember.- Overrides:
getControllerContext
in classJcmsFormHandler
- Returns:
- the HashMap which contains the context
-
setFields
public void setFields(Data data)
Set the common (Data) fields. This method is also a hook for sub-classed to fill some field (or do anything else) before a create or an update.- Parameters:
data
- the publication to set the fields- Since:
- jcms-5.7.1
-
getDataClass
public abstract java.lang.Class<? extends Data> getDataClass()
-
getAvailableField
public java.lang.Object getAvailableField(java.lang.String field)
Get value of the given field calling getAvailable{field}(). Called by widgets and meta templates See alsogetEnumValues(String)
andgetEnumLabels(String, String)
- Parameters:
field
- the field name- Returns:
- Object return by getAvailable
- Since:
- jcms-9.0.0
-
getTabGroupMaxCount
public int getTabGroupMaxCount(java.lang.String tabGroupName)
Returns the max value of the given tab group from the fields defining this tab group.- Parameters:
tabGroupName
- Tab group defined in the type- Returns:
- tab group count
-
getEnumValues
public java.lang.Object getEnumValues(java.lang.String field)
Get enum values of the given field calling clazz.get{field}Values(). Called by widgets and meta templates- Parameters:
field
- the field name- Returns:
- Object return by getAvailable
- Since:
- jcms-9.0.0
-
getEnumLabels
public java.lang.Object getEnumLabels(java.lang.String field, java.lang.String userLang)
Get enum values of the given field calling clazz.get{field}Labels(). Called by widgets and meta templates- Parameters:
field
- the field nameuserLang
- the userLang- Returns:
- Object return by getAvailable
- Since:
- jcms-9.0.0
-
validateCreateExtension
protected boolean validateCreateExtension(Data extendedData) throws java.io.IOException
- Throws:
java.io.IOException
-
performCreateExtension
protected DataExtension performCreateExtension() throws java.io.IOException
- Throws:
java.io.IOException
-
validateUpdateExtension
protected boolean validateUpdateExtension(DataExtension extension, Data extendedData) throws java.io.IOException
- Throws:
java.io.IOException
-
performUpdateExtension
protected DataExtension performUpdateExtension(DataExtension extension) throws java.io.IOException
- Throws:
java.io.IOException
-
validateCancel
public boolean validateCancel()
-
performCancel
public boolean performCancel() throws java.io.IOException
- Throws:
java.io.IOException
-
validateRefresh
public boolean validateRefresh()
-
performRefresh
public boolean performRefresh() throws java.io.IOException
- Throws:
java.io.IOException
-
setOpCreate
public void setOpCreate(java.lang.String v)
-
setOpUpdate
public void setOpUpdate(java.lang.String v)
-
setOpDelete
public void setOpDelete(java.lang.String v)
-
setOpCancel
public void setOpCancel(java.lang.String v)
-
setOpRefresh
public void setOpRefresh(java.lang.String v)
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
-
setForceDelete
public void setForceDelete(java.lang.String v)
-
getExtFormHandler
public EditTypeExtensionHandler getExtFormHandler()
-
setExtFormHandler
public void setExtFormHandler(EditTypeExtensionHandler handler)
-
setExtraKeys
public void setExtraKeys(java.lang.String[] extraKeys)
Convenient methods to update ExtraDataMap from bean- Parameters:
extraKeys
- the extraKey- Since:
- jcms-5.7.1
-
setExtraValues
public void setExtraValues(java.lang.String[] extraValues)
Convenient methods to update ExtraDataMap from bean- Parameters:
extraValues
- the extraValues- Since:
- jcms-5.7.1
-
getAvailableExtraDataMap
public java.util.Map<java.lang.String,java.lang.String> getAvailableExtraDataMap()
Returns a Map of available extra data. A mix between:- Default extra data
- Previous extra data
- Submited extra data
- Returns:
- Map of extra data
-
setExtraDBKeys
public void setExtraDBKeys(java.lang.String[] extraDBKeys)
Convenient methods to update ExtraDBDataMap from bean- Parameters:
extraDBKeys
- the extraDBKey- Since:
- jcms-6.0
-
setExtraDBValues
public void setExtraDBValues(java.lang.String[] extraDBValues)
Convenient methods to update ExtraDBDataMap from bean- Parameters:
extraDBValues
- the extraDBValues- Since:
- jcms-6.0
-
getAvailableExtraDBDataMap
public java.util.Map<java.lang.String,java.lang.String> getAvailableExtraDBDataMap()
Returns a Map of available extra db data. A mix between:- Default extra db data
- Previous extra db data
- Submited extra db data
- Returns:
- Map of extra db data
- Since:
- jcms-6.0
-
processDataIds
protected <T extends Data> java.util.List<T> processDataIds(java.lang.String fieldName, java.lang.String[] ids, java.lang.Class<T> clazz)
Computes link array to retrieve Data of the given Class. Trim end of the returned List. If link array contains value MultipartRequest.MULTIPART_UPLOAD then instanciate a new FileDocument but do NOT perform create. Handler.validate() should perform Create or Update. Underlaying files are never overrided.- Type Parameters:
T
- The data type- Parameters:
fieldName
- the field nameids
- arrays of idsclazz
- the class of links- Returns:
- List a list of Data
- Since:
- jcms-5.7.0
-
processDataIds
protected <T extends Data> java.util.List<T> processDataIds(java.lang.String fieldName, java.lang.String[] ids, java.lang.Class<T> clazz, boolean trim)
Computes link array to retrieve Data of the given Class. optionaly, trims the end of the returned List. If link array contains value MultipartRequest.MULTIPART_UPLOAD then instanciate a new FileDocument but do NOT perform create. Handler.validate() should perform Create or Update. Underlaying files are never overrided.- Type Parameters:
T
- The data type- Parameters:
fieldName
- the field nameids
- arrays of idsclazz
- the class of linkstrim
- if true, trim the end of the returned list.- Returns:
- List a list of Data
- Since:
- jcms-6.0.0
-
processDataId
protected Data processDataId(java.lang.String fieldName, java.lang.String dataId, java.lang.Class<? extends Data> clazz)
Computes given dataid, trim and retrieve associated data. If link contains value MultipartRequest.MULTIPART_UPLOAD then instanciate a new FileDocument but do NOT perform create. Handler.validate() should perform Create or Update. Underlaying files are never overrided. Check the data match the given class.- Parameters:
fieldName
- The field namedataId
- the id of the dataclazz
- the class of the data- Returns:
- Data the updated data
- Since:
- jcms-5.7.0
-
validateUploadedFileDocument
protected boolean validateUploadedFileDocument(Data data, Member author, Workspace ws)
Performs create on given data if it is a FileDocument that have just been uploaded. This method should be called byEditPublicationHandler#validateBeforeOp()
- Parameters:
data
- the data to work withauthor
- the author of the dataws
- the workspace of the data- Returns:
- true if ControllerStatus is ok
- Since:
- jcms-5.7.0
- See Also:
EditPublicationHandler.validateBeforeOp()
-
validateUploadedFileDocument
protected boolean validateUploadedFileDocument(Data data, java.util.Map dataML, Member author, Workspace ws)
Performs create on given data if it is a FileDocument that have just been uploaded. This method should be called byEditPublicationHandler#validateBeforeOp()
- Parameters:
data
- the data to work withdataML
- the other languagesauthor
- the author of the dataws
- the workspace of the data- Returns:
- true if ControllerStatus is ok
- Since:
- jcms-6.1.3
- See Also:
EditPublicationHandler.validateBeforeOp()
-
validateUploadedFileDocument
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. This method should be called byEditPublicationHandler#validateBeforeOp()
- Parameters:
datas
- an array of data to work withauthor
- the author of the dataws
- the workspace of the data- Returns:
- true if ControllerStatus is ok
- Since:
- jcms-5.7.0
- See Also:
EditPublicationHandler.validateBeforeOp()
-
validateUploadedFileDocument
protected boolean validateUploadedFileDocument(Data[] datas, java.util.Map dataML, Member author, Workspace ws)
Performs create on given data if it is a FileDocument that have just been uploaded. This method should be called byEditPublicationHandler#validateBeforeOp()
- Parameters:
datas
- an array of data to work withdataML
- the other languagesauthor
- the author of the dataws
- the workspace of the data- Returns:
- true if ControllerStatus is ok
- Since:
- jcms-6.1.3
- See Also:
EditPublicationHandler.validateBeforeOp()
-
createUploadedFileDocument
protected boolean createUploadedFileDocument(Data data, Member author, Workspace ws)
Performs create on given data if it is a FileDocument that have just been uploaded. This method should be called byEditPublicationHandler#validateBeforeOp()
- Parameters:
data
- the data to work withauthor
- the author of the dataws
- the workspace of the data- Returns:
- true if ControllerStatus is ok
- Since:
- jcms-5.7.0
- See Also:
EditPublicationHandler.validateBeforeOp()
-
createUploadedFileDocument
protected boolean createUploadedFileDocument(Data data, java.util.Map dataML, Member author, Workspace ws)
Performs create on given array of data if it is a FileDocument that have just been uploaded. This method should be called byEditPublicationHandler#validateBeforeOp()
- Parameters:
data
- the data to work with (main languagedataML
- the other languagesauthor
- the author of the dataws
- the workspace of the data- Returns:
- true if ControllerStatus is ok
- Since:
- jcms-6.1.3
- See Also:
EditPublicationHandler.validateBeforeOp()
-
createUploadedFileDocument
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. This method should be called byEditPublicationHandler#validateBeforeOp()
- Parameters:
datas
- an array of data to work withauthor
- the author of the dataws
- the workspace of the data- Returns:
- true if ControllerStatus is ok
- Since:
- jcms-6.1.2
- See Also:
EditPublicationHandler.validateBeforeOp()
-
createUploadedFileDocument
protected boolean createUploadedFileDocument(Data[] datas, java.util.Map dataML, Member author, Workspace ws)
Performs create on given array of data if it is a FileDocument that have just been uploaded. This method should be called byEditPublicationHandler#validateBeforeOp()
- Parameters:
datas
- an array of data to work withdataML
- the other languagesauthor
- the author of the dataws
- the workspace of the data- Returns:
- true if ControllerStatus is ok
- Since:
- jcms-6.1.3
- See Also:
EditPublicationHandler.validateBeforeOp()
-
processMLData
public Data processMLData(java.lang.String fieldName, java.lang.Class clazz, java.lang.String[] values, java.util.Map mlMap)
Process the given ML values (data ids)- Parameters:
fieldName
- the field nameclazz
- the classvalues
- the idsmlMap
- the mlMap- Returns:
- the data in the main language
- Since:
- jcms-5.7.0
-
processMLDataArray
public <T extends Data> Data[] processMLDataArray(java.lang.String fieldName, java.lang.Class<T> clazz, java.lang.String[] values, java.util.Map mlMap)
Process the given ML values (data ids)- Type Parameters:
T
- The data type- Parameters:
fieldName
- the field nameclazz
- the classvalues
- the idsmlMap
- the mlMap- Returns:
- the data array in the main language
- Since:
- jcms-5.7.0
-
getAvailableData
public Data getAvailableData(Data data, Data dataField, Data field, java.util.Map mlMap, java.lang.String lang)
Generic method to get available ML field for a given data in a given language.- Parameters:
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- Returns:
- the value for the field of the object in the given language
- Since:
- jcms-5.7.0
-
getAvailableDataArray
public Data[] getAvailableDataArray(Data data, Data[] dataField, Data[] field, java.util.Map mlMap, java.lang.String lang)
Generic method to get available ML field for a given array of data in a given language.- Parameters:
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- Returns:
- the value for the field of the object in the given language
- Since:
- jcms-5.7.0
-
isFirstAccess
public boolean isFirstAccess()
Returns true if this is the first access to this form (no previous submission).- Returns:
- true if this is the first access to this form (no previous submission).
- Since:
- jcms-5.7.0
-
handleRestResponse
protected void handleRestResponse() throws java.io.IOException
- Throws:
java.io.IOException
-
restValidation
protected boolean restValidation(boolean result) throws java.io.IOException
- Throws:
java.io.IOException
-
getModalRedirect
public java.lang.String getModalRedirect()
Description copied from class:JcmsFormHandler
Get the redirect value to be used in the modals with modalRedirect.jspf and the request attribute 'modal.redirect'.- Overrides:
getModalRedirect
in classJcmsFormHandler
- Returns:
- redirect value
-
getDeleteRedirect
public static java.lang.String getDeleteRedirect(Data data, java.util.Locale userLocale)
Get the redirect value to be used by default in the ctx menus for delete action.Returns publication workspace home url if data is a Publication, else returns null.
- Parameters:
data
- the data to be deleteduserLocale
- the user context- Returns:
- redirect value
- Since:
- jcms-10.0.6
-
-