Class Entity

java.lang.Object
com.priint.pubserver.entity.Entity
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EntityBucket, EntityContentMetaData, EntityCord, EntityKeyValue, EntityMediaAsset, EntityPlanning, EntityPrice, EntityTableData, EntityText

public class Entity extends Object implements Serializable

Entity of the Entity Model (base class)

All entity class are derived from this base class.

See Also:
  • Field Details

    • allowedTags

      public static final PluginConfigTag[] allowedTags
      Type of Tags to be used for this entities. For all tags see: PluginConfigTag
    • ENTITYCLASS_BUCKET

      public static final String ENTITYCLASS_BUCKET
      The constant ENTITYCLASS_BUCKET.
      See Also:
    • ENTITYCLASS_TEXT

      public static final String ENTITYCLASS_TEXT
      The constant ENTITYCLASS_TEXT.
      See Also:
    • ENTITYCLASS_MEDIAASSET

      public static final String ENTITYCLASS_MEDIAASSET
      The constant ENTITYCLASS_MEDIAASSET.
      See Also:
    • ENTITYCLASS_KEYVALUE

      public static final String ENTITYCLASS_KEYVALUE
      The constant ENTITYCLASS_KEYVALUE.
      See Also:
    • ENTITYCLASS_CORD

      public static final String ENTITYCLASS_CORD
      The constant ENTITYCLASS_CORD.
      See Also:
    • ENTITYCLASS_PRICE

      public static final String ENTITYCLASS_PRICE
      The constant ENTITYCLASS_PRICE.
      See Also:
    • ENTITYCLASS_PLANNING

      public static final String ENTITYCLASS_PLANNING
      The constant ENTITYCLASS_PLANNING.
      See Also:
    • ENTITYCLASS_CONTENTMETADATA

      public static final String ENTITYCLASS_CONTENTMETADATA
      The constant ENTITYCLASS_CONTENTMETADATA.
      See Also:
    • ENTITYCLASS_TABLEDATA

      public static final String ENTITYCLASS_TABLEDATA
      The constant ENTITYCLASS_TABLEDATA.
      See Also:
    • ENTITYTYPE_CONNECTOR

      public static final String ENTITYTYPE_CONNECTOR
      The constant ENTITYTYPE_CONNECTOR.
      See Also:
    • ENTITYTYPE_ASSEMBLING

      public static final String ENTITYTYPE_ASSEMBLING
      The constant ENTITYTYPE_ASSEMBLING.
      See Also:
    • ENTITYTYPE_STATIC

      public static final String ENTITYTYPE_STATIC
      The constant ENTITYTYPE_STATIC.
      See Also:
  • Constructor Details

    • Entity

      public Entity()
      Default constructor.

      Creates an entity and initializes the context definitions.

    • Entity

      public Entity(String label)
      Creates an entity with a name and initializes the context definitions.
      Parameters:
      label -
  • Method Details

    • getLabel

      public String getLabel()
      Get the name of the entity.
      Returns:
      label as String
    • setLabel

      public void setLabel(String label)
      Set the name of the entity.

      Throws a NullArgumentException if label is null.

      Parameters:
      label -
    • getIdentifier

      public String getIdentifier()
      Get the identifier of the entity.
      Returns:
      identifier as String
    • setIdentifier

      public void setIdentifier(String identifier)
      Set the identifier of the entity.

      Throws a NullArgumentException if identifier is null.

      Parameters:
      identifier -
    • getEntityClass

      public String getEntityClass()
      Get the name of the entity data class, e.g. Bucket, Cord, Text, MediaAsset, Price etc.
      Returns:
      name of entityClass as String
    • setEntityClass

      public void setEntityClass(String entityClass)
      Set the class of the entity as a String, e.g. bucket, cord, text, media_asset, price etc.

      When changing the entityClass property, dataClass is also updated, so that both properties reflect the same value.

      Throws a NullArgumentException if argument is null.

      Parameters:
      entityClass -
    • setEntityDataClass

      public void setEntityDataClass(Entity.DataClass dataClass)

      Sets the dataClass property of this entity

      When changing dataClass, the entityClass property is also updated, so that both fields reflect the same value.

      Parameters:
      dataClass - as Entity.DataClass
    • getEntityDataClass

      public Entity.DataClass getEntityDataClass()

      Gets the data class of this entity

      Returns:
      dataClass as Entity.DataClass
    • getEntityType

      public String getEntityType()
      Get the entity type. Entity type describes by which way the entity data instances are retrieved:
      connector, evaluate, static.
      Returns:
      entityType as String
    • setEntityType

      public void setEntityType(String entityType)
      Set the entity type. Entity type describes by which way the entity data instances are created:
      connector, evaluate, static.

      Throws a NullArgumentException if argument is null.

      Parameters:
      entityType -
    • getRevisionNumber

      public String getRevisionNumber()
      Get revision number. Revision number is automatically generated at check-in time.
      Returns:
      revisionNumber as String
    • setRevisionNumber

      public void setRevisionNumber(String revisionNumber)
      Set revision number. Revision number is automatically generated at check-in time.

      Throws a NullArgumentException if argument is null.

      Parameters:
      revisionNumber -
    • getIcon

      public Image getIcon()
      Get an icon as Image
      Returns:
      icon as Image
    • setIcon

      public void setIcon(Image icon)
      Set an icon as Image
      Parameters:
      icon -

      Throws a NullArgumentException if argument is null.

    • getTag

      public String getTag()
      Get the tag of the entity.
      Returns:
      tag as String
    • getTags

      public List<String> getTags()
      Get tags of the entity as a list.
      Returns:
      list of tags as List of Strings
    • setTag

      public void setTag(String tag)
      Set the tag of the entity.

      Throws a NullArgumentException if tag is null.

      Parameters:
      tag -
    • getTemplateRule

      public TemplateRule getTemplateRule()
      Get the rule by which templates can be found.
      Returns:
      template as TemplateRule
    • setTemplateRule

      public void setTemplateRule(TemplateRule templateRule)
      Set the rule by which templates can be found.

      Throws a NullArgumentException if argument is null.

      Parameters:
      templateRule - TemplateRule
    • getDescription

      public String getDescription()
      Get the description for the entity.
      Returns:
      description as String
    • setDescription

      public void setDescription(String description)
      Set the description for the entity.

      Throws a NullArgumentException if argument is null.

      Parameters:
      description -
    • getHelpTexts

      public List<Text> getHelpTexts()
      Get description of the entity for end users.

      Will for example be used in tool tips of client applications.

      This is localized information - there it uses the Text class.

      Returns:
      helpTexts as List of Text
    • setHelpTexts

      public void setHelpTexts(List<Text> helpTexts)
      Set description of the entity for end users.

      Will for example be used in tool tips of client applications.

      This is localized information - there it uses the Text class.

      Parameters:
      helpTexts - as List of Text

      Throws a NullArgumentException if argument is null.

    • getEntityModel

      public EntityModel getEntityModel()
      Get the entity model that contains this entity.

      Entities can only belong to one model.

      Returns:
      entityModel as EntityModel
    • setEntityModel

      public void setEntityModel(EntityModel entityModel)
      Set the entity model of this entity.

      Throws a NullArgumentException if entityModel argument is null.

      Parameters:
      entityModel -
    • getConConnector

      public String getConConnector()
      Get the connector name (mappedName of the connector plug-in).
      Returns:
      conConnector as String
    • setConConnector

      public void setConConnector(String conConnector)
      Set the connector name (mappedName of the connector plug-in).

      Throws a NullArgumentException if argument is null.

      Parameters:
      conConnector -
    • getConInstance

      public String getConInstance()
      Get the connector instance name - as defined in the connector plug-in configuration.
      Returns:
      conInstance as String
    • setConInstance

      public void setConInstance(String conInstance)
      Set the connector instance name - as defined in the connector plug-in configuration.

      Throws a NullArgumentException if argument is null.

      Parameters:
      conInstance - the connector instance
    • getConConnectorEntity

      public String getConConnectorEntity()
      Get the container entity identifier.
      Returns:
      conConnectorEntity
      See Also:
    • setConConnectorEntity

      public void setConConnectorEntity(String conConnectorEntity)
      Set the container entity identifier.

      Throws a NullArgumentException if argument is null.

      Parameters:
      conConnectorEntity - the con connector entity
      See Also:
    • isConUseMatchingMethod

      public boolean isConUseMatchingMethod()
      True if connector will use matching method as defined in entity manager.
      Returns:
      true if conUseMatchingMethod
    • setConUseMatchingMethod

      public void setConUseMatchingMethod(boolean conUseMatchingMethod)
      Sets that connector shall use matching method as defined in entity manager.
      Parameters:
      conUseMatchingMethod -
    • getConMatchingMethod

      public EntityMethodCall getConMatchingMethod()
      Get the Entity Matching Method to use. Matching method has to be defined in Entity Manager.
      Returns:
      conMatchingMethod
      See Also:
    • setConMatchingMethod

      public void setConMatchingMethod(EntityMethodCall conMatchingMethod)
      Set the Entity Matching Method to use. Matching method has to be defined in Entity Manager.

      Throws a NullArgumentException if argument is null.

      Parameters:
      conMatchingMethod - EntityMethodCall
    • isConCachingAllowed

      public boolean isConCachingAllowed()
      True if caching is generally allowed for the caching strategy specified.
      Returns:
      conCachingAllowed boolean
      See Also:
    • setConCachingAllowed

      public void setConCachingAllowed(boolean conCachingAllowed)
      Set if caching is generally allowed for the caching strategy specified.
      Parameters:
      conCachingAllowed -
      See Also:
    • getConCachingStrategy

      public Entity.CacheType getConCachingStrategy()
      Get current caching strategy for the entity.

      Either lifetime or cronjobdate.

      Returns:
      conCachingStrategy as Entity.CacheType
    • setConCachingStrategy

      public void setConCachingStrategy(Entity.CacheType conCachingStrategy)
      Sets the caching strategy for the entity
      Parameters:
      conCachingStrategy - the con caching strategy
      See Also:
    • getConLifetime

      public int getConLifetime()
      Get caching lifetime for this entity in seconds. Cache expires after this time and entity will reloaded from content system if requested again.
      Returns:
      conLifetime as int
    • setConLifetime

      public void setConLifetime(int conLifetime)
      Set caching lifetime for this entity in seconds.

      Throws a NullArgumentException if argument is null.

      Parameters:
      conLifetime -
    • getConCronjobdate

      public String getConCronjobdate()
      Controls when cache will be refreshed.
      Returns:
      conCronjobdate Format of the result: 0 min hour ? * days * where: - min (0 - 59) - hour (0 - 23) - days: days of the week separated by comma (MON,TUE,WED...) example: * 0 10 03 ? * MON,TUE,WED
    • setConCronjobdate

      public void setConCronjobdate(String conCronjobdate)
      Controls when cache will be refreshed.

      Throws a NullArgumentException if argument is null.

      Parameters:
      conCronjobdate -
    • getContextDefinitions

      public List<ContextDefinition> getContextDefinitions()
      Get the context definitions as a list.
      Returns:
      contextDefinitions as List of ContextDefinition
    • setContextDefinitions

      public void setContextDefinitions(List<ContextDefinition> contextDefinitions)
      Set the context definitions as a list.

      Throws a NullArgumentException if argument is null.

      Parameters:
      contextDefinitions -
    • isPublicEntity

      public boolean isPublicEntity()
      True if the entity is visible for modules outside of entity manager.
      Returns:
      publicEntity as boolean
    • setPublicEntity

      public void setPublicEntity(boolean publicEntity)
      Set if the entity is visible for modules outside of entity manager.
      Parameters:
      publicEntity -
    • getConConnectorEntityDescription

      public String getConConnectorEntityDescription()
      Get a description for the container entity identifier.
      Returns:
      description as String
    • setConConnectorEntityDescription

      public void setConConnectorEntityDescription(String conConnectorEntityDescription)
      Set a description for the container entity identifier.

      Throws a NullArgumentException if argument is null.

      Parameters:
      conConnectorEntityDescription -
    • getIconName

      public String getIconName()
      Get the name of the icon that will be used for graphic representation of the entity.
      Returns:
      name as String
    • setIconName

      public void setIconName(String iconName)
      Set the name of the icon that will be used for graphic representation of the entity.

      Throws a NullArgumentException if argument is null.

      Parameters:
      iconName -
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPluginConfigName

      protected String getPluginConfigName()
      Gets the name of this entity to use in plug-in configuration objects.
      Returns:
      string containing plug-in configuration name
    • getPluginConfigPath

      protected String getPluginConfigPath(String entityIdentifier)
      Gets the path of a dependent entity to use in plug-in configuration objects.
      Parameters:
      entityIdentifier -
      Returns:
      the path of a dependent entity as String
    • getPluginConfigPath

      public String getPluginConfigPath()
      Gets the path of this entity to use in plug-in configuration objects.
      Returns:
      path of this entity as String
    • toPluginConfig

      public PluginConfig toPluginConfig()
      Creates a plug-in configuration object for this entity with all dependencies.
      Returns:
      PluginConfig
    • getEntityDependencyNames

      public Set<String> getEntityDependencyNames()
      Collects all dependent entities of an entity including content entities, sub-entities and cord entities and returns a set of identifiers.
      Returns:
      set of dependency names
    • getContentMetaDataEntities

      public List<EntityDependency> getContentMetaDataEntities()
      Gets the dependent content meta data entities for the entity.

      Defaults to an empty list.

      Returns:
      List of EntityDependency
    • setContentMetaDataEntities

      public void setContentMetaDataEntities(List<EntityDependency> contentMetaDataEntities)
      Sets the dependent content meta data entities for the entity.

      Throws a NullArgumentException if argument is null.

      Parameters:
      contentMetaDataEntities -