public class FacetMeta extends Object implements ISection, TransientAwareModel, Identifiable<String>, Displayable, org.springframework.beans.factory.BeanNameAware
Modifier and Type | Class and Description |
---|---|
static class |
FacetMeta.TemplateAttributes
Deprecated.
- TODO : Use a more dynamic way
|
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIB_ENCODING
From the
attributes will return Boolean . |
static String |
ATTRIB_FILTER
A server side filter on the content.
|
static String |
ATTRIB_INDEX
If an Array is being used or
isCollectionType() is true, then one can map more fine grained meta properties to particular index within the array or collection starting from 0. |
static String |
ATTRIB_NAMESPACE
A facet can be given a namespace, so that in Content situations one can embed facets not just directly under the main container but deeper as components of components.
|
static String |
ATTRIB_SUB_TYPE
getType() defines the generic nature, however there can be sub-classification of type. |
static String |
ATTRIB_TAG_ATTRIBS
Allow to specify a List of List of attribute name, attribute value, (optionally) any delimiter to use while merging.
|
static org.apache.commons.collections.Transformer |
FACET_IDENTIFIER |
Constructor and Description |
---|
FacetMeta() |
FacetMeta(FacetMeta facetMeta) |
Modifier and Type | Method and Description |
---|---|
Boolean |
getAssignIndependentModel()
In
EntityDetailsTemplatePanel while form processings, some fields may share the Form Compound model. |
Object |
getAttribute(String key) |
Map<String,Object> |
getAttributes()
Custom properties for the given meta informations that can be shared by all
adapters and
Transformer s of this FacetMeta |
CustomItemComponentRenderAdapter |
getCustomItemRenderAdapter()
Customize how an Item is rendered within the form.
|
CustomTemplateRenderAdapter |
getCustomTemplateRenderAdapter()
Any custom way to render a field in a template
(In Edit mode), not final rendering
|
org.apache.commons.collections.Transformer |
getDecodeEditorTransformer()
Allows to decode the encoding done by
encodeEditorTransformer when loading in the CMS Editor |
Object |
getDefaultvalue()
Static Object or
Transformer s (that consumes ModelObject), applied if the value is null and only null (Blanks etc will not demand a default value substitution)
If Data Type is a Collection then the type should be a Collection type to match the required model |
String |
getDisplayName() |
org.apache.commons.collections.Transformer |
getDisplayTransformer()
During Rendering of the data one can apply this;
The transformer can be applied on non String objects also.
|
org.apache.commons.collections.Transformer |
getEncodeEditorTransformer()
Due to dynamic nature of content, security etc.
|
String |
getId() |
Boolean |
getIncludeAsField()
If we do not wish to annotate the Field in the entity, and want the
TemplatePanel to pick it up as a field. |
Object |
getLookup()
|
String |
getName()
Name is case sensitive
|
FacetMeta |
getParent()
|
String |
getRenderComponentName()
An optional String that is used to represent which UI Component will be responsible for rendering this
FacetMeta . |
org.apache.commons.collections.Transformer |
getSubmitTransformer()
During Submission of the data one can apply this.
|
ContentType |
getType() |
Boolean |
isCollectionType()
The facet has a collection and the
ContentType is implied on the elements in the collection and not the collection itself.When this is true, for each element in the Collection a separate Component is rendered. |
boolean |
isFieldType()
Can be a field or an other (like Attribute type)
|
boolean |
isHypothetical()
Hypothetical facets are derived (read only) facets that cannot participate in the submission process.
They are NOT properties of the template entity. |
boolean |
isSupplement()
The FacetMeta supplements some other form/carrier and hence should be merged if there is a situation
where multiple meta information are applicable.
|
boolean |
isTransientLost()
If returns true means all transient values were lost.
|
void |
recoverTransient()
If
TransientAwareModel.isTransientLost() then a way to recover its transient values. |
void |
setAssignIndependentModel(Boolean assignIndependentModel)
In
EntityDetailsTemplatePanel while form processings, some fields may share the Form Compound model. |
void |
setAttributes(Map<String,Object> attributes)
Custom properties for the given meta informations that can be shared by all
adapters and
Transformer s of this FacetMeta |
void |
setBeanName(String name) |
void |
setCollectionType(Boolean collectionType)
The facet has a collection and the
ContentType is implied on the elements in the collection and not the collection itself.When this is true, for each element in the Collection a separate Component is rendered. |
void |
setCustomItemRenderAdapter(CustomItemComponentRenderAdapter customItemRenderAdapter)
Customize how an Item is rendered within the form.
|
void |
setCustomTemplateRenderAdapter(CustomTemplateRenderAdapter customTemplateRenderAdapter)
Any custom way to render a field in a template
(In Edit mode), not final rendering
|
void |
setDecodeEditorTransformer(org.apache.commons.collections.Transformer decodeEditorTransformer)
Allows to decode the encoding done by
encodeEditorTransformer when loading in the CMS Editor |
void |
setDefaultvalue(Object defaultvalue)
Static Object or
Transformer s (that consumes ModelObject), applied if the value is null and only null (Blanks etc will not demand a default value substitution)
If Data Type is a Collection then the type should be a Collection type to match the required model |
void |
setDisplayName(String displayName) |
void |
setDisplayTransformer(org.apache.commons.collections.Transformer decodeTransformer)
During Rendering of the data one can apply this;
The transformer can be applied on non String objects also.
|
void |
setEncodeEditorTransformer(org.apache.commons.collections.Transformer encodeTransformer)
Due to dynamic nature of content, security etc.
|
void |
setHypothetical(boolean hypothetical)
Hypothetical facets are derived (read only) facets that cannot participate in the submission process.
They are NOT properties of the template entity. |
void |
setId(String id) |
void |
setIncludeAsField(Boolean includeAsField)
If we do not wish to annotate the Field in the entity, and want the
TemplatePanel to pick it up as a field. |
void |
setLookup(Object lookup)
|
void |
setName(String name)
Name is case sensitive
|
void |
setParent(FacetMeta parent)
|
void |
setRenderComponentName(String renderComponentName)
An optional String that is used to represent which UI Component will be responsible for rendering this
FacetMeta . |
void |
setSubmitTransformer(org.apache.commons.collections.Transformer submitTransformer)
During Submission of the data one can apply this.
|
void |
setSupplement(boolean supplement)
The FacetMeta supplements some other form/carrier and hence should be merged if there is a situation
where multiple meta information are applicable.
|
void |
setType(ContentType type) |
String |
toString() |
public static final String ATTRIB_FILTER
attributes
will return Filter
public static final String ATTRIB_ENCODING
attributes
will return Boolean
.
Will use SiteApplication#APPLICATION_ENCODING_CHARSET
if it is encoded to encode while saving & decide while decoding.public static final String ATTRIB_TAG_ATTRIBS
public static final String ATTRIB_NAMESPACE
ContentFacet
s and also naming cached files in ContentLocationResolver
spublic static final String ATTRIB_INDEX
isCollectionType()
is true, then one can map more fine grained meta properties to particular index within the array or collection starting from 0.public static final String ATTRIB_SUB_TYPE
getType()
defines the generic nature, however there can be sub-classification of type. Use this attribute to define a sub-type meta data.public static final org.apache.commons.collections.Transformer FACET_IDENTIFIER
public FacetMeta()
public FacetMeta(FacetMeta facetMeta)
public void setName(String name)
ISection
public String getDisplayName()
getDisplayName
in interface Displayable
getDisplayName
in interface ISection
public void setDisplayName(String displayName)
setDisplayName
in interface ISection
public ContentType getType()
public void setType(ContentType type)
public Boolean isCollectionType()
ContentType
is implied on the elements in the collection and not the collection itself.public void setCollectionType(Boolean collectionType)
ContentType
is implied on the elements in the collection and not the collection itself.public boolean isSupplement()
Field
can only carry limited amount of information by means of annotations (optionally supplied).
If we want to add additional meta data or imply its a field; then we can define a FacetMeta
that supplements it.
public void setSupplement(boolean supplement)
Field
can only carry limited amount of information by means of annotations (optionally supplied).
If we want to add additional meta data or imply its a field; then we can define a FacetMeta
that supplements it.
public Boolean getIncludeAsField()
TemplatePanel
to pick it up as a field.
This this is applicable. A field can be also supplemented by type etc, in which case supplement
can also be true.
THE EXISTANCE OF THIS FIELD IS IN A WAY A HACK.
Type
annotation has to be used to consider a field as a field for Admin UI. But there are situations when dealing with with an entity in multiple templates
or template using multiple entitites; we may want to skip the field. In that case a Type cannot be imposed in the java code. Then via configuration we must specify if to fetch it as a
field (and not an attribute).!Boolean.TRUE.equals(metaItem.getFacetMeta().getIncludeAsField())
means Attribute.public void setIncludeAsField(Boolean includeAsField)
TemplatePanel
to pick it up as a field.
This this is applicable. A field can be also supplemented by type etc, in which case supplement
can also be true.
THE EXISTANCE OF THIS FIELD IS IN A WAY A HACK.
Type
annotation has to be used to consider a field as a field for Admin UI. But there are situations when dealing with with an entity in multiple templates
or template using multiple entitites; we may want to skip the field. In that case a Type cannot be imposed in the java code. Then via configuration we must specify if to fetch it as a
field (and not an attribute).!Boolean.TRUE.equals(metaItem.getFacetMeta().getIncludeAsField())
means Attribute.public boolean isHypothetical()
Template
model they belong to.name
is merely used for identification of the Facet itself, and does not bind it to any related data structure within the model.
CustomTemplateRenderAdapter.processItem(Object, MetaItem, Object, com.neurosys.security.auth.domain.User, Object...)
,
but rather it should be filtered out in the container templates submission process instead.EntityDetailsTemplatePanel
public void setHypothetical(boolean hypothetical)
Template
model they belong to.name
is merely used for identification of the Facet itself, and does not bind it to any related data structure within the model.
CustomTemplateRenderAdapter.processItem(Object, MetaItem, Object, com.neurosys.security.auth.domain.User, Object...)
,
but rather it should be filtered out in the container templates submission process instead.EntityDetailsTemplatePanel
public Map<String,Object> getAttributes()
Transformer
s of this FacetMeta
CKEditorConfigs}, {@link TemplateAttributes} or constants defined with prefix "ATTRIB_"
public void setAttributes(Map<String,Object> attributes)
Transformer
s of this FacetMeta
CKEditorConfigs}, {@link TemplateAttributes} or constants defined with prefix "ATTRIB_"
public String getRenderComponentName()
FacetMeta
.
If not provided then the API will by default use a combination of ContentType
and optionally name
.
DefaultWicketTemplateRenderAdapter} for sample implementation.
public void setRenderComponentName(String renderComponentName)
FacetMeta
.
If not provided then the API will by default use a combination of ContentType
and optionally name
.
DefaultWicketTemplateRenderAdapter} for sample implementation.
public org.apache.commons.collections.Transformer getEncodeEditorTransformer()
Transformer
will act on the input (after all attributes
are processed)public void setEncodeEditorTransformer(org.apache.commons.collections.Transformer encodeTransformer)
Transformer
will act on the input (after all attributes
are processed)public org.apache.commons.collections.Transformer getDecodeEditorTransformer()
encodeEditorTransformer
when loading in the CMS Editorpublic void setDecodeEditorTransformer(org.apache.commons.collections.Transformer decodeEditorTransformer)
encodeEditorTransformer
when loading in the CMS Editorpublic org.apache.commons.collections.Transformer getDisplayTransformer()
Transformer
where the output may or may not represent the model that backs it.
For example in a SELECT box if you render the choice objects as Strings, then depends on the rendering component like CustomTemplateRenderAdapter
on if they can recognize the output to one of the choices in input.public void setDisplayTransformer(org.apache.commons.collections.Transformer decodeTransformer)
Transformer
where the output may or may not represent the model that backs it.
For example in a SELECT box if you render the choice objects as Strings, then depends on the rendering component like CustomTemplateRenderAdapter
on if they can recognize the output to one of the choices in input.public org.apache.commons.collections.Transformer getSubmitTransformer()
customItemRenderAdapter
is defined with a TwoWayTransformer
then this should fire over the result of that.
and the value produced from any transformation is still subject to all validation checks etc of any standard field value. The process is the same, just additional ability
to provide fine grained transformations.public void setSubmitTransformer(org.apache.commons.collections.Transformer submitTransformer)
customItemRenderAdapter
is defined with a TwoWayTransformer
then this should fire over the result of that.
and the value produced from any transformation is still subject to all validation checks etc of any standard field value. The process is the same, just additional ability
to provide fine grained transformations.public CustomTemplateRenderAdapter getCustomTemplateRenderAdapter()
public void setCustomTemplateRenderAdapter(CustomTemplateRenderAdapter customTemplateRenderAdapter)
public CustomItemComponentRenderAdapter getCustomItemRenderAdapter()
SelectRenderAdapter
would be used by DefaultWicketTemplateRenderAdapter
; else a Hidden FieldCustomTemplateRenderAdapter
.public void setCustomItemRenderAdapter(CustomItemComponentRenderAdapter customItemRenderAdapter)
SelectRenderAdapter
would be used by DefaultWicketTemplateRenderAdapter
; else a Hidden FieldCustomTemplateRenderAdapter
.public FacetMeta getParent()
FacetMeta
may contain FacetMeta
's recursively (child components). The child FacetMeta
may want to carry its parent
hierarchy with it and inherit properties from its parents.public void setParent(FacetMeta parent)
FacetMeta
may contain FacetMeta
's recursively (child components). The child FacetMeta
may want to carry its parent
hierarchy with it and inherit properties from its parents.public Object getDefaultvalue()
Transformer
s (that consumes ModelObject), applied if the value is null and only null (Blanks etc will not demand a default value substitution)
public void setDefaultvalue(Object defaultvalue)
Transformer
s (that consumes ModelObject), applied if the value is null and only null (Blanks etc will not demand a default value substitution)
public Boolean getAssignIndependentModel()
EntityDetailsTemplatePanel
while form processings, some fields may share the Form Compound model.
With this it forces the field to have its own Model disconnected from the rest.public void setAssignIndependentModel(Boolean assignIndependentModel)
EntityDetailsTemplatePanel
while form processings, some fields may share the Form Compound model.
With this it forces the field to have its own Model disconnected from the rest.public Object getLookup()
Transformer
s (that consumes ModelObject and produces a List) and/or List
of String
s or List
of FacetMeta
s
Transformer
to produce a Listpublic void setLookup(Object lookup)
Transformer
s (that consumes ModelObject and produces a List) and/or List
of String
s or List
of FacetMeta
s
Transformer
to produce a Listpublic String getId()
getId
in interface Identifiable<String>
public void setId(String id)
setId
in interface Identifiable<String>
public boolean isFieldType()
facet
- public boolean isTransientLost()
TransientAwareModel
isTransientLost
in interface TransientAwareModel
public void recoverTransient()
TransientAwareModel
TransientAwareModel.isTransientLost()
then a way to recover its transient values.
TransientAwareModel.isTransientLost()
true
recover by getting it back for the context.recoverTransient
in interface TransientAwareModel
public void setBeanName(String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
Copyright © 2018. All rights reserved.