Class MembersWorkspaceModule
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.workspaces.AbstractWorkspaceModule
-
- org.ametys.plugins.workspaces.members.MembersWorkspaceModule
-
- All Implemented Interfaces:
Comparable<WorkspaceModule>,WorkspaceModule,LogEnabled,PluginAware,Contextualizable,Serviceable
public class MembersWorkspaceModule extends AbstractWorkspaceModule
Helper component for managing members
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMembersWorkspaceModule.InvitationBean representing a invitation by email
-
Field Summary
Fields Modifier and Type Field Description static StringMEMBERS_MODULE_IDThe id of members modulestatic StringMEMBERS_SERVICE_IDId of service of members-
Fields inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceModule
_context, _currentUserProvider, _i18nUtils, _modulesEP, _observationManager, _pageDAO, _pluginName, _projectManager, _projectRightHelper, _resolver, _rightManager, _serviceEP, _skinsManager, _userHelper, _userManager
-
Fields inherited from interface org.ametys.plugins.workspaces.project.modules.WorkspaceModule
ORDER_ABOUT, ORDER_ALERTS, ORDER_CALENDAR, ORDER_DOCUMENTS, ORDER_MEMBERS, ORDER_MINISITE, ORDER_NEWS, ORDER_TASKS, ORDER_THREADS, ORDER_WALLCONTENT
-
-
Constructor Summary
Constructors Constructor Description MembersWorkspaceModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MembersWorkspaceModule.InvitationaddInvitation(Project project, Date invitDate, String mail, UserIdentity author, Map<String,String> allowedProfileByModules)Add an invitationSet<String>getAllowedEventTypes()Get the set of allowed event type for the moduleStringgetId()Get the module IdList<MembersWorkspaceModule.Invitation>getInvitations(String email)Get the invitations for a given mailList<MembersWorkspaceModule.Invitation>getInvitations(Project project)Returns the invitation sorted by ascending dateNodegetInvitationsRootNode(Project project, boolean create)Get the node holding the invitationsStringgetInvitationXPathQuery(Project project, Expression invitExpression, SortCriteria sortCriteria)Creates the XPath query corresponding to specifiedExpression.I18nizableTextgetModuleDescription()Get the module titleStringgetModuleName()Get the module nameprotected StringgetModulePageName()Returns the module page's nameprotected I18nizableTextgetModulePageTitle()Returns the module page's title as i18nModifiableResourceCollectiongetModuleRoot(Project project, boolean create)Get the module root node for the given projectI18nizableTextgetModuleTitle()Get the module titleintgetOrder()Get the module orderprotected voidinitializeModulePage(ModifiablePage memberPage)Initialize the module pagebooleaninvitationExists(Project project, String mail)Determines if a invitation already exists for this emailbooleanremoveInvitation(Project project, String mail)Remove a invitationvoidservice(ServiceManager smanager)-
Methods inherited from class org.ametys.plugins.workspaces.AbstractWorkspaceModule
_createModulePage, _deleteEvents, _deletePages, _getAmetysObject, _getDefaultXslt, _getModulePages, _internalActivateModule, _internalDeactivateModule, _internalDeleteData, _setPagesVisibility, activateModule, contextualize, deactivateModule, deleteData, getModulePageTemplate, getModuleUrl, initializeSitemap, setPluginInfo
-
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, isUnactivatedByDefault
-
-
-
-
Field Detail
-
MEMBERS_MODULE_ID
public static final String MEMBERS_MODULE_ID
The id of members module
-
MEMBERS_SERVICE_ID
public static final String MEMBERS_SERVICE_ID
Id of service of members- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MembersWorkspaceModule
public MembersWorkspaceModule()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractWorkspaceModule- Throws:
ServiceException
-
getId
public String getId()
Description copied from interface:WorkspaceModuleGet the module Id- Returns:
- The module ID
-
getOrder
public int getOrder()
Description copied from interface:WorkspaceModuleGet the module order- Returns:
- the priority in menus
-
getModuleName
public String getModuleName()
Description copied from interface:WorkspaceModuleGet the module name- Returns:
- the module name
-
getModulePageName
protected String getModulePageName()
Description copied from class:AbstractWorkspaceModuleReturns the module page's name- Specified by:
getModulePageNamein classAbstractWorkspaceModule- Returns:
- The module page's name
-
getModuleTitle
public I18nizableText getModuleTitle()
Description copied from interface:WorkspaceModuleGet the module title- Returns:
- The title
-
getModuleDescription
public I18nizableText getModuleDescription()
Description copied from interface:WorkspaceModuleGet the module title- Returns:
- The title
-
getModulePageTitle
protected I18nizableText getModulePageTitle()
Description copied from class:AbstractWorkspaceModuleReturns the module page's title as i18n- Specified by:
getModulePageTitlein classAbstractWorkspaceModule- Returns:
- The module page's title
-
initializeModulePage
protected void initializeModulePage(ModifiablePage memberPage)
Description copied from class:AbstractWorkspaceModuleInitialize the module page- Specified by:
initializeModulePagein classAbstractWorkspaceModule- Parameters:
memberPage- The module page
-
getModuleRoot
public ModifiableResourceCollection getModuleRoot(Project project, boolean create)
Description copied from interface:WorkspaceModuleGet the module root node for the given project- Parameters:
project- The project containing the modulecreate- True to create the node if it does not exists- Returns:
- The root node, or null if it does not exists and was not created
-
getAllowedEventTypes
public Set<String> getAllowedEventTypes()
Description copied from interface:WorkspaceModuleGet the set of allowed event type for the module- Returns:
- The set of allowed event types
-
getInvitationsRootNode
public Node getInvitationsRootNode(Project project, boolean create) throws RepositoryException
Get the node holding the invitations- Parameters:
project- The projectcreate- true to create the node if it does not exist- Returns:
- the invitations' root node
- Throws:
RepositoryException- if an error occurred
-
getInvitations
public List<MembersWorkspaceModule.Invitation> getInvitations(String email)
Get the invitations for a given mail- Parameters:
email- the email- Returns:
- the invitations
-
getInvitations
public List<MembersWorkspaceModule.Invitation> getInvitations(Project project) throws RepositoryException
Returns the invitation sorted by ascending date- Parameters:
project- The project- Returns:
- The invitations node
- Throws:
RepositoryException- if an error occurred
-
getInvitationXPathQuery
public String getInvitationXPathQuery(Project project, Expression invitExpression, SortCriteria sortCriteria) throws RepositoryException
Creates the XPath query corresponding to specifiedExpression.- Parameters:
project- The project. Can be null to browser all projectsinvitExpression- the query predicates.sortCriteria- the sort criteria.- Returns:
- the created XPath query.
- Throws:
RepositoryException- if an error occurred
-
addInvitation
public MembersWorkspaceModule.Invitation addInvitation(Project project, Date invitDate, String mail, UserIdentity author, Map<String,String> allowedProfileByModules) throws RepositoryException
Add an invitation- Parameters:
project- The projectmail- The mailinvitDate- The invitation's dateauthor- The invitation's authorallowedProfileByModules- The allowed profiles by modules- Returns:
- The created invitation node
- Throws:
RepositoryException- if an error occurred
-
invitationExists
public boolean invitationExists(Project project, String mail) throws RepositoryException
Determines if a invitation already exists for this email- Parameters:
project- the projectmail- the mail to test- Returns:
- true if a invitation exists
- Throws:
RepositoryException- if an error occured
-
removeInvitation
public boolean removeInvitation(Project project, String mail) throws RepositoryException
Remove a invitation- Parameters:
project- the projectmail- the mail to remove- Returns:
- true if a invitation has been removed
- Throws:
RepositoryException- if an error occured
-
-