Package nl.gx.webmanager.wcb
Interface Component
-
- All Known Subinterfaces:
DojoComponent
,ElementComponent
,FormComponent
,FormFragmentComponent
,FormLogicProviderComponent
,LanguagePackComponent
,MediaItemComponent
,PageMetaDataComponent
,PanelComponent
,PresentationComponent
,ProfileProviderComponent
,SearchFacetComponent
,ServiceComponent
,ServletComponent
- All Known Implementing Classes:
APIServiceImpl
,ComponentBase
,ComponentTypeBase
,ContentIndexSearchServiceImpl
,ContentLabelsCategoryFieldAdapterImpl
,ContentUsageAdapterImpl
,DojoComponentTypeImpl
,ElementComponentTypeImpl
,FormComponentTypeImpl
,MediaItemComponentTypeImpl
,PageMetaDataComponentTypeImpl
,PanelComponentTypeImpl
,PresentationComponentTypeImpl
,ProfileProviderComponentTypeImpl
,SearchFacetComponentTypeImpl
,ServiceComponentTypeImpl
,ServletComponentTypeImpl
,SimpleDojoComponent
,SimpleElementComponent
,SimpleFormComponent
,SimpleMediaItemComponent
,SimpleMetaDataComponent
,SimplePanelComponent
,SimplePresentationComponent
,SimpleProfileProviderComponent
,SimpleSearchFacetComponent
,SimpleServiceComponent
,SimpleServletComponent
public interface Component
- Author:
- bramk
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
exportContent(javax.jcr.Node node, boolean exportBinaries, OutputStream out)
Writes the repository content associated with the given Node to given OutputStream.Class[]
getClassesFromBundle()
Retrieve all classes from the bundle.Class
getClassForName(String fullyQualifiedClassName)
Returns the class for the given fully qualified class name.ComponentBundle
getComponentBundle()
Returns the component bundle which contains this component.ComponentDefinition
getComponentDefinition()
Returns the definition containing all metadata describing this component.Collection<ExtensionProvider>
getExtensions(String interfaceClassName)
String
getId()
Return the identifier for this component.Object
getInstance()
Returns an instance of the component's class.Object
getInstanceForName(String fullyQualifiedClassName)
Returns an instance of the given class if it is serviced by this component's OSGi bundle.javax.jcr.Node
getPrivateNode(String websiteIdentifier)
Retrieve a private node for this panelcomponent.String
getTypeId()
Return the identifier for this components type.WrapperDefinition[]
getWrapperDefinitions()
Returns the component's WrapperDefinitions.void
importContent(javax.jcr.Node targetNode, boolean importBinaries, InputStream in, int uuidbehavior)
Imports content into the JCR.void
onDestroy()
Can be implemented by components for attaching logic to a destroy event.void
onInit()
Can be implemented by components for attaching logic to a init event.void
onInstall()
Can be implemented by components for attaching logic to an install event.boolean
onPurge()
Can be implemented by components for attaching logic to a purge event.void
onStart()
Can be implemented by components for attaching logic to a start event.void
onStop()
Can be implemented by components for attaching logic to a stop event.boolean
onUninstall()
Can be implemented by components for attaching logic to an uninstall event Note that the WCB containing the component needs to be ACTIVE in order for the onUninstall to be invoked.void
onUpdate()
Can be implemented by components for attaching logic to an update event.void
purgeContent()
Deletes the content created by instances of the component.void
setBundleContext(org.osgi.framework.BundleContext bundleContext)
Sets the context of the OSGi bundle which contains this component.void
setComponentBundle(ComponentBundle componentBundle)
Sets the component bundle which contains this component.void
setComponentDefinition(ComponentDefinition componentDefinition)
Set the definition containing all metadata describing this component.void
setComponentManager(ComponentManager componentManager)
-
-
-
Method Detail
-
getId
String getId()
Return the identifier for this component.- Returns:
- a string identifier
-
getTypeId
String getTypeId()
Return the identifier for this components type.- Returns:
- a string identifier
-
onStart
void onStart()
Can be implemented by components for attaching logic to a start event.
-
onStop
void onStop()
Can be implemented by components for attaching logic to a stop event.
-
onDestroy
void onDestroy()
Can be implemented by components for attaching logic to a destroy event.
-
onInit
void onInit()
Can be implemented by components for attaching logic to a init event.
-
onInstall
void onInstall()
Can be implemented by components for attaching logic to an install event.
-
onUpdate
void onUpdate()
Can be implemented by components for attaching logic to an update event.
-
onPurge
boolean onPurge()
Can be implemented by components for attaching logic to a purge event. Note that the WCB containing the component needs to be ACTIVE in order for the onPurge to be invoked.- Returns:
true
if the install succeeded, false otherwise. Iffalse
is returned, the WCB will not be purged.
-
onUninstall
boolean onUninstall()
Can be implemented by components for attaching logic to an uninstall event Note that the WCB containing the component needs to be ACTIVE in order for the onUninstall to be invoked.- Returns:
true
if the uninstallation succeeded, false otherwise. Iffalse
is returned, the WCB will not be uninstalled.
-
getComponentDefinition
ComponentDefinition getComponentDefinition()
Returns the definition containing all metadata describing this component.- Returns:
- the definition containing all metadata describing this component
-
setComponentDefinition
void setComponentDefinition(ComponentDefinition componentDefinition)
Set the definition containing all metadata describing this component.- Parameters:
componentDefinition
- Definition containing all metadata describing this component
-
getComponentBundle
ComponentBundle getComponentBundle()
Returns the component bundle which contains this component.- Returns:
- the component bundle which contains this component
-
setComponentManager
void setComponentManager(ComponentManager componentManager)
- Parameters:
componentManager
-
-
setComponentBundle
void setComponentBundle(ComponentBundle componentBundle)
Sets the component bundle which contains this component.- Parameters:
componentBundle
- Component bundle which contains this component
-
setBundleContext
void setBundleContext(org.osgi.framework.BundleContext bundleContext)
Sets the context of the OSGi bundle which contains this component.- Parameters:
bundleContext
- Context of the OSGi bundle which contains this component
-
getClassForName
Class getClassForName(String fullyQualifiedClassName)
Returns the class for the given fully qualified class name. Return null if it can't be found.- Parameters:
fullyQualifiedClassName
- fully qualified class name- Returns:
- the class for the given fully qualified class name. Return null if it can't be found.
-
getWrapperDefinitions
WrapperDefinition[] getWrapperDefinitions()
Returns the component's WrapperDefinitions.- Returns:
- the component's WrapperDefinitions
-
getClassesFromBundle
Class[] getClassesFromBundle()
Retrieve all classes from the bundle.- Returns:
- an array of classes present in the bundle
-
getInstance
Object getInstance()
Returns an instance of the component's class.- Returns:
- an instance of the component's class
-
getInstanceForName
Object getInstanceForName(String fullyQualifiedClassName)
Returns an instance of the given class if it is serviced by this component's OSGi bundle.- Parameters:
fullyQualifiedClassName
- Fully qualified class name- Returns:
- an instance of the given class if it is serviced by this component's OSGi bundle
-
purgeContent
void purgeContent()
Deletes the content created by instances of the component.
-
getPrivateNode
javax.jcr.Node getPrivateNode(String websiteIdentifier)
Retrieve a private node for this panelcomponent. If websiteIdentifier!=null, then the webContainerNode is returned (specific for the current webinitiatif). Otherwise, the allContainerNode is returned (the same for all webinitiatifs).- Parameters:
websiteIdentifier
- the unique identifier of the cuurent webinitiatif, or null if the allContainerNode should be returned- Returns:
- the private node
-
exportContent
void exportContent(javax.jcr.Node node, boolean exportBinaries, OutputStream out) throws ExportException
Writes the repository content associated with the given Node to given OutputStream. The default implementation uses the JCR exportSystemView method and recursively exports the start node and all its subnodes. If the default implementation does not suffice, then any subclass can override it (i.e., a WCB developer can extend SimplePanelComponent and implement WCB-specific export functionality).- Parameters:
node
- the root of the subtree to be serializedexportBinaries
- whether binaries should be includedout
- The OutputStream to which the systemview on the content is exported.- Throws:
ExportException
- on error
-
importContent
void importContent(javax.jcr.Node targetNode, boolean importBinaries, InputStream in, int uuidbehavior) throws ImportException
Imports content into the JCR. The default implementation uses the JCR Session.importXML method. The choice to import binaries is ignored in the default implementation since the JCR importXML methods do not support it (binaries are always imported). If the default implementation does not suffice, then any subclass can override it (i.e., a WCB developer can extend SimplePanelComponent and implement WCB-specific import functionality).- Parameters:
targetNode
- the node under which the deserialized subtree is addedimportBinaries
- whether binary content should be imported; ignored by the default implementationin
- the inputstream from which the xml to deserialize is readuuidbehavior
- a four-value flag that governs how incoming UUIDs are handled- Throws:
ImportException
- on error
-
getExtensions
Collection<ExtensionProvider> getExtensions(String interfaceClassName)
- Parameters:
interfaceClassName
-- Returns:
-
-