Package mc.core.model.generic
Class Attribute
java.lang.Object
mc.core.model.base.EntityBase
mc.core.model.base.ComplexEntity
mc.core.model.generic.Attribute
- All Implemented Interfaces:
Serializable,IBaseEntity,ICollectionManaged,ICoreEntity,IEntity,IRightManaged,ISortableEntity,IStateManaged,ITypeManaged,IVersionManaged
@Entity
public class Attribute
extends ComplexEntity
implements IRightManaged, ICollectionManaged, IStateManaged, IVersionManaged
Attributes carry most of the information of complex entities, which make up their characteristics. An Attribute is
used to define a feature and is assigned to an complex entity. Usually the feature has a value or values which will
be added to the assignment. Except for territory dependent Attributes an Attribute can be assigned to a ComplexEntity
only once.
Most fields of an Attribute serve to define the value(s) in order to make editing of the feature described by this Attribute simpler and less prone to error.
Some properties with regard to defining the value(s):
It has a list of children that have values and are assigned to complexEntities. Such a group of Attributes can be assigned to a complexentity several times. enum
NONE: default, no attribute group
PARENT: the parent that defines the group
CHILD: a child Attribute in the group
Most fields of an Attribute serve to define the value(s) in order to make editing of the feature described by this Attribute simpler and less prone to error.
Some properties with regard to defining the value(s):
dataTypeForValue: mandatory except for Attributes whose AttributeType is of subtype
OBJECTS_STATIC
enumeration: if true values of the Attribute can only be selected, not freely added. The predefined values are stored in liststandardValuesmultivalue: if true Attribute can have more than one value
allowedUnits: optional, only use if dataTypeForValue allows for unit(s) in value. Narrow down
the choice of possible units.
minSizeForValue: for text values the minimum size of allowed text, for numeric values the
minimum value, used in validation of value
maxSizeForValue: for text values the maximum size of allowed text, for numeric values the
maximum value, used in validation of value
territoryDependent: if true the Attribute can be assigned for each active territory and have a
value/values
- TYPES: type attributes, the list of these Attributes is set by type of ComplexEntity and the same for all ComplexEntities of this type. The Attribute is only assigned to ComplexEntity when it has a value, when the value is removed also the assignment is removed.
- OBJECTS_VALUE: Attributes that can be assigned to ComplexEntity freely by the user and have values. AllowedAttributeTypes in ComplexEntityType constrain the choice of Attributes to be assigned.
- PRESENTATION: used as parameters to fine tune publication
- OBJECTS_STATIC: Attributes without a value, that are used as text blocks. The name of the Attribute holds the text.
It has a list of children that have values and are assigned to complexEntities. Such a group of Attributes can be assigned to a complexentity several times. enum
attributeGroup must be set depending on the role of an
Attribute in an attribute group:- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumno property fields, used as parameter constant and label keyNested classes/interfaces inherited from class mc.core.model.base.ComplexEntity
ComplexEntity.ComplexEntityComparatorNested classes/interfaces inherited from class mc.core.model.base.EntityBase
EntityBase.EntityComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intBIT FIELD FLAGS (the first 5 reserved or used for complex entity)
migrate data value (DVASset type) assignment by add new version/remove last versionFields inherited from class mc.core.model.base.EntityBase
INTDESC_COLUMN_LENGTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongive the maximum list of RightTypes that apply for this class.getDefaultValue(Locale locale) booleantype of ComplexEntity must be attached if existsgetSampleValue(Locale locale) type of ComplexEntity must be attachedgetType()override in derived classes, return null if ComplexEntity-subclass is not type managed.booleanbooleanDeprecated.booleanbooleantells if this attribute be used by faceted-searchbooleantells if the Attribute can be inherited when assigned to a ComplexEntities that is a HrcEntity.booleanbooleanbooleanbooleanbooleanFlag that indicates if the entities have a root collection per type or if there is only one global root collection.booleanbooleanbooleanbooleanDeprecated.voidsetAllowedPattern(String allowedPattern) voidsetAllowedUnits(List<Unit> allowedUnits) voidsetAttributeType(AttributeType attributeType) voidsetDataTypeForValue(DataType dataTypeForValue) voidsetDefaultValues(DataValueSet defaultValues) voidsetEnumeration(boolean isEnumeration) voidsetFacetable(boolean facetable) to allow this attribute for faceted-searchvoidsetInheritable(boolean isInheritable) voidsetMaxSizeForValue(Integer maxSizeForValue) voidsetMinSizeForValue(Integer minSizeForValue) voidsetMultivalue(boolean isMultivalue) voidsetReadonly(boolean isReadonly) voidsetReassignDataValues(boolean migrate) voidsetSampleValues(DataValueSet sampleValues) voidsetSearchable(boolean isSearchable) voidsetStandardValues(List<DataValueSet> standardValues) voidsetTerritoryDependent(boolean territoryDependent) voidsetType(ComplexTypeEntity type) override in derived classes if ComplexEntity-subclass is type managed, else do nothing.
be used by entity mapperMethods inherited from class mc.core.model.base.ComplexEntity
addState, getAttributes, getCollections, getCollections, getCollectionToCEs, getDateCreated, getDateModified, getEntityData, getEntityDatas, getEntityFilters, getEntityOwner, getExternalKey, getFileId, getFilename, getId, getLifeCycleFlag, getMasterId, getMasterLocale, getMemos, getParameter, getParameters, getParameterValue, getPermissions, getRelatedEntities, getState, getStates, getStatesToRemove, getVersions, getWatches, isArchived, isDeleted, isRightInheritanceDisabled, isSecondaryCollection, isVisible, setAttributes, setCollectionToCEs, setDateCreated, setDateModified, setEntityDatas, setEntityFilters, setEntityOwner, setExternalKey, setFileId, setFilename, setId, setLifeCycleFlag, setMasterId, setMasterLocale, setMemos, setParameters, setPermissions, setRelatedEntities, setRightInheritanceDisabled, setStates, setVersions, setWatchesMethods inherited from class mc.core.model.base.EntityBase
equals, getCollection, getDescription, getDescription, getFlag, getIsSystem, getName, getName, getNamespace, getPrio, hashCode, setCollection, setDescription, setDescription, setFlag, setInternalDescription, setIsSystem, setName, setName, setNamespace, setPrio, toStringMethods inherited from interface mc.core.model.base.IBaseEntity
getId, setIdMethods inherited from interface mc.core.model.base.ICollectionManaged
getCollection, setCollectionMethods inherited from interface mc.core.model.base.IEntity
getDescription, getName, getPrio, setInternalDescriptionMethods inherited from interface mc.core.model.base.IRightManaged
getPermissionsMethods inherited from interface mc.core.model.base.IStateManaged
getState, getStates
-
Field Details
-
FLAG_REASSIGN_DATAVALUES
public static final int FLAG_REASSIGN_DATAVALUESBIT FIELD FLAGS (the first 5 reserved or used for complex entity)
migrate data value (DVASset type) assignment by add new version/remove last version- See Also:
-
-
Constructor Details
-
Attribute
public Attribute() -
Attribute
-
-
Method Details
-
isMultivalue
public boolean isMultivalue() -
setMultivalue
public void setMultivalue(boolean isMultivalue) -
isEnumeration
public boolean isEnumeration() -
setEnumeration
public void setEnumeration(boolean isEnumeration) -
isReadonly
public boolean isReadonly()- Returns:
trueif this attribute is read-only from a user perspective. API calls are not affected by this setting.
-
setReadonly
public void setReadonly(boolean isReadonly) - Parameters:
isReadonly-trueto make this attribute read-only from a user perspective. API calls are not restricted by this setting.
-
isSearchable
public boolean isSearchable() -
setSearchable
public void setSearchable(boolean isSearchable) -
isFacetable
public boolean isFacetable()tells if this attribute be used by faceted-search- Returns:
- boolean
-
setFacetable
public void setFacetable(boolean facetable) to allow this attribute for faceted-search -
isInheritable
public boolean isInheritable()tells if the Attribute can be inherited when assigned to a ComplexEntities that is a HrcEntity. If yes Attribute will be displayed also in offspring, without being assigned itself. Only when child overwrites the value will the Attribute get assigned.- Returns:
- boolean
-
setInheritable
public void setInheritable(boolean isInheritable) -
isTerritoryDependent
public boolean isTerritoryDependent() -
setTerritoryDependent
public void setTerritoryDependent(boolean territoryDependent) -
getAllowedUnits
-
setAllowedUnits
-
getDataTypeForValue
-
setDataTypeForValue
-
getStandardValues
-
setStandardValues
-
getDefaultValues
-
setDefaultValues
-
getSampleValues
-
setSampleValues
-
getAttributeType
-
setAttributeType
-
setType
Description copied from class:ComplexEntityoverride in derived classes if ComplexEntity-subclass is type managed, else do nothing.
be used by entity mapper- Overrides:
setTypein classComplexEntity
-
getMaxSizeForValue
- Returns:
- Maximum number of characters of value for texts. Maximum value for numbers.
-
setMaxSizeForValue
- Parameters:
maxSizeForValue- Maximum number of characters of value for texts. Maximum value for numbers.
-
getMinSizeForValue
- Returns:
- Minimum number of characters of value for texts. Minimum value for numbers.
-
setMinSizeForValue
- Parameters:
minSizeForValue- Minimum number of characters of value for texts. Minimum value for numbers.
-
getAllowedPattern
-
setAllowedPattern
-
isTypeAttribute
Deprecated. -
isConfigType
Deprecated. -
getDefaultValue
- Parameters:
locale- Locale if Datatype is locale dependent, is ignored for locale independent Datatypes (can be null)- Returns:
- default DataValue for given locale if exist and if datavalue is locale dependent, for locale independent returns the first datavalue if exist, otherwise null
-
getSampleValue
- Parameters:
locale- Locale if Datatype is locale dependent, is ignored for locale independent Datatypes (can be null)- Returns:
- sample DataValue for given locale if exist and if datavalue is locale dependent, for locale independent returns the first datavalue if exist, otherwise null
-
isPresentationAttribute
public boolean isPresentationAttribute() -
getHasObjectRights
public boolean getHasObjectRights()Description copied from class:ComplexEntitytype of ComplexEntity must be attached if exists- Specified by:
getHasObjectRightsin interfaceIRightManaged- Overrides:
getHasObjectRightsin classComplexEntity- Returns:
- true if object rights are configured for this ComplexEntity
-
getStateGroupTypes
Description copied from class:ComplexEntitytype of ComplexEntity must be attached- Specified by:
getStateGroupTypesin interfaceIStateManaged- Overrides:
getStateGroupTypesin classComplexEntity- Returns:
- List of StateGroupType configured for this ComplexEntity, is no type of nothing configured empty list
-
getType
Description copied from class:ComplexEntityoverride in derived classes, return null if ComplexEntity-subclass is not type managed.- Specified by:
getTypein interfaceICollectionManaged- Specified by:
getTypein interfaceITypeManaged- Specified by:
getTypein classComplexEntity
-
isRootPerType
public boolean isRootPerType()Description copied from interface:ICollectionManagedFlag that indicates if the entities have a root collection per type or if there is only one global root collection. if rootPerType true it can only apply to entities that have a type, i.e. ComplexEntities.- Specified by:
isRootPerTypein interfaceICollectionManaged
-
getAllowedRightTypes
Description copied from interface:IRightManagedgive the maximum list of RightTypes that apply for this class.- Specified by:
getAllowedRightTypesin interfaceIRightManaged- Returns:
- array of enum RightType
-
isSearchRelevant
public boolean isSearchRelevant() -
getInternalDescription
- Specified by:
getInternalDescriptionin interfaceIEntity- Overrides:
getInternalDescriptionin classComplexEntity- Returns:
- Unique identifier in combination with entity class if internalDescription property is defined as unique.
Might be
null.
-
hasStandardValues
public boolean hasStandardValues() -
isReassignDataValues
public boolean isReassignDataValues() -
setReassignDataValues
public void setReassignDataValues(boolean migrate)
-