Package org.opencms.ui.util
Class CmsNewResourceBuilder
java.lang.Object
org.opencms.ui.util.CmsNewResourceBuilder
Helper class for creating a new resource using the New dialog.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface for callbacks which should be notified when this helper has created a resource.classProperty helper subclass which is responsible for loading the initial property data to display in the property dialog for a resource to be created in the New dialog. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCallback(CmsNewResourceBuilder.I_Callback callback) Adds a callback to be notified when the resource is created.Triggers the resource creation.Gets the created resource.Loads the property data with which the property dialog for the new resource should be initialized.Creates a resource, but doesn't throw any exceptions.voidsetExplorerNameGeneration(boolean explorerNameGenerationMode) Sets the Explorer name generation mode.voidSets the locale.voidsetModel(CmsResource modelResource) Sets the model resource.voidsetPatternPath(String destination) Sets the creation path containing a number pattern.voidsetPropertyChanges(CmsPropertyChangeSet propertyChanges) Sets the property changes.voidsetSiteRoot(String siteRoot) Sets the site root of the CMS context.voidSets the resource type name.
-
Constructor Details
-
CmsNewResourceBuilder
Creates a new instance.- Parameters:
cms- the CMS context- Throws:
CmsException- if something goes wrong
-
-
Method Details
-
addCallback
Adds a callback to be notified when the resource is created.- Parameters:
callback- the callback
-
createResource
Triggers the resource creation.- Returns:
- the created resource
- Throws:
CmsException- if something goes wrong
-
getCreatedResource
Gets the created resource.This will null before the resource creation process.
- Returns:
- the created resource
-
getPropertyData
Loads the property data with which the property dialog for the new resource should be initialized.- Returns:
- the properties bean
-
safeCreateResource
Creates a resource, but doesn't throw any exceptions.Exceptions will be passed to the onError method of registered callbacks.
- Returns:
- the created resource
-
setExplorerNameGeneration
Sets the Explorer name generation mode.- Parameters:
explorerNameGenerationMode- the explorer name generation mode
-
setLocale
Sets the locale.- Parameters:
locale- the locale
-
setModel
Sets the model resource.- Parameters:
modelResource- the model resource
-
setPatternPath
Sets the creation path containing a number pattern.- Parameters:
destination- the creation path
-
setSiteRoot
Sets the site root of the CMS context.- Parameters:
siteRoot- the site root
-
setType
Sets the resource type name.- Parameters:
type- the resource type name
-