Class CmsContentDefinition

    • 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 informations
        newLink - the new link
        referenceId - the reference resource structure id
        locale - 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 id
        entities - the locale specific entities of the content
        configurations - the attribute configurations
        externalWidgetConfigurations - the external widget configurations
        complexWidgetData - the complex widget configurations
        types - the types
        tabInfos - the tab information
        locale - the content locale
        contentLocales - the content locales
        availableLocales - the available locales
        synchronizations - the elements that require a synchronization across all locales
        syncValues - the locale synchronization values
        skipPaths - the paths to skip during locale synchronization
        title - the content title
        sitePath - the site path
        resourceType - the resource type name
        iconClasses - the resource icon classes
        performedAutocorrection - flag indicating the current content has an invalid XML structure and was auto corrected
        autoUnlock - false if the editor should not unlock resources automatically in standalone mode
        editorChangeScopes - the editor change handler scopes
    • 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 entity
        path - 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 entity
        target - the target entity
        transferAttributes - the attributes to consider for the value transfer
        entityTypes - the entity types
        attributeConfigurations - the attribute configurations
        considerDefaults - 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 UUID
        locale - 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 type
        entityTypes - the entity types
        attributeConfigurations - 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
      • 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
      • getIconClasses

        public java.lang.String getIconClasses()
        Returns the resource icon classes.

        Returns:
        the resource icon classes
      • 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()
        Returns true 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