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

Contains all information needed for editing an XMLContent.

  • Field Details

  • Constructor Details

    • CmsContentDefinition

      public CmsContentDefinition(List<CmsModelResourceInfo> modelInfos, String newLink, CmsUUID referenceId, 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(String entityId, Map<String,CmsEntity> entities, Map<String,CmsAttributeConfiguration> configurations, Collection<CmsExternalWidgetConfiguration> externalWidgetConfigurations, Map<String,CmsComplexWidgetData> complexWidgetData, Map<String,CmsType> types, List<CmsTabInfo> tabInfos, String locale, List<String> contentLocales, Map<String,String> availableLocales, List<String> synchronizations, Map<String,String> syncValues, Collection<String> skipPaths, String title, String sitePath, String resourceType, String iconClasses, boolean performedAutocorrection, boolean autoUnlock, Set<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
    • CmsContentDefinition

      Constructor for serialization only.

  • Method Details

    • entityIdToUuid

      public static CmsUUID entityIdToUuid(String entityId)
      Returns the UUID according to the given entity id.

      Parameters:
      entityId - the entity id
      Returns:
      the entity id
    • getLocaleFromId

      public static String getLocaleFromId(String entityId)
      Extracts the locale from the entity id.

      Parameters:
      entityId - the entity id
      Returns:
      the locale
    • getValueForPath

      public static String getValueForPath(CmsEntity entity, 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, List<String> transferAttributes, Map<String,CmsType> entityTypes, Map<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 String uuidToEntityId(CmsUUID uuid, 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, Map<String,CmsType> entityTypes, Map<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

      Returns the available locales.

      Returns:
      the available locales
    • getComplexWidgetData

      Gets the complex widget configurations.

      Returns:
      the complex widget configurations
    • getContentLocales

      Returns the content locales.

      Returns:
      the content locales
    • getEditorChangeScopes

      Returns the editor change handler scopes.

      Returns:
      the editor change handler scopes
    • getExternalWidgetConfigurations

      Returns the external widget configurations.

      Returns:
      the external widget configurations
    • getIconClasses

      Returns the resource icon classes.

      Returns:
      the resource icon classes
    • getModelInfos

      Returns the model file informations.

      Returns:
      the model file informations
    • getNewLink

      public String getNewLink()
      Returns the new link.

      Returns:
      the new link
    • getReferenceResourceId

      Returns the reference resource structure id.

      Returns:
      the reference resource structure id
    • getResourceType

      Returns the resource type.

      Returns:
      the resource type
    • getSitePath

      public String getSitePath()
      Returns the site path.

      Returns:
      the site path
    • getSkipPaths

      Returns the paths to skip during locale synchronization.

      Returns:
      the paths to skip during locale synchronization
    • getSynchronizations

      Returns the elements that require a synchronization across all locales.

      Returns:
      the element paths
    • getSyncValues

      Returns the locale synchronization values.

      Returns:
      the locale synchronization values
    • getTitle

      public 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
    • isReusedElement

      public boolean isReusedElement()
      Checks if the element should be marked as 'reused' in the editor.
      Returns:
      true if the element should be marked as 'reused' in the editor
    • 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
    • setReusedElement

      public void setReusedElement(boolean reused)
      Enables / disables marking of the element as 'reused' in the content editor.
      Parameters:
      reused - true if the element should be shown as 'reused'