|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.opencms.workplace.CmsWorkplace
org.opencms.workplace.tools.CmsToolDialog
org.opencms.workplace.CmsDialog
org.opencms.workplace.editors.CmsEditor
org.opencms.workplace.editors.CmsXmlContentEditor
Creates the editor for XML content definitions.
| Field Summary | |
static int |
ACTION_CHECK
Action for checking content before executing the direct edit action. |
static int |
ACTION_ELEMENT_ADD
Action for optional element creation. |
static int |
ACTION_ELEMENT_REMOVE
Action for optional element removal. |
static int |
ACTION_NEW
Action for new file creation. |
static String |
EDITOR_ACTION_CHECK
Indicates that the content should be checked before executing the direct edit action. |
static String |
EDITOR_ACTION_ELEMENT_ADD
Indicates an optional element should be created. |
static String |
EDITOR_ACTION_ELEMENT_REMOVE
Indicates an optional element should be removed. |
static String |
EDITOR_ACTION_NEW
Indicates a new file should be created. |
static String |
PARAM_ELEMENTINDEX
Parameter name for the request parameter "elementindex". |
static String |
PARAM_ELEMENTNAME
Parameter name for the request parameter "elementname". |
| Fields inherited from class org.opencms.workplace.tools.CmsToolDialog |
PARAM_PATH, PARAM_ROOT, PARAM_STYLE |
| 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 |
actionDirectEdit()
Performs a configurable action performed by the editor. |
void |
actionExit()
Performs the exit editor action. |
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(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. |
String |
buildAddElement(String elementName,
int insertAfter,
boolean enabled)
Returns the html for a button to add an optional element. |
String |
buildRemoveElement(String elementName,
int index,
boolean enabled)
Returns the html for a button to remove an optional element. |
String |
buildSelectElementLanguage(String attributes)
Builds the html String for the element language selector. |
int |
getButtonStyle()
Returns the style setting to use when generating buttons for this widget dialog. |
String |
getEditorResourceUri()
Returns the URI to the editor resource folder where button images and javascripts are located. |
Locale |
getElementLocale()
Returns the current element locale. |
String |
getParamElementIndex()
Returns the index of the element to add or remove. |
String |
getParamElementName()
Returns the name of the element to add or remove. |
String |
getParamNewLink()
Returns the "new link" parameter. |
String |
getXmlEditorForm()
Generates the HTML form for the XML content editor. |
String |
getXmlEditorHtmlEnd()
Generates the HTML for the end of the html editor form page. |
String |
getXmlEditorIncludes()
Generates the javascript includes for the used widgets in the editor form. |
String |
getXmlEditorInitCalls()
Generates the javascript initialization calls for the used widgets in the editor form. |
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,
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(Locale locale)
Sets the editor values for the locale with the parameters from the request. |
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 |
setParamNewLink(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.tools.CmsToolDialog |
dialogTitle, getAdminTool, getCurrentToolPath, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamPath, setParamRoot, setParamStyle |
| 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, buttonBarSpacer, calendarIncludes, calendarInit, dialogHorizontalSpacer, getCalendarDate, getCalendarLocalizedTime, getLocale, getMessages |
| Field Detail |
public static final int ACTION_CHECK
public static final int ACTION_ELEMENT_ADD
public static final int ACTION_ELEMENT_REMOVE
public static final int ACTION_NEW
public static final String EDITOR_ACTION_CHECK
public static final String EDITOR_ACTION_ELEMENT_ADD
public static final String EDITOR_ACTION_ELEMENT_REMOVE
public static final String EDITOR_ACTION_NEW
public static final String PARAM_ELEMENTINDEX
public static final String PARAM_ELEMENTNAME
| Constructor Detail |
public CmsXmlContentEditor(CmsJspActionElement jsp)
jsp - an initialized JSP action element| Method Detail |
public void actionChangeElementLanguage()
public void actionClear(boolean forceUnlock)
actionClear in class CmsEditorforceUnlock - if true, the resource will be unlocked anyway
public void actionDirectEdit()
throws IOException,
JspException
The default action is: save resource, clear temporary files and publish the resource directly.
IOException - if a redirection fails
JspException - if including a JSP fails
public void actionExit()
throws IOException,
JspException
actionExit in class CmsEditorJspException - if including an element fails
IOException - if a redirection failsCmsEditor.actionExit()
public void actionNew()
throws JspException
JspException - in case something goes wrong
public void actionPreview()
throws IOException,
JspException
IOException - if redirect fails
JspException - if inclusion of error page fails
public void actionSave()
throws JspException
actionSave in class CmsEditorJspException - if including an element failsCmsEditor.actionSave()
public void actionSave(Locale locale)
throws JspException
This is also used when changing the element language.
locale - the locale to save the content
JspException - if including the error page fails
public void actionToggleElement()
throws JspException
Depends on the given action value.
JspException - if including the error page fails
public String buildAddElement(String elementName,
int insertAfter,
boolean enabled)
elementName - name of the elementinsertAfter - the index of the element after which the new element should be createdenabled - if true, the button to add an element is shown, otherwise a spacer is returned
public String buildRemoveElement(String elementName,
int index,
boolean enabled)
elementName - name of the elementindex - the element index of the element to removeenabled - if true, the button to remove an element is shown, otherwise a spacer is returned
public String buildSelectElementLanguage(String attributes)
This method has to use the resource request parameter because the temporary file is not available in the upper button frame.
attributes - optional attributes for the <select> tag
public int getButtonStyle()
I_CmsWidgetDialog
getButtonStyle in interface I_CmsWidgetDialogI_CmsWidgetDialog.getButtonStyle()public String getEditorResourceUri()
CmsEditor
getEditorResourceUri in class CmsEditorCmsEditor.getEditorResourceUri()public Locale getElementLocale()
public String getParamElementIndex()
public String getParamElementName()
public String getParamNewLink()
public String getXmlEditorForm()
public String getXmlEditorHtmlEnd()
throws JspException
JspException - if including the error page fails
public String getXmlEditorIncludes()
throws JspException
JspException - if including the error page fails
public String getXmlEditorInitCalls()
throws JspException
JspException - if including the error page fails
public String getXmlEditorInitMethods()
throws JspException
JspException - if an error occurs during JavaScript generationpublic boolean hasValidationErrors()
public boolean isPreviewEnabled()
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.
public void setEditorValues(Locale locale)
throws CmsXmlException
Called before saving the xml content, redisplaying the input form, changing the language and adding or removing elements.
locale - the locale of the content to save
CmsXmlException - if something goes wrongpublic void setParamElementIndex(String elementIndex)
elementIndex - the index of the element to add or removepublic void setParamElementName(String elementName)
elementName - the name of the element to add or removepublic void setParamNewLink(String paramNewLink)
paramNewLink - the "new link" parameter to setpublic boolean showElementLanguageSelector()
public boolean useNewStyle()
I_CmsWidgetDialogThis param is not intended for external use.
useNewStyle in interface I_CmsWidgetDialoguseNewStyle in class CmsToolDialogtrue if using the new styleCmsToolDialog.useNewStyle()protected void initContent()
Not necessary for the xmlcontent editor.
initContent in class CmsEditorprotected void initElementLanguage()
protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings,
HttpServletRequest request)
CmsWorkplace
initWorkplaceRequestValues in class CmsDialogCmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||