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
Modifier and TypeClassDescriptionstatic interface
Interface for callbacks which should be notified when this helper has created a resource.class
Property 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCallback
(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.void
setExplorerNameGeneration
(boolean explorerNameGenerationMode) Sets the Explorer name generation mode.void
Sets the locale.void
setModel
(CmsResource modelResource) Sets the model resource.void
setPatternPath
(String destination) Sets the creation path containing a number pattern.void
setPropertyChanges
(CmsPropertyChangeSet propertyChanges) Sets the property changes.void
setSiteRoot
(String siteRoot) Sets the site root of the CMS context.void
Sets 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
-