org.opencms.workplace.editors
Class CmsXmlContentEditor

java.lang.Object
  extended byorg.opencms.workplace.CmsWorkplace
      extended byorg.opencms.workplace.tools.CmsToolDialog
          extended byorg.opencms.workplace.CmsDialog
              extended byorg.opencms.workplace.editors.CmsEditorBase
                  extended byorg.opencms.workplace.editors.CmsEditor
                      extended byorg.opencms.workplace.editors.CmsXmlContentEditor
All Implemented Interfaces:
I_CmsWidgetDialog

public class CmsXmlContentEditor
extends CmsEditor
implements I_CmsWidgetDialog

Creates the editor for XML content definitions.

Since:
6.0.0
Version:
$Revision: 1.76 $
Author:
Alexander Kandzior, Andreas Zahner

Field Summary
static int ACTION_CHECK
          Action for checking content before executing the direct edit action.
static int ACTION_CONFIRMCORRECTION
          Action for confirming the XML content structure correction.
static int ACTION_CORRECTIONCONFIRMED
          Action for correction of the XML content structure confirmed.
static int ACTION_ELEMENT_ADD
          Action for optional element creation.
static int ACTION_ELEMENT_MOVE_DOWN
          Action for element move down operation.
static int ACTION_ELEMENT_MOVE_UP
          Action for element move up operation.
static int ACTION_ELEMENT_REMOVE
          Action for optional element removal.
static int ACTION_NEW
          Action for new file creation.
static java.lang.String EDITOR_ACTION_CHECK
          Indicates that the content should be checked before executing the direct edit action.
static java.lang.String EDITOR_ACTION_CONFIRMCORRECTION
          Indicates that the correction of the XML content structure should be confirmed.
static java.lang.String EDITOR_ACTION_ELEMENT_ADD
          Indicates an optional element should be created.
static java.lang.String EDITOR_ACTION_ELEMENT_MOVE_DOWN
          Indicates an element should be moved down.
static java.lang.String EDITOR_ACTION_ELEMENT_MOVE_UP
          Indicates an element should be moved up.
static java.lang.String EDITOR_ACTION_ELEMENT_REMOVE
          Indicates an optional element should be removed.
static java.lang.String EDITOR_ACTION_NEW
          Indicates a new file should be created.
static java.lang.String EDITOR_CORRECTIONCONFIRMED
          Indicates that the correction of the XML content structure was confirmed by the user.
static java.lang.String PARAM_ELEMENTINDEX
          Parameter name for the request parameter "elementindex".
static java.lang.String PARAM_ELEMENTNAME
          Parameter name for the request parameter "elementname".
static java.lang.String PARAM_NEWLINK
          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_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_BASE, PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW
 
Fields inherited from class org.opencms.workplace.CmsWorkplace
DEBUG, 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, PARAM_WP_EXPLORER_RESOURCE, PARAM_WP_PROJECT, PARAM_WP_SITE, PATH_DIALOGS, PATH_WORKPLACE, REQUEST_ATTRIBUTE_MULTIPART, REQUEST_ATTRIBUTE_RELOADTREE, RFS_PATH_RESOURCES, SESSION_WORKPLACE_CLASS, TEMP_FILE_PREFIX, VFS_DIR_DEFAULTBODIES, VFS_DIR_TEMPLATES, VFS_PATH_COMMONS, VFS_PATH_EDITORS, VFS_PATH_GALLERIES, VFS_PATH_LOCALES, VFS_PATH_MODULES, VFS_PATH_RESOURCES, VFS_PATH_SYSTEM, VFS_PATH_VIEWS, VFS_PATH_WORKPLACE
 
Constructor Summary
CmsXmlContentEditor(CmsJspActionElement jsp)
          Public constructor.
 
