public class SubComponent extends AbstractRenderableModelObject implements Comparable<SubComponent>, SurfBugData
A type of Renderable object that is referenced by an AdvancedComponent.
An AdvancedComponent can have zero or more ComponentElements that it uses to render its content. This
allows the AdvancedComponent to behave as a group into which multiple ComponoentElements can be added
into.
Although a ComponentElement is an instance of a ModelObject it cannot be represented by it's own
configuration. Instead it is "hidden" from the Spring Surf configuration so that it can only be defined within
and AdvancedComponent or ModuleDeployment.
| Modifier and Type | Class and Description |
|---|---|
class |
SubComponent.RenderData
Provides data about the rendering of a
SubComponent, specifically whether or not it
should be rendered, the URI to render it and the properties associated with it. |
| Modifier and Type | Field and Description |
|---|---|
static String |
SUB_COMPONENT_TYPE |
PROP_PROCESSORcustomProperties, description, descriptionId, id, info, modelProperties, modificationTime, resourceContainer, title, titleIdPROP_DESCRIPTION, PROP_DESCRIPTION_ID, PROP_ID, PROP_TITLE, PROP_TITLE_ID| Constructor and Description |
|---|
SubComponent(String id,
String parentId) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyConfiguration(org.dom4j.Element componentEl)
Parses the supplied configuration
Element (which should be a <renderable-element>) and
applies the data therein to the current instance. |
SubComponent |
clone()
Clones the current object, resetting all the key data as it does so.
|
int |
compareTo(SubComponent that)
Compares the indices of the current instance and the supplied instance.
|
SubComponent.RenderData |
determineURI(RequestContext context,
org.springframework.context.ApplicationContext applicationContext)
Determines the URL to use to render the SubComponent instance.
|
String |
getComponentTypeId() |
List<SubComponentEvaluation> |
getEvaluations() |
Integer |
getIndex() |
String |
getParentId() |
String |
getProcessorId()
Gets the default 'view' processor id
|
org.springframework.extensions.webscripts.WebScript |
getResolvedWebScript()
Return the WebScript that was resolved to render this component (this will only
be available during rendering) it will return null if the component is not backed
by a WebScript.
|
String |
getTypeId()
Returns the type id of the model object.
|
void |
mergeExtension(SubComponent ext)
Merges the overrides defined in the supplied extension.
|
void |
setAllProperties(Map<String,Serializable> standardProps,
Map<String,Serializable> customProps)
Sets all the properties for this SubComponent.
|
void |
setComponentTypeId(String componentTypeId) |
void |
setProcessorId(String processorId) |
void |
setResolvedWebScript(org.springframework.extensions.webscripts.WebScript webScript)
Sets the
WebScript that gets resolved to render this SubComponent. |
void |
setUri(String uri) |
String |
toString() |
getProcessorId, getProcessorProperties, getProcessorProperties, getProcessorProperty, getProcessorProperty, getRenderModesaddResource, addResource, getBooleanProperty, getCustomProperties, getCustomProperty, getDescription, getDescriptionId, getDocument, getId, getKey, getModelProperties, getModelProperty, getModificationTime, getPersisterId, getProperties, getProperty, getResource, getResourceContainer, getResources, getResourcesMap, getStoragePath, getTitle, getTitleId, isCustomProperty, isModelProperty, isSaved, removeCustomProperty, removeModelProperty, removeProperty, removeResource, setCustomProperty, setDescription, setDescriptionId, setId, setModelProperty, setModificationTime, setProperty, setTitle, setTitleId, touch, toXML, updateResource, updateXMLpublic static final String SUB_COMPONENT_TYPE
public String getParentId()
public String toString()
toString in class AbstractModelObjectpublic Integer getIndex()
public void setUri(String uri)
public String getProcessorId()
RenderablegetProcessorId in interface RenderablegetProcessorId in class AbstractRenderableModelObjectpublic void setProcessorId(String processorId)
public String getComponentTypeId()
public void setComponentTypeId(String componentTypeId)
public void mergeExtension(SubComponent ext)
Merges the overrides defined in the supplied extension.
ext - The extending SubComponent to merge.public SubComponent clone()
Clones the current object, resetting all the key data as it does so. This method should be called before applying extensions to ensure that the correct base data is set for extending and that multiple threads won't attempt to concurrently modify the original.
public List<SubComponentEvaluation> getEvaluations()
List of SubComponentEvaluation instances configured for this SubComponentpublic SubComponent.RenderData determineURI(RequestContext context, org.springframework.context.ApplicationContext applicationContext)
Determines the URL to use to render the SubComponent instance. The URL returned will be
defined in the first successfully passed SubComponentEvaluation processed (providing
that it is configured to enable the SubComponent to render). If there are no SubComponentEvaluation
instances configured then the default URL is returned. If a SubComponentEvaluation
evaluates but indicates that the SubComponent should not be rendered or no URL is defined then
null will be returned which indicates that nothing will get rendered.
context - The current RequestContext is supplied to for the SubComponentEvaluation instances to use.null if it should not be rendered.public int compareTo(SubComponent that)
Compares the indices of the current instance and the supplied instance. If either index is null it will be treated as null.
compareTo in interface Comparable<SubComponent>public String getTypeId()
ModelObjectgetTypeId in interface ModelObjectgetTypeId in class AbstractModelObjectpublic void setResolvedWebScript(org.springframework.extensions.webscripts.WebScript webScript)
Sets the WebScript that gets resolved to render this SubComponent.
setResolvedWebScript in interface SurfBugDatawebScript - The resolved WebScriptpublic org.springframework.extensions.webscripts.WebScript getResolvedWebScript()
SurfBugDatagetResolvedWebScript in interface SurfBugDataWebScript that gets resolved to render this SubComponent.public void setAllProperties(Map<String,Serializable> standardProps, Map<String,Serializable> customProps)
Sets all the properties for this SubComponent. This is provided so that an AdvancedComponent can parse and
old style SubComponent configuration file and pass the properties to the SubComponent.
standardProps - MapcustomProps - Mappublic void applyConfiguration(org.dom4j.Element componentEl)
Parses the supplied configuration Element (which should be a <renderable-element>) and
applies the data therein to the current instance. This should result in the index, uri and evaluation (and
associated evaluators) being set.
componentEl - The <renderable-element> configuration Element to parse and apply.Copyright © 2005–2016 Alfresco Software. All rights reserved.