Class Component
- java.lang.Object
-
- pt.ist.fenixframework.core.AbstractDomainObject
-
- org.fenixedu.cms.domain.component.Component_Base
-
- org.fenixedu.cms.domain.component.Component
-
- All Implemented Interfaces:
Serializable,Cloneable,pt.ist.fenixframework.DomainObject
- Direct Known Subclasses:
ListCategoryPosts_Base,StaticPost_Base,StrategyBasedComponent_Base
public abstract class Component extends Component_Base implements Cloneable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static HashMap<String,ComponentDescriptor>COMPONENTS
-
Constructor Summary
Constructors Constructor Description Component()The loggedUsercreates a new component.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static com.google.gson.JsonArrayavailableComponents(Site site)abstract Componentclone(CloneCache cloneCache)Class<?>componentType()voiddelete()static ComponentforType(Class<? extends CMSComponent> type)static ComponentDescriptorforType(String type)Searches for the class of a component with a given type.StringgetDescription()StringgetName()StringgetType()abstract voidhandle(Page page, TemplateContext componentContext, TemplateContext globalContext)Provides the necessary info needed to render the component on a given page and context.abstract com.google.gson.JsonObjectjson()static voidregister(Class<?> c)Registers a new class has a component.-
Methods inherited from class org.fenixedu.cms.domain.component.Component_Base
addInstalledPage, getCreatedBy, getCreationDate, getInstalledPageSet, getRelationComponentPage, getRelationComponentUser, removeInstalledPage, setCreatedBy, setCreationDate, setType
-
-
-
-
Field Detail
-
COMPONENTS
protected static final HashMap<String,ComponentDescriptor> COMPONENTS
-
-
Method Detail
-
register
public static void register(Class<?> c)
Registers a new class has a component.- Parameters:
c- the class being registered as a component.
-
forType
public static ComponentDescriptor forType(String type)
Searches for the class of a component with a given type.- Parameters:
type- the type of the component.- Returns:
- the class of the component with the given type.
-
availableComponents
public static com.google.gson.JsonArray availableComponents(Site site)
-
getName
public String getName()
- Returns:
- the name of the component.
-
getDescription
public String getDescription()
- Returns:
- the description of the component.
-
getType
public String getType()
- Overrides:
getTypein classComponent_Base- Returns:
- the type of the component.
-
handle
public abstract void handle(Page page, TemplateContext componentContext, TemplateContext globalContext)
Provides the necessary info needed to render the component on a given page and context.- Parameters:
page- the page where the component will be rendered.componentContext- local context for the component.globalContext- global context where the component is being rendered.
-
clone
public abstract Component clone(CloneCache cloneCache)
-
delete
public void delete()
-
componentType
public Class<?> componentType()
-
forType
public static Component forType(Class<? extends CMSComponent> type)
-
json
public abstract com.google.gson.JsonObject json()
-
-