Method Summary
 void actionChangeElementLanguage()
          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 actionDeleteElementLocale()
          Performs the delete locale action.
 void actionDirectEdit()
          Performs a configurable action performed by the editor.
 void actionExit()
          Performs the exit editor action.
 void actionMoveElement()
          Moves an element in the xml content either up or down.
 void actionNew()
          Creates a new XML content item for editing.
 void actionPreview()
          Performs the preview xml content action in a new browser window.
 void actionSave()
          Performs the save content action.
 void actionSave(java.util.Locale locale)
          Performs the save content action.
 void actionToggleElement()
          Adds an optional element to the xml content or removes an optional element from the xml content.
 java.lang.String buildSelectElementLanguage(java.lang.String attributes)
          Builds the html String for the element language selector.
protected  void commitTempFile()
          Writes the content of a temporary file back to the original file.
 int getButtonStyle()
          Returns the style setting to use when generating buttons for this widget dialog.
 java.lang.String getEditorResourceUri()
          Returns the URI to the editor resource folder where button images and javascripts are located.
 java.util.Locale getElementLocale()
          Returns the current element locale.
 java.util.Set getHelpMessageIds()
          Returns a set of help messages ids that are already included on the widget dialog.
 java.lang.String getParamElementIndex()
          Returns the index of the element to add or remove.
 java.lang.String getParamElementName()
          Returns the name of the element to add or remove.
 java.lang.String getParamModelFile()
          Returns the parameter that specifies the model file name.
 java.lang.String getParamNewLink()
          Returns the "new link" parameter.
 java.lang.String getUserAgent()
          Returns the "user-agent" of the current request, or null in case no request is available.
 CmsXmlContentWidgetVisitor getWidgetCollector()
          Returns the different xml editor widgets used in the form to display.
 java.lang.String getXmlEditorForm()
          Generates the HTML form for the XML content editor.
 java.lang.String getXmlEditorHtmlEnd()
          Generates the HTML for the end of the html editor form page.
 java.lang.String getXmlEditorIncludes()
          Generates the javascript includes for the used widgets in the editor form.
 java.lang.String getXmlEditorInitCalls()
          Generates the javascript initialization calls for the used widgets in the editor form.
 java.lang.String getXmlEditorInitMethods()
          Generates the JavaScript initialization methods for the used widgets.
 boolean hasValidationErrors()
          Returns true if the edited content contains validation errors, otherwise false.
protected  void initContent()
          Initializes the editor content when opening the editor for the first time.
protected  void initElementLanguage()
          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 isPreviewEnabled()
          Returns true if the preview is available for the edited xml content.
 void setEditorValues(java.util.Locale locale)
          Sets the editor values for the locale with the parameters from the request.
 void setParamElementIndex(java.lang.String elementIndex)
          Sets the index of the element to add or remove.
 void setParamElementName(java.lang.String elementName)
          Sets the name of the element to add or remove.
 void setParamModelFile(java.lang.String paramMasterFile)
          Sets the parameter that specifies the model file name.
 void setParamNewLink(java.lang.String paramNewLink)
          Sets the "new link" parameter.
 boolean showElementLanguageSelector()
          Determines if the element language selector is shown dependent on the available Locales.
 boolean useNewStyle()
          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, createTempFile, decodeContent, decodeParamValue, deleteLocaleButton, deleteTempFile, encodeContent, getCloneCms, getEditorDisplayOptions, getFileEncoding, getFileEncoding, getOpenCmsContext, getParamBacklink, getParamContent, getParamDirectedit, getParamEditastext, getParamEditormode, getParamElementlanguage, getParamLoaddefault, getParamModified, getParamOldelementlanguage, getParamTempfile, getPicsUri, setFileEncoding, setParamBacklink, setParamContent, setParamDirectedit, setParamEditastext, setParamEditormode, setParamElementlanguage, setParamLoaddefault, setParamModified, setParamOldelementlanguage, setParamTempfile, showErrorPage, showErrorPage
 
Methods inherited from class org.opencms.workplace.editors.CmsEditorBase
initTimeWarp
 
