@Entity public class StructuredContentImpl extends Object implements StructuredContent, AdminMainEntity, ProfileEntity
Modifier and Type | Class and Description |
---|---|
static class |
StructuredContentImpl.Presentation |
Modifier and Type | Field and Description |
---|---|
protected String |
contentName |
protected Map<String,String> |
fieldValuesMap |
protected Long |
id |
protected Map<String,StructuredContentField> |
legacyStructuredContentFields |
protected Locale |
locale |
protected Boolean |
offlineFlag |
protected Integer |
priority |
protected Set<StructuredContentItemCriteria> |
qualifyingItemCriteria |
static String |
SC_DONT_DUPLICATE_SC_TYPE_HINT |
protected Map<String,StructuredContentFieldXref> |
structuredContentFields |
protected StructuredContentType |
structuredContentType |
MAIN_ENTITY_NAME_PROPERTY
Constructor and Description |
---|
StructuredContentImpl() |
Modifier and Type | Method and Description |
---|---|
<G extends StructuredContent> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
String |
getContentName()
Gets the name.
|
String |
getFieldValue(String fieldName)
Returns the value of the associated
StructuredContentField if the given fieldName
exists in the map returned by StructuredContent.getStructuredContentFieldXrefs() , and null otherwise. |
Map<String,String> |
getFieldValues() |
Long |
getId()
Gets the primary key.
|
Locale |
getLocale()
Gets the
Locale associated with this content item. |
String |
getMainEntityName() |
Boolean |
getOfflineFlag()
Returns the offlineFlag.
|
Integer |
getPriority()
Gets the integer priority of this content item.
|
Set<StructuredContentItemCriteria> |
getQualifyingItemCriteria() |
Map<String,StructuredContentField> |
getStructuredContentFields()
Deprecated.
|
Map<String,StructuredContentFieldXref> |
getStructuredContentFieldXrefs()
NOTE: This method is typically only used when wanting to persist new
StructuredContentField s. |
Map<String,StructuredContentRule> |
getStructuredContentMatchRules() |
StructuredContentType |
getStructuredContentType()
Gets the
StructuredContentType associated with this content item. |
void |
setContentName(String contentName)
Sets the name.
|
void |
setFieldValues(Map<String,String> fieldValuesMap)
Sets the transient fieldValues map on this StructuredContent.
|
void |
setId(Long id)
Sets the primary key.
|
void |
setLocale(Locale locale)
Sets the locale associated with this content item.
|
void |
setOfflineFlag(Boolean offlineFlag)
Sets the offline flag.
|
void |
setPriority(Integer priority)
Sets the display priority of this item.
|
void |
setQualifyingItemCriteria(Set<StructuredContentItemCriteria> qualifyingItemCriteria) |
void |
setStructuredContentFields(Map<String,StructuredContentField> structuredContentFields) |
void |
setStructuredContentFieldXrefs(Map<String,StructuredContentFieldXref> structuredContentFields)
Sets the structured content fields for this item.
|
void |
setStructuredContentMatchRules(Map<String,StructuredContentRule> structuredContentMatchRules) |
void |
setStructuredContentType(StructuredContentType structuredContentType)
Sets the
StructuredContentType associated with this content item. |
public static final String SC_DONT_DUPLICATE_SC_TYPE_HINT
protected Long id
protected String contentName
protected Locale locale
protected Integer priority
protected Set<StructuredContentItemCriteria> qualifyingItemCriteria
protected StructuredContentType structuredContentType
protected Map<String,StructuredContentFieldXref> structuredContentFields
protected Map<String,StructuredContentField> legacyStructuredContentFields
protected Boolean offlineFlag
public Long getId()
StructuredContent
getId
in interface StructuredContent
public void setId(Long id)
StructuredContent
setId
in interface StructuredContent
id
- the new primary keypublic String getContentName()
StructuredContent
getContentName
in interface StructuredContent
public void setContentName(String contentName)
StructuredContent
setContentName
in interface StructuredContent
public Locale getLocale()
StructuredContent
Locale
associated with this content item.getLocale
in interface StructuredContent
public void setLocale(Locale locale)
StructuredContent
setLocale
in interface StructuredContent
public StructuredContentType getStructuredContentType()
StructuredContent
StructuredContentType
associated with this content item.getStructuredContentType
in interface StructuredContent
public void setStructuredContentType(StructuredContentType structuredContentType)
StructuredContent
StructuredContentType
associated with this content item.setStructuredContentType
in interface StructuredContent
@Deprecated public Map<String,StructuredContentField> getStructuredContentFields()
getStructuredContentFields
in interface StructuredContent
public void setStructuredContentFields(Map<String,StructuredContentField> structuredContentFields)
setStructuredContentFields
in interface StructuredContent
public Map<String,StructuredContentFieldXref> getStructuredContentFieldXrefs()
StructuredContent
StructuredContentField
s.
Users trying to get a field to render should typically invoke StructuredContent.getFieldValues()
.
Gets a map with the custom fields associated with this content item.StructuredContentType
of ad which defined a field
named targetUrl. The field could be accessed with
structuredContentItem.getStructuredContentFields().get("targetUrl")
getStructuredContentFieldXrefs
in interface StructuredContent
public void setStructuredContentFieldXrefs(@Nullable Map<String,StructuredContentFieldXref> structuredContentFields)
StructuredContent
setStructuredContentFieldXrefs
in interface StructuredContent
public String getFieldValue(String fieldName)
StructuredContent
StructuredContentField
if the given fieldName
exists in the map returned by StructuredContent.getStructuredContentFieldXrefs()
, and null otherwise.getFieldValue
in interface StructuredContent
public void setFieldValues(Map<String,String> fieldValuesMap)
StructuredContent
setFieldValues
in interface StructuredContent
public Map<String,String> getFieldValues()
getFieldValues
in interface StructuredContent
StructuredContentField
field key names to their associated valuespublic Boolean getOfflineFlag()
StructuredContent
getOfflineFlag
in interface StructuredContent
public void setOfflineFlag(Boolean offlineFlag)
StructuredContent
setOfflineFlag
in interface StructuredContent
public Integer getPriority()
StructuredContent
getPriority
in interface StructuredContent
public void setPriority(Integer priority)
StructuredContent
setPriority
in interface StructuredContent
public Map<String,StructuredContentRule> getStructuredContentMatchRules()
getStructuredContentMatchRules
in interface StructuredContent
public void setStructuredContentMatchRules(Map<String,StructuredContentRule> structuredContentMatchRules)
setStructuredContentMatchRules
in interface StructuredContent
public Set<StructuredContentItemCriteria> getQualifyingItemCriteria()
getQualifyingItemCriteria
in interface StructuredContent
public void setQualifyingItemCriteria(Set<StructuredContentItemCriteria> qualifyingItemCriteria)
setQualifyingItemCriteria
in interface StructuredContent
public String getMainEntityName()
getMainEntityName
in interface AdminMainEntity
public <G extends StructuredContent> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException
MultiTenantCloneable
public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException {
CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context);
if (createResponse.isAlreadyPopulated()) {
return createResponse;
}
MyClass myClone = createResponse.getClone();
//copy extended field values on myClone here
return createResponse;
}
Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity:
public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException {
CreateResponse createResponse = context.createOrRetrieveCopyInstance(this);
MyClass myClone = createResponse.getClone();
//copy extended field values on myClone here
return createResponse;
}
createOrRetrieveCopyInstance
in interface MultiTenantCloneable<StructuredContent>
context
- a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException
- if there's a problem detected with the cloning configurationCopyright © 2022. All rights reserved.