Package org.opencms.workplace.explorer
Class CmsNewResource
- java.lang.Object
-
- org.opencms.workplace.explorer.CmsNewResource
-
public class CmsNewResource extends java.lang.Object
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
Fields Modifier and Type Field Description static int
ACTION_NEWFORM
The value for the resource name form action.static int
ACTION_SUBMITFORM
The value for the resource name form submission action.static int
BUTTON_NEXT
Constant for the "Next" button in the build button methods.static java.lang.String
DEFAULT_SUFFIX
The default suffix.static char
DELIM_PROPERTYVALUES
Delimiter for property values, e.g.static java.lang.String
DIALOG_ADVANCED
The name for the advanced resource form action.static java.lang.String
DIALOG_NEWFORM
The name for the resource form action.static java.lang.String
DIALOG_SUBMITFORM
The name for the resource form submission action.static java.lang.String
DIALOG_TYPE
The dialog type.static java.lang.String
LIST_COLUMN_URI
List column id constant.static java.lang.String
PARAM_APPENDSUFFIXHTML
Request parameter name for the append html suffix checkbox.static java.lang.String
PARAM_CURRENTFOLDER
Request parameter name for the current folder name.static java.lang.String
PARAM_NEWFORMURI
Request parameter name for the new form uri.static java.lang.String
PARAM_NEWRESOURCEEDITPROPS
Request parameter name for the new resource edit properties flag.static java.lang.String
PARAM_NEWRESOURCETYPE
Request parameter name for the new resource type.static java.lang.String
PARAM_NEWRESOURCEURI
Request parameter name for the new resource uri.static java.lang.String
SESSION_ATTR_ADVANCED
Session attribute to store advanced mode.static java.lang.String
SESSION_ATTR_PAGE
Session attribute to store current page.static java.lang.String
VALUE_DEFAULT
The property value for available resource to reset behaviour to default dialog.
-
Constructor Summary
Constructors Constructor Description CmsNewResource()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
computeNewTitleProperty(java.lang.String name)
Returns the value for the Title property from the given resource name.protected static org.opencms.file.CmsProperty
createPropertyObject(java.lang.String name, java.lang.String value)
Creates a single property object and sets the value individual or shared depending on the OpenCms settings.protected static java.util.List<org.opencms.file.CmsProperty>
createResourceProperties(org.opencms.file.CmsObject cms, java.lang.String resourceName, java.lang.String resTypeName, java.lang.String title)
Returns the properties to create automatically with the new VFS resource.static java.lang.Object
getNewResourceHandler(java.lang.String type, java.lang.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 Detail
-
ACTION_NEWFORM
public static final int ACTION_NEWFORM
The value for the resource name form action.- See Also:
- Constant Field Values
-
ACTION_SUBMITFORM
public static final int ACTION_SUBMITFORM
The value for the resource name form submission action.- See Also:
- Constant Field Values
-
BUTTON_NEXT
public static final int BUTTON_NEXT
Constant for the "Next" button in the build button methods.- See Also:
- Constant Field Values
-
DEFAULT_SUFFIX
public static final java.lang.String DEFAULT_SUFFIX
The default suffix.- See Also:
- Constant Field Values
-
DELIM_PROPERTYVALUES
public static final char DELIM_PROPERTYVALUES
Delimiter for property values, e.g. for available resource types or template sites.- See Also:
- Constant Field Values
-
DIALOG_ADVANCED
public static final java.lang.String DIALOG_ADVANCED
The name for the advanced resource form action.- See Also:
- Constant Field Values
-
DIALOG_NEWFORM
public static final java.lang.String DIALOG_NEWFORM
The name for the resource form action.- See Also:
- Constant Field Values
-
DIALOG_SUBMITFORM
public static final java.lang.String DIALOG_SUBMITFORM
The name for the resource form submission action.- See Also:
- Constant Field Values
-
DIALOG_TYPE
public static final java.lang.String DIALOG_TYPE
The dialog type.- See Also:
- Constant Field Values
-
LIST_COLUMN_URI
public static final java.lang.String LIST_COLUMN_URI
List column id constant.- See Also:
- Constant Field Values
-
PARAM_APPENDSUFFIXHTML
public static final java.lang.String PARAM_APPENDSUFFIXHTML
Request parameter name for the append html suffix checkbox.- See Also:
- Constant Field Values
-
PARAM_CURRENTFOLDER
public static final java.lang.String PARAM_CURRENTFOLDER
Request parameter name for the current folder name.- See Also:
- Constant Field Values
-
PARAM_NEWFORMURI
public static final java.lang.String PARAM_NEWFORMURI
Request parameter name for the new form uri.- See Also:
- Constant Field Values
-
PARAM_NEWRESOURCEEDITPROPS
public static final java.lang.String PARAM_NEWRESOURCEEDITPROPS
Request parameter name for the new resource edit properties flag.- See Also:
- Constant Field Values
-
PARAM_NEWRESOURCETYPE
public static final java.lang.String PARAM_NEWRESOURCETYPE
Request parameter name for the new resource type.- See Also:
- Constant Field Values
-
PARAM_NEWRESOURCEURI
public static final java.lang.String PARAM_NEWRESOURCEURI
Request parameter name for the new resource uri.- See Also:
- Constant Field Values
-
SESSION_ATTR_ADVANCED
public static final java.lang.String SESSION_ATTR_ADVANCED
Session attribute to store advanced mode.- See Also:
- Constant Field Values
-
SESSION_ATTR_PAGE
public static final java.lang.String SESSION_ATTR_PAGE
Session attribute to store current page.- See Also:
- Constant Field Values
-
VALUE_DEFAULT
public static final java.lang.String VALUE_DEFAULT
The property value for available resource to reset behaviour to default dialog.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsNewResource
public CmsNewResource()
-
-
Method Detail
-
computeNewTitleProperty
public static java.lang.String computeNewTitleProperty(java.lang.String name)
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 java.lang.Object getNewResourceHandler(java.lang.String type, java.lang.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
protected static org.opencms.file.CmsProperty createPropertyObject(java.lang.String name, java.lang.String value)
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 java.util.List<org.opencms.file.CmsProperty> createResourceProperties(org.opencms.file.CmsObject cms, java.lang.String resourceName, java.lang.String resTypeName, java.lang.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
-
-