Methods inherited from class org.opencms.workplace.CmsDialog
actionCloseDialog, appendDelimiter, buildAjaxResultContainer, buildAjaxWaitMessage, buildLockAdditionalOptions, buildLockConfirmationMessageJS, buildLockDialog, buildLockDialog, buildLockHeaderBox, checkResourcePermissions, 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, pageHtml, pageHtml, setAction, setOnlineHelpUriCustom, setParamAction, setParamCloseLink, setParamDialogtype, setParamFramename, setParamIsPopup, setParamMessage, setParamOriginalParams, setParamPreActionDone, setParamRedirect, setParamResource, setParamTitle
 
Methods inherited from class org.opencms.workplace.tools.CmsToolDialog
dialogTitle, getAdminTool, getCurrentToolPath, getParamBase, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamBase, 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, checkLock, checkRole, fillParamValues, fillParamValues, getBroadcastMessageString, getCms, getEncoding, getExplorerFileListFullUri, getFrameSource, getJsp, getLocale, getMacroResolver, getMessages, getMultiPartFileItems, getParameterMap, getResourceUri, getResourceUri, getSession, getSettings, getSkinUri, getStyleUri, getStyleUri, getStyleUri, getTemporaryFileName, htmlEnd, initMessages, initSettings, initUserSettings, initWorkplaceMembers, initWorkplaceSettings, isForwarded, isHelpEnabled, isSubElement, isTemporaryFile, isTemporaryFileName, key, key, keyDefault, nullToEmpty, paramsAsHidden, paramsAsHidden, paramsAsParameterMap, paramsAsRequest, paramValues, resolveMacros, sendCmsRedirect, sendForward, setForwarded, shortKey, switchToCurrentProject, switchToTempProject
 
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 Detail

ACTION_CHECK

public static final int ACTION_CHECK
Action for checking content before executing the direct edit action.

See Also:
Constant Field Values

ACTION_CONFIRMCORRECTION

public static final int ACTION_CONFIRMCORRECTION
Action for confirming the XML content structure correction.

See Also:
Constant Field Values

ACTION_CORRECTIONCONFIRMED

public static final int ACTION_CORRECTIONCONFIRMED
Action for correction of the XML content structure confirmed.

See Also:
Constant Field Values

ACTION_ELEMENT_ADD

public static final int ACTION_ELEMENT_ADD
Action for optional element creation.

See Also:
Constant Field Values

ACTION_ELEMENT_MOVE_DOWN

public static final int ACTION_ELEMENT_MOVE_DOWN
Action for element move down operation.

See Also:
Constant Field Values

ACTION_ELEMENT_MOVE_UP

public static final int ACTION_ELEMENT_MOVE_UP
Action for element move up operation.

See Also:
Constant Field Values

ACTION_ELEMENT_REMOVE

public static final int ACTION_ELEMENT_REMOVE
Action for optional element removal.

See Also:
Constant Field Values

ACTION_NEW

public static final int ACTION_NEW
Action for new file creation.

See Also:
Constant Field Values

EDITOR_ACTION_CHECK

public static final java.lang.String EDITOR_ACTION_CHECK
Indicates that the content should be checked before executing the direct edit action.

See Also:
Constant Field Values

EDITOR_ACTION_CONFIRMCORRECTION

public static final java.lang.String EDITOR_ACTION_CONFIRMCORRECTION
Indicates that the correction of the XML content structure should be confirmed.

See Also:
Constant Field Values

EDITOR_ACTION_ELEMENT_ADD

public static final java.lang.String EDITOR_ACTION_ELEMENT_ADD
Indicates an optional element should be created.

See Also:
Constant Field Values

EDITOR_ACTION_ELEMENT_MOVE_DOWN

public static final java.lang.String EDITOR_ACTION_ELEMENT_MOVE_DOWN
Indicates an element should be moved down.

See Also:
Constant Field Values

EDITOR_ACTION_ELEMENT_MOVE_UP

public static final java.lang.String EDITOR_ACTION_ELEMENT_MOVE_UP
Indicates an element should be moved up.

See Also:
Constant Field Values

EDITOR_ACTION_ELEMENT_REMOVE

public static final java.lang.String EDITOR_ACTION_ELEMENT_REMOVE
Indicates an optional element should be removed.

See Also:
Constant Field Values

