Class KeyValue
- java.lang.Object
-
- com.priint.pubserver.plugin.entitydata.KeyValue
-
- All Implemented Interfaces:
GetContext,GetIdentifier,GetSequence,EntityData,PersistentData,java.io.Serializable
@Entity public class KeyValue extends java.lang.Object implements java.io.Serializable, GetContext, GetIdentifier, GetSequence, EntityData, PersistentData
Data object for entity type KeyValue
KeyValue data are used for example for technical attributes of a product like weight, or size etc.
- Since:
- 4.0.0, 4.0.5 origin attribute supported, parentKeyValue and refKeyValue are to be referenced and not included, added JPA annotations, getLanguage() and getCountry() are deprecated
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKeyValue.properties
-
Constructor Summary
Constructors Constructor Description KeyValue()Default constructor.KeyValue(java.lang.String identifier, java.lang.String key, java.lang.String value, java.lang.String dataType, java.lang.String entityKeyValueId, Context context, Bucket bucket)Creates a KeyValueKeyValue(java.lang.String identifier, java.lang.String key, java.lang.String keyLabel, java.lang.String value, java.lang.String dataType, java.lang.String entityKeyValueId, Context context, java.lang.String bucketId, java.lang.String createdBy, java.util.Date createdOn, java.lang.String updatedBy, java.util.Date updatedOn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BucketgetBucket()java.lang.StringgetBucketId()BucketgetBucketMetaData()ConnectorEntitygetConnectorEntity()java.util.List<ContentMetaData>getContentMetaData()ContextgetContext()Get the context for this element ornullif not set.CordgetCord()java.lang.StringgetCreatedBy()java.util.DategetCreatedOn()java.lang.StringgetDataType()EntityKeyValuegetEntity()java.lang.StringgetEntityIdentifier()Identifier of an entity in the entity model where the current object refers to.java.lang.StringgetEntityKeyValueId()java.lang.StringgetGroupIdentifier()String key for grouping key values of the same type.java.lang.StringgetIdentifier()Get the string identifier of the keyvalue.java.lang.StringgetKey()java.lang.StringgetKeyLabel()java.lang.StringgetKeySymbol()MediaAssetgetMediaAsset()MediaObjectgetMediaObject()java.util.List<KeyValue>getMetaData()KeyValuegetMetaDataParent()java.lang.StringgetOrigin()KeyValuegetParentKeyValue()java.lang.StringgetParentKeyValueId()PricegetPrice()KeyValuegetRefKeyValue()java.lang.StringgetRefKeyValueId()intgetSequence()Get sequence number for the keyvalue as given in the content system.java.lang.StringgetSource()java.util.List<KeyValue>getSubKeyValues()TableDataCellgetTableCell()TableDatagetTableData()TableDataRowgetTableRow()java.lang.StringgetTemplate()TextgetText()java.lang.StringgetTimestamp()Get timestamp from the content system.java.lang.StringgetUpdatedBy()java.util.DategetUpdatedOn()java.lang.StringgetValue()java.lang.StringgetVersion()Version string from the content systemvoidsetBucket(Bucket bucket)Sets bucket and bucketId.voidsetBucketId(java.lang.String bucketId)Sets bucketId and eventually removes current bucket if it does not match the idvoidsetBucketMetaData(Bucket bucketMetaData)voidsetConnectorEntity(ConnectorEntity connectorEntity)voidsetContentMetaData(java.util.List<ContentMetaData> contentMetaData)voidsetContext(Context context)set the context of entity data objectvoidsetCord(Cord cord)voidsetCreatedBy(java.lang.String createdBy)voidsetCreatedOn(java.util.Date createdOn)voidsetDataType(java.lang.String dataType)voidsetEntity(EntityKeyValue entityKeyValue)Sets entityKeyValue and entityKeyValueId.voidsetEntityIdentifier(java.lang.String entityIdentifier)Identifier of an entity in the entity model where the current object refers to.voidsetEntityKeyValueId(java.lang.String entityKeyValueId)Sets entityKeyValueId and eventually removes current entityKeyValue if it does not match the idvoidsetGroupIdentifier(java.lang.String groupIdentifier)voidsetIdentifier(java.lang.String identifier)voidsetKey(java.lang.String key)voidsetKeyLabel(java.lang.String keyLabel)voidsetKeySymbol(java.lang.String keySymbol)voidsetMediaAsset(MediaAsset mediaAsset)voidsetMediaObject(MediaObject mediaObject)voidsetMetaData(java.util.List<KeyValue> metaData)voidsetMetaDataParent(KeyValue metaDataParent)voidsetOrigin(java.lang.String origin)voidsetParentKeyValue(KeyValue parentKeyValue)voidsetParentKeyValueId(java.lang.String parentKeyValueId)Sets parentKeyValueId and eventually removes current parentKeyValue if it does not match the idvoidsetPrice(Price price)voidsetRefKeyValue(KeyValue refKeyValue)voidsetRefKeyValueId(java.lang.String refKeyValueId)Sets refKeyValueId and eventually removes current refKeyValue if it does not match the idvoidsetSequence(int sequence)voidsetSource(java.lang.String source)voidsetSubKeyValues(java.util.List<KeyValue> subKeyValues)voidsetTableCell(TableDataCell tableCell)voidsetTableData(TableData tableData)voidsetTableRow(TableDataRow tableRow)voidsetTemplate(java.lang.String template)voidsetText(Text text)voidsetTimestamp(java.lang.String timestamp)voidsetUpdatedBy(java.lang.String updatedBy)voidsetUpdatedOn(java.util.Date updatedOn)voidsetValue(java.lang.String value)voidsetVersion(java.lang.String version)java.lang.StringtoString()
-
-
-
Constructor Detail
-
KeyValue
public KeyValue()
Default constructor.
-
KeyValue
public KeyValue(java.lang.String identifier, java.lang.String key, java.lang.String value, java.lang.String dataType, java.lang.String entityKeyValueId, Context context, Bucket bucket)Creates a KeyValue- Parameters:
identifier-getIdentifier()key-getKey()value-getValue()dataType-getDataType()entityKeyValueId-getEntityKeyValueId()context-getContext()bucket-getBucket()
-
KeyValue
public KeyValue(java.lang.String identifier, java.lang.String key, java.lang.String keyLabel, java.lang.String value, java.lang.String dataType, java.lang.String entityKeyValueId, Context context, java.lang.String bucketId, java.lang.String createdBy, java.util.Date createdOn, java.lang.String updatedBy, java.util.Date updatedOn)- Parameters:
identifier-getIdentifier()key-getKey()keyLabel-getKeyLabel()value-getValue()dataType-getDataType()entityKeyValueId-getEntityKeyValueId()context-getContext()bucketId-getBucketId()createdBy-getCreatedBy()createdOn-getCreatedOn()updatedBy-getUpdatedBy()updatedOn-getUpdatedOn()
-
-
Method Detail
-
getIdentifier
public java.lang.String getIdentifier()
Get the string identifier of the keyvalue.- Specified by:
getIdentifierin interfaceEntityData- Specified by:
getIdentifierin interfaceGetIdentifier- Specified by:
getIdentifierin interfacePersistentData- Returns:
- identifier string or
nullif not set
-
setIdentifier
public void setIdentifier(java.lang.String identifier)
- Specified by:
setIdentifierin interfaceEntityData- Parameters:
identifier- seegetIdentifier()
-
getGroupIdentifier
public java.lang.String getGroupIdentifier()
String key for grouping key values of the same type.- Returns:
- group identifier string or
nullif not set
-
setGroupIdentifier
public void setGroupIdentifier(java.lang.String groupIdentifier)
- Parameters:
groupIdentifier- seegetGroupIdentifier()
-
getVersion
public java.lang.String getVersion()
Version string from the content system- Returns:
- version string or
nullif not set
-
setVersion
public void setVersion(java.lang.String version)
- Parameters:
version- seegetVersion()
-
getTimestamp
public java.lang.String getTimestamp()
Get timestamp from the content system.Timestamp is used as a string to support differing types of timestamp representation as used by different content system. publishing server does not validate any format of this string.
- Returns:
- timestamp string
-
setTimestamp
public void setTimestamp(java.lang.String timestamp)
- Parameters:
timestamp- seegetTimestamp()
-
getTemplate
public java.lang.String getTemplate()
- Returns:
- String identifier of the template to render this content.
-
setTemplate
public void setTemplate(java.lang.String template)
- Parameters:
template-getTemplate()
-
getConnectorEntity
public ConnectorEntity getConnectorEntity()
- Returns:
- connector entity object or
nullif not set
-
setConnectorEntity
public void setConnectorEntity(ConnectorEntity connectorEntity)
- Parameters:
connectorEntity- seegetConnectorEntity()
-
getKey
public java.lang.String getKey()
- Returns:
- Name of the key, e.g. "length"
-
setKey
public void setKey(java.lang.String key)
- Parameters:
key-getKey()
-
getKeyLabel
public java.lang.String getKeyLabel()
- Returns:
- Label for the key. Used for publishing, if key itself is something like a code.
-
setKeyLabel
public void setKeyLabel(java.lang.String keyLabel)
- Parameters:
keyLabel-getKeyLabel()
-
getValue
public java.lang.String getValue()
- Returns:
- Value of the key-value object, e.g. "12.3" for a key named "length".
Value is always a string. You may use dataType property for specifying the preferred type.
-
setValue
public void setValue(java.lang.String value)
- Parameters:
value-getValue()
-
getDataType
public java.lang.String getDataType()
- Returns:
- Data type of the value (String, int, float, boolean).
There is no vocabulary explicitly restricting the values of this property.
-
setDataType
public void setDataType(java.lang.String dataType)
- Parameters:
dataType-getDataType()
-
getSource
public java.lang.String getSource()
- Returns:
- origin of the KeyValue, i.e. whether it comes from the connector or entity manager.
This property is set from the publishing server.
-
setSource
public void setSource(java.lang.String source)
- Parameters:
source-getSource()
-
getSequence
public int getSequence()
Get sequence number for the keyvalue as given in the content system.This should reflect the position of the current keyvalue in the sorting of keyvalues of its bucket.
- Specified by:
getSequencein interfaceGetSequence- Returns:
- ordered position within a list sequenceable objects
-
setSequence
public void setSequence(int sequence)
- Parameters:
sequence- seegetSequence()
-
getRefKeyValue
public KeyValue getRefKeyValue()
- Returns:
- link to a referenced keyValue (like "Kilogramm")
-
setRefKeyValue
public void setRefKeyValue(KeyValue refKeyValue)
- Parameters:
refKeyValue-getRefKeyValue()
-
getParentKeyValue
public KeyValue getParentKeyValue()
- Returns:
- link to parent KeyValue
-
setParentKeyValue
public void setParentKeyValue(KeyValue parentKeyValue)
- Parameters:
parentKeyValue-getParentKeyValue()
-
getEntity
public EntityKeyValue getEntity()
- Returns:
- Entity from Entity Model
-
setEntity
public void setEntity(EntityKeyValue entityKeyValue)
Sets entityKeyValue and entityKeyValueId.- Parameters:
entityKeyValue-getEntity()- See Also:
setEntityKeyValueId(String)
-
getContext
public Context getContext()
Get the context for this element ornullif not set.- Specified by:
getContextin interfaceEntityData- Specified by:
getContextin interfaceGetContext- Returns:
- context
-
setContext
public void setContext(Context context)
Description copied from interface:EntityDataset the context of entity data object- Specified by:
setContextin interfaceEntityData- Parameters:
context-getContext()
-
getBucket
public Bucket getBucket()
- Returns:
- Parent bucket that this keyValue is related to.
-
setBucket
public void setBucket(Bucket bucket)
Sets bucket and bucketId.- Parameters:
bucket-getBucket()- See Also:
setBucketId(String)
-
getMetaData
public java.util.List<KeyValue> getMetaData()
- Returns:
- List of meta data related to the bucket or empty list.
List is LAZY loaded.
-
setMetaData
public void setMetaData(java.util.List<KeyValue> metaData)
- Parameters:
metaData- seegetMetaData()
-
getSubKeyValues
public java.util.List<KeyValue> getSubKeyValues()
- Returns:
- List of KeyValues related to KeyValue.
List is LAZY loaded.
-
setSubKeyValues
public void setSubKeyValues(java.util.List<KeyValue> subKeyValues)
- Parameters:
subKeyValues-getSubKeyValues()
-
getEntityKeyValueId
public java.lang.String getEntityKeyValueId()
- Returns:
- Identifier of related entity in entity model.
-
setEntityKeyValueId
public void setEntityKeyValueId(java.lang.String entityKeyValueId)
Sets entityKeyValueId and eventually removes current entityKeyValue if it does not match the id- Parameters:
entityKeyValueId-getEntityKeyValueId()
-
getBucketId
public java.lang.String getBucketId()
- Returns:
- Identifier of parent bucket that this content element is related to. Is null for following methods:
EntityManagerRemote.getEntityKeyValuesOfBucket(String, String, String, String, String, Context, String)EntityManagerRemote.getEntityKeyValuesByIdentifier(String, String, String, String, Context, String)EntityManagerRemote.getEntityKeyValuesOfPlanning(String, String, String, String, String, Context, String, String)}EntityManagerRemote.getEntityKeyValuesOfPlannedBucket(String, String, String, String, Context, String)}
-
setBucketId
public void setBucketId(java.lang.String bucketId)
Sets bucketId and eventually removes current bucket if it does not match the id- Parameters:
bucketId-getBucketId()
-
getKeySymbol
public java.lang.String getKeySymbol()
- Returns:
- Symbol for key
-
setKeySymbol
public void setKeySymbol(java.lang.String keySymbol)
- Parameters:
keySymbol-getKeySymbol()
-
getCreatedBy
public java.lang.String getCreatedBy()
- Returns:
- creation user or
nullif not set
-
setCreatedBy
public void setCreatedBy(java.lang.String createdBy)
- Parameters:
createdBy- seegetCreatedBy()
-
getCreatedOn
public java.util.Date getCreatedOn()
- Returns:
- creation date or
nullif not set
-
setCreatedOn
public void setCreatedOn(java.util.Date createdOn)
- Parameters:
createdOn- seegetCreatedOn()
-
getUpdatedBy
public java.lang.String getUpdatedBy()
- Returns:
- last modified user or
nullif not set
-
setUpdatedBy
public void setUpdatedBy(java.lang.String updatedBy)
- Parameters:
updatedBy- seegetUpdatedBy()
-
getUpdatedOn
public java.util.Date getUpdatedOn()
- Returns:
- last modified date or
nullif not set
-
setUpdatedOn
public void setUpdatedOn(java.util.Date updatedOn)
- Parameters:
updatedOn- seegetUpdatedOn()
-
getText
public Text getText()
-
setText
public void setText(Text text)
-
getTableData
public TableData getTableData()
-
setTableData
public void setTableData(TableData tableData)
-
getMediaObject
public MediaObject getMediaObject()
-
setMediaObject
public void setMediaObject(MediaObject mediaObject)
-
getPrice
public Price getPrice()
-
setPrice
public void setPrice(Price price)
-
getMediaAsset
public MediaAsset getMediaAsset()
-
setMediaAsset
public void setMediaAsset(MediaAsset mediaAsset)
-
getMetaDataParent
public KeyValue getMetaDataParent()
-
setMetaDataParent
public void setMetaDataParent(KeyValue metaDataParent)
-
getCord
public Cord getCord()
-
setCord
public void setCord(Cord cord)
-
getTableRow
public TableDataRow getTableRow()
-
setTableRow
public void setTableRow(TableDataRow tableRow)
-
getBucketMetaData
public Bucket getBucketMetaData()
-
setBucketMetaData
public void setBucketMetaData(Bucket bucketMetaData)
-
getTableCell
public TableDataCell getTableCell()
-
setTableCell
public void setTableCell(TableDataCell tableCell)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getRefKeyValueId
public final java.lang.String getRefKeyValueId()
- Returns:
- Identifier of related keyValue, e.g. a unit. Is null for following methods:
EntityManagerRemote.getEntityKeyValuesOfBucket(String, String, String, String, String, Context, String)EntityManagerRemote.getEntityKeyValuesByIdentifier(String, String, String, String, Context, String)EntityManagerRemote.getEntityKeyValuesOfPlanning(String, String, String, String, String, Context, String, String)}EntityManagerRemote.getEntityKeyValuesOfPlannedBucket(String, String, String, String, Context, String)}
-
setRefKeyValueId
public final void setRefKeyValueId(java.lang.String refKeyValueId)
Sets refKeyValueId and eventually removes current refKeyValue if it does not match the id- Parameters:
refKeyValueId-getRefKeyValueId()
-
getParentKeyValueId
public final java.lang.String getParentKeyValueId()
- Returns:
- Identifier of parent keyValue. Is null for following methods:
EntityManagerRemote.getEntityKeyValuesOfBucket(String, String, String, String, String, Context, String)EntityManagerRemote.getEntityKeyValuesByIdentifier(String, String, String, String, Context, String)EntityManagerRemote.getEntityKeyValuesOfPlanning(String, String, String, String, String, Context, String, String)}EntityManagerRemote.getEntityKeyValuesOfPlannedBucket(String, String, String, String, Context, String)}
-
setParentKeyValueId
public final void setParentKeyValueId(java.lang.String parentKeyValueId)
Sets parentKeyValueId and eventually removes current parentKeyValue if it does not match the id- Parameters:
parentKeyValueId-getParentKeyValueId()
-
getOrigin
public java.lang.String getOrigin()
- Returns:
- Origin of data entity object, e.g. name of the source system. This property is filled by the connector. Might return
null.
-
setOrigin
public void setOrigin(java.lang.String origin)
- Parameters:
origin-getOrigin()
-
getEntityIdentifier
public java.lang.String getEntityIdentifier()
Description copied from interface:EntityDataIdentifier of an entity in the entity model where the current object refers to.- Specified by:
getEntityIdentifierin interfaceEntityData- Returns:
- entity identifier as string
-
setEntityIdentifier
public void setEntityIdentifier(java.lang.String entityIdentifier)
Description copied from interface:EntityDataIdentifier of an entity in the entity model where the current object refers to.- Specified by:
setEntityIdentifierin interfaceEntityData
-
getContentMetaData
public java.util.List<ContentMetaData> getContentMetaData()
- Returns:
- List of ContentMetaData related to KeyValue.
List is not loaded by Entity Manager in its standard methods. Use specific Entity Manager methods for loading.
-
setContentMetaData
public void setContentMetaData(java.util.List<ContentMetaData> contentMetaData)
- Parameters:
contentMetaData-getContentMetaData()
-
-