Package org.opencms.workplace.explorer
Class CmsNewResource
java.lang.Object
org.opencms.workplace.explorer.CmsNewResource
The new resource entry dialog which displays the possible "new actions" for the current user.
It handles the creation of "simple" resource types like plain or JSP resources.
The following files use this class:
- /commons/newresource.jsp
- Since:
- 6.0.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The value for the resource name form action.static final int
The value for the resource name form submission action.static final int
Constant for the "Next" button in the build button methods.static final String
The default suffix.static final char
Delimiter for property values, e.g.static final String
The name for the advanced resource form action.static final String
The name for the resource form action.static final String
The name for the resource form submission action.static final String
The dialog type.static final String
List column id constant.static final String
Request parameter name for the append html suffix checkbox.static final String
Request parameter name for the current folder name.static final String
Request parameter name for the new form uri.static final String
Request parameter name for the new resource edit properties flag.static final String
Request parameter name for the new resource type.static final String
Request parameter name for the new resource uri.static final String
Session attribute to store advanced mode.static final String
Session attribute to store current page.static final String
The property value for available resource to reset behaviour to default dialog. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Returns the value for the Title property from the given resource name.protected static org.opencms.file.CmsProperty
createPropertyObject
(String name, String value) Creates a single property object and sets the value individual or shared depending on the OpenCms settings.protected static List<org.opencms.file.CmsProperty>
createResourceProperties
(org.opencms.file.CmsObject cms, String resourceName, String resTypeName, String title) Returns the properties to create automatically with the new VFS resource.static Object
getNewResourceHandler
(String type, String defaultClassName, javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) A factory to return handlers to create new resources.
-
Field Details
-
ACTION_NEWFORM
The value for the resource name form action.- See Also:
-
ACTION_SUBMITFORM
The value for the resource name form submission action.- See Also:
-
BUTTON_NEXT
Constant for the "Next" button in the build button methods.- See Also:
-
DEFAULT_SUFFIX
The default suffix.- See Also:
-
DELIM_PROPERTYVALUES
Delimiter for property values, e.g. for available resource types or template sites.- See Also:
-
DIALOG_ADVANCED
The name for the advanced resource form action.- See Also:
-
DIALOG_NEWFORM
The name for the resource form action.- See Also:
-
DIALOG_SUBMITFORM
The name for the resource form submission action.- See Also:
-
DIALOG_TYPE
The dialog type.- See Also:
-
LIST_COLUMN_URI
List column id constant.- See Also:
-
PARAM_APPENDSUFFIXHTML
Request parameter name for the append html suffix checkbox.- See Also:
-
PARAM_CURRENTFOLDER
Request parameter name for the current folder name.- See Also:
-
PARAM_NEWFORMURI
Request parameter name for the new form uri.- See Also:
-
PARAM_NEWRESOURCEEDITPROPS
Request parameter name for the new resource edit properties flag.- See Also:
-
PARAM_NEWRESOURCETYPE
Request parameter name for the new resource type.- See Also:
-
PARAM_NEWRESOURCEURI
Request parameter name for the new resource uri.- See Also:
-
SESSION_ATTR_ADVANCED
Session attribute to store advanced mode.- See Also:
-
SESSION_ATTR_PAGE
Session attribute to store current page.- See Also:
-
VALUE_DEFAULT
The property value for available resource to reset behaviour to default dialog.- See Also:
-
-
Constructor Details
-
CmsNewResource
public CmsNewResource()
-
-
Method Details
-
computeNewTitleProperty
Returns the value for the Title property from the given resource name.- Parameters:
name
- the name of the resource- Returns:
- the value for the Title property from the given resource name
-
getNewResourceHandler
public static Object getNewResourceHandler(String type, String defaultClassName, javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws org.opencms.main.CmsRuntimeException A factory to return handlers to create new resources.- Parameters:
type
- the resource type name to get a new resource handler for, as specified in the explorer type settingsdefaultClassName
- a default handler class name, to be used if the handler class specified in the explorer type settings cannot be foundcontext
- the JSP page contextreq
- the JSP requestres
- the JSP response- Returns:
- a new instance of the handler class
- Throws:
org.opencms.main.CmsRuntimeException
- if something goes wrong
-
createPropertyObject
Creates a single property object and sets the value individual or shared depending on the OpenCms settings.- Parameters:
name
- the name of the propertyvalue
- the value to set- Returns:
- an initialized property object
-
createResourceProperties
protected static List<org.opencms.file.CmsProperty> createResourceProperties(org.opencms.file.CmsObject cms, String resourceName, String resTypeName, String title) Returns the properties to create automatically with the new VFS resource.If configured, the Title and Navigation properties are set on resource creation.
- Parameters:
cms
- the initialized CmsObjectresourceName
- the full resource nameresTypeName
- the name of the resource typetitle
- the Title String to use for the property values- Returns:
- the List of initialized property objects
-