EDITOR_ACTION_NEW

public static final java.lang.String EDITOR_ACTION_NEW
Indicates a new file should be created.

See Also:
Constant Field Values

EDITOR_CORRECTIONCONFIRMED

public static final java.lang.String EDITOR_CORRECTIONCONFIRMED
Indicates that the correction of the XML content structure was confirmed by the user.

See Also:
Constant Field Values

PARAM_ELEMENTINDEX

public static final java.lang.String PARAM_ELEMENTINDEX
Parameter name for the request parameter "elementindex".

See Also:
Constant Field Values

PARAM_ELEMENTNAME

public static final java.lang.String PARAM_ELEMENTNAME
Parameter name for the request parameter "elementname".

See Also:
Constant Field Values

PARAM_NEWLINK

public static final java.lang.String PARAM_NEWLINK
Parameter name for the request parameter "newlink".

See Also:
Constant Field Values
Constructor Detail

CmsXmlContentEditor

public CmsXmlContentEditor(CmsJspActionElement jsp)
Public constructor.

Parameters:
jsp - an initialized JSP action element
Method Detail

actionChangeElementLanguage

public void actionChangeElementLanguage()
Performs the change element language action of the editor.


actionClear

public void actionClear(boolean forceUnlock)
Deletes the temporary file and unlocks the edited resource when in direct edit mode.

Specified by:
actionClear in class CmsEditor
Parameters:
forceUnlock - if true, the resource will be unlocked anyway

actionDeleteElementLocale

public void actionDeleteElementLocale()
                               throws javax.servlet.jsp.JspException
Performs the delete locale action.

Throws:
javax.servlet.jsp.JspException - if something goes wrong

actionDirectEdit

public void actionDirectEdit()
                      throws java.io.IOException,
                             javax.servlet.jsp.JspException,
                             javax.servlet.ServletException
Performs a configurable action performed by the editor.

The default action is: save resource, clear temporary files and publish the resource directly.

Throws:
java.io.IOException - if a forward fails
javax.servlet.ServletException - of a forward fails
javax.servlet.jsp.JspException - if including a JSP fails

actionExit

public void actionExit()
                throws java.io.IOException,
                       javax.servlet.jsp.JspException,
                       javax.servlet.ServletException
Performs the exit editor action.

Specified by:
actionExit in class CmsEditor
Throws:
javax.servlet.jsp.JspException - if including an element fails
javax.servlet.ServletException - if a forward fails
java.io.IOException - if a forward fails
See Also:
CmsEditor.actionExit()

actionMoveElement

public void actionMoveElement()
                       throws javax.servlet.jsp.JspException
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

public void actionNew()
               throws javax.servlet.jsp.JspException
Creates a new XML content item for editing.

Throws:
javax.servlet.jsp.JspException - in case something goes wrong

actionPreview

public void actionPreview()
                   throws java.io.IOException,
                          javax.servlet.jsp.JspException
Performs the preview xml content action in a new browser window.

Throws:
java.io.IOException - if redirect fails
javax.servlet.jsp.JspException - if inclusion of error page fails

actionSave

public void actionSave()
                throws javax.servlet.jsp.JspException
Performs the save content action.

Specified by:
actionSave in class CmsEditor
Throws:
javax.servlet.jsp.JspException - if including an element fails
See Also:
CmsEditor.actionSave()

actionSave

public void actionSave(java.util.Locale locale)
                throws javax.servlet.jsp.JspException
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

public void actionToggleElement()
                         throws javax.servlet.jsp.JspException
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

buildSelectElementLanguage

public java.lang.String buildSelectElementLanguage(java.lang.String attributes)
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 selectbox

getButtonStyle

public int getButtonStyle()
Description copied from interface: I_CmsWidgetDialog
Returns the style setting to use when generating buttons for this widget dialog.

Specified by:
getButtonStyle in interface I_CmsWidgetDialog
Returns:
the style setting to use when generating buttons for this widget dialog
See Also:
I_CmsWidgetDialog.getButtonStyle()

getEditorResourceUri

