Class MediaItemComponentTypeImpl
- java.lang.Object
-
- nl.gx.webmanager.wcb.foundation.ComponentBase
-
- nl.gx.webmanager.wcb.foundation.ComponentTypeBase
-
- 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@ContentType
annotation may only be changed after an purgeContent and uninstall of the WCB.
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
INSTALL
protected static String
PURGECONTENT
protected static String
UNINSTALL
-
Fields inherited from class nl.gx.webmanager.wcb.foundation.ComponentBase
myBundleContext, myComponentBundle, myComponentDefinition
-
-
Constructor Summary
Constructors Constructor Description MediaItemComponentTypeImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkComponentDefinition(ComponentDefinition componentDefinition)
Check whether a componentDefinition is valid for this componentType.void
deployResources(ComponentDefinition componentDefinition)
Deploys the necessary resources for a component.String
getComponentInterface()
Return the component interface this componentType provides.String
getComponentTypeInterface()
Returns the componentType interface this componentType publishes.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.void
setAsAvailableContentType(MediaItemComponentDefinition mediaCompDef)
Appends this media component as available content type among all webinitiatifs.void
setAsAvailableContentType(MediaItemComponentDefinition mediaCompDef, int webId, boolean available)
Appends this media component as available content type on the specified webinitiatif.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, enableComponentForAllWebsites, enableMenuItems, getComponent, getComponentCount, getComponentManager, getComponents, getLocaleIdFromResourceName, getPreferencesService, grantsMenuItemAccess, installComponent, 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
enableComponentForAllWebsites, getComponent, getComponentCount, getComponents, installComponent
-
-
-
-
Field Detail
-
INSTALL
protected static final String INSTALL
- See Also:
- Constant Field Values
-
UNINSTALL
protected static final String UNINSTALL
- See Also:
- Constant Field Values
-
PURGECONTENT
protected static final String PURGECONTENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
startComponent
public boolean startComponent(Component component)
Description copied from interface:ComponentType
Starts an installed component.- Specified by:
startComponent
in interfaceComponentType
- Specified by:
startComponent
in classComponentTypeBase
- Parameters:
component
- Component that should be started- Returns:
- true if the component was successfully started
-
setAsAvailableContentType
public void setAsAvailableContentType(MediaItemComponentDefinition mediaCompDef)
Appends this media component as available content type among all webinitiatifs. This effective checks the content type in the "Active content types" section of the Channel Configuration panel- Specified by:
setAsAvailableContentType
in interfaceMediaItemComponentType
- Parameters:
mediaCompDef
- The media item component definition to activate
-
setAsAvailableContentType
public void setAsAvailableContentType(MediaItemComponentDefinition mediaCompDef, int webId, boolean available)
Appends this media component as available content type on the specified webinitiatif. This effective checks the content type in the "Active content types" section of the Channel Configuration panel on that webinitiatif.- Specified by:
setAsAvailableContentType
in interfaceMediaItemComponentType
- Parameters:
mediaCompDef
- The media item component definition to activatewebId
- The id of the website to enable to content type onavailable
- If true, the contenttype is added as available, if false, it is removed
-
stopComponent
public boolean stopComponent(Component component)
Description copied from interface:ComponentType
Stops an installed component.- Specified by:
stopComponent
in interfaceComponentType
- Specified by:
stopComponent
in classComponentTypeBase
- Parameters:
component
- Component that should be stopped- Returns:
- true if the component was successfully stopped
-
installComponent
public boolean installComponent(ComponentDefinition componentDefinition)
Description copied from interface:ComponentType
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 interfaceComponentType
- Overrides:
installComponent
in classComponentTypeBase
- 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 interface:ComponentType
Updates a component.- Specified by:
updateComponent
in interfaceComponentType
- Overrides:
updateComponent
in classComponentTypeBase
- 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 interface:ComponentType
Deletes the content created by instances of the component type.- Specified by:
purgeComponent
in interfaceComponentType
- Overrides:
purgeComponent
in classComponentTypeBase
- 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 interface:ComponentType
Uninstalls a component. Uninstalling means all files and objects instantiated by the component's definition are deleted.- Specified by:
uninstallComponent
in interfaceComponentType
- Overrides:
uninstallComponent
in classComponentTypeBase
- Parameters:
componentDefinition
- Definition of the component that is to be uninstalled- Returns:
- true if the component was successfully uninstalled
-
deployResources
public void deployResources(ComponentDefinition componentDefinition)
Description copied from interface:ComponentType
Deploys the necessary resources for a component. This should deploy all resources that are removed on a restart of an installation, for instance mediaitem icons.- Specified by:
deployResources
in interfaceComponentType
- Overrides:
deployResources
in classComponentTypeBase
- Parameters:
componentDefinition
- theComponentDefinition
of the component that is enabled
-
checkComponentDefinition
public boolean checkComponentDefinition(ComponentDefinition componentDefinition)
Description copied from interface:ComponentType
Check whether a componentDefinition is valid for this componentType.- Specified by:
checkComponentDefinition
in interfaceComponentType
- Overrides:
checkComponentDefinition
in classComponentTypeBase
- Parameters:
componentDefinition
- definition of a component that is validated- Returns:
- a boolean value indicating whether the componentDefinition is valid
-
getComponentInterface
public String getComponentInterface()
Description copied from interface:ComponentType
Return the component interface this componentType provides.- Specified by:
getComponentInterface
in interfaceComponentType
- Returns:
- identifier for provided type
-
getComponentTypeInterface
public String getComponentTypeInterface()
Description copied from interface:ComponentType
Returns the componentType interface this componentType publishes.- Specified by:
getComponentTypeInterface
in interfaceComponentType
- Returns:
- identifier for provided type
-
-