public abstract class CmsWorkplace
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
static boolean |
DEBUG
The debug flag.
|
static java.lang.String |
DEFAULT_LANGUAGE
Parameter for the default language.
|
static java.util.Locale |
DEFAULT_LOCALE
Parameter for the default locale.
|
static java.lang.String |
DIALOG_PATH_COMMON
Constant for the JSP common files (e.g. error page) path.
|
static java.lang.String |
FILE_DIALOG_CLOSE
Constant for the JSP common close dialog page.
|
static java.lang.String |
FILE_DIALOG_SCREEN_CONFIRM
Constant for the JSP common confirmation dialog.
|
static java.lang.String |
FILE_DIALOG_SCREEN_ERROR
Constant for the JSP common error dialog.
|
static java.lang.String |
FILE_DIALOG_SCREEN_ERRORPAGE
Constant for the JSP common error dialog.
|
static java.lang.String |
FILE_DIALOG_SCREEN_WAIT
Constant for the JSP common wait screen.
|
static java.lang.String |
FILE_EXPLORER_FILELIST
Constant for the JSP explorer filelist file.
|
static java.lang.String |
FILE_REPORT_OUTPUT
Constant for the JSP common report page.
|
static int |
HTML_END
Helper variable to deliver the html end part.
|
static int |
HTML_START
Helper variable to deliver the html start part.
|
static java.lang.String |
PARAM_WP_EXPLORER_RESOURCE
The request parameter for the workplace project selection.
|
static java.lang.String |
PARAM_WP_PROJECT
The request parameter for the workplace project selection.
|
static java.lang.String |
PARAM_WP_SITE
The request parameter for the workplace site selection.
|
static java.lang.String |
PATH_DIALOGS
Constant for the JSP dialogs path.
|
static java.lang.String |
PATH_WORKPLACE
Constant for the JSP workplace path.
|
protected static java.lang.String |
REQUEST_ATTRIBUTE_MULTIPART
Key name for the request attribute to indicate a multipart request was already parsed.
|
protected static java.lang.String |
REQUEST_ATTRIBUTE_RELOADTREE
Key name for the request attribute to reload the folder tree view.
|
static java.lang.String |
RES_PATH_FILETYPES
Path for file type icons relative to the resources folder.
|
static java.lang.String |
RFS_PATH_RESOURCES
Path to exported system image folder.
|
protected static java.lang.String |
SESSION_WORKPLACE_CLASS
Key name for the session workplace class.
|
static java.lang.String |
VFS_DIR_DEFAULTBODIES
Directory name of content default_bodies folder.
|
static java.lang.String |
VFS_DIR_TEMPLATES
Directory name of content templates folder.
|
static java.lang.String |
VFS_PATH_COMMONS
Path to commons.
|
static java.lang.String |
VFS_PATH_EDITORS
Path to the workplace editors.
|
static java.lang.String |
VFS_PATH_GALLERIES
Path to the galleries.
|
static java.lang.String |
VFS_PATH_LOCALES
Path to locales.
|
static java.lang.String |
VFS_PATH_MODULES
Path to modules folder.
|
static java.lang.String |
VFS_PATH_RESOURCES
Path to system image folder.
|
static java.lang.String |
VFS_PATH_SYSTEM
Path to system folder.
|
static java.lang.String |
VFS_PATH_VIEWS
Path to workplace views.
|
static java.lang.String |
VFS_PATH_WORKPLACE
Path to the workplace.
|
static java.lang.String |
VIEW_DIRECT_EDIT
Constant for the direct edit view JSP.
|
static java.lang.String |
VIEW_WORKPLACE
Constant for the direct edit view JSP.
|
构造器和说明 |
---|
CmsWorkplace(CmsJspActionElement jsp)
Public constructor.
|
CmsWorkplace(javax.servlet.jsp.PageContext context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Public constructor with JSP variables.
|
限定符和类型 | 方法和说明 |
---|---|
protected void |
addMessages(CmsMessages messages)
Auxiliary method for initialization of messages.
|
protected void |
addMessages(java.lang.String bundleName)
Auxiliary method for initialization of messages.
|
java.lang.String |
allParamsAsHidden()
Returns all parameters of the current workplace class
as hidden field tags that can be inserted in a form.
|
java.lang.String |
allParamsAsRequest()
Returns all present request parameters as String.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
allParamValues()
Returns the values of all parameter methods of this workplace class instance.
|
java.lang.String |
bodyEnd()
Builds the end html of the body.
|
java.lang.String |
bodyStart(java.lang.String className)
Builds the start html of the body.
|
java.lang.String |
bodyStart(java.lang.String className,
java.lang.String parameters)
Builds the start html of the body.
|
java.lang.String |
buildSelect(java.lang.String parameters,
java.util.List<java.lang.String> options,
java.util.List<java.lang.String> values,
int selected)
Generates a html select box out of the provided values.
|
static java.lang.String |
buildSelect(java.lang.String parameters,
java.util.List<java.lang.String> options,
java.util.List<java.lang.String> values,
int selected,
boolean useLineFeed)
Generates a html select box out of the provided values.
|
java.lang.String |
button(java.lang.String href,
java.lang.String target,
java.lang.String image,
java.lang.String label,
int type)
Generates a button for the OpenCms workplace.
|
java.lang.String |
button(java.lang.String href,
java.lang.String target,
java.lang.String image,
java.lang.String label,
int type,
java.lang.String imagePath)
Generates a button for the OpenCms workplace.
|
java.lang.String |
buttonBar(int segment)
Returns the html for a button bar.
|
java.lang.String |
buttonBar(int segment,
java.lang.String attributes)
Returns the html for a button bar.
|
java.lang.String |
buttonBarHorizontalLine()
Generates a horizontal button bar separator line with maximum width.
|
java.lang.String |
buttonBarLabel(java.lang.String label)
Generates a button bar label.
|
java.lang.String |
buttonBarLabel(java.lang.String label,
java.lang.String className)
Generates a button bar label.
|
java.lang.String |
buttonBarLine(int leftPixel,
int rightPixel,
java.lang.String className)
Generates a variable button bar separator line.
|
java.lang.String |
buttonBarLineSpacer(int pixel)
Generates a variable button bar separator line spacer.
|
java.lang.String |
buttonBarSeparator(int leftPixel,
int rightPixel)
Generates a button bar separator.
|
java.lang.String |
buttonBarSpacer(int width)
Returns the html for an invisible spacer between button bar contents like buttons, labels, etc.
|
java.lang.String |
buttonBarStartTab(int leftPixel,
int rightPixel)
Generates a button bar starter tab.
|
void |
checkLock(java.lang.String resource)
Checks the lock state of the resource and locks it if the autolock feature is enabled.
|
void |
checkLock(java.lang.String resource,
CmsLockType type)
Checks the lock state of the resource and locks it if the autolock feature is enabled.
|
protected void |
checkRole()
Checks that the current user is a workplace user.
|
protected java.lang.String |
decodeParamValue(java.lang.String paramName,
java.lang.String paramValue)
Decodes an individual parameter value.
|
void |
fillParamValues(CmsWorkplaceSettings settings,
javax.servlet.http.HttpServletRequest request)
First sets site and project in the workplace settings, then fills all class parameter values from the data
provided in the current request.
|
void |
fillParamValues(javax.servlet.http.HttpServletRequest request)
Fills all class parameter values from the data provided in the current request.
|
java.lang.String |
getBroadcastMessageString()
Returns the message String for the broadcast message alert of the workplace.
|
CmsObject |
getCms()
Returns the initialized cms object for the current user.
|
java.lang.String |
getEncoding()
Returns the current workplace encoding.
|
java.lang.String |
getExplorerFileListFullUri()
Returns the uri (including context path) to the explorer file list.
|
java.lang.String |
getFrameSource(java.lang.String frameName,
java.lang.String uri)
Returns the html for the frame name and source and stores this information in the workplace settings.
|
CmsJspActionElement |
getJsp()
Returns the JSP action element.
|
java.util.Locale |
getLocale()
Returns the current users workplace locale settings.
|
CmsMacroResolver |
getMacroResolver()
Returns the current used macro resolver instance.
|
CmsMessages |
getMessages()
Returns the current used message object.
|
java.util.List<org.apache.commons.fileupload.FileItem> |
getMultiPartFileItems()
Returns a list of FileItem instances parsed from the request, in the order that they were transmitted.
|
protected java.util.Map<java.lang.String,java.lang.String[]> |
getParameterMap()
Returns the map of parameters read from the current request.
|
java.lang.String |
getResourceUri()
Returns the path to the workplace static resources.
|
static java.lang.String |
getResourceUri(java.lang.String resourceName)
Returns the full Workplace resource path to the selected resource.
|
javax.servlet.http.HttpSession |
getSession()
Returns the current user http session.
|
CmsWorkplaceSettings |
getSettings()
Returns the current users workplace settings.
|
static java.lang.String |
getSkinUri()
Returns the path to the skin resources.
|
static java.lang.String |
getStartSiteRoot(CmsObject cms,
CmsWorkplaceSettings settings)
Returns the start site from the given workplace settings.
|
static java.lang.String |
getStyleUri(CmsJspActionElement jsp)
Returns the path to the cascading stylesheets.
|
static java.lang.String |
getStyleUri(CmsJspActionElement jsp,
java.lang.String filename)
Returns the path to the cascading stylesheets.
|
java.lang.String |
getStyleUri(java.lang.String filename)
Returns the path to the cascading stylesheets.
|
static java.lang.String |
getTemporaryFileName(java.lang.String resourceName)
Returns the temporary file name for the given resource name.
|
java.lang.String |
htmlEnd()
Builds the end html of the page.
|
java.lang.String |
htmlStart(java.lang.String title)
Builds the start html of the page, including setting of DOCTYPE and
inserting a header with the content-type.
|
protected void |
initMessages()
Initializes the message object.
|
boolean |
initSettings(CmsWorkplaceSettings settings,
javax.servlet.http.HttpServletRequest request)
Sets site and project in the workplace settings with the request values of parameters
and . |
protected void |
initTimeWarp(CmsUserSettings settings,
javax.servlet.http.HttpSession session)
Sets the users time warp if configured and if the current timewarp setting is different or
clears the current time warp setting if the user has no configured timewarp.
|
static CmsWorkplaceSettings |
initUserSettings(CmsObject cms,
CmsWorkplaceSettings settings,
boolean update)
Updates the user settings in the given workplace settings for the current user, reading the user settings
from the database if required.
|
protected void |
initWorkplaceMembers(CmsJspActionElement jsp)
Initializes this workplace class instance.
|
protected abstract void |
initWorkplaceRequestValues(CmsWorkplaceSettings settings,
javax.servlet.http.HttpServletRequest request)
Analyzes the request for workplace parameters and adjusts the workplace
settings accordingly.
|
static CmsWorkplaceSettings |
initWorkplaceSettings(CmsObject cms,
CmsWorkplaceSettings settings,
boolean update)
Updates the given workplace settings, also re-initializing
the state of the Workplace to the users preferences (for example setting the startup site and project).
|
boolean |
isForwarded()
Returns the forwarded flag.
|
boolean |
isHelpEnabled()
Returns true if the online help for the users current workplace language is installed.
|
boolean |
isSubElement()
Returns true if the currently processed element is an included sub element.
|
static boolean |
isTemporaryFile(CmsResource resource)
Returns
true if the given resource is a temporary file. |
java.lang.String |
key(java.lang.String keyName)
Returns the localized resource string for a given message key,
checking the workplace default resources and all module bundles.
|
java.lang.String |
key(java.lang.String keyName,
java.lang.Object[] params)
Returns the localized resource string for a given message key,
with the provided replacement parameters.
|
java.lang.String |
keyDefault(java.lang.String keyName,
java.lang.String defaultValue)
Returns the localized resource string for the given message key,
checking the workplace default resources and all module bundles.
|
java.lang.String |
nullToEmpty(java.lang.String value)
Returns the empty String "" if the provided value is null, otherwise just returns
the provided value.
|
java.lang.String |
pageBody(int segment,
java.lang.String className,
java.lang.String parameters)
Builds the html of the body.
|
java.lang.String |
pageHtml(int segment,
java.lang.String title)
Returns the default html for a workplace page, including setting of DOCTYPE and
inserting a header with the content-type.
|
java.lang.String |
pageHtmlStyle(int segment,
java.lang.String title,
java.lang.String stylesheet)
Returns the default html for a workplace page, including setting of DOCTYPE and
inserting a header with the content-type, allowing the selection of an individual style sheet.
|
java.lang.String |
paramsAsHidden()
Returns all initialized parameters of the current workplace class
as hidden field tags that can be inserted in a form.
|
java.lang.String |
paramsAsHidden(java.util.Collection<java.lang.String> excludes)
Returns all initialized parameters of the current workplace class
that are not in the given exclusion list as hidden field tags that can be inserted in a form.
|
java.util.Map<java.lang.String,java.lang.String[]> |
paramsAsParameterMap()
Returns all initialized parameters of the current workplace class in the
form of a parameter map, i.e. the values are arrays.
|
java.lang.String |
paramsAsRequest()
Returns all initialized parameters of the current workplace class
as request parameters, i.e. in the form
key1=value1&key2=value2 etc. |
protected java.util.Map<java.lang.String,java.lang.Object> |
paramValues()
Returns the values of all parameter methods of this workplace class instance.
|
java.lang.String |
resolveMacros(java.lang.String input)
Resolves the macros in the given String and replaces them by their localized keys.
|
void |
sendCmsRedirect(java.lang.String location)
Sends a http redirect to the specified URI in the OpenCms VFS.
|
void |
sendForward(java.lang.String location,
java.util.Map<java.lang.String,java.lang.String[]> params)
Forwards to the specified location in the OpenCms VFS.
|
void |
setForwarded(boolean forwarded)
Sets the forwarded flag.
|
java.lang.String |
shortKey(java.lang.String keyName)
Get a localized short key value for the workplace.
|
protected java.lang.String |
substituteSiteTitle(java.lang.String title)
Replaces the site title, if necessary.
|
protected void |
switchToCurrentProject()
Helper method to change back from the temporary project to the current project.
|
protected CmsUUID |
switchToTempProject()
Helper method to change the current project to the temporary file project.
|
public static final boolean DEBUG
public static final java.util.Locale DEFAULT_LOCALE
public static final java.lang.String DEFAULT_LANGUAGE
public static final int HTML_END
public static final int HTML_START
public static final java.lang.String PARAM_WP_EXPLORER_RESOURCE
public static final java.lang.String PARAM_WP_PROJECT
public static final java.lang.String PARAM_WP_SITE
public static final java.lang.String RES_PATH_FILETYPES
public static final java.lang.String VFS_PATH_SYSTEM
public static final java.lang.String VFS_PATH_WORKPLACE
public static final java.lang.String PATH_DIALOGS
public static final java.lang.String PATH_WORKPLACE
public static final java.lang.String RFS_PATH_RESOURCES
public static final java.lang.String VFS_DIR_DEFAULTBODIES
public static final java.lang.String VFS_DIR_TEMPLATES
public static final java.lang.String VFS_PATH_COMMONS
public static final java.lang.String VFS_PATH_EDITORS
public static final java.lang.String VFS_PATH_GALLERIES
public static final java.lang.String VFS_PATH_LOCALES
public static final java.lang.String VFS_PATH_MODULES
public static final java.lang.String VFS_PATH_RESOURCES
public static final java.lang.String VFS_PATH_VIEWS
public static final java.lang.String FILE_EXPLORER_FILELIST
public static final java.lang.String DIALOG_PATH_COMMON
public static final java.lang.String FILE_DIALOG_CLOSE
public static final java.lang.String FILE_DIALOG_SCREEN_CONFIRM
public static final java.lang.String FILE_DIALOG_SCREEN_ERROR
public static final java.lang.String FILE_DIALOG_SCREEN_ERRORPAGE
public static final java.lang.String FILE_DIALOG_SCREEN_WAIT
public static final java.lang.String FILE_REPORT_OUTPUT
public static final java.lang.String VIEW_DIRECT_EDIT
public static final java.lang.String VIEW_WORKPLACE
protected static final java.lang.String REQUEST_ATTRIBUTE_MULTIPART
protected static final java.lang.String REQUEST_ATTRIBUTE_RELOADTREE
protected static final java.lang.String SESSION_WORKPLACE_CLASS
public CmsWorkplace(CmsJspActionElement jsp)
jsp
- the initialized JSP contextpublic CmsWorkplace(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
context
- the JSP page contextreq
- the JSP requestres
- the JSP responsepublic static java.lang.String buildSelect(java.lang.String parameters, java.util.List<java.lang.String> options, java.util.List<java.lang.String> values, int selected, boolean useLineFeed)
parameters
- a string that will be inserted into the initial select tag,
if null no parameters will be insertedoptions
- the optionsvalues
- the option values, if null the select will have no value attributesselected
- the index of the pre-selected option, if -1 no option is pre-selecteduseLineFeed
- if true, adds some formatting "\n" to the output Stringpublic static java.lang.String getResourceUri(java.lang.String resourceName)
resourceName
- the name of the resource to get the resource path forpublic static java.lang.String getSkinUri()
public static java.lang.String getStyleUri(CmsJspActionElement jsp)
jsp
- the JSP contextpublic static java.lang.String getStyleUri(CmsJspActionElement jsp, java.lang.String filename)
jsp
- the JSP contextfilename
- the name of the stylesheetpublic static java.lang.String getTemporaryFileName(java.lang.String resourceName)
To create a temporary file name of a resource name, the prefix char '~'
(tilde)
is added to the file name after all parent folder names have been removed.
resourceName
- the resource name to return the temporary file name forCmsResource.isTemporaryFileName(String)
,
isTemporaryFile(CmsResource)
public static CmsWorkplaceSettings initUserSettings(CmsObject cms, CmsWorkplaceSettings settings, boolean update)
cms
- the cms object for the current usersettings
- the workplace settings to update (if null
a new instance is created)update
- flag indicating if settings are only updated (user preferences)initWorkplaceSettings(CmsObject, CmsWorkplaceSettings, boolean)
public static CmsWorkplaceSettings initWorkplaceSettings(CmsObject cms, CmsWorkplaceSettings settings, boolean update)
initUserSettings(CmsObject, CmsWorkplaceSettings, boolean)
before updating the workplace project, selected site etc.cms
- the cms object for the current usersettings
- the workplace settings to update (if null
a new instance is created)update
- flag indicating if settings are only updated (user preferences)initUserSettings(CmsObject, CmsWorkplaceSettings, boolean)
public static java.lang.String getStartSiteRoot(CmsObject cms, CmsWorkplaceSettings settings)
cms
- the cms contextsettings
- the workplace settingspublic static boolean isTemporaryFile(CmsResource resource)
true
if the given resource is a temporary file.
A resource is considered a temporary file it is a file where the
CmsResource#FLAG_TEMPFILE
flag has been set, or if the file name (without parent folders)
starts with the prefix char '~'
(tilde).
resource
- the resource name to checktrue
if the given resource name is a temporary filegetTemporaryFileName(String)
,
CmsResource.isTemporaryFileName(String)
public java.lang.String allParamsAsHidden()
public java.lang.String allParamsAsRequest()
The String is formatted as a parameter String (param1=val1¶m2=val2
) with UTF-8 encoded values.
public java.lang.String bodyEnd()
public java.lang.String bodyStart(java.lang.String className)
className
- optional class attribute to add to the body tagpublic java.lang.String bodyStart(java.lang.String className, java.lang.String parameters)
className
- optional class attribute to add to the body tagparameters
- optional parameters to add to the body tagpublic java.lang.String buildSelect(java.lang.String parameters, java.util.List<java.lang.String> options, java.util.List<java.lang.String> values, int selected)
parameters
- a string that will be inserted into the initial select tag,
if null no parameters will be insertedoptions
- the optionsvalues
- the option values, if null the select will have no value attributesselected
- the index of the pre-selected option, if -1 no option is pre-selectedpublic java.lang.String button(java.lang.String href, java.lang.String target, java.lang.String image, java.lang.String label, int type)
href
- the href link for the button, if none is given the button will be disabledtarget
- the href link target for the button, if none is given the target will be same windowimage
- the image name for the button, skin path will be automattically added as prefixlabel
- the label for the text of the buttontype
- 0: image only (default), 1: image and text, 2: text onlypublic java.lang.String button(java.lang.String href, java.lang.String target, java.lang.String image, java.lang.String label, int type, java.lang.String imagePath)
href
- the href link for the button, if none is given the button will be disabledtarget
- the href link target for the button, if none is given the target will be same windowimage
- the image name for the button, skin path will be automattically added as prefixlabel
- the label for the text of the buttontype
- 0: image only (default), 1: image and text, 2: text onlyimagePath
- the path to the imagepublic java.lang.String buttonBar(int segment)
segment
- the HTML segment (START / END)public java.lang.String buttonBar(int segment, java.lang.String attributes)
segment
- the HTML segment (START / END)attributes
- optional attributes for the table tagpublic java.lang.String buttonBarHorizontalLine()
public java.lang.String buttonBarLabel(java.lang.String label)
label
- the label to showpublic java.lang.String buttonBarLabel(java.lang.String label, java.lang.String className)
label
- the label to showclassName
- the css class name for the formattingpublic java.lang.String buttonBarLine(int leftPixel, int rightPixel, java.lang.String className)
leftPixel
- the amount of pixel left to the linerightPixel
- the amount of pixel right to the lineclassName
- the css class name for the formattingpublic java.lang.String buttonBarLineSpacer(int pixel)
pixel
- the amount of pixel spacepublic java.lang.String buttonBarSeparator(int leftPixel, int rightPixel)
leftPixel
- the amount of pixel left to the separatorrightPixel
- the amount of pixel right to the separatorpublic java.lang.String buttonBarSpacer(int width)
width
- the width of the invisible spacerpublic java.lang.String buttonBarStartTab(int leftPixel, int rightPixel)
leftPixel
- the amount of pixel left to the starterrightPixel
- the amount of pixel right to the starterpublic void checkLock(java.lang.String resource) throws CmsException
resource
- the resource name which is checkedCmsException
- if reading or locking the resource failspublic void checkLock(java.lang.String resource, CmsLockType type) throws CmsException
resource
- the resource name which is checkedtype
- indicates the mode CmsLockType.EXCLUSIVE
or CmsLockType.TEMPORARY
CmsException
- if reading or locking the resource failspublic void fillParamValues(CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
settings
- the workplace settingsrequest
- the current requestpublic void fillParamValues(javax.servlet.http.HttpServletRequest request)
All methods that start with "setParam" are possible candidates to be automatically filled. The remaining part of the method name is converted to lower case. Then a parameter of this name is searched in the request parameters. If the parameter is found, the "setParam" method is automatically invoked by reflection with the value of the parameter.
request
- the current JSP requestpublic java.lang.String getBroadcastMessageString()
Caution: returns the pure message String (not escaped) or null, if no message is pending.
public CmsObject getCms()
public java.lang.String getEncoding()
public java.lang.String getExplorerFileListFullUri()
public java.lang.String getFrameSource(java.lang.String frameName, java.lang.String uri)
frameName
- the name of the frameuri
- the absolute path of the framepublic CmsJspActionElement getJsp()
public java.util.Locale getLocale()
public CmsMacroResolver getMacroResolver()
public CmsMessages getMessages()
public java.util.List<org.apache.commons.fileupload.FileItem> getMultiPartFileItems()
This list is automatically initialized from the createParameterMapFromMultiPart(HttpServletRequest) method.
public java.lang.String getResourceUri()
Workplaces static resources are images, css files etc. These are exported during the installation of OpenCms, and are usually only read from this exported location to avoid the overhaead of accessing the database later.
public javax.servlet.http.HttpSession getSession()
public CmsWorkplaceSettings getSettings()
public java.lang.String getStyleUri(java.lang.String filename)
filename
- the name of the stylesheetpublic java.lang.String htmlEnd()
public java.lang.String htmlStart(java.lang.String title)
title
- the content for the title tagpublic boolean initSettings(CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
PARAM_WP_SITE
and PARAM_WP_PROJECT
.settings
- the workplace settingsrequest
- the current requestpublic boolean isForwarded()
public boolean isHelpEnabled()
public boolean isSubElement()
public java.lang.String key(java.lang.String keyName)
If the key was not found, the return value is
"??? " + keyName + " ???"
.
If the key starts with "help."
and is not found,
the value "index.html"
is returned.
keyName
- the key for the desired stringCmsMessages.key(String)
public java.lang.String key(java.lang.String keyName, java.lang.Object[] params)
If the key was found in the bundle, it will be formatted using
a
using the provided parameters.MessageFormat
If the key was not found in the bundle, the return value is
"??? " + keyName + " ???"
. This will also be returned
if the bundle was not properly initialized first.
keyName
- the key for the desired stringparams
- the parameters to use for formattingCmsMessages.key(String)
public java.lang.String keyDefault(java.lang.String keyName, java.lang.String defaultValue)
If the key was not found, the provided default value is returned.
keyName
- the key for the desired stringdefaultValue
- the default value in case the key does not exist in the bundleCmsMessages.keyDefault(String, String)
public java.lang.String nullToEmpty(java.lang.String value)
Use this method in forms if a getParamXXX method is used, but a String (not null) is required.
value
- the String to checkpublic java.lang.String pageBody(int segment, java.lang.String className, java.lang.String parameters)
segment
- the HTML segment (START / END)className
- optional class attribute to add to the body tagparameters
- optional parameters to add to the body tagpublic java.lang.String pageHtml(int segment, java.lang.String title)
segment
- the HTML segment (START / END)title
- the title of the page, if null no title tag is insertedpublic java.lang.String pageHtmlStyle(int segment, java.lang.String title, java.lang.String stylesheet)
segment
- the HTML segment (START / END)title
- the title of the page, if null no title tag is insertedstylesheet
- the used style sheet, if null the default stylesheet 'workplace.css' is insertedpublic java.lang.String paramsAsHidden()
public java.lang.String paramsAsHidden(java.util.Collection<java.lang.String> excludes)
excludes
- the parameters to excludepublic java.util.Map<java.lang.String,java.lang.String[]> paramsAsParameterMap()
public java.lang.String paramsAsRequest()
key1=value1&key2=value2
etc.public java.lang.String resolveMacros(java.lang.String input)
The following macro contexts are available in the Workplace:
CmsObject
).CmsMessages
).getJsp()
).input
- the input String containing the macrosCmsMacroResolver.resolveMacros(String)
public void sendCmsRedirect(java.lang.String location) throws java.io.IOException
location
- the location the response is redirected tojava.io.IOException
- in case redirection failspublic void sendForward(java.lang.String location, java.util.Map<java.lang.String,java.lang.String[]> params) throws java.io.IOException, javax.servlet.ServletException
location
- the location the response is redirected toparams
- the map of parameters to use for the forwarded requestjava.io.IOException
- in case the forward failsjavax.servlet.ServletException
- in case the forward failspublic void setForwarded(boolean forwarded)
forwarded
- the forwarded flag to setpublic java.lang.String shortKey(java.lang.String keyName)
keyName
- name of the keyprotected void addMessages(CmsMessages messages)
messages
- the CmsMessages
to addprotected void addMessages(java.lang.String bundleName)
bundleName
- the resource bundle name to addprotected java.util.Map<java.lang.String,java.lang.Object> allParamValues()
protected void checkRole() throws CmsRoleViolationException
CmsRoleViolationException
- if the user does not have the required roleprotected java.lang.String decodeParamValue(java.lang.String paramName, java.lang.String paramValue)
In special cases some parameters might require a different-from-default encoding. This is the case if the content of the parameter was encoded using the JavaScript encodeURIComponent() method on the client, which always encodes in UTF-8.
paramName
- the name of the parameterparamValue
- the unencoded value of the parameterprotected java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
This method will also handle parameters from forms
of type multipart/form-data
.
protected void initMessages()
By default the CmsWorkplaceMessages
are initialized.
You SHOULD override this method for setting the bundles you really need,
using the
or addMessages(CmsMessages)
method.addMessages(String)
protected void initTimeWarp(CmsUserSettings settings, javax.servlet.http.HttpSession session)
Timwarping is controlled by the session attribute
CmsContextInfo.ATTRIBUTE_REQUEST_TIME
with a value of type Long
.
settings
- the user settings which are configured via the preferences dialogsession
- the session of the userprotected void initWorkplaceMembers(CmsJspActionElement jsp)
This method can be used in case there a workplace class was generated using
Class.forName(java.lang.String)
to initialize the class members.
jsp
- the initialized JSP contextprotected abstract void initWorkplaceRequestValues(CmsWorkplaceSettings settings, javax.servlet.http.HttpServletRequest request)
settings
- the workplace settingsrequest
- the current requestprotected java.util.Map<java.lang.String,java.lang.Object> paramValues()
protected java.lang.String substituteSiteTitle(java.lang.String title)
title
- the site titleprotected void switchToCurrentProject() throws CmsException
CmsException
- if switching back failsprotected CmsUUID switchToTempProject() throws CmsException
The id of the old project is stored in a member variable to switch back.
CmsException
- if getting the tempfileproject id fails