Package nl.gx.webmanager.wcb.foundation
Class ComponentDefinitionImpl
- java.lang.Object
-
- nl.gx.webmanager.wcb.foundation.ComponentDefinitionImpl
-
- All Implemented Interfaces:
ComponentDefinition
- Direct Known Subclasses:
DojoComponentDefinitionImpl
,FormComponentDefinitionImpl
,MediaItemComponentDefinitionImpl
,MenuItemComponentDefinitionImpl
,PageMetaDataComponentDefinitionImpl
,PresentationComponentDefinitionImpl
,ServiceComponentDefinitionImpl
,ServletComponentDefinitionImpl
public class ComponentDefinitionImpl extends Object implements ComponentDefinition
This class is used to describe components. It implements the ComponentDefinition interface as well as providing setters.- Author:
- bramk
-
-
Constructor Summary
Constructors Constructor Description ComponentDefinitionImpl(boolean isLicensed)
Constructs a newComponentDefinitionImpl
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ComponentBundleDefinition
getComponentBundleDefinition()
Returns the component bundle definition.String
getControllerClassName()
Returns the fully qualified className of the controlled class of the component this componentDefinition describes.ComponentDependency[]
getDependencies()
Returns the array of componentDependencies of the component this componentDefinition describes.String
getDescription()
Return the language independent description of the componentString
getDisplayLanguage(String resourceName)
Return the Java I18N display language assosiated with the resource file used by Spring.String[]
getEntityClassNames()
Gets the list of classNames that should be handled by the EntityFactory and PersisitenceManager.String
getEntityFactoryClassName()
Get the name of the EntityFactory class to use for handling persistence of this component.ComponentExtension[]
getExtensions()
Returns a list of component extensions of the component definition.String
getId()
Returns the unique id for the component.String
getImplementationClassName()
Returns the fully qualified className of the implementing class of the component this componentDefinition describes.Object
getImplementationInstance()
Returns the instance of the implementing class of the component this ComponentDefinition describes.String
getInstanceClassName()
Return the fully qualified className of the class returned by the getInstance method the component this componentDefinition describes.String[]
getInterfaceClassNames()
Returns the array of fully qualified classNames of the published interfaces for the component this componentDefinition describes.String
getLanguageResourceMessage(String messageKey, String languageResource)
Returns the message with the given messagekey from the resourcebundle of the specified language.HashMap<String,HashMap<String,String>>
getLanguageResourceMessages()
Returns a hashtable of loaded languageResources.String[]
getLanguageResources()
Returns the names of the language resource files associated with this componentString
getName()
Returns the name for the component.String
getNameSpace()
Deprecated.String
getNodeType()
Returns the unique node type associated with the component.PermissionCategory
getPermissionCategory()
Returns the permission category associated with this component.Map<String,Permission[]>
getPermissionsForPermissionGroups()
Returns a mapping that maps for each permission group which permissions used in this component should be assigned to that permission group.String
getPersistenceManagerClassName()
Get the name of the PersistenceManager class to use for handling persistence of this component.Dictionary<String,String>
getProperties()
TODO rename to something like 'context' Returns a dictionary with additional properties for the component this componentDefinition describes.String
getTypeId()
Returns the unique id for componentType of the component this componentDefinition describes.String[]
getWrapperClassNames()
boolean
isLicensed()
Returns whether theComponent
requires a license or not.void
setComponentBundleDefinition(ComponentBundleDefinition compBundleDef)
Sets the bundle component definition.void
setControllerClassName(String controllerClassName)
void
setDependencies(ComponentDependency[] dependencies)
void
setDescription(String description)
Set the language independent description of the componentvoid
setEntityClassNames(String[] entityClassnames)
Sets the names of entity classes handled by the EntityFactory and the PersistenceManager.void
setEntityFactoryClassName(String entityFactoryClassName)
Set the name of the EntityFactory class to use for handling persistence.void
setExtensions(ComponentExtension[] extensions)
Sets the extensions of the component definition.void
setId(String id)
void
setImplementationClassName(String implementationClassName)
void
setImplementationInstance(Object implementationInstance)
void
setInstanceClassName(String instanceClassName)
void
setInterfaceClassNames(String[] interfaceClassNames)
void
setLanguageResources(String[] languageResources)
void
setName(String name)
void
setNameSpace(String nameSpace)
Deprecated.void
setNodeType(String nodeType)
Setter for the node type assosiated with the component.void
setPermissionCategory(PermissionCategory permissionCategory)
Sets the permission category associated with the component.void
setPermissionsForPermissionGroup(String permissionGroupValue, Permission[] permissions)
Put an array of permissions in a map using the uniquely identifying value of a permission group as a key.void
setPersistenceManagerClassName(String persistenceManagerClassName)
Set the name of the PersistenceManager class to use for handling persistence.void
setProperties(Dictionary<String,String> properties)
void
setTypeId(String typeId)
void
setWrapperClassNames(String[] wrapperClassNames)
-
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:ComponentDefinition
Returns the unique id for the component.- Specified by:
getId
in interfaceComponentDefinition
- Returns:
- the id
-
setId
public void setId(String id)
-
getName
public String getName()
Description copied from interface:ComponentDefinition
Returns the name for the component.- Specified by:
getName
in interfaceComponentDefinition
- Returns:
- the name
-
setName
public void setName(String name)
- Parameters:
name
-
-
getNameSpace
@Deprecated public String getNameSpace()
Deprecated.This method is deprecated. Use the getNameSpace on ComponentBundleDefinitionImpl instead.- Specified by:
getNameSpace
in interfaceComponentDefinition
-
setNameSpace
@Deprecated public void setNameSpace(String nameSpace)
Deprecated.This method is deprecated. Use the setNameSpace on ComponentBundleDefinitionImpl instead.
-
getDescription
public String getDescription()
Return the language independent description of the component- Specified by:
getDescription
in interfaceComponentDefinition
- Returns:
- Language independent description of the component
-
setDescription
public void setDescription(String description)
Set the language independent description of the component- Parameters:
secription
- Language independent description of the component
-
isLicensed
public final boolean isLicensed()
Description copied from interface:ComponentDefinition
Returns whether theComponent
requires a license or not.- Specified by:
isLicensed
in interfaceComponentDefinition
- Returns:
- If TRUE, the component requires a license to run in Web Manager.
-
getTypeId
public String getTypeId()
Description copied from interface:ComponentDefinition
Returns the unique id for componentType of the component this componentDefinition describes.- Specified by:
getTypeId
in interfaceComponentDefinition
- Returns:
- the typeId
-
setTypeId
public void setTypeId(String typeId)
- Parameters:
typeId
-
-
getControllerClassName
public String getControllerClassName()
Description copied from interface:ComponentDefinition
Returns the fully qualified className of the controlled class of the component this componentDefinition describes.- Specified by:
getControllerClassName
in interfaceComponentDefinition
- Returns:
- the className
-
setControllerClassName
public void setControllerClassName(String controllerClassName)
- Parameters:
controllerClassName
-
-
getInterfaceClassNames
public String[] getInterfaceClassNames()
Description copied from interface:ComponentDefinition
Returns the array of fully qualified classNames of the published interfaces for the component this componentDefinition describes.- Specified by:
getInterfaceClassNames
in interfaceComponentDefinition
- Returns:
- an array of interfaceClassNames
-
setInterfaceClassNames
public void setInterfaceClassNames(String[] interfaceClassNames)
- Parameters:
interfaceClassNames
-
-
getImplementationClassName
public String getImplementationClassName()
Description copied from interface:ComponentDefinition
Returns the fully qualified className of the implementing class of the component this componentDefinition describes.- Specified by:
getImplementationClassName
in interfaceComponentDefinition
- Returns:
- the className
-
setImplementationClassName
public void setImplementationClassName(String implementationClassName)
- Parameters:
implementationClassName
-
-
getImplementationInstance
public Object getImplementationInstance()
Description copied from interface:ComponentDefinition
Returns the instance of the implementing class of the component this ComponentDefinition describes. This is the instance of the service that is described by this component definition. This instance returns an implementation of the class with nameComponentDefinition.getImplementationClassName()
, thus the class name of the object returned here equals, if not null, the implementation class name.- Specified by:
getImplementationInstance
in interfaceComponentDefinition
- Returns:
- The instance of the component
-
setImplementationInstance
public void setImplementationInstance(Object implementationInstance)
-
getDependencies
public ComponentDependency[] getDependencies()
Description copied from interface:ComponentDefinition
Returns the array of componentDependencies of the component this componentDefinition describes.- Specified by:
getDependencies
in interfaceComponentDefinition
- Returns:
- an array of componentDependencies
-
setDependencies
public void setDependencies(ComponentDependency[] dependencies)
- Parameters:
dependencies
-
-
getProperties
public Dictionary<String,String> getProperties()
Description copied from interface:ComponentDefinition
TODO rename to something like 'context' Returns a dictionary with additional properties for the component this componentDefinition describes.- Specified by:
getProperties
in interfaceComponentDefinition
- Returns:
- a dictionary of properties
-
setProperties
public void setProperties(Dictionary<String,String> properties)
- Parameters:
properties
-
-
setNodeType
public void setNodeType(String nodeType)
Setter for the node type assosiated with the component.- Parameters:
nodeType
- The node type assosiated with the component.
-
getNodeType
public String getNodeType()
Description copied from interface:ComponentDefinition
Returns the unique node type associated with the component.- Specified by:
getNodeType
in interfaceComponentDefinition
- Returns:
- the unique node type associated with the component
-
getInstanceClassName
public String getInstanceClassName()
Description copied from interface:ComponentDefinition
Return the fully qualified className of the class returned by the getInstance method the component this componentDefinition describes.- Specified by:
getInstanceClassName
in interfaceComponentDefinition
- Returns:
- the className
-
setInstanceClassName
public void setInstanceClassName(String instanceClassName)
- Parameters:
instanceClassName
-
-
getWrapperClassNames
public String[] getWrapperClassNames()
- Specified by:
getWrapperClassNames
in interfaceComponentDefinition
-
setWrapperClassNames
public void setWrapperClassNames(String[] wrapperClassNames)
- Parameters:
wrapperClassNames
-
-
getPermissionCategory
public PermissionCategory getPermissionCategory()
Description copied from interface:ComponentDefinition
Returns the permission category associated with this component.- Specified by:
getPermissionCategory
in interfaceComponentDefinition
- Returns:
- The permission category associated with this component.
-
setPermissionCategory
public void setPermissionCategory(PermissionCategory permissionCategory)
Sets the permission category associated with the component.- Parameters:
permissionCategory
- The permission category to set.
-
getPermissionsForPermissionGroups
public Map<String,Permission[]> getPermissionsForPermissionGroups()
Description copied from interface:ComponentDefinition
Returns a mapping that maps for each permission group which permissions used in this component should be assigned to that permission group. Permission groups are identified by a uniquely identifying string.- Specified by:
getPermissionsForPermissionGroups
in interfaceComponentDefinition
- Returns:
- a mapping that maps for each permission group which permissions used in this component should be assigned to that permission group
-
setPermissionsForPermissionGroup
public void setPermissionsForPermissionGroup(String permissionGroupValue, Permission[] permissions)
Put an array of permissions in a map using the uniquely identifying value of a permission group as a key. Note that this public method is not defined in the ComponentDefinition interface. This means you can only use this method when you still have access to this implementing class.- Parameters:
permissions
- Array of permissionspermissionGroupValue
- Uniquely identifying value of a permission group
-
setComponentBundleDefinition
public void setComponentBundleDefinition(ComponentBundleDefinition compBundleDef)
Description copied from interface:ComponentDefinition
Sets the bundle component definition.- Specified by:
setComponentBundleDefinition
in interfaceComponentDefinition
- Parameters:
compBundleDef
- Component bundle definition to set
-
getComponentBundleDefinition
public ComponentBundleDefinition getComponentBundleDefinition()
Description copied from interface:ComponentDefinition
Returns the component bundle definition.- Specified by:
getComponentBundleDefinition
in interfaceComponentDefinition
- Returns:
- The component bundle definition.
-
getLanguageResources
public String[] getLanguageResources()
Description copied from interface:ComponentDefinition
Returns the names of the language resource files associated with this component- Specified by:
getLanguageResources
in interfaceComponentDefinition
- Returns:
- the names of the language resource files associated with this component
-
setLanguageResources
public void setLanguageResources(String[] languageResources)
- Parameters:
languageResources
-
-
getDisplayLanguage
public String getDisplayLanguage(String resourceName)
Return the Java I18N display language assosiated with the resource file used by Spring.- Specified by:
getDisplayLanguage
in interfaceComponentDefinition
- Parameters:
resourceName
- Name of the resource file. Syntax of this file must be messages__ .properties - Returns:
- Java locale display language name assosiated with the resource.
-
getLanguageResourceMessage
public String getLanguageResourceMessage(String messageKey, String languageResource)
Returns the message with the given messagekey from the resourcebundle of the specified language.- Specified by:
getLanguageResourceMessage
in interfaceComponentDefinition
- Parameters:
messageKey
- bel to retrieve from the language resourcelanguageResource
- Language resource filename to retrieve message key from- Returns:
- nameValuePair with the label and values of the specified language label and language
-
getLanguageResourceMessages
public HashMap<String,HashMap<String,String>> getLanguageResourceMessages()
Returns a hashtable of loaded languageResources. Maps the name of the language resources onto a Hashmage containing the messageKeys and messageValues of the languageresource. if the languageResources where not loaded, it will be.- Specified by:
getLanguageResourceMessages
in interfaceComponentDefinition
- Returns:
- a hashtable which maps the name of all available languageresources onto a Hashmage containing the messageKeys and messageValues of the languageresource.
-
getEntityFactoryClassName
public String getEntityFactoryClassName()
Description copied from interface:ComponentDefinition
Get the name of the EntityFactory class to use for handling persistence of this component.- Specified by:
getEntityFactoryClassName
in interfaceComponentDefinition
- Returns:
- Class name as a string.
-
setEntityFactoryClassName
public void setEntityFactoryClassName(String entityFactoryClassName)
Set the name of the EntityFactory class to use for handling persistence.- Parameters:
entityFactoryClassName
-
-
getPersistenceManagerClassName
public String getPersistenceManagerClassName()
Description copied from interface:ComponentDefinition
Get the name of the PersistenceManager class to use for handling persistence of this component.- Specified by:
getPersistenceManagerClassName
in interfaceComponentDefinition
- Returns:
- Class name as a string.
-
setPersistenceManagerClassName
public void setPersistenceManagerClassName(String persistenceManagerClassName)
Set the name of the PersistenceManager class to use for handling persistence.- Parameters:
persistenceManagerClassName
-
-
getEntityClassNames
public String[] getEntityClassNames()
Description copied from interface:ComponentDefinition
Gets the list of classNames that should be handled by the EntityFactory and PersisitenceManager.- Specified by:
getEntityClassNames
in interfaceComponentDefinition
- Returns:
- an Array containing names of Entity classes
-
setEntityClassNames
public void setEntityClassNames(String[] entityClassnames)
Sets the names of entity classes handled by the EntityFactory and the PersistenceManager.- Parameters:
entityClassnames
- the names of entity classes to be handled by the EntityFactory and the PersistenceManager
-
getExtensions
public ComponentExtension[] getExtensions()
Description copied from interface:ComponentDefinition
Returns a list of component extensions of the component definition.- Specified by:
getExtensions
in interfaceComponentDefinition
- Returns:
- List of component extensions
-
setExtensions
public void setExtensions(ComponentExtension[] extensions)
Description copied from interface:ComponentDefinition
Sets the extensions of the component definition.- Specified by:
setExtensions
in interfaceComponentDefinition
-
-