Class CmsContentDefinition
- java.lang.Object
-
- org.opencms.acacia.shared.CmsContentDefinition
-
- org.opencms.ade.contenteditor.shared.CmsContentDefinition
-
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
public class CmsContentDefinition extends CmsContentDefinition
Contains all information needed for editing an XMLContent.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SETTINGS_TAB_ID
The id of the element settings tab.-
Fields inherited from class org.opencms.acacia.shared.CmsContentDefinition
FUNCTION_RENDER_FORM, FUNCTION_RENDER_INLINE, NATIVE_RENDERER, PARAM_INIT_CALL
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CmsContentDefinition()
Constructor for serialization only.CmsContentDefinition(java.lang.String entityId, java.util.Map<java.lang.String,CmsEntity> entities, java.util.Map<java.lang.String,CmsAttributeConfiguration> configurations, java.util.Collection<CmsExternalWidgetConfiguration> externalWidgetConfigurations, java.util.Map<java.lang.String,CmsComplexWidgetData> complexWidgetData, java.util.Map<java.lang.String,CmsType> types, java.util.List<CmsTabInfo> tabInfos, java.lang.String locale, java.util.List<java.lang.String> contentLocales, java.util.Map<java.lang.String,java.lang.String> availableLocales, java.util.List<java.lang.String> synchronizations, java.util.Map<java.lang.String,java.lang.String> syncValues, java.util.Collection<java.lang.String> skipPaths, java.lang.String title, java.lang.String sitePath, java.lang.String resourceType, java.lang.String iconClasses, boolean performedAutocorrection, boolean autoUnlock, java.util.Set<java.lang.String> editorChangeScopes)
Constructor.CmsContentDefinition(java.util.List<CmsModelResourceInfo> modelInfos, java.lang.String newLink, CmsUUID referenceId, java.lang.String locale)
Constructor for model file informations object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static CmsEntity
createDefaultValueEntity(CmsType entityType, java.util.Map<java.lang.String,CmsType> entityTypes, java.util.Map<java.lang.String,CmsAttributeConfiguration> attributeConfigurations)
Creates an entity object containing the default values configured for it's type.static CmsUUID
entityIdToUuid(java.lang.String entityId)
Returns the UUID according to the given entity id.java.util.Map<java.lang.String,java.lang.String>
getAvailableLocales()
Returns the available locales.java.util.Map<java.lang.String,CmsComplexWidgetData>
getComplexWidgetData()
Gets the complex widget configurations.java.util.List<java.lang.String>
getContentLocales()
Returns the content locales.java.util.Set<java.lang.String>
getEditorChangeScopes()
Returns the editor change handler scopes.java.util.List<CmsExternalWidgetConfiguration>
getExternalWidgetConfigurations()
Returns the external widget configurations.java.lang.String
getIconClasses()
Returns the resource icon classes.static java.lang.String
getLocaleFromId(java.lang.String entityId)
Extracts the locale from the entity id.java.util.List<CmsModelResourceInfo>
getModelInfos()
Returns the model file informations.java.lang.String
getNewLink()
Returns the new link.CmsUUID
getReferenceResourceId()
Returns the reference resource structure id.java.lang.String
getResourceType()
Returns the resource type.java.lang.String
getSitePath()
Returns the site path.java.util.Collection<java.lang.String>
getSkipPaths()
Returns the paths to skip during locale synchronization.java.util.List<java.lang.String>
getSynchronizations()
Returns the elements that require a synchronization across all locales.java.util.Map<java.lang.String,java.lang.String>
getSyncValues()
Returns the locale synchronization values.java.lang.String
getTitle()
Returns the title.static java.lang.String
getValueForPath(CmsEntity entity, java.lang.String path)
Returns the value for the given XPath expression.boolean
hasEditorChangeHandlers()
Returnstrue
if any editor change handlers have been configured for this content type.boolean
hasSynchronizedElements()
Returns if there are locale synchronized elements configured.boolean
isAutoUnlock()
Returns the value of the acacia-unlock configuration option.boolean
isDeleteOnCancel()
Returns if the resource needs to removed on cancel.boolean
isDirectEdit()
Returns true if the direct edit flag is set, which means that the editor was opened from the classic direct edit mode.boolean
isModelInfo()
Returns if the model file informations are present, in this case no additional data is contained.boolean
isPerformedAutocorrection()
Returns if auto correction was performed.void
setDeleteOnCancel(boolean deleteOnCancel)
Sets if the resource needs to removed on cancel.void
setDirectEdit(boolean isDirectEdit)
Sets the value of the direct edit flag.static void
transferValues(CmsEntity original, CmsEntity target, java.util.List<java.lang.String> transferAttributes, java.util.Map<java.lang.String,CmsType> entityTypes, java.util.Map<java.lang.String,CmsAttributeConfiguration> attributeConfigurations, boolean considerDefaults)
Transfers values from the original entity to the given target entity.static java.lang.String
uuidToEntityId(CmsUUID uuid, java.lang.String locale)
Returns the entity id according to the given UUID.-
Methods inherited from class org.opencms.acacia.shared.CmsContentDefinition
extractIndex, getConfigurations, getEntities, getEntity, getEntityId, getEntityTypeName, getLocale, getTabInfos, getTypes, hasIndex, isGroupOptionalFields, removeIndex
-
-
-
-
Field Detail
-
SETTINGS_TAB_ID
public static final java.lang.String SETTINGS_TAB_ID
The id of the element settings tab.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsContentDefinition
public CmsContentDefinition(java.util.List<CmsModelResourceInfo> modelInfos, java.lang.String newLink, CmsUUID referenceId, java.lang.String locale)
Constructor for model file informations object.- Parameters:
modelInfos
- the model file informationsnewLink
- the new linkreferenceId
- the reference resource structure idlocale
- the locale
-
CmsContentDefinition
public CmsContentDefinition(java.lang.String entityId, java.util.Map<java.lang.String,CmsEntity> entities, java.util.Map<java.lang.String,CmsAttributeConfiguration> configurations, java.util.Collection<CmsExternalWidgetConfiguration> externalWidgetConfigurations, java.util.Map<java.lang.String,CmsComplexWidgetData> complexWidgetData, java.util.Map<java.lang.String,CmsType> types, java.util.List<CmsTabInfo> tabInfos, java.lang.String locale, java.util.List<java.lang.String> contentLocales, java.util.Map<java.lang.String,java.lang.String> availableLocales, java.util.List<java.lang.String> synchronizations, java.util.Map<java.lang.String,java.lang.String> syncValues, java.util.Collection<java.lang.String> skipPaths, java.lang.String title, java.lang.String sitePath, java.lang.String resourceType, java.lang.String iconClasses, boolean performedAutocorrection, boolean autoUnlock, java.util.Set<java.lang.String> editorChangeScopes)
Constructor.- Parameters:
entityId
- the entity identities
- the locale specific entities of the contentconfigurations
- the attribute configurationsexternalWidgetConfigurations
- the external widget configurationscomplexWidgetData
- the complex widget configurationstypes
- the typestabInfos
- the tab informationlocale
- the content localecontentLocales
- the content localesavailableLocales
- the available localessynchronizations
- the elements that require a synchronization across all localessyncValues
- the locale synchronization valuesskipPaths
- the paths to skip during locale synchronizationtitle
- the content titlesitePath
- the site pathresourceType
- the resource type nameiconClasses
- the resource icon classesperformedAutocorrection
- flag indicating the current content has an invalid XML structure and was auto correctedautoUnlock
- false if the editor should not unlock resources automatically in standalone modeeditorChangeScopes
- the editor change handler scopes
-
CmsContentDefinition
protected CmsContentDefinition()
Constructor for serialization only.
-
-
Method Detail
-
entityIdToUuid
public static CmsUUID entityIdToUuid(java.lang.String entityId)
Returns the UUID according to the given entity id.- Parameters:
entityId
- the entity id- Returns:
- the entity id
-
getLocaleFromId
public static java.lang.String getLocaleFromId(java.lang.String entityId)
Extracts the locale from the entity id.- Parameters:
entityId
- the entity id- Returns:
- the locale
-
getValueForPath
public static java.lang.String getValueForPath(CmsEntity entity, java.lang.String path)
Returns the value for the given XPath expression.- Parameters:
entity
- the entitypath
- the path- Returns:
- the value
-
transferValues
public static void transferValues(CmsEntity original, CmsEntity target, java.util.List<java.lang.String> transferAttributes, java.util.Map<java.lang.String,CmsType> entityTypes, java.util.Map<java.lang.String,CmsAttributeConfiguration> attributeConfigurations, boolean considerDefaults)
Transfers values from the original entity to the given target entity.- Parameters:
original
- the original entitytarget
- the target entitytransferAttributes
- the attributes to consider for the value transferentityTypes
- the entity typesattributeConfigurations
- the attribute configurationsconsiderDefaults
- if default values should be added according to minimum occurrence settings
-
uuidToEntityId
public static java.lang.String uuidToEntityId(CmsUUID uuid, java.lang.String locale)
Returns the entity id according to the given UUID.- Parameters:
uuid
- the UUIDlocale
- the content locale- Returns:
- the entity id
-
createDefaultValueEntity
protected static CmsEntity createDefaultValueEntity(CmsType entityType, java.util.Map<java.lang.String,CmsType> entityTypes, java.util.Map<java.lang.String,CmsAttributeConfiguration> attributeConfigurations)
Creates an entity object containing the default values configured for it's type.- Parameters:
entityType
- the entity typeentityTypes
- the entity typesattributeConfigurations
- the attribute configurations- Returns:
- the created entity
-
getAvailableLocales
public java.util.Map<java.lang.String,java.lang.String> getAvailableLocales()
Returns the available locales.- Returns:
- the available locales
-
getComplexWidgetData
public java.util.Map<java.lang.String,CmsComplexWidgetData> getComplexWidgetData()
Gets the complex widget configurations.- Returns:
- the complex widget configurations
-
getContentLocales
public java.util.List<java.lang.String> getContentLocales()
Returns the content locales.- Returns:
- the content locales
-
getEditorChangeScopes
public java.util.Set<java.lang.String> getEditorChangeScopes()
Returns the editor change handler scopes.- Returns:
- the editor change handler scopes
-
getExternalWidgetConfigurations
public java.util.List<CmsExternalWidgetConfiguration> getExternalWidgetConfigurations()
Returns the external widget configurations.- Returns:
- the external widget configurations
-
getIconClasses
public java.lang.String getIconClasses()
Returns the resource icon classes.- Returns:
- the resource icon classes
-
getModelInfos
public java.util.List<CmsModelResourceInfo> getModelInfos()
Returns the model file informations.- Returns:
- the model file informations
-
getNewLink
public java.lang.String getNewLink()
Returns the new link.- Returns:
- the new link
-
getReferenceResourceId
public CmsUUID getReferenceResourceId()
Returns the reference resource structure id.- Returns:
- the reference resource structure id
-
getResourceType
public java.lang.String getResourceType()
Returns the resource type.- Returns:
- the resource type
-
getSitePath
public java.lang.String getSitePath()
Returns the site path.- Returns:
- the site path
-
getSkipPaths
public java.util.Collection<java.lang.String> getSkipPaths()
Returns the paths to skip during locale synchronization.- Returns:
- the paths to skip during locale synchronization
-
getSynchronizations
public java.util.List<java.lang.String> getSynchronizations()
Returns the elements that require a synchronization across all locales.- Returns:
- the element paths
-
getSyncValues
public java.util.Map<java.lang.String,java.lang.String> getSyncValues()
Returns the locale synchronization values.- Returns:
- the locale synchronization values
-
getTitle
public java.lang.String getTitle()
Returns the title.- Returns:
- the title
-
hasEditorChangeHandlers
public boolean hasEditorChangeHandlers()
Returnstrue
if any editor change handlers have been configured for this content type.- Returns:
true
if any editor change handlers have been configured for this content type.
-
hasSynchronizedElements
public boolean hasSynchronizedElements()
Returns if there are locale synchronized elements configured.- Returns:
true
if there are locale synchronized elements configured
-
isAutoUnlock
public boolean isAutoUnlock()
Returns the value of the acacia-unlock configuration option.- Returns:
- the value of the acacia-unlock configuration option
-
isDeleteOnCancel
public boolean isDeleteOnCancel()
Returns if the resource needs to removed on cancel.- Returns:
true
if the resource needs to removed on cancel
-
isDirectEdit
public boolean isDirectEdit()
Returns true if the direct edit flag is set, which means that the editor was opened from the classic direct edit mode.- Returns:
- true if the direct edit flag is set
-
isModelInfo
public boolean isModelInfo()
Returns if the model file informations are present, in this case no additional data is contained.- Returns:
true
if the definition contains the model file informations
-
isPerformedAutocorrection
public boolean isPerformedAutocorrection()
Returns if auto correction was performed.- Returns:
true
if auto correction was performed
-
setDeleteOnCancel
public void setDeleteOnCancel(boolean deleteOnCancel)
Sets if the resource needs to removed on cancel.- Parameters:
deleteOnCancel
-true
if the resource needs to removed on cancel
-
setDirectEdit
public void setDirectEdit(boolean isDirectEdit)
Sets the value of the direct edit flag.- Parameters:
isDirectEdit
- the new value for the direct edit flag
-
-