Package org.ametys.plugins.workspaces
Class AbstractWorkspaceModule
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.AbstractWorkspaceModule
- All Implemented Interfaces:
Comparable<WorkspaceModule>
,WorkspaceModule
,LogEnabled
,PluginAware
,Contextualizable
,Serviceable
- Direct Known Subclasses:
AlertWorkspaceModule
,CalendarWorkspaceModule
,DocumentWorkspaceModule
,EditionFOWorkspaceModule
,MembersWorkspaceModule
,NewsWorkspaceModule
,TasksWorkspaceModule
,ThreadWorkspaceModule
,WallContentModule
public abstract class AbstractWorkspaceModule
extends AbstractLogEnabled
implements WorkspaceModule, Serviceable, Contextualizable, PluginAware
Abstract class for
WorkspaceModule
implementation-
Field Summary
Modifier and TypeFieldDescriptionprotected Context
The avalon contextprotected CurrentUserProvider
The current user provider.protected I18nUtils
The i18n utils.protected WorkspaceModuleExtensionPoint
The modules extension pointprotected ObservationManager
Observer manager.protected PageDAO
The page DAOprotected String
The plugin nameprotected ProjectManager
Project managerprotected ProjectRightHelper
Project right helperprotected AmetysObjectResolver
Ametys resolverprotected RightManager
The rights managerprotected ServiceExtensionPoint
The services handlerprotected SkinsManager
The skins manager.protected UserHelper
The users managerprotected UserManager
User managerFields inherited from interface org.ametys.plugins.workspaces.project.modules.WorkspaceModule
ORDER_ALERTS, ORDER_CALENDAR, ORDER_DOCUMENTS, ORDER_MEMBERS, ORDER_NEWS, ORDER_TASKS, ORDER_THREADS, ORDER_WALLCONTENT, ORDER_WIKI
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ModifiablePage
_createModulePage
(Project project, Sitemap sitemap, String name, I18nizableText pageTitle, String skinTemplate) Create a new page if not already existsprotected void
_deleteEvents
(Project project) Delete all events related to this moduleprotected void
_deletePages
(Project project) Delete the module pages and their related contentsprotected <A extends AmetysObject>
A_getAmetysObject
(ModifiableTraversableAmetysObject parent, String name, String type, boolean create) Utility method to get or create an ametys objectprotected String
_getDefaultXslt
(String serviceId) Get the default value of the XSLT parameter of the given service._getModulePages
(Project project) Get the module pagesprotected void
_internalActivateModule
(Project project) Internal process when module is activatedprotected void
_internalDeactivateModule
(Project project) Internal process when module is deactivatedprotected void
_internalDeleteData
(Project project) Internal process to delete dataprotected void
_setPagesVisibility
(Project project, boolean visible) Change the visibility of module pages if neededvoid
activateModule
(Project project) Activate the module for the project, creating the module pagesvoid
contextualize
(Context context) void
deactivateModule
(Project project) Deactivate a modulevoid
deleteData
(Project project) Delete a module and all related data (pages, events, resources, ...)protected abstract String
Returns the module page's nameprotected String
Returns the template to use for module's pageprotected abstract I18nizableText
Returns the module page's title as i18ngetModuleUrl
(Project project) Get the URL of the first module's pageprotected abstract void
initializeModulePage
(ModifiablePage modulePage) Initialize the module pagevoid
initializeSitemap
(Project project, Sitemap sitemap) Initialize the sitemap for the modulevoid
service
(ServiceManager manager) void
setPluginInfo
(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.workspaces.project.modules.WorkspaceModule
compareTo, getAllowedEventTypes, getId, getModuleDescription, getModuleName, getModuleRoot, getModuleTitle, getOrder
-
Field Details
-
_projectManager
Project manager -
_projectRightHelper
Project right helper -
_userManager
User manager -
_resolver
Ametys resolver -
_rightManager
The rights manager -
_observationManager
Observer manager. -
_currentUserProvider
The current user provider. -
_userHelper
The users manager -
_i18nUtils
The i18n utils. -
_skinsManager
The skins manager. -
_pageDAO
The page DAO -
_context
The avalon context -
_pluginName
The plugin name -
_serviceEP
The services handler -
_modulesEP
The modules extension point
-
-
Constructor Details
-
AbstractWorkspaceModule
public AbstractWorkspaceModule()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
setPluginInfo
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
deleteData
Description copied from interface:WorkspaceModule
Delete a module and all related data (pages, events, resources, ...)- Specified by:
deleteData
in interfaceWorkspaceModule
- Parameters:
project
- The project
-
deactivateModule
Description copied from interface:WorkspaceModule
Deactivate a module- Specified by:
deactivateModule
in interfaceWorkspaceModule
- Parameters:
project
- The project
-
activateModule
Description copied from interface:WorkspaceModule
Activate the module for the project, creating the module pages- Specified by:
activateModule
in interfaceWorkspaceModule
- Parameters:
project
- The project
-
initializeSitemap
Description copied from interface:WorkspaceModule
Initialize the sitemap for the module- Specified by:
initializeSitemap
in interfaceWorkspaceModule
- Parameters:
project
- The project of the modulesitemap
- The sitemap
-
getModuleUrl
Description copied from interface:WorkspaceModule
Get the URL of the first module's page- Specified by:
getModuleUrl
in interfaceWorkspaceModule
- Parameters:
project
- The project- Returns:
- the module url
-
_createModulePage
protected ModifiablePage _createModulePage(Project project, Sitemap sitemap, String name, I18nizableText pageTitle, String skinTemplate) Create a new page if not already exists- Parameters:
project
- The module projectsitemap
- The sitemap where the page will be createdname
- The page's namepageTitle
- The page's title as i18nizable textskinTemplate
- The template from the skin to apply on the page- Returns:
- the created page or
null
if page already exists
-
_setPagesVisibility
Change the visibility of module pages if needed- Parameters:
project
- The projectvisible
- visibletrue
to set pages as visible,false
otherwise
-
_deletePages
Delete the module pages and their related contents- Parameters:
project
- The project
-
_getModulePages
Get the module pages- Parameters:
project
- the project- Returns:
- the module pages
-
_deleteEvents
Delete all events related to this module- Parameters:
project
- The project
-
_getDefaultXslt
Get the default value of the XSLT parameter of the given service.- Parameters:
serviceId
- the service ID.- Returns:
- the default XSLT parameter value.
-
getModulePageName
Returns the module page's name- Returns:
- The module page's name
-
getModulePageTitle
Returns the module page's title as i18n- Returns:
- The module page's title
-
getModulePageTemplate
Returns the template to use for module's page- Returns:
- The template
-
initializeModulePage
Initialize the module page- Parameters:
modulePage
- The module page
-
_internalDeactivateModule
Internal process when module is deactivated- Parameters:
project
- The project
-
_internalDeleteData
Internal process to delete data- Parameters:
project
- The project
-
_internalActivateModule
Internal process when module is activated- Parameters:
project
- The project
-
_getAmetysObject
protected <A extends AmetysObject> A _getAmetysObject(ModifiableTraversableAmetysObject parent, String name, String type, boolean create) throws AmetysRepositoryException Utility method to get or create an ametys object- Type Parameters:
A
- A sub class of AmetysObject- Parameters:
parent
- The parent objectname
- The ametys object nametype
- The ametys object typecreate
- True to create the object if it does not exist- Returns:
- ametys object
- Throws:
AmetysRepositoryException
- if an repository error occurs
-