|
||||||||||
| 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
public class CmsDialog
Provides methods for building the dialog windows of OpenCms.
| Field Summary | |
|---|---|
static int |
ACTION_CANCEL
Value for the action: cancel. |
static int |
ACTION_CLOSEPOPUP
Value for the action: close popup window. |
static int |
ACTION_CLOSEPOPUP_SAVE
Value for the action: save & close popup window. |
static int |
ACTION_CONFIRMED
Value for the action: confirmed. |
static int |
ACTION_DEFAULT
Value for the action: default (show initial dialog form). |
static int |
ACTION_OK
Value for the action: ok. |
static int |
ACTION_REPORT_BEGIN
Value for the action: begin the report. |
static int |
ACTION_REPORT_END
Value for the action: end the report. |
static int |
ACTION_REPORT_UPDATE
Value for the action: update the report. |
static int |
ACTION_SET
Value for the action: button "set" clicked. |
static int |
ACTION_WAIT
Value for the action: wait (show please wait screen). |
protected static String |
ATTRIBUTE_THROWABLE
Key name for the throwable attribute. |
static int |
BUTTON_ADVANCED
Constant for the "Advanced" button in the build button methods. |
static int |
BUTTON_BACK
Constant for the "Back" button in the build button methods. |
static int |
BUTTON_CANCEL
Constant for the "Cancel" button in the build button methods. |
static int |
BUTTON_CLOSE
Constant for the "Close" button in the build button methods. |
static int |
BUTTON_CONTINUE
Constant for the "Continue" button in the build button methods. |
static int |
BUTTON_DETAILS
Constant for the "Details" button in the build button methods. |
static int |
BUTTON_DISCARD
Constant for the "Discard" button in the build button methods (same function as "Cancel" button but different text on button. |
static int |
BUTTON_EDIT
Constant for the "Edit" button in the build button methods (same function as "Ok" button but different text on button. |
static int |
BUTTON_OK
Constant for the "OK" button in the build button methods. |
static int |
BUTTON_OK_NO_SUBMIT
Constant for the "OK" button in the build button methods (without form submission). |
static int |
BUTTON_SET
Constant for the "Set" button in the build button methods. |
static String |
DIALOG_BACK
Request parameter value for the action: back. |
static String |
DIALOG_CANCEL
Request parameter value for the action: cancel. |
static String |
DIALOG_CONFIRMED
Request parameter value for the action: dialog confirmed. |
static String |
DIALOG_CONTINUE
Request parameter value for the action: continue. |
static String |
DIALOG_INITIAL
Request parameter value for the action: initial call. |
static String |
DIALOG_OK
Request parameter value for the action: ok. |
static String |
DIALOG_SET
Request parameter value for the action: set. |
static String |
DIALOG_WAIT
Request parameter value for the action: show please wait screen. |
static String |
PARAM_ACTION
Request parameter name for the action. |
static String |
PARAM_CLOSELINK
Request parameter name for the closelink. |
static String |
PARAM_DIALOGTYPE
Request parameter name for the dialog type. |
static String |
PARAM_ERRORSTACK
Request parameter name for the error stack. |
static String |
PARAM_FILE
Request parameter name for the file. |
static String |
PARAM_FRAMENAME
Request parameter name for the frame name. |
static String |
PARAM_ISPOPUP
Request parameter name for the "is popup" flag. |
static String |
PARAM_LOCK
Request parameter name for the lock. |
static String |
PARAM_MESSAGE
Request parameter name for the error message. |
static String |
PARAM_REDIRECT
Request parameter name for the redirect flag. |
static String |
PARAM_RESOURCE
Request parameter name for the resource. |
static String |
PARAM_TARGET
Request parameter name for the target. |
static String |
PARAM_THREAD
Request parameter name for the thread id. |
static String |
PARAM_THREAD_HASNEXT
Request parameter name for indicating if another thread is following the current one. |
static String |
PARAM_TITLE
Request parameter name for the dialog title. |
static String |
REPORT_BEGIN
Request parameter value for the action: begin the report. |
static String |
REPORT_END
Request parameter value for the action: end the report. |
static String |
REPORT_UPDATE
Request parameter value for the action: update the report. |
| Fields inherited from class org.opencms.workplace.tools.CmsToolDialog |
|---|
PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW |
| Constructor Summary | |
|---|---|
CmsDialog(CmsJspActionElement jsp)
Public constructor with JSP action element. |
|
CmsDialog(PageContext context,
HttpServletRequest req,
HttpServletResponse res)
Public constructor with JSP variables. |
|
| Method Summary | |
|---|---|
void |
actionCloseDialog()
Used to close the current JSP dialog. |
protected String |
appendDelimiter(String attribute)
Appends a space char. |
protected boolean |
checkResourcePermissions(CmsPermissionSet required,
boolean neededForFolder)
Checks if the permissions of the current user on the resource to use in the dialog are sufficient. |
protected boolean |
checkResourcePermissions(CmsPermissionSet required,
boolean neededForFolder,
CmsMessageContainer errorMessage)
Checks if the permissions of the current user on the resource to use in the dialog are sufficient. |
String |
dialog(int segment,
String attributes)
Builds the outer dialog window border. |
String |
dialogBlock(int segment,
String headline,
boolean error)
Builds a block with 3D border and optional subheadline in the dialog content area. |
String |
dialogBlockEnd()
Builds the end HTML for a block with 3D border in the dialog content area. |
String |
dialogBlockStart(String headline)
Builds the start HTML for a block with 3D border and optional subheadline in the dialog content area. |
String |
dialogButtonRow(int segment)
Builds the button row under the dialog content area without the buttons. |
String |
dialogButtonRowEnd()
Builds the end of the button row under the dialog content area without the buttons. |
String |
dialogButtonRowStart()
Builds the start of the button row under the dialog content area without the buttons. |
String |
dialogButtons(int[] buttons,
String[] attributes)
Builds the html for the button row under the dialog content area, including buttons. |
String |
dialogButtonsClose()
Builds a button row with a single "close" button. |
String |
dialogButtonsClose(String closeAttribute)
Builds a button row with a single "close" button. |
String |
dialogButtonsCloseDetails(String closeAttribute,
String detailsAttribute)
Builds a button row with a "close" and a "details" button. |
protected void |
dialogButtonsHtml(StringBuffer result,
int button,
String attribute)
Renders the HTML for a single input button of a specified type. |
String |
dialogButtonsOk()
Builds a button row with a single "ok" button. |
String |
dialogButtonsOk(String okAttribute)
Builds a button row with a single "ok" button. |
String |
dialogButtonsOkCancel()
Builds a button row with an "ok" and a "cancel" button. |
String |
dialogButtonsOkCancel(String okAttributes,
String cancelAttributes)
Builds a button row with an "ok" and a "cancel" button. |
String |
dialogButtonsOkCancelAdvanced(String okAttributes,
String cancelAttributes,
String advancedAttributes)
Builds a button row with an "ok", a "cancel" and an "advanced" button. |
String |
dialogButtonsSetOkCancel(String setAttributes,
String okAttributes,
String cancelAttributes)
Builds a button row with a "set", an "ok", and a "cancel" button. |
String |
dialogContent(int segment,
String title)
Builds the content area of the dialog window. |
String |
dialogContentEnd()
Returns the end html for the content area of the dialog window. |
String |
dialogContentStart(String title)
Returns the start html for the content area of the dialog window. |
String |
dialogEnd()
Returns the end html for the outer dialog window border. |
String |
dialogHead(String title)
Builds the title of the dialog window. |
String |
dialogHorizontalSpacer(int width)
Builds an invisible horiziontal spacer with the specified width. |
String |
dialogRow(int segment)
Builds a dialog line without break (display: block). |
String |
dialogRowEnd()
Builds the end of a dialog line without break (display: block). |
String |
dialogRowStart()
Builds the start of a dialog line without break (display: block). |
String |
dialogScriptSubmit()
Builds the standard javascript for submitting the dialog. |
String |
dialogSeparator()
Builds a horizontal separator line in the dialog content area. |
String |
dialogSpacer()
Builds a space between two elements in the dialog content area. |
String |
dialogStart()
Returns the start html for the outer dialog window border. |
String |
dialogStart(String attributes)
Returns the start html for the outer dialog window border. |
String |
dialogSubheadline(String headline)
Builds a subheadline in the dialog content area. |
String |
dialogToggleStart(String headline,
String id,
boolean show)
Builds the HTML code to fold and unfild a white-box. |
String |
dialogWhiteBox(int segment)
Builds a white box in the dialog content area. |
String |
dialogWhiteBoxEnd()
Builds the end of a white box in the dialog content area. |
String |
dialogWhiteBoxStart()
Builds the start of a white box in the dialog content area. |
int |
getAction()
Returns the action value. |
protected String |
getAdministrationBackLink()
Returns the link URL to get back one folder in the administration view. |
String |
getCancelAction()
Returns the action to be carried out after a click on the cancel button.. |
String |
getDialogRealUri()
Returns the http URI of the current dialog, to be used as value for the "action" attribute of a html form. |
String |
getDialogUri()
Returns the http URI of the current dialog, to be used as value for the "action" attribute of a html form. |
String |
getOnlineHelpUriCustom()
Returns the custom mapping for the online help. |
String |
getParamAction()
Returns the value of the action parameter, or null if this parameter was not provided. |
String |
getParamCloseLink()
Returns the value of the closelink parameter, or null if this parameter was not provided. |
String |
getParamDialogtype()
Returns the value of the dialogtype parameter, or null if this parameter was not provided. |
String |
getParamFramename()
Returns the value of the frame name parameter. |
String |
getParamIsPopup()
Returns the ispopup parameter. |
String |
getParamMessage()
Returns the value of the message parameter, or null if this parameter was not provided. |
String |
getParamRedirect()
Returns the value of the redirect flag parameter. |
String |
getParamResource()
Returns the value of the file parameter, or null if this parameter was not provided. |
String |
getParamTitle()
Returns the value of the title parameter, or null if this parameter was not provided. |
String |
getState()
Gets a formatted file state string. |
String |
htmlStart()
Builds the start html of the page, including setting of DOCTYPE and inserting a header with the content-type. |
String |
htmlStart(String helpUrl)
Builds the start html of the page, including setting of DOCTYPE and inserting a header with the content-type. |
String |
htmlStart(String helpUrl,
String title)
Builds the start html of the page, including setting of DOCTYPE and inserting a header with the content-type. |
String |
htmlStartStyle(String title,
String stylesheet)
Builds the start html of the page, including setting of DOCTYPE, inserting a header with the content-type and choosing an individual style sheet. |
void |
includeErrorpage(CmsWorkplace wp,
Throwable t)
Displays the throwable on the error page and logs the error. |
static CmsDialog |
initCmsDialog(PageContext context,
HttpServletRequest req,
HttpServletResponse res)
Returns an initialized CmsDialog instance that is read from the request attributes. |
protected void |
initWorkplaceRequestValues(CmsWorkplaceSettings settings,
HttpServletRequest request)
Analyzes the request for workplace parameters and adjusts the workplace settings accordingly. |
boolean |
isPopup()
Returns the "isPopup" flag. |
String |
pageHtml(int segment,
String helpUrl)
Builds the start html of the page, including setting of DOCTYPE and inserting a header with the content-type. |
String |
pageHtml(int segment,
String helpUrl,
String title)
Builds the start html of the page, including setting of DOCTYPE and inserting a header with the content-type. |
protected void |
setAction(int value)
Sets the action value. |
void |
setOnlineHelpUriCustom(String uri)
Set the custom mapping for the online help. |
void |
setParamAction(String value)
Sets the value of the action parameter. |
void |
setParamCloseLink(String value)
Sets the value of the closelink parameter. |
void |
setParamDialogtype(String value)
Sets the value of the dialogtype parameter. |
void |
setParamFramename(String value)
Sets the value of the frame name parameter. |
void |
setParamIsPopup(String value)
Sets the ispopup parameter. |
void |
setParamMessage(String value)
Sets the value of the message parameter. |
void |
setParamRedirect(String redirect)
Sets the value of the redirect flag parameter. |
void |
setParamResource(String value)
Sets the value of the file parameter. |
void |
setParamTitle(String value)
Sets the value of the title parameter. |
| 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, useNewStyle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ACTION_CANCEL
public static final int ACTION_CLOSEPOPUP
public static final int ACTION_CLOSEPOPUP_SAVE
public static final int ACTION_CONFIRMED
public static final int ACTION_DEFAULT
public static final int ACTION_OK
public static final int ACTION_REPORT_BEGIN
public static final int ACTION_REPORT_END
public static final int ACTION_REPORT_UPDATE
public static final int ACTION_SET
public static final int ACTION_WAIT
public static final int BUTTON_ADVANCED
public static final int BUTTON_BACK
public static final int BUTTON_CANCEL
public static final int BUTTON_CLOSE
public static final int BUTTON_CONTINUE
public static final int BUTTON_DETAILS
public static final int BUTTON_DISCARD
public static final int BUTTON_EDIT
public static final int BUTTON_OK
public static final int BUTTON_OK_NO_SUBMIT
public static final int BUTTON_SET
public static final String DIALOG_BACK
public static final String DIALOG_CANCEL
public static final String DIALOG_CONFIRMED
public static final String DIALOG_CONTINUE
public static final String DIALOG_INITIAL
public static final String DIALOG_OK
public static final String DIALOG_SET
public static final String DIALOG_WAIT
public static final String PARAM_ACTION
public static final String PARAM_CLOSELINK
public static final String PARAM_DIALOGTYPE
public static final String PARAM_ERRORSTACK
public static final String PARAM_FILE
public static final String PARAM_FRAMENAME
public static final String PARAM_ISPOPUP
public static final String PARAM_LOCK
public static final String PARAM_MESSAGE
public static final String PARAM_REDIRECT
public static final String PARAM_RESOURCE
public static final String PARAM_TARGET
public static final String PARAM_THREAD
public static final String PARAM_THREAD_HASNEXT
public static final String PARAM_TITLE
public static final String REPORT_BEGIN
public static final String REPORT_END
public static final String REPORT_UPDATE
protected static final String ATTRIBUTE_THROWABLE
| Constructor Detail |
|---|
public CmsDialog(CmsJspActionElement jsp)
jsp - an initialized JSP action element
public CmsDialog(PageContext context,
HttpServletRequest req,
HttpServletResponse res)
context - the JSP page contextreq - the JSP requestres - the JSP response| Method Detail |
|---|
public static CmsDialog initCmsDialog(PageContext context,
HttpServletRequest req,
HttpServletResponse res)
This method is used by dialog elements. The dialog elements do not initialize their own workplace class, but use the initialized instance of the "master" class. This is required to ensure that parameters of the "master" class can properly be kept on the dialog elements.
To prevent null pointer exceptions, an empty dialog is returned if nothing is found in the request attributes.
context - the JSP page contextreq - the JSP requestres - the JSP response
public void actionCloseDialog()
throws JspException
This method tries to include the URI stored in the workplace settings. This URI is determined by the frame name, which has to be set in the framename parameter.
JspException - if including an element fails
public String dialog(int segment,
String attributes)
segment - the HTML segment (START / END)attributes - optional additional attributes for the opening dialog table
public String dialogBlock(int segment,
String headline,
boolean error)
segment - the HTML segment (START / END)headline - the headline String for the blockerror - if true, an error block will be created
public String dialogBlockEnd()
public String dialogBlockStart(String headline)
headline - the headline String for the block
public String dialogButtonRow(int segment)
segment - the HTML segment (START / END)
public String dialogButtonRowEnd()
public String dialogButtonRowStart()
public String dialogButtons(int[] buttons,
String[] attributes)
buttons - array of constants of which buttons to include in the rowattributes - array of Strings for additional button attributes
public String dialogButtonsClose()
public String dialogButtonsClose(String closeAttribute)
closeAttribute - additional attributes for the "close" button
public String dialogButtonsCloseDetails(String closeAttribute,
String detailsAttribute)
closeAttribute - additional attributes for the "close" buttondetailsAttribute - additional attributes for the "details" button
public String dialogButtonsOk()
public String dialogButtonsOk(String okAttribute)
okAttribute - additional attributes for the "ok" button
public String dialogButtonsOkCancel()
public String dialogButtonsOkCancel(String okAttributes,
String cancelAttributes)
okAttributes - additional attributes for the "ok" buttoncancelAttributes - additional attributes for the "cancel" button
public String dialogButtonsOkCancelAdvanced(String okAttributes,
String cancelAttributes,
String advancedAttributes)
okAttributes - additional attributes for the "ok" buttoncancelAttributes - additional attributes for the "cancel" buttonadvancedAttributes - additional attributes for the "advanced" button
public String dialogButtonsSetOkCancel(String setAttributes,
String okAttributes,
String cancelAttributes)
setAttributes - additional attributes for the "set" buttonokAttributes - additional attributes for the "ok" buttoncancelAttributes - additional attributes for the "cancel" button
public String dialogContent(int segment,
String title)
segment - the HTML segment (START / END)title - the title String for the dialog window
public String dialogContentEnd()
public String dialogContentStart(String title)
title - the title for the dialog
public String dialogEnd()
public String dialogHead(String title)
title - the title String for the dialog window
public String dialogHorizontalSpacer(int width)
width - the width of the spacer in pixels
public String dialogRow(int segment)
segment - the HTML segment (START / END)
public String dialogRowEnd()
public String dialogRowStart()
public String dialogScriptSubmit()
dialogScriptSubmit in class CmsToolDialogpublic String dialogSeparator()
public String dialogSpacer()
public String dialogStart()
public String dialogStart(String attributes)
attributes - optional html attributes to insert
public String dialogSubheadline(String headline)
headline - the desired headline string
public String dialogToggleStart(String headline,
String id,
boolean show)
headline - the heading to displayid - the id of the toggleshow - true if the white box is open at the beginning
public String dialogWhiteBox(int segment)
segment - the HTML segment (START / END)
public String dialogWhiteBoxEnd()
public String dialogWhiteBoxStart()
public int getAction()
The action value is used on JSP pages to select the proper action in a large "switch" statement.
public String getCancelAction()
public String getDialogRealUri()
This URI is the real one.
public String getDialogUri()
This URI could not be really the real one...
public String getOnlineHelpUriCustom()
public String getParamAction()
The action parameter is very important,
it will select the dialog action to perform.
The value of the getAction() method will be
initialized from the action parameter.
public String getParamCloseLink()
public String getParamDialogtype()
This parameter is very important. It must match to the localization keys, e.g. "copy" for the copy dialog.
This parameter must be set manually by the subclass during first initialization.
public String getParamFramename()
public String getParamIsPopup()
Use this parameter to indicate that the dialog is shown in a popup window.
public String getParamMessage()
The message parameter is used on dialogs to show any text message.
public String getParamRedirect()
public String getParamResource()
The file parameter selects the file on which the dialog action is to be performed.
public String getParamTitle()
This parameter is used to build the title of the dialog. It is a parameter so that the title can be passed to included elements.
public String getState()
throws CmsException
CmsException - if something goes wrongpublic String htmlStart()
public String htmlStart(String helpUrl)
This overloads the default method of the parent class.
htmlStart in class CmsWorkplacehelpUrl - the key for the online help to include on the page
public String htmlStart(String helpUrl,
String title)
helpUrl - the key for the online help to include on the pagetitle - the title for the page
public String htmlStartStyle(String title,
String stylesheet)
title - the title for the pagestylesheet - the style sheet to include
public void includeErrorpage(CmsWorkplace wp,
Throwable t)
throws JspException
wp - the workplace classt - the throwable to be displayed on the errorpage
JspException - if the include of the errorpage jsp failspublic boolean isPopup()
public String pageHtml(int segment,
String helpUrl)
This overloads the default method of the parent class.
pageHtml in class CmsWorkplacesegment - the HTML segment (START / END)helpUrl - the url for the online help to include on the page
public String pageHtml(int segment,
String helpUrl,
String title)
This overloads the default method of the parent class.
segment - the HTML segment (START / END)helpUrl - the url for the online help to include on the pagetitle - the title for the page
public void setOnlineHelpUriCustom(String uri)
This value will be set to a javascript variable called onlineHelpUriCustom. If it is set, the top.head javascript for the online help will use this value.
This method should be called from ,
initWorkplaceRequestValues(CmsWorkplaceSettings, HttpServletRequest)
or from the jsp if the dialog class is used for several actions.
It should be used whenever the online help mapping does not work (due to jsp - forwards).CmsWorkplace.initWorkplaceMembers(CmsJspActionElement)
uri - the left hand value in mapping.properties for the online help pagespublic void setParamAction(String value)
value - the value to setpublic void setParamCloseLink(String value)
value - the value to setpublic void setParamDialogtype(String value)
value - the value to setpublic void setParamFramename(String value)
value - the value to setpublic void setParamIsPopup(String value)
value - the ispopup parameter valuepublic void setParamMessage(String value)
value - the value to setpublic void setParamRedirect(String redirect)
redirect - the value of the redirect flag parameterpublic void setParamResource(String value)
value - the value to setpublic void setParamTitle(String value)
value - the value to setprotected String appendDelimiter(String attribute)
attribute - a tag attribute
protected boolean checkResourcePermissions(CmsPermissionSet required,
boolean neededForFolder)
Automatically generates a CmsMessageContainer object with an error message and stores it in the users session.
required - the required permissions for the dialogneededForFolder - if true, the permissions are required for the parent folder of the resource (e.g. for editors)
protected boolean checkResourcePermissions(CmsPermissionSet required,
boolean neededForFolder,
CmsMessageContainer errorMessage)
Automatically generates a CmsMessageContainer object with an error message and stores it in the users session.
required - the required permissions for the dialogneededForFolder - if true, the permissions are required for the parent folder of the resource (e.g. for editors)errorMessage - the message container that is stored in the session in case the permissions are not sufficient
protected void dialogButtonsHtml(StringBuffer result,
int button,
String attribute)
result - a string buffer where the rendered HTML gets appended tobutton - a integer key to identify the buttonattribute - an optional string with possible tag attributes, or nullprotected String getAdministrationBackLink()
protected void initWorkplaceRequestValues(CmsWorkplaceSettings settings,
HttpServletRequest request)
CmsWorkplace
initWorkplaceRequestValues in class CmsToolDialogsettings - the workplace settingsrequest - the current requestCmsWorkplace.initWorkplaceRequestValues(org.opencms.workplace.CmsWorkplaceSettings, javax.servlet.http.HttpServletRequest)protected void setAction(int value)
value - the action value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||