public class CmsPropertyEditorHelper extends java.lang.Object
Constructor and Description |
---|
CmsPropertyEditorHelper(CmsObject cms)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,CmsClientProperty> |
convertProperties(java.util.List<CmsProperty> properties)
Converts CmsProperty objects to CmsClientProperty objects.
|
java.util.Map<CmsUUID,java.util.Map<java.lang.String,CmsXmlContentProperty>> |
getDefaultProperties(java.util.List<CmsUUID> structureIds)
Internal method for computing the default property configurations for a list of structure ids.
|
protected java.util.Map<java.lang.String,CmsXmlContentProperty> |
getDefaultPropertiesForType(java.lang.String typeName)
Helper method to get the default property configuration for the given resource type.
|
protected java.util.Map<java.lang.String,CmsProperty> |
getPropertiesByName(java.util.List<CmsProperty> properties)
Converts a list of properties to a map.
|
protected boolean |
isWritable(CmsObject cms,
CmsResource resource)
Returns whether the current user has write permissions, the resource is lockable or already locked by the current user and is in the current project.
|
CmsPropertiesBean |
loadPropertyData(CmsUUID id)
Loads the data needed for editing the properties of a resource.
|
void |
overrideStructureId(CmsUUID structureId)
Sets a structure id that overrides the one stored in a property change set.
|
void |
saveProperties(CmsPropertyChangeSet changes)
Saves a set of property changes.
|
public CmsPropertyEditorHelper(CmsObject cms)
cms
- the CMS contextpublic java.util.Map<CmsUUID,java.util.Map<java.lang.String,CmsXmlContentProperty>> getDefaultProperties(java.util.List<CmsUUID> structureIds) throws CmsException
structureIds
- the structure ids for which we want the default property configurationsCmsException
- if something goes wrongpublic CmsPropertiesBean loadPropertyData(CmsUUID id) throws CmsException
id
- the structure id of the resourceCmsException
- if something goes wrongpublic void overrideStructureId(CmsUUID structureId)
structureId
- the new structure idpublic void saveProperties(CmsPropertyChangeSet changes) throws CmsException
changes
- the set of property changesCmsException
- if something goes wrongprotected java.util.Map<java.lang.String,CmsClientProperty> convertProperties(java.util.List<CmsProperty> properties)
properties
- a list of server-side propertiesprotected java.util.Map<java.lang.String,CmsXmlContentProperty> getDefaultPropertiesForType(java.lang.String typeName)
typeName
- the name of the resource typeprotected java.util.Map<java.lang.String,CmsProperty> getPropertiesByName(java.util.List<CmsProperty> properties)
properties
- the list of propertiesprotected boolean isWritable(CmsObject cms, CmsResource resource) throws CmsException
cms
- the cms contextresource
- the resourcetrue
if the resource is writableCmsException
- in case checking the permissions fails