Class CmsXmlContentEditor
- All Implemented Interfaces:
I_CmsWidgetDialog
- Since:
- 6.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Action for checking content before executing the direct edit action.static final int
Action for confirming the XML content structure correction.static final int
Value for the action: copy the current locale.static final int
Action for correction of the XML content structure confirmed.static final int
Action for optional element creation.static final int
Action for element move down operation.static final int
Action for element move up operation.static final int
Action for optional element removal.static final int
Action for new file creation.static final int
Action that sub choices should be determined.static final String
Request context attribute for the page from which the editor was opened.static final String
Indicates that the content should be checked before executing the direct edit action.static final String
Indicates that the correction of the XML content structure should be confirmed.static final String
Indicates an optional element should be created.static final String
Indicates an element should be moved down.static final String
Indicates an element should be moved up.static final String
Indicates an optional element should be removed.static final String
Indicates a new file should be created.static final String
Indicates that sub choices should be determined.static final String
Indicates that the contents of the current locale should be copied to other locales.static final String
Indicates that the correction of the XML content structure was confirmed by the user.static final String
Parameter name for the request parameter "choiceelement".static final String
Parameter name for the request parameter "choicetype".static final String
Parameter name for the request parameter "editcontext".static final String
Parameter name for the request parameter "elementindex".static final String
Parameter name for the request parameter "elementname".static final String
Parameter name for the request parameter "newlink".Fields inherited from class org.opencms.workplace.editors.CmsEditor
ACTION_CHANGE_BODY, ACTION_DELETELOCALE, ACTION_EXIT, ACTION_PREVIEW, ACTION_SAVE, ACTION_SAVEACTION, ACTION_SAVEEXIT, ACTION_SHOW, ACTION_SHOW_ERRORMESSAGE, EDITOR_CHANGE_ELEMENT, EDITOR_CLEANUP, EDITOR_CLOSEBROWSER, EDITOR_DELETELOCALE, EDITOR_EXIT, EDITOR_PREVIEW, EDITOR_SAVE, EDITOR_SAVEACTION, EDITOR_SAVEEXIT, EDITOR_SHOW, EDITOR_SHOW_ERRORMESSAGE, EMPTY_LOCALE, PARAM_BACKLINK, PARAM_CONTENT, PARAM_DIRECTEDIT, PARAM_EDITASTEXT, PARAM_EDITORMODE, PARAM_ELEMENTLANGUAGE, PARAM_LOADDEFAULT, PARAM_MODIFIED, PARAM_OLDELEMENTLANGUAGE, PARAM_TEMPFILE, PATH_EDITORS
Fields inherited from class org.opencms.workplace.CmsDialog
ACTION_CANCEL, ACTION_CLOSEPOPUP, ACTION_CLOSEPOPUP_SAVE, ACTION_CONFIRMED, ACTION_CONTINUE, ACTION_DEFAULT, ACTION_LOCKS_CONFIRMED, ACTION_OK, ACTION_REPORT_BEGIN, ACTION_REPORT_END, ACTION_REPORT_UPDATE, ACTION_SET, ACTION_WAIT, ATTRIBUTE_THROWABLE, BUTTON_ADVANCED, BUTTON_BACK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_CONTINUE, BUTTON_DETAILS, BUTTON_DISCARD, BUTTON_EDIT, BUTTON_OK, BUTTON_OK_NO_SUBMIT, BUTTON_SET, DIALOG_BACK, DIALOG_CANCEL, DIALOG_CONFIRMED, DIALOG_CONTINUE, DIALOG_INITIAL, DIALOG_LOCKS_CONFIRMED, DIALOG_OK, DIALOG_SET, DIALOG_WAIT, PARAM_ACTION, PARAM_ACTION_VALUE_FOR_CHANGED_INDEX, PARAM_CLOSELINK, PARAM_DIALOGTYPE, PARAM_ERRORSTACK, PARAM_FILE, PARAM_FRAMENAME, PARAM_ISPOPUP, PARAM_LOCK, PARAM_MESSAGE, PARAM_ORIGINALPARAMS, PARAM_PREACTIONDONE, PARAM_REDIRECT, PARAM_RESOURCE, PARAM_TARGET, PARAM_THREAD, PARAM_THREAD_HASNEXT, PARAM_TITLE, REPORT_BEGIN, REPORT_END, REPORT_UPDATE
Fields inherited from class org.opencms.workplace.tools.CmsToolDialog
PARAM_ADMIN_PROJECT, PARAM_BASE, PARAM_FORCE, PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW
Fields inherited from class org.opencms.workplace.CmsWorkplace
DEBUG, DEFAULT_DATE_STRING, DEFAULT_LANGUAGE, DEFAULT_LOCALE, DIALOG_PATH_COMMON, FILE_DIALOG_CLOSE, FILE_DIALOG_SCREEN_CONFIRM, FILE_DIALOG_SCREEN_ERROR, FILE_DIALOG_SCREEN_ERRORPAGE, FILE_DIALOG_SCREEN_WAIT, FILE_EXPLORER_FILELIST, FILE_REPORT_OUTPUT, HTML_END, HTML_START, INPUT_DEFAULT, INPUT_NONE, JSP_WORKPLACE_URI, PARAM_DIRECTPUBLISH, PARAM_MODELFILE, PARAM_NEWRESOURCETYPE, PARAM_PUBLISHSIBLINGS, PARAM_RELATEDRESOURCES, PARAM_RESOURCELIST, PARAM_SUBRESOURCES, PARAM_WP_EXPLORER_RESOURCE, PARAM_WP_PROJECT, PARAM_WP_SITE, PARAM_WP_START, PARAM_WP_VIEW, PATH_DIALOGS, PATH_WORKPLACE, REQUEST_ATTRIBUTE_MULTIPART, REQUEST_ATTRIBUTE_RELOADTREE, RES_PATH_FILETYPES, RFS_PATH_RESOURCES, SESSION_WORKPLACE_CLASS, VFS_DIR_DEFAULTBODIES, VFS_DIR_TEMPLATES, VFS_PATH_COMMONS, VFS_PATH_EDITORS, VFS_PATH_GALLERIES, VFS_PATH_LOCALES, VFS_PATH_MODELDIALOG, VFS_PATH_MODULES, VFS_PATH_NEWRESOURCEDIALOG, VFS_PATH_RESOURCES, VFS_PATH_SITES, VFS_PATH_SYSTEM, VFS_PATH_VIEWS, VFS_PATH_WORKPLACE, VIEW_ADMIN, VIEW_DIRECT_EDIT, VIEW_EXPLORER, VIEW_GALLERY, VIEW_LIST, VIEW_WORKPLACE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Performs the change element language action of the editor.void
actionClear
(boolean forceUnlock) Deletes the temporary file and unlocks the edited resource when in direct edit mode.void
Performs the copy locale action.void
Performs the delete locale action.void
Performs a configurable action performed by the editor.void
Performs the exit editor action.void
Moves an element in the xml content either up or down.void
Creates a new XML content item for editing.void
Performs the preview XML content action in a new browser window.void
Performs the save content action.void
actionSave
(Locale locale) Performs the save content action.void
Adds an optional element to the XML content or removes an optional element from the XML content.buildElementChoices
(String elementName, boolean choiceType, boolean checkChoice) Returns the JSON array with information about the choices of a given element.buildSelectElementLanguage
(String attributes) Builds the HTML String for the element language selector.Returns the available sub choices for a nested choice element.protected void
Writes the content of a temporary file back to the original file.protected Locale
ensureLocale
(Locale locale) Makes sure the requested locale node is present in the content document by either copying an existing locale node or creating an empty one.int
Returns the style setting to use when generating buttons for this widget dialog.Returns the URI to the editor resource folder where button images and javascripts are located.Returns the current element locale.Returns a set of help messages ids that are already included on the widget dialog.Returns the name of the choice element to add.Returns the flag if the element to add is a choice type.Gets the editor context path (usually either a container page path or null).Returns the index of the element to add or remove.Returns the name of the element to add or remove.Returns the mode.Returns the parameter that specifies the model file name.Returns the "new link" parameter.Returns the postCreateHandler.Returns the "user-agent" of the current request, ornull
in case no request is available.Returns the different xml editor widgets used in the form to display.Generates the HTML form for the XML content editor.Generates the HTML for the end of the HTML editor form page.Generates the JavaScript includes for the used widgets in the editor form.Generates the JavaScript initialization calls for the used widgets in the editor form.Generates the JavaScript initialization methods for the used widgets.boolean
Returns true if the edited content contains validation errors, otherwise false.protected void
Initializes the editor content when opening the editor for the first time.protected void
Initializes the element language for the first call of the editor.protected void
initWorkplaceRequestValues
(CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request) Analyzes the request for workplace parameters and adjusts the workplace settings accordingly.boolean
Returns true if the preview is available for the edited xml content.void
setEditorValues
(Locale locale) Sets the editor values for the locale with the parameters from the request.void
setParamChoiceElement
(String choiceElement) Sets the name of the choice element to add.void
setParamChoiceType
(String paramChoiceType) Sets the flag if the element to add is a choice type.void
setParamEditContext
(String editContext) Sets the edit context URI.void
setParamElementIndex
(String elementIndex) Sets the index of the element to add or remove.void
setParamElementName
(String elementName) Sets the name of the element to add or remove.void
setParamMode
(String mode) Sets the content creation mode.void
setParamModelFile
(String paramMasterFile) Sets the parameter that specifies the model file name.void
setParamNewLink
(String paramNewLink) Sets the "new link" parameter.void
setParamPostCreateHandler
(String handler) Sets the post-create handler class name.boolean
Determines if the element language selector is shown dependent on the available Locales.boolean
Tests if we are working with the new administration dialog style.Methods inherited from class org.opencms.workplace.editors.CmsEditor
actionClose, buildSelectElementLanguage, button, buttonActionCancel, buttonActionDirectEdit, checkLock, clearEditorSessionInfo, createTempFile, decodeContent, decodeParamValue, deleteLocaleButton, deleteTempFile, encodeContent, getCloneCms, getEditorDisplayOptions, getEditorSessionInfo, getFileEncoding, getFileEncoding, getOpenCmsContext, getParamBacklink, getParamContent, getParamDirectedit, getParamEditastext, getParamEditormode, getParamElementlanguage, getParamLoaddefault, getParamModified, getParamOldelementlanguage, getParamTempfile, getPicsUri, initMessages, initSessionInfo, setFileEncoding, setParamBacklink, setParamContent, setParamDirectedit, setParamEditastext, setParamEditormode, setParamElementlanguage, setParamLoaddefault, setParamModified, setParamOldelementlanguage, setParamTempfile, showErrorPage, showErrorPage
Methods inherited from class org.opencms.workplace.editors.CmsEditorBase
checkResourcePermissions, checkRole, initTimeWarp
Methods inherited from class org.opencms.workplace.CmsDialog
actionCloseDialog, appendDelimiter, buildAjaxResultContainer, buildAjaxWaitMessage, buildLockAdditionalOptions, buildLockConfirmationMessageJS, buildLockHeaderBox, checkResourcePermissions, computeCurrentFolder, dialog, dialogBlock, dialogBlockEnd, dialogBlockStart, dialogButtonRow, dialogButtonRowEnd, dialogButtonRowStart, dialogButtons, dialogButtonsClose, dialogButtonsClose, dialogButtonsCloseDetails, dialogButtonsHtml, dialogButtonsOk, dialogButtonsOk, dialogButtonsOkCancel, dialogButtonsOkCancel, dialogButtonsOkCancelAdvanced, dialogButtonsSetOkCancel, dialogContent, dialogContentEnd, dialogContentStart, dialogEnd, dialogHead, dialogHorizontalSpacer, dialogLockButtons, dialogRow, dialogRowEnd, dialogRowStart, dialogScriptSubmit, dialogSeparator, dialogSpacer, dialogStart, dialogStart, dialogSubheadline, dialogToggleStart, dialogWhiteBox, dialogWhiteBoxEnd, dialogWhiteBoxStart, getAction, getAdministrationBackLink, getCancelAction, getDialogRealUri, getDialogUri, getOnlineHelpUriCustom, getParamAction, getParamCloseLink, getParamDialogtype, getParamFramename, getParamIsPopup, getParamMessage, getParamOriginalParams, getParamPreActionDone, getParamRedirect, getParamResource, getParamTitle, getState, hasCorrectLockstate, hasSiblings, htmlStart, htmlStart, htmlStart, htmlStartStyle, includeErrorpage, initCmsDialog, isPopup, isPreEditor, openLaunchpad, openWorkplaceLink, pageHtml, pageHtml, setAction, setOnlineHelpUriCustom, setParamAction, setParamCloseLink, setParamDialogtype, setParamFramename, setParamIsPopup, setParamMessage, setParamOriginalParams, setParamPreActionDone, setParamRedirect, setParamResource, setParamTitle
Methods inherited from class org.opencms.workplace.tools.CmsToolDialog
computeUpLevelLink, dialogTitle, getAdminTool, getCurrentToolPath, getParamBase, getParamForce, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamBase, setParamForce, setParamPath, setParamRoot, setParamStyle
Methods inherited from class org.opencms.workplace.CmsWorkplace
addMessages, addMessages, allParamsAsHidden, allParamsAsRequest, allParamValues, bodyEnd, bodyStart, bodyStart, buildSelect, buildSelect, button, button, buttonBar, buttonBar, buttonBarHorizontalLine, buttonBarLabel, buttonBarLabel, buttonBarLine, buttonBarLineSpacer, buttonBarSeparator, buttonBarSpacer, buttonBarStartTab, canEditPermissionsForRoles, checkLock, fillParamValues, fillParamValues, generateCssStyle, generatePageEndExtended, generatePageEndSimple, generatePageStartExtended, generatePageStartSimple, getBroadcastMessageString, getCms, getEncoding, getExplorerFileListFullUri, getFrameSource, getJsp, getLocale, getMacroResolver, getMessages, getMultiPartFileItems, getParameterMap, getResourceUri, getResourceUri, getSession, getSettings, getSkinUri, getStartSiteRoot, getStartSiteRoot, getStaticResourceUri, getStaticResourceUri, getStyleUri, getStyleUri, getStyleUri, getTemporaryFileName, getWorkplaceExplorerLink, getWorkplaceExplorerLink, getWorkplaceSettings, htmlEnd, initSettings, initUserSettings, initWorkplaceMembers, initWorkplaceMembers, initWorkplaceSettings, isForwarded, isHelpEnabled, isSubElement, isTemporaryFile, key, key, keyDefault, nullToEmpty, paramsAsHidden, paramsAsHidden, paramsAsParameterMap, paramsAsRequest, paramValues, resolveMacros, sendCmsRedirect, sendForward, setForwarded, shortKey, substituteSiteTitle, substituteSiteTitleStatic, switchToCurrentProject, switchToTempProject, updateUserPreferences
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opencms.widgets.I_CmsWidgetDialog
button, buttonBar, buttonBarHorizontalLine, buttonBarSeparator, buttonBarSpacer, buttonBarStartTab, dialogHorizontalSpacer, getLocale, getMessages
-
Field Details
-
ACTION_CHECK
Action for checking content before executing the direct edit action.- See Also:
-
ACTION_CONFIRMCORRECTION
Action for confirming the XML content structure correction.- See Also:
-
ACTION_COPYLOCALE
Value for the action: copy the current locale.- See Also:
-
ACTION_CORRECTIONCONFIRMED
Action for correction of the XML content structure confirmed.- See Also:
-
ACTION_ELEMENT_ADD
Action for optional element creation.- See Also:
-
ACTION_ELEMENT_MOVE_DOWN
Action for element move down operation.- See Also:
-
ACTION_ELEMENT_MOVE_UP
Action for element move up operation.- See Also:
-
ACTION_ELEMENT_REMOVE
Action for optional element removal.- See Also:
-
ACTION_NEW
Action for new file creation.- See Also:
-
ACTION_SUBCHOICES
Action that sub choices should be determined.- See Also:
-
ATTRIBUTE_EDITCONTEXT
Request context attribute for the page from which the editor was opened. -
EDITOR_ACTION_CHECK
Indicates that the content should be checked before executing the direct edit action.- See Also:
-
EDITOR_ACTION_CONFIRMCORRECTION
Indicates that the correction of the XML content structure should be confirmed.- See Also:
-
EDITOR_ACTION_ELEMENT_ADD
Indicates an optional element should be created.- See Also:
-
EDITOR_ACTION_ELEMENT_MOVE_DOWN
Indicates an element should be moved down.- See Also:
-
EDITOR_ACTION_ELEMENT_MOVE_UP
Indicates an element should be moved up.- See Also:
-
EDITOR_ACTION_ELEMENT_REMOVE
Indicates an optional element should be removed.- See Also:
-
EDITOR_ACTION_NEW
Indicates a new file should be created.- See Also:
-
EDITOR_ACTION_SUBCHOICES
Indicates that sub choices should be determined.- See Also:
-
EDITOR_COPYLOCALE
Indicates that the contents of the current locale should be copied to other locales.- See Also:
-
EDITOR_CORRECTIONCONFIRMED
Indicates that the correction of the XML content structure was confirmed by the user.- See Also:
-
PARAM_CHOICEELEMENT
Parameter name for the request parameter "choiceelement".- See Also:
-
PARAM_CHOICETYPE
Parameter name for the request parameter "choicetype".- See Also:
-
PARAM_EDITCONTEXT
Parameter name for the request parameter "editcontext".- See Also:
-
PARAM_ELEMENTINDEX
Parameter name for the request parameter "elementindex".- See Also:
-
PARAM_ELEMENTNAME
Parameter name for the request parameter "elementname".- See Also:
-
PARAM_NEWLINK
Parameter name for the request parameter "newlink".- See Also:
-
-
Constructor Details
-
CmsXmlContentEditor
Public constructor.- Parameters:
jsp
- an initialized JSP action element
-
-
Method Details
-
actionChangeElementLanguage
Performs the change element language action of the editor. -
actionClear
Deletes the temporary file and unlocks the edited resource when in direct edit mode.- Specified by:
actionClear
in classCmsEditor
- Parameters:
forceUnlock
- if true, the resource will be unlocked anyway
-
actionCopyElementLocale
Performs the copy locale action.- Throws:
javax.servlet.jsp.JspException
- if something goes wrong
-
actionDeleteElementLocale
Performs the delete locale action.- Throws:
javax.servlet.jsp.JspException
- if something goes wrong
-
actionDirectEdit
public void actionDirectEdit() throws IOException, javax.servlet.jsp.JspException, javax.servlet.ServletExceptionPerforms a configurable action performed by the editor.The default action is: save resource, clear temporary files and publish the resource directly.
- Throws:
IOException
- if a forward failsjavax.servlet.ServletException
- of a forward failsjavax.servlet.jsp.JspException
- if including a JSP fails
-
actionExit
public void actionExit() throws IOException, javax.servlet.jsp.JspException, javax.servlet.ServletExceptionPerforms the exit editor action.- Specified by:
actionExit
in classCmsEditor
- Throws:
IOException
- if a forward failsjavax.servlet.jsp.JspException
- if including an element failsjavax.servlet.ServletException
- if a forward fails- See Also:
-
actionMoveElement
Moves an element in the xml content either up or down.Depends on the given action value.
- Throws:
javax.servlet.jsp.JspException
- if including the error page fails
-
actionNew
Creates a new XML content item for editing.- Throws:
javax.servlet.jsp.JspException
- in case something goes wrong
-
actionPreview
Performs the preview XML content action in a new browser window.- Throws:
IOException
- if redirect failsjavax.servlet.jsp.JspException
- if inclusion of error page fails
-
actionSave
Performs the save content action.- Specified by:
actionSave
in classCmsEditor
- Throws:
javax.servlet.jsp.JspException
- if including an element fails- See Also:
-
actionSave
Performs the save content action.This is also used when changing the element language.
- Parameters:
locale
- the locale to save the content- Throws:
javax.servlet.jsp.JspException
- if including the error page fails
-
actionToggleElement
Adds an optional element to the XML content or removes an optional element from the XML content.Depends on the given action value.
- Throws:
javax.servlet.jsp.JspException
- if including the error page fails
-
buildElementChoices
Returns the JSON array with information about the choices of a given element.The returned array is only filled if the given element has choice options, otherwise an empty array is returned.
Note: the first array element is an object containing information if the element itself is a choice type, the following elements are the choice option items.- Parameters:
elementName
- the element name to check (complete xpath)choiceType
- flag indicating if the given element name represents a choice type or notcheckChoice
- flag indicating if the element name should be checked if it is a choice option and choice type- Returns:
- the JSON array with information about the choices of a given element
-
buildSelectElementLanguage
Builds the HTML String for the element language selector.This method has to use the resource request parameter because the temporary file is not available in the upper button frame.
- Parameters:
attributes
- optional attributes for the <select> tag- Returns:
- the HTML for the element language select box
-
buildSubChoices
Returns the available sub choices for a nested choice element.- Returns:
- the available sub choices for a nested choice element as JSON array string
-
getButtonStyle
Description copied from interface:I_CmsWidgetDialog
Returns the style setting to use when generating buttons for this widget dialog.- Specified by:
getButtonStyle
in interfaceI_CmsWidgetDialog
- Returns:
- the style setting to use when generating buttons for this widget dialog
- See Also:
-
getEditorResourceUri
Description copied from class:CmsEditor
Returns the URI to the editor resource folder where button images and javascripts are located.- Specified by:
getEditorResourceUri
in classCmsEditor
- Returns:
- the URI to the editor resource folder
- See Also:
-
getElementLocale
Returns the current element locale.- Returns:
- the current element locale
-
getHelpMessageIds
Description copied from interface:I_CmsWidgetDialog
Returns a set of help messages ids that are already included on the widget dialog.This is used to prevent the occurence of multiple html
div
id's with the same value when generating the help texts. For valid html, each id can be used only once.- Specified by:
getHelpMessageIds
in interfaceI_CmsWidgetDialog
- Returns:
- a set of help messages ids that are already included on the widget dialog
- See Also:
-
getParamChoiceElement
Returns the name of the choice element to add.- Returns:
- the name of the choice element to add
-
getParamChoiceType
Returns the flag if the element to add is a choice type.- Returns:
- the flag if the element to add is a choice type
-
getParamEditContext
Gets the editor context path (usually either a container page path or null).- Returns:
- the editor context path
-
getParamElementIndex
Returns the index of the element to add or remove.- Returns:
- the index of the element to add or remove
-
getParamElementName
Returns the name of the element to add or remove.- Returns:
- the name of the element to add or remove
-
getParamMode
Returns the mode.- Returns:
- the mode
-
getParamModelFile
Returns the parameter that specifies the model file name.- Returns:
- the parameter that specifies the model file name
-
getParamNewLink
Returns the "new link" parameter.- Returns:
- the "new link" parameter
-
getParamPostCreateHandler
Returns the postCreateHandler.- Returns:
- the postCreateHandler
-
getUserAgent
Description copied from interface:I_CmsWidgetDialog
Returns the "user-agent" of the current request, ornull
in case no request is available.- Specified by:
getUserAgent
in interfaceI_CmsWidgetDialog
- Returns:
- the "user-agent" of the current request
- See Also:
-
getWidgetCollector
Returns the different xml editor widgets used in the form to display.- Returns:
- the different xml editor widgets used in the form to display
-
getXmlEditorForm
Generates the HTML form for the XML content editor.- Returns:
- the HTML that generates the form for the XML editor
-
getXmlEditorHtmlEnd
Generates the HTML for the end of the HTML editor form page.- Returns:
- the HTML for the end of the HTML editor form page
- Throws:
javax.servlet.jsp.JspException
- if including the error page fails
-
getXmlEditorIncludes
Generates the JavaScript includes for the used widgets in the editor form.- Returns:
- the JavaScript includes for the used widgets
- Throws:
javax.servlet.jsp.JspException
- if including the error page fails
-
getXmlEditorInitCalls
Generates the JavaScript initialization calls for the used widgets in the editor form.- Returns:
- the JavaScript initialization calls for the used widgets
- Throws:
javax.servlet.jsp.JspException
- if including the error page fails
-
getXmlEditorInitMethods
Generates the JavaScript initialization methods for the used widgets.- Returns:
- the JavaScript initialization methods for the used widgets
- Throws:
javax.servlet.jsp.JspException
- if an error occurs during JavaScript generation
-
hasValidationErrors
Returns true if the edited content contains validation errors, otherwise false.- Returns:
- true if the edited content contains validation errors, otherwise false
-
isPreviewEnabled
Returns true if the preview is available for the edited xml content.This method has to use the resource request parameter and read the file from vfs because the temporary file is not available in the upper button frame.
- Returns:
- true if the preview is enabled, otherwise false
-
setEditorValues
Sets the editor values for the locale with the parameters from the request.Called before saving the xml content, redisplaying the input form, changing the language and adding or removing elements.
- Parameters:
locale
- the locale of the content to save- Throws:
CmsXmlException
- if something goes wrong
-
setParamChoiceElement
Sets the name of the choice element to add.- Parameters:
choiceElement
- the name of the choice element to add
-
setParamChoiceType
Sets the flag if the element to add is a choice type.- Parameters:
paramChoiceType
- the flag if the element to add is a choice type
-
setParamEditContext
Sets the edit context URI.- Parameters:
editContext
- the edit context URI.
-
setParamElementIndex
Sets the index of the element to add or remove.- Parameters:
elementIndex
- the index of the element to add or remove
-
setParamElementName
Sets the name of the element to add or remove.- Parameters:
elementName
- the name of the element to add or remove
-
setParamMode
Sets the content creation mode.- Parameters:
mode
- the content creation mode
-
setParamModelFile
Sets the parameter that specifies the model file name.- Parameters:
paramMasterFile
- the parameter that specifies the model file name
-
setParamNewLink
Sets the "new link" parameter.- Parameters:
paramNewLink
- the "new link" parameter to set
-
setParamPostCreateHandler
Sets the post-create handler class name.- Parameters:
handler
- the post-create handler class name
-
showElementLanguageSelector
Determines if the element language selector is shown dependent on the available Locales.- Returns:
- true, if more than one Locale is available, otherwise false
-
useNewStyle
Description copied from class:CmsToolDialog
Tests if we are working with the new administration dialog style.The default is the new style, this parameter is not intended for external use.
- Specified by:
useNewStyle
in interfaceI_CmsWidgetDialog
- Overrides:
useNewStyle
in classCmsToolDialog
- Returns:
true
if using the new style- See Also:
-
commitTempFile
Description copied from class:CmsEditor
Writes the content of a temporary file back to the original file.- Overrides:
commitTempFile
in classCmsEditor
- Throws:
CmsException
- if something goes wrong- See Also:
-
ensureLocale
Makes sure the requested locale node is present in the content document by either copying an existing locale node or creating an empty one.- Parameters:
locale
- the requested locale- Returns:
- the locale
-
initContent
Initializes the editor content when opening the editor for the first time.Not necessary for the xmlcontent editor.
- Specified by:
initContent
in classCmsEditor
-
initElementLanguage
Initializes the element language for the first call of the editor. -
initWorkplaceRequestValues
protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request) Description copied from class:CmsWorkplace
Analyzes the request for workplace parameters and adjusts the workplace settings accordingly.- Overrides:
initWorkplaceRequestValues
in classCmsDialog
- Parameters:
settings
- the workplace settingsrequest
- the current request- See Also:
-