|
||||||||||
| 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
public class 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_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 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_MOVE_DOWN
Indicates an element should be moved down. |
static String |
EDITOR_ACTION_ELEMENT_MOVE_UP
Indicates an element should be moved up. |
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.editors.CmsEditor |
|---|
ACTION_CHANGE_BODY, ACTION_EXIT, ACTION_PREVIEW, ACTION_SAVE, ACTION_SAVEACTION, ACTION_SAVEEXIT, ACTION_SHOW, ACTION_SHOW_ERRORMESSAGE, EDITOR_CHANGE_ELEMENT, EDITOR_CLEANUP, EDITOR_EXIT, EDITOR_PREVIEW, EDITOR_SAVE, EDITOR_SAVEACTION, EDITOR_SAVEEXIT, EDITOR_SHOW, EDITOR_SHOW_ERRORMESSAGE, 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.tools.CmsToolDialog |
|---|
PARAM_BASE, PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW |
| 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 |
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(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 |
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. |
Set |
getHelpMessageIds()
Returns a set of help messages ids that are already included on the widget dialog. |
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 |
getUserAgent()
Returns the "user-agent" of the current request, or null in case no
request is available. |
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, getParamBase, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamBase, 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, buttonBar, buttonBarHorizontalLine, buttonBarSeparator, buttonBarSpacer, buttonBarStartTab, 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_MOVE_DOWN
public static final int ACTION_ELEMENT_MOVE_UP
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_MOVE_DOWN
public static final String EDITOR_ACTION_ELEMENT_MOVE_UP
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,
ServletException
The default action is: save resource, clear temporary files and publish the resource directly.
IOException - if a forward fails
ServletException - of a forward fails
JspException - if including a JSP fails
public void actionExit()
throws IOException,
JspException,
ServletException
actionExit in class CmsEditorIOException - if a forward fails
JspException - if including an element fails
ServletException - if a forward failsCmsEditor.actionExit()
public void actionMoveElement()
throws JspException
Depends on the given action value.
JspException - if including the error page fails
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 failspublic 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 Set getHelpMessageIds()
I_CmsWidgetDialog
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.
getHelpMessageIds in interface I_CmsWidgetDialogI_CmsWidgetDialog.getHelpMessageIds()public String getParamElementIndex()
public String getParamElementName()
public String getParamNewLink()
public String getUserAgent()
I_CmsWidgetDialognull in case no
request is available.
getUserAgent in interface I_CmsWidgetDialogI_CmsWidgetDialog.getUserAgent()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()
CmsToolDialogThe default is the new style, this param is not intented 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 CmsDialogsettings - the workplace settingsrequest - the current requestCmsWorkplace.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 | |||||||||