public class CmsNewResourceBuilder extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
CmsNewResourceBuilder.I_Callback
Interface for callbacks which should be notified when this helper has created a resource.
|
class |
CmsNewResourceBuilder.PropertyEditorHelper
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 and Description |
---|
CmsNewResourceBuilder(CmsObject cms)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addCallback(CmsNewResourceBuilder.I_Callback callback)
Adds a callback to be notified when the resource is created.
|
CmsResource |
createResource()
Triggers the resource creation.
|
CmsResource |
getCreatedResource()
Gets the created resource.
|
CmsPropertiesBean |
getPropertyData()
Loads the property data with which the property dialog for the new resource should be initialized.
|
CmsResource |
safeCreateResource()
Creates a resource, but doesn't throw any exceptions.
|
void |
setExplorerNameGeneration(boolean explorerNameGenerationMode)
Sets the Explorer name generation mode.
|
void |
setLocale(java.util.Locale locale)
Sets the locale.
|
void |
setModel(CmsResource modelResource)
Sets the model resource.
|
void |
setPatternPath(java.lang.String destination)
Sets the creation path containing a number pattern.
|
void |
setPropertyChanges(CmsPropertyChangeSet propertyChanges)
Sets the property changes.
|
void |
setSiteRoot(java.lang.String siteRoot)
Sets the site root of the CMS context.
|
void |
setType(java.lang.String type)
Sets the resource type name.
|
public CmsNewResourceBuilder(CmsObject cms) throws CmsException
cms
- the CMS contextCmsException
- if something goes wrongpublic void addCallback(CmsNewResourceBuilder.I_Callback callback)
callback
- the callbackpublic CmsResource createResource() throws CmsException
CmsException
- if something goes wrongpublic CmsResource getCreatedResource()
This will null before the resource creation process.
public CmsPropertiesBean getPropertyData()
public CmsResource safeCreateResource()
Exceptions will be passed to the onError method of registered callbacks.
public void setExplorerNameGeneration(boolean explorerNameGenerationMode)
explorerNameGenerationMode
- the explorer name generation modepublic void setLocale(java.util.Locale locale)
locale
- the localepublic void setModel(CmsResource modelResource)
modelResource
- the model resourcepublic void setPatternPath(java.lang.String destination)
destination
- the creation pathpublic void setPropertyChanges(CmsPropertyChangeSet propertyChanges)
propertyChanges
- the property changespublic void setSiteRoot(java.lang.String siteRoot)
siteRoot
- the site rootpublic void setType(java.lang.String type)
type
- the resource type name