Interface Component

    • 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. 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

        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 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,
                           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