REF
- as Reference to Type of Page the template points to. See getReference()
public class Template<REF> extends ModelObject implements ISection, ChangeGenerator
Component
s.
Template
is uniquely identified by its name
in the application. (id is for backend identification by say a DB)
If no DB is in use, Id can also be null for this reason, name is the preferred identifier.
Modifier and Type | Field and Description |
---|---|
protected List<ChangeListener> |
listeners |
static org.apache.commons.collections.Transformer |
TEMPLATE_IDENTIFIER |
Constructor and Description |
---|
Template() |
Template(String name) |
Template(Template template) |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener changeListener)
Notify all
ChangeListener s about a change |
boolean |
equals(Object obj) |
EnsureAccessorExistsTransformer |
getAccessorExistsTransformer()
While creating new records some nested entities may need to be constructed before
#save(Serializable, MetaItem, Object) |
Map<String,?> |
getAttributes() |
Map<String,String> |
getDefaultResourceLocations()
If the system is unable to derive the path for a given resource where should it be placed
Each key corresponds to a file based ContentType Property name from FacetMeta or A Field that is Annotated with Type and has a File based ContentType
Note: These paths must be absolute always and may employ the variable; example
|
String |
getDisplayName()
User friendly display name : Useful in Admin view etc.
|
FacetMeta |
getFacetMeta(String facetName) |
Collection<FacetMeta> |
getFacets()
What all dynamic place holders does the template have.
|
List<String> |
getFieldOrderListing()
List of field/attribute Names as String that govern the order of listing
in the form.
|
Long |
getId() |
List |
getListeners()
Get list directly.
|
String |
getMarkupLocation()
In addition to reference, if there is a specific location we want to offer to override or change default
path, configure alternate location of the template markup.
|
String |
getName()
Unique identification name
|
IPublisherAdapter |
getPublishAdapter() |
Class<REF> |
getReference()
The reference to the class that will construct the template (A factory or a self instantiating bean)
The template is bound a Type of class reference which has the actual implementation and wiring to the native framework. |
org.apache.commons.collections.Transformer |
getSubmitTransformer()
Entity level submission; the entity is the input to the
Transformer
During Submission of the entity backing the template one can apply this.The exact order of the calling is usage dependent, but typically it will be @ the end of the process after all the fields FacetMeta.getSubmitTransformer() are processed. |
int |
hashCode() |
boolean |
isProcessFields()
If true will Consider the core entity field definitions while preparing the
MetaItem list for the Entity. |
void |
notifyAllListeners(Object object)
Whenever a node is selected, it also notifies its listeners.
|
void |
publish(Object entity)
A service method to publish content/entity that the template represents
Each Template knows how to publish its content also; will publish it if a IPublisherAdapter is provided |
void |
setAccessorExistsTransformer(EnsureAccessorExistsTransformer accessorExistsTransformer)
While creating new records some nested entities may need to be constructed before
#save(Serializable, MetaItem, Object) |
void |
setAttributes(Map<String,?> attributes) |
void |
setDefaultResourceLocations(Map<String,String> defaultResourceLocations)
If the system is unable to derive the path for a given resource where should it be placed
Each key corresponds to a file based ContentType Property name from FacetMeta or A Field that is Annotated with Type and has a File based ContentType
Note: These paths must be absolute always and may employ the variable; example
|
void |
setDisplayName(String displayName)
User friendly display name : Useful in Admin view etc.
|
void |
setFacets(Collection<FacetMeta> facets)
What all dynamic place holders does the template have.
|
void |
setFieldOrderListing(List<String> fieldOrderListing)
List of field/attribute Names as String that govern the order of listing
in the form.
|
void |
setId(Long id) |
void |
setListeners(List listeners)
Set list directly.
|
void |
setMarkupLocation(String markupLocation)
In addition to reference, if there is a specific location we want to offer to override or change default
path, configure alternate location of the template markup.
|
void |
setName(String name)
Unique identification name
|
void |
setProcessFields(boolean processFields)
If true will Consider the core entity field definitions while preparing the
MetaItem list for the Entity. |
void |
setPublishAdapter(IPublisherAdapter publishAdapter) |
void |
setReference(Class<REF> reference)
The reference to the class that will construct the template (A factory or a self instantiating bean)
The template is bound a Type of class reference which has the actual implementation and wiring to the native framework. |
void |
setSubmitTransformer(org.apache.commons.collections.Transformer submitTransformer)
Entity level submission; the entity is the input to the
Transformer
During Submission of the entity backing the template one can apply this.The exact order of the calling is usage dependent, but typically it will be @ the end of the process after all the fields FacetMeta.getSubmitTransformer() are processed. |
String |
toString() |
public static final org.apache.commons.collections.Transformer TEMPLATE_IDENTIFIER
protected transient List<ChangeListener> listeners
public Template()
public Template(String name)
public Template(Template template)
public Long getId()
public void setId(Long id)
public String getName()
public void setName(String name)
public String getDisplayName()
getDisplayName
in interface ISection
public void setDisplayName(String displayName)
setDisplayName
in interface ISection
public Class<REF> getReference()
public void setReference(Class<REF> reference)
public Collection<FacetMeta> getFacets()
ContentDescriber
)'s facets should match the Templates facets.ContentDescriber#getFacets()}
public void setFacets(Collection<FacetMeta> facets)
ContentDescriber
)'s facets should match the Templates facets.ContentDescriber#getFacets()}
public List<String> getFieldOrderListing()
MetaItem.getName()
public void setFieldOrderListing(List<String> fieldOrderListing)
MetaItem.getName()
public Map<String,String> getDefaultResourceLocations()
public void setDefaultResourceLocations(Map<String,String> defaultResourceLocations)
public String getMarkupLocation()
TemplatePageLocator
may override the meaning.
See specific implementation to be sure.IPageLocator}
,
TemplatePageLocator}
public void setMarkupLocation(String markupLocation)
TemplatePageLocator
may override the meaning.
See specific implementation to be sure.IPageLocator}
,
TemplatePageLocator}
public IPublisherAdapter getPublishAdapter()
public void setPublishAdapter(IPublisherAdapter publishAdapter)
public org.apache.commons.collections.Transformer getSubmitTransformer()
Transformer
During Submission of the entity backing the template one can apply this.FacetMeta.getSubmitTransformer()
are processed.public void setSubmitTransformer(org.apache.commons.collections.Transformer submitTransformer)
Transformer
During Submission of the entity backing the template one can apply this.FacetMeta.getSubmitTransformer()
are processed.public boolean isProcessFields()
MetaItem
list for the Entity.public void setProcessFields(boolean processFields)
MetaItem
list for the Entity.public void publish(Object entity) throws Exception
IPublisherAdapter
is providedcontent/entity
- Exception
public EnsureAccessorExistsTransformer getAccessorExistsTransformer()
#save(Serializable, MetaItem, Object)
public void setAccessorExistsTransformer(EnsureAccessorExistsTransformer accessorExistsTransformer)
#save(Serializable, MetaItem, Object)
public FacetMeta getFacetMeta(String facetName)
template
- as TemplatefacetName
- name of facet to look forFacetMeta
@nullable truepublic void addChangeListener(ChangeListener changeListener)
ChangeListener
s about a changeaddChangeListener
in interface ChangeGenerator
changeListener
- public List getListeners()
ChangeGenerator
getListeners
in interface ChangeGenerator
public void setListeners(List listeners)
ChangeGenerator
setListeners
in interface ChangeGenerator
public void notifyAllListeners(Object object)
notifyAllListeners
in interface ChangeGenerator
object
- Copyright © 2018. All rights reserved.