public java.lang.String 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 class CmsEditor
Returns:
the URI to the editor resource folder
See Also:
CmsEditor.getEditorResourceUri()

getElementLocale

public java.util.Locale getElementLocale()
Returns the current element locale.

Returns:
the current element locale

getHelpMessageIds

public java.util.Set 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 interface I_CmsWidgetDialog
Returns:
a set of help messages ids that are already included on the widget dialog
See Also:
I_CmsWidgetDialog.getHelpMessageIds()

getParamElementIndex

public java.lang.String getParamElementIndex()
Returns the index of the element to add or remove.

Returns:
the index of the element to add or remove

getParamElementName

public java.lang.String getParamElementName()
Returns the name of the element to add or remove.

Returns:
the name of the element to add or remove

getParamModelFile

public java.lang.String getParamModelFile()
Returns the parameter that specifies the model file name.

Returns:
the parameter that specifies the model file name

getParamNewLink

public java.lang.String getParamNewLink()
Returns the "new link" parameter.

Returns:
the "new link" parameter

getUserAgent

public java.lang.String getUserAgent()
Description copied from interface: I_CmsWidgetDialog
Returns the "user-agent" of the current request, or null in case no request is available.

Specified by:
getUserAgent in interface I_CmsWidgetDialog
Returns:
the "user-agent" of the current request
See Also:
I_CmsWidgetDialog.getUserAgent()

getWidgetCollector

public CmsXmlContentWidgetVisitor 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

public java.lang.String getXmlEditorForm()
Generates the HTML form for the XML content editor.

Returns:
the HTML that generates the form for the XML editor

getXmlEditorHtmlEnd

public java.lang.String getXmlEditorHtmlEnd()
                                     throws javax.servlet.jsp.JspException
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

public java.lang.String getXmlEditorIncludes()
                                      throws javax.servlet.jsp.JspException
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

public java.lang.String getXmlEditorInitCalls()
                                       throws javax.servlet.jsp.JspException
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

public java.lang.String getXmlEditorInitMethods()
                                         throws javax.servlet.jsp.JspException
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

public boolean hasValidationErrors()
Returns true if the edited content contains validation errors, otherwise false.

Returns:
true if the edited content contains validation errors, otherwise false

isPreviewEnabled

public boolean 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

public void setEditorValues(java.util.Locale locale)
                     throws CmsXmlException
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

setParamElementIndex

public void setParamElementIndex(java.lang.String elementIndex)
Sets the index of the element to add or remove.

Parameters:
elementIndex - the index of the element to add or remove

setParamElementName

public void setParamElementName(java.lang.String elementName)
Sets the name of the element to add or remove.

Parameters:
elementName - the name of the element to add or remove

setParamModelFile

public void setParamModelFile(java.lang.String paramMasterFile)
Sets the parameter that specifies the model file name.

Parameters:
paramMasterFile - the parameter that specifies the model file name

setParamNewLink

public void setParamNewLink(java.lang.String paramNewLink)
Sets the "new link" parameter.

Parameters:
paramNewLink - the "new link" parameter to set

showElementLanguageSelector

public boolean 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

public boolean useNewStyle()
Description copied from interface: I_CmsWidgetDialog
Tests if we are working with the new administration dialog style.

This param is not intended for external use.

Specified by:
useNewStyle in interface I_CmsWidgetDialog
Overrides:
useNewStyle in class CmsToolDialog
Returns:
true if using the new style
See Also:
CmsToolDialog.useNewStyle()

commitTempFile

protected void commitTempFile()
                       throws CmsException
Description copied from class: CmsEditor
Writes the content of a temporary file back to the original file.

Overrides:
commitTempFile in class CmsEditor
Throws:
CmsException - if something goes wrong
See Also:
CmsEditor.commitTempFile()

initContent

protected void initContent()
Initializes the editor content when opening the editor for the first time.

Not necessary for the xmlcontent editor.

Specified by:
initContent in class CmsEditor

initElementLanguage

protected void 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 class CmsDialog
See Also:
CmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)