nl.gx.webmanager.wcb.mediaitemtype.impl
Class MediaItemComponentTypeImpl

java.lang.Object
  extended by nl.gx.webmanager.wcb.foundation.ComponentBase
      extended by nl.gx.webmanager.wcb.foundation.ComponentTypeBase
          extended by nl.gx.webmanager.wcb.mediaitemtype.impl.MediaItemComponentTypeImpl
All Implemented Interfaces:
DelegatedControllerAware, Component, ComponentType, MediaItemComponentType

public final class MediaItemComponentTypeImpl
extends ComponentTypeBase
implements MediaItemComponentType

This class provides a componentType implementation for GX Webmanager media items. NOTE: media types are identified by their content type (provided by the @ContentType annotation. So if the value of this annotation is changed in an update of the WCB the framework will not identify the WCB as already installed WCB but will create a new content type for it. Therefore the value of the

Author:
Ivo Ladage

Field Summary
protected static java.lang.String INSTALL
           
protected static java.lang.String PURGECONTENT
           
protected static java.lang.String UNINSTALL
           
 
Fields inherited from class nl.gx.webmanager.wcb.foundation.ComponentBase
myBundleContext, myComponentBundle, myComponentDefinition
 
Constructor Summary
MediaItemComponentTypeImpl()
           
 
Method Summary
 boolean checkComponentDefinition(ComponentDefinition componentDefinition)
          Checks if the component definition is valid
 java.lang.String getComponentInterface()
          Returns the class name of the component interface.
 java.lang.String getComponentTypeInterface()
          Returns the class name of the component type interface.
protected  org.osgi.service.prefs.PreferencesService getPreferencesService()
          Returns the injected preferences service.
 boolean installComponent(ComponentDefinition componentDefinition)
          Invoked when a component of this component type is installed.
 boolean purgeComponent(ComponentDefinition componentDefinition)
          Deletes the content created by instances of the component type.
protected  void removeAllJellyContent(ComponentDefinition componentDefinition)
          Removes all content from the database tables created by this content type
protected  void removeCustomJCRMediaItems(ComponentDefinition componentDefinition, nl.gx.siteworks.core.SiteWorksSession session)
          Removes all JCR nodes and node types associated with the given component.
 boolean startComponent(Component component)
          Starts an installed component.
 boolean stopComponent(Component component)
          Stops an installed component.
 boolean uninstallComponent(ComponentDefinition componentDefinition)
          Uninstalls a component.
 boolean updateComponent(ComponentDefinition componentDefinition)
          Updates a component.
 
Methods inherited from class nl.gx.webmanager.wcb.foundation.ComponentTypeBase
componentAdded, componentRemoved, createEditLanguageLabels, createOrUpdatePermissions, createOrUpdatePermissions, createOrUpdateRbacCategory, createPermission, createPermission, createPermissions, createPermissions, deleteEditLanguageLabels, deletePermissions, deletePermissions, disableMenuItems, enableMenuItems, getComponent, getComponentCount, getComponentManager, getComponents, getLocaleIdFromResourceName, grantsMenuItemAccess, insertIntoMainMenu, logError, updatePermissionsForPermissionGroups
 
Methods inherited from class nl.gx.webmanager.wcb.foundation.ComponentBase
dependencyAdded, dependencyRemoved, exportContent, extensionAdded, extensionRemoved, getBundleContext, getClassesFromBundle, getClassForName, getComponentBundle, getComponentDefinition, getDelegatedController, getExtensions, getId, getInstance, getInstanceForName, getPrivateNode, getPrivateNode, getTypeId, getWrapperDefinitions, importContent, internalDoStart, internalDoStop, onDestroy, onInit, onInstall, onPurge, onStart, onStop, onUninstall, onUpdate, purgeContent, setBundleContext, setComponentBundle, setComponentBundle, setComponentDefinition, setComponentManager, setDelegatedController
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.gx.webmanager.wcb.ComponentType
getComponent, getComponentCount, getComponents
 

Field Detail

INSTALL

protected static final java.lang.String INSTALL
See Also:
Constant Field Values

UNINSTALL

protected static final java.lang.String UNINSTALL
See Also:
Constant Field Values

PURGECONTENT

protected static final java.lang.String PURGECONTENT
See Also:
Constant Field Values
Constructor Detail

MediaItemComponentTypeImpl

public MediaItemComponentTypeImpl()
Method Detail

startComponent

public boolean startComponent(Component component)
Starts an installed component.

Specified by:
startComponent in interface ComponentType
Specified by:
startComponent in class ComponentTypeBase
Parameters:
component - Component that should be started
Returns:
true if the component was successfully started

stopComponent

public boolean stopComponent(Component component)
Description copied from class: ComponentTypeBase
Stops an installed component.

Specified by:
stopComponent in interface ComponentType
Specified by:
stopComponent in class ComponentTypeBase
Parameters:
component - Component that should be started
Returns:
true if the component was successfully stopped

installComponent

public boolean installComponent(ComponentDefinition componentDefinition)
Description copied from class: ComponentTypeBase
Invoked when a component of this component type is installed. The component type implements installation logic that is applicable for all components of this type and then invokes onInstall to allow inherited component types to implement additional logic. The onInstall callback method is only invoked if the generic component installation logic was successful.

Specified by:
installComponent in interface ComponentType
Overrides:
installComponent in class ComponentTypeBase
Parameters:
componentDefinition - Definition of the component that is to be installed
Returns:
true if the component was successfully installed

updateComponent

public boolean updateComponent(ComponentDefinition componentDefinition)
Description copied from class: ComponentTypeBase
Updates a component.

Specified by:
updateComponent in interface ComponentType
Overrides:
updateComponent in class ComponentTypeBase
Parameters:
componentDefinition - Definition of the component that is to be installed
Returns:
true if the component was successfully updated

purgeComponent

public boolean purgeComponent(ComponentDefinition componentDefinition)
Description copied from class: ComponentTypeBase
Deletes the content created by instances of the component type.

Specified by:
purgeComponent in interface ComponentType
Overrides:
purgeComponent in class ComponentTypeBase
Parameters:
componentDefinition - Definition of the component that is to be purged
Returns:
true if the component was successfully purged

uninstallComponent

public boolean uninstallComponent(ComponentDefinition componentDefinition)
Description copied from class: ComponentTypeBase
Uninstalls a component. Uninstalling means all files and objects instantiated by the component's definition are deleted.

Specified by:
uninstallComponent in interface ComponentType
Overrides:
uninstallComponent in class ComponentTypeBase
Parameters:
componentDefinition - Definition of the component that is to be uninstalled
Returns:
true if the component was successfully uninstalled

checkComponentDefinition

public boolean checkComponentDefinition(ComponentDefinition componentDefinition)
Checks if the component definition is valid

Specified by:
checkComponentDefinition in interface ComponentType
Overrides:
checkComponentDefinition in class ComponentTypeBase
Parameters:
componentDefinition - definition of a component that is validated
Returns:
true if it is valid, false otherwise

removeCustomJCRMediaItems

protected void removeCustomJCRMediaItems(ComponentDefinition componentDefinition,
                                         nl.gx.siteworks.core.SiteWorksSession session)
                                  throws javax.jcr.RepositoryException
Removes all JCR nodes and node types associated with the given component.

Parameters:
componentDefinition - The component definition to remove the JCR nodes for
Throws:
javax.jcr.RepositoryException

removeAllJellyContent

protected void removeAllJellyContent(ComponentDefinition componentDefinition)
                              throws java.sql.SQLException,
                                     javax.management.ServiceNotFoundException
Removes all content from the database tables created by this content type

Parameters:
componentDefinition - Component definition to remove content for
Throws:
java.sql.SQLException
javax.management.ServiceNotFoundException

getComponentInterface

public java.lang.String getComponentInterface()
Returns the class name of the component interface.

Specified by:
getComponentInterface in interface ComponentType
Returns:
The class name of the component interface

getComponentTypeInterface

public java.lang.String getComponentTypeInterface()
Returns the class name of the component type interface.

Specified by:
getComponentTypeInterface in interface ComponentType
Returns:
The class name of the component type interface

getPreferencesService

protected org.osgi.service.prefs.PreferencesService getPreferencesService()
Returns the injected preferences service.

Overrides:
getPreferencesService in class ComponentTypeBase
Returns:
The preferences service


Copyright © 2007-2011 GX Software BV. All Rights Reserved.