nl.gx.webmanager.wcb
Interface Component

All Known Subinterfaces:
ElementComponent, FormComponent, MediaItemComponent, PageMetaDataComponent, PanelComponent, PresentationComponent, ProfileProviderComponent, ServiceComponent, ServletComponent
All Known Implementing Classes:
APIServiceImpl, AuthorisationSessionTimeoutServiceImpl, AuthorizationServiceImpl, ComponentBase, ComponentTypeBase, ElementComponentTypeImpl, FormComponentTypeImpl, MediaItemComponentTypeImpl, OnlineHelpProviderImpl, PageMetaDataComponentTypeImpl, PanelComponentTypeImpl, PresentationComponentTypeImpl, ProfileProviderComponentTypeImpl, ServiceComponentTypeImpl, ServletComponentTypeImpl, SimpleElementComponent, SimpleFormComponent, SimpleMediaItemComponent, SimpleMetaDataComponent, SimplePanelComponent, SimplePresentationComponent, SimpleProfileProviderComponent, SimpleServiceComponent, SimpleServletComponent

public interface Component

Author:
bramk

Method Summary
 void exportContent(javax.jcr.Node node, boolean exportBinaries, java.io.OutputStream out)
          Writes the repository content associated with the given Node to given OutputStream.
 java.lang.Class[] getClassesFromBundle()
          Retrieve all classes from the bundle.
 java.lang.Class getClassForName(java.lang.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.
 java.util.Collection<ExtensionProvider> getExtensions(java.lang.String interfaceClassName)
           
 java.lang.String getId()
          Return the identifier for this component.
 java.lang.Object getInstance()
          Returns an instance of the component's class.
 java.lang.Object getInstanceForName(java.lang.String fullyQualifiedClassName)
          Returns an instance of the given class if it is serviced by this component's OSGi bundle.
 javax.jcr.Node getPrivateNode(java.lang.String websiteIdentifier)
          Retrieve a private node for this panelcomponent.
 java.lang.String getTypeId()
          Return the identifier for this components type.
 WrapperDefinition[] getWrapperDefinitions()
          Returns the component's WrapperDefinitions.
 void importContent(javax.jcr.Node targetNode, boolean importBinaries, java.io.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

java.lang.String getId()
Return the identifier for this component.

Returns:
a string identifier

getTypeId

java.lang.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. If false 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. If false 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

java.lang.Class getClassForName(java.lang.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

java.lang.Class[] getClassesFromBundle()
Retrieve all classes from the bundle.

Returns:
an array of classes present in the bundle

getInstance

java.lang.Object getInstance()
Returns an instance of the component's class.

Returns:
an instance of the component's class

getInstanceForName

java.lang.Object getInstanceForName(java.lang.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(java.lang.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,
                   java.io.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 serialized
exportBinaries - whether binaries should be included
out - The OutputStream to which the systemview on the content is exported.
Throws:
ExportException - on error

importContent

void importContent(javax.jcr.Node targetNode,
                   boolean importBinaries,
                   java.io.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 added
importBinaries - whether binary content should be imported; ignored by the default implementation
in - the inputstream from which the xml to deserialize is read
uuidbehavior - a four-value flag that governs how incoming UUIDs are handled
Throws:
ImportException - on error

getExtensions

java.util.Collection<ExtensionProvider> getExtensions(java.lang.String interfaceClassName)
Parameters:
interfaceClassName -
Returns:


Copyright © 2007-2010 GX creative online development BV. All Rights Reserved.