|
||||||||||
| 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.explorer.CmsNewResource
public class 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:
| Field Summary | |
|---|---|
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 String |
DIALOG_NEWFORM
The name for the resource form action. |
static String |
DIALOG_SUBMITFORM
The name for the resource form submission action. |
static String |
DIALOG_TYPE
The dialog type. |
static String |
PARAM_CURRENTFOLDER
Request parameter name for the current folder name. |
static String |
PARAM_NEWRESOURCEEDITPROPS
Request parameter name for the new resource edit properties flag. |
static String |
PARAM_NEWRESOURCETYPE
Request parameter name for the new resource type. |
static String |
PARAM_NEWRESOURCEURI
Request parameter name for the new resource uri. |
| Fields inherited from class org.opencms.workplace.tools.CmsToolDialog |
|---|
PARAM_PATH, PARAM_ROOT, PARAM_STYLE, STYLE_NEW |
| Constructor Summary | |
|---|---|
CmsNewResource(CmsJspActionElement jsp)
Public constructor with JSP action element. |
|
CmsNewResource(PageContext context,
HttpServletRequest req,
HttpServletResponse res)
Public constructor with JSP variables. |
|
| Method Summary | |
|---|---|
void |
actionCreateResource()
Creates the resource using the specified resource name and the newresourcetype parameter. |
void |
actionEditProperties()
Forwards to the property dialog if the resourceeditprops parameter is true. |
void |
actionSelect()
Forwards to the next page of the new resource wizard after selecting the new resource type. |
String |
buildNewList(String attributes)
Builds the html for the list of possible new resources. |
protected String |
computeCurrentFolder()
Returns the full path of the current workplace folder. |
protected String |
computeFullResourceName()
Appends the full path to the new resource name given in the resource parameter. |
String |
computeNewTitleProperty()
Returns the value for the Title property from the given resource name. |
protected CmsProperty |
createPropertyObject(String name,
String value)
Creates a single property object and sets the value individual or shared depending on the OpenCms settings. |
protected List |
createResourceProperties(String resourceName,
String resTypeName,
String title)
Returns the properties to create automatically with the new VFS resource. |
protected void |
dialogButtonsHtml(StringBuffer result,
int button,
String attribute)
Renders the HTML for a single input button of a specified type. |
String |
dialogButtonsNextCancel(String nextAttrs,
String cancelAttrs)
Builds a button row with an "next" and a "cancel" button. |
static Object |
getNewResourceHandler(String type,
String defaultClassName,
PageContext context,
HttpServletRequest req,
HttpServletResponse res)
A factory to return handlers to create new resources. |
String |
getParamCurrentFolder()
Returns the current folder set by the http request. |
String |
getParamNewResourceEditProps()
Returns the new resource edit properties flag parameter. |
String |
getParamNewResourceType()
Returns the new resource type parameter. |
String |
getParamNewResourceUri()
Returns the new resource URI parameter. |
String |
getParamPage()
Returns the paramPage. |
protected void |
initWorkplaceRequestValues(CmsWorkplaceSettings settings,
HttpServletRequest request)
Analyzes the request for workplace parameters and adjusts the workplace settings accordingly. |
boolean |
isResourceCreated()
Returns true if the resource is created successfully; otherwise false. |
void |
setParamCurrentFolder(String paramCurrentFolder)
Sets the current folder. |
void |
setParamNewResourceEditProps(String newResourceEditProps)
Sets the new resource edit properties flag parameter. |
void |
setParamNewResourceType(String newResourceType)
Sets the new resource type parameter. |
void |
setParamNewResourceUri(String newResourceUri)
Sets the new resource URI parameter. |
void |
setParamPage(String paramPage)
Sets the paramPage. |
void |
setResourceCreated(boolean successfullyCreated)
Sets the boolean flag successfullyCreated. |
| 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_NEWFORM
public static final int ACTION_SUBMITFORM
public static final int BUTTON_NEXT
public static final String DIALOG_NEWFORM
public static final String DIALOG_SUBMITFORM
public static final String DIALOG_TYPE
public static final String PARAM_CURRENTFOLDER
public static final String PARAM_NEWRESOURCEEDITPROPS
public static final String PARAM_NEWRESOURCETYPE
public static final String PARAM_NEWRESOURCEURI
| Constructor Detail |
|---|
public CmsNewResource(CmsJspActionElement jsp)
jsp - an initialized JSP action element
public CmsNewResource(PageContext context,
HttpServletRequest req,
HttpServletResponse res)
context - the JSP page contextreq - the JSP requestres - the JSP response| Method Detail |
|---|
public static Object getNewResourceHandler(String type,
String defaultClassName,
PageContext context,
HttpServletRequest req,
HttpServletResponse res)
throws CmsRuntimeException
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
CmsRuntimeException - if something goes wrong
public void actionCreateResource()
throws JspException
JspException - if inclusion of error dialog fails
public void actionEditProperties()
throws IOException,
JspException,
ServletException
If the parameter is not true, the dialog will be closed.
IOException - if forwarding to the property dialog fails
ServletException - if forwarding to the property dialog fails
JspException - if an inclusion fails
public void actionSelect()
throws IOException,
ServletException
IOException - if forwarding fails
ServletException - if forwarding failspublic String buildNewList(String attributes)
attributes - optional attributes for the radio input tags
public String computeNewTitleProperty()
Additionally translates the new resource name according to the file translation rules.
public String dialogButtonsNextCancel(String nextAttrs,
String cancelAttrs)
nextAttrs - optional attributes for the next buttoncancelAttrs - optional attributes for the cancel button
public String getParamCurrentFolder()
If the request parameter value is null/empty then returns the default computed folder.
public String getParamNewResourceEditProps()
public String getParamNewResourceType()
public String getParamNewResourceUri()
public String getParamPage()
public boolean isResourceCreated()
public void setParamCurrentFolder(String paramCurrentFolder)
paramCurrentFolder - the current folder to setpublic void setParamNewResourceEditProps(String newResourceEditProps)
newResourceEditProps - the new resource edit properties flag parameterpublic void setParamNewResourceType(String newResourceType)
newResourceType - the new resource type parameterpublic void setParamNewResourceUri(String newResourceUri)
newResourceUri - the new resource URI parameterpublic void setParamPage(String paramPage)
paramPage - the paramPage to setpublic void setResourceCreated(boolean successfullyCreated)
successfullyCreated - a boolean flag that indicates if the create resource operation was successfull or notprotected String computeCurrentFolder()
protected String computeFullResourceName()
protected CmsProperty createPropertyObject(String name,
String value)
name - the name of the propertyvalue - the value to set
protected List createResourceProperties(String resourceName,
String resTypeName,
String title)
If configured, the Title and Navigation properties are set on resource creation.
resourceName - the full resource nameresTypeName - the name of the resource typetitle - the Title String to use for the property values
protected void dialogButtonsHtml(StringBuffer result,
int button,
String attribute)
CmsDialog
dialogButtonsHtml in class CmsDialogresult - 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 nullCmsDialog.dialogButtonsHtml(java.lang.StringBuffer, int, java.lang.String)
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 | |||||||||