|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.gx.webmanager.wcb.foundation.ComponentBase
nl.gx.webmanager.wcb.foundation.ComponentTypeBase
public abstract class ComponentTypeBase
Base class for component type's containing utility functions that are used in component type implementations.
| Field Summary | |
|---|---|
protected JcrRepository |
myJcrService
|
protected nl.gx.siteworks.util.SiteworksUtil |
mySiteworksUtil
|
| Fields inherited from class nl.gx.webmanager.wcb.foundation.ComponentBase |
|---|
myBundleContext, myComponentBundle, myComponentDefinition |
| Constructor Summary | |
|---|---|
ComponentTypeBase()
|
|
| Method Summary | |
|---|---|
boolean |
checkComponentDefinition(ComponentDefinition componentDefinition)
Check whether a componentDefinition is valid for this componentType. |
void |
componentAdded(org.osgi.framework.ServiceReference serviceReference,
java.lang.Object service)
Adds a reference of the component service to the local map. |
void |
componentRemoved(org.osgi.framework.ServiceReference serviceReference,
java.lang.Object service)
Removes a reference of the component service to the local map. |
protected void |
createEditLanguageLabels(ComponentDefinition componentDefinition,
nl.gx.siteworks.core.HtmlObject object,
java.lang.String key)
Create language edit labels. |
protected nl.gx.siteworks.core.HtmlObject |
createOrUpdatePermissions(ComponentDefinition componentDefinition)
Creates or updates the permissions as defined in the component definition and returns the rbac category to which the permissions are assigned. |
protected nl.gx.siteworks.core.HtmlObject |
createOrUpdatePermissions(MenuItemComponentDefinition componentDefinition,
nl.gx.siteworks.core.HtmlObject menuItem)
Creates or updates the permissions as defined in the component definition and returns the rbac category to which the permissions are assigned. |
protected nl.gx.siteworks.core.HtmlObject |
createOrUpdateRbacCategory(MenuItemComponentDefinition componentDefinition)
Creates or updates the rbac category as defined in the component definition and returns it. |
protected nl.gx.siteworks.core.HtmlObject |
createPermission(Permission permission,
ComponentDefinition componentDefinition,
nl.gx.siteworks.core.HtmlObject rbacCategory)
Creates and returns a single persistent rbac permission HtmlObject based on the given Permission and ComponentDefinition object and assigns it to the given rbac category
HtmlObject. |
protected nl.gx.siteworks.core.HtmlObject |
createPermission(Permission permission,
MenuItemComponentDefinition componentDefinition,
nl.gx.siteworks.core.HtmlObject rbacCategory,
nl.gx.siteworks.core.HtmlObject menuItem)
Creates and returns a single persistent rbac permission HtmlObject based on the given Permission and ComponentDefinition object and assigns it to the given rbac category
HtmlObject and associates it with the given menu item HtmlObject in the WebManager menu
structure. |
protected void |
createPermissions(ComponentDefinition componentDefinition)
Creates the permissions as defined in the component definition. |
protected void |
createPermissions(MenuItemComponentDefinition componentDefinition,
nl.gx.siteworks.core.HtmlObject menuItem)
Creates the permissions as defined in the component definition. |
protected void |
deleteEditLanguageLabels(nl.gx.siteworks.core.HtmlObject htmlObject)
Deletes all language labels from the given HtmlObject object. |
protected void |
deletePermissions(ComponentDefinition componentDefinition)
Deletes the permissions as defined in the component definition. |
protected void |
deletePermissions(MenuItemComponentDefinition componentDefinition)
Deletes the permissions as defined in the component definition. |
protected void |
disableMenuItems(MenuItemComponentDefinition componentDefinition,
java.lang.String menuType)
Disables the menu items for the component by de-assigning them from the permission free menu items or from the corresponding rbac permissions. |
protected void |
enableMenuItems(MenuItemComponentDefinition componentDefinition,
java.lang.String menuType)
Enables the menu items for the component by assigning them to the permission free menu items or to the corresponding rbac permissions. |
Component |
getComponent(java.lang.String id)
Get a registered component by id. |
int |
getComponentCount()
Get the number of registered components for this componentType. |
ComponentManager |
getComponentManager()
Get the componentManager. |
Component[] |
getComponents()
Get an array of registered component for this componentType. |
protected static java.lang.String |
getLocaleIdFromResourceName(java.lang.String resourceName)
Returns the programmatic name of the entire locale, based on the name of a resource file, with the language, country and variant separated by underbars. |
protected org.osgi.service.prefs.PreferencesService |
getPreferencesService()
Override this method to return the preferences service. |
protected boolean |
grantsMenuItemAccess(MenuItemComponentDefinition componentDefinition,
Permission permission)
Returns if the given permission should grant the user access to the element menu item, according to the component definition |
protected void |
insertIntoMainMenu(MenuItemComponentDefinition componentDefinition,
nl.gx.siteworks.core.HtmlObject menuStructureItem)
Creates the permissions as defined in the component definition. |
boolean |
installComponent(ComponentDefinition componentDefinition)
Invoked when a component of this component type is installed. |
protected void |
logError(java.lang.String error,
java.lang.Exception e,
ComponentDefinition compDef)
Log an error message that installation, update, purge or uninstallation failed. |
boolean |
purgeComponent(ComponentDefinition componentDefinition)
Deletes the content created by instances of the component type. |
abstract boolean |
startComponent(Component component)
Starts an installed component. |
abstract boolean |
stopComponent(Component component)
Stops an installed component. |
boolean |
uninstallComponent(ComponentDefinition componentDefinition)
Uninstalls a component. |
boolean |
updateComponent(ComponentDefinition componentDefinition)
Updates a component. |
protected void |
updatePermissionsForPermissionGroups(ComponentDefinition componentDefinition)
Updates the permissions assigned to the permission groups Can be invoked both from install and update |
| 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 |
|---|
getComponentInterface, getComponentTypeInterface |
| Field Detail |
|---|
protected JcrRepository myJcrService
protected nl.gx.siteworks.util.SiteworksUtil mySiteworksUtil
| Constructor Detail |
|---|
public ComponentTypeBase()
| Method Detail |
|---|
public ComponentManager getComponentManager()
getComponentManager in class ComponentBasepublic boolean installComponent(ComponentDefinition componentDefinition)
installComponent in interface ComponentTypecomponentDefinition - Definition of the component that is to be installed
public boolean updateComponent(ComponentDefinition componentDefinition)
updateComponent in interface ComponentTypecomponentDefinition - Definition of the component that is to be installed
public boolean purgeComponent(ComponentDefinition componentDefinition)
purgeComponent in interface ComponentTypecomponentDefinition - Definition of the component that is to be purged
public boolean uninstallComponent(ComponentDefinition componentDefinition)
uninstallComponent in interface ComponentTypecomponentDefinition - Definition of the component that is to be uninstalled
public abstract boolean startComponent(Component component)
startComponent in interface ComponentTypecomponent - Component that should be started
public abstract boolean stopComponent(Component component)
stopComponent in interface ComponentTypecomponent - Component that should be started
public boolean checkComponentDefinition(ComponentDefinition componentDefinition)
checkComponentDefinition in interface ComponentTypecomponentDefinition - definition of a component that is validated
public Component getComponent(java.lang.String id)
getComponent in interface ComponentTypeid - Unique identifier representing the component
public Component[] getComponents()
getComponents in interface ComponentTypepublic int getComponentCount()
getComponentCount in interface ComponentTypeprotected org.osgi.service.prefs.PreferencesService getPreferencesService()
public final void componentAdded(org.osgi.framework.ServiceReference serviceReference,
java.lang.Object service)
serviceReference - Component service reference.service - Component service.
public final void componentRemoved(org.osgi.framework.ServiceReference serviceReference,
java.lang.Object service)
serviceReference - Component service reference.service - Component service.protected static java.lang.String getLocaleIdFromResourceName(java.lang.String resourceName)
resourceName - Name of the resource file from which the programmatic name is to be extracted.
protected void enableMenuItems(MenuItemComponentDefinition componentDefinition,
java.lang.String menuType)
throws nl.gx.siteworks.core.HtmlObjectNotFoundException
componentDefinition - Component definition to enable menu items for
nl.gx.siteworks.core.HtmlObjectNotFoundException
protected void disableMenuItems(MenuItemComponentDefinition componentDefinition,
java.lang.String menuType)
throws nl.gx.siteworks.core.HtmlObjectNotFoundException
componentDefinition - Component definition to disable menu items for
nl.gx.siteworks.core.HtmlObjectNotFoundException
protected void createEditLanguageLabels(ComponentDefinition componentDefinition,
nl.gx.siteworks.core.HtmlObject object,
java.lang.String key)
throws nl.gx.siteworks.core.DuplicateNameException
componentDefinition - Component definition containing the language resources to read the labels
fromobject - Object to assign the created label tokey - Key to load the label from the language resources
nl.gx.siteworks.core.DuplicateNameExceptionprotected void deleteEditLanguageLabels(nl.gx.siteworks.core.HtmlObject htmlObject)
htmlObject - HtmlObject object to remove the language labels from.
protected nl.gx.siteworks.core.HtmlObject createOrUpdateRbacCategory(MenuItemComponentDefinition componentDefinition)
throws nl.gx.siteworks.core.DuplicateNameException,
nl.gx.siteworks.core.HtmlObjectNotFoundException
componentDefinition - Component definition to create the rbac category for.
nl.gx.siteworks.core.DuplicateNameException - If the rbac category HtmlObject object or on of its language label
HtmlObject objects cannot be created because there already exists an HtmlObject object with
the same name.
nl.gx.siteworks.core.HtmlObjectNotFoundException - If the all webs registry HtmlObject object cannot be found.
protected nl.gx.siteworks.core.HtmlObject createPermission(Permission permission,
MenuItemComponentDefinition componentDefinition,
nl.gx.siteworks.core.HtmlObject rbacCategory,
nl.gx.siteworks.core.HtmlObject menuItem)
throws nl.gx.siteworks.core.DuplicateNameException
Permission and ComponentDefinition object and assigns it to the given rbac category
HtmlObject and associates it with the given menu item HtmlObject in the WebManager menu
structure.
permission - Permission object which contains the permission's data.componentDefinition - ComponentDefinition object which is used to retrieve the needed text
labels.rbacCategory - HtmlObject object to which the new permission HtmlObject object has
to be assigned.menuItem - The menu item HtmlObject in the WebManager menu structure with which the new to
be associated.
Permission and
ComponentDefinition object.
nl.gx.siteworks.core.DuplicateNameException - If there already is a HtmlObject of the rbac_permission
objecttype with the same name as the name for the created rbac permission.
protected final nl.gx.siteworks.core.HtmlObject createPermission(Permission permission,
ComponentDefinition componentDefinition,
nl.gx.siteworks.core.HtmlObject rbacCategory)
throws nl.gx.siteworks.core.DuplicateNameException
Permission and ComponentDefinition object and assigns it to the given rbac category
HtmlObject.
permission - Permission object which contains the permission's data.componentDefinition - ComponentDefinition object which is used to retrieve the needed text
labels.rbacCategory - HtmlObject object to which the new permission HtmlObject object has
to be assigned.
Permission and
ComponentDefinition object.
nl.gx.siteworks.core.DuplicateNameException - If there already is a HtmlObject of the rbac_permission
objecttype with the same name as the name for the created rbac permission.
protected boolean grantsMenuItemAccess(MenuItemComponentDefinition componentDefinition,
Permission permission)
componentDefinition - permission -
protected void updatePermissionsForPermissionGroups(ComponentDefinition componentDefinition)
protected void insertIntoMainMenu(MenuItemComponentDefinition componentDefinition,
nl.gx.siteworks.core.HtmlObject menuStructureItem)
throws nl.gx.siteworks.core.HtmlObjectNotFoundException
componentDefinition - menuStructureItem -
nl.gx.siteworks.core.HtmlObjectNotFoundException
protected void createPermissions(MenuItemComponentDefinition componentDefinition,
nl.gx.siteworks.core.HtmlObject menuItem)
throws nl.gx.siteworks.core.HtmlObjectNotFoundException,
nl.gx.siteworks.core.DuplicateNameException
componentDefinition - Component definition to update the permissions formenuItem - menu item associated with the component
nl.gx.siteworks.core.HtmlObjectNotFoundException - If the wm_all_webinitiatives_registry HtmlObject object cannot be
found.
nl.gx.siteworks.core.DuplicateNameException - If the rbac category HtmlObject object or on of its language label
HtmlObject objects cannot be created because there already exists an HtmlObject object with
the same name.
protected final void createPermissions(ComponentDefinition componentDefinition)
throws nl.gx.siteworks.core.HtmlObjectNotFoundException,
nl.gx.siteworks.core.DuplicateNameException
componentDefinition - Component definition to update the permissions for.
nl.gx.siteworks.core.HtmlObjectNotFoundException - If the wm_all_webinitiatives_registry HtmlObject object cannot be
found.
nl.gx.siteworks.core.DuplicateNameException - If the rbac category HtmlObject object or on of its language label
HtmlObject objects cannot be created because there already exists an HtmlObject object with
the same name.
protected nl.gx.siteworks.core.HtmlObject createOrUpdatePermissions(MenuItemComponentDefinition componentDefinition,
nl.gx.siteworks.core.HtmlObject menuItem)
throws nl.gx.siteworks.core.HtmlObjectNotFoundException,
nl.gx.siteworks.core.DuplicateNameException
componentDefinition - Component definition to create or update the permissions formenuItem - Menu item associated with the component
nl.gx.siteworks.core.HtmlObjectNotFoundException - If the wm_all_webinitiatives_registry HtmlObject object cannot be
found.
nl.gx.siteworks.core.DuplicateNameException - If the rbac category HtmlObject object or on of its language label
HtmlObject objects cannot be created because there already exists an HtmlObject object with
the same name.
protected final nl.gx.siteworks.core.HtmlObject createOrUpdatePermissions(ComponentDefinition componentDefinition)
throws nl.gx.siteworks.core.HtmlObjectNotFoundException,
nl.gx.siteworks.core.DuplicateNameException
componentDefinition - Component definition to create or update the permissions for
HtmlObject to which the created or updated permissions are assigned.
nl.gx.siteworks.core.HtmlObjectNotFoundException - If the wm_all_webinitiatives_registry HtmlObject object cannot be
found.
nl.gx.siteworks.core.DuplicateNameException - If the rbac category HtmlObject object or on of its language label
HtmlObject objects cannot be created because there already exists an HtmlObject object with
the same name.
protected void deletePermissions(MenuItemComponentDefinition componentDefinition)
throws nl.gx.siteworks.core.HtmlObjectNotFoundException,
nl.gx.siteworks.core.DuplicateNameException
componentDefinition - Component definition to remove the permissions for
nl.gx.siteworks.core.HtmlObjectNotFoundException - Is never thrown.
nl.gx.siteworks.core.DuplicateNameException - Is never thrown.protected final void deletePermissions(ComponentDefinition componentDefinition)
componentDefinition - Component definition to remove the permissions for
protected void logError(java.lang.String error,
java.lang.Exception e,
ComponentDefinition compDef)
error - e - compDef -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||