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:
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 private static String__INVITATION_ACLConstants for invitation's acl nodeprivate static String__INVITATION_AUTHORConstants for invitation's author propertyprivate static String__INVITATION_DATEConstants for invitation's date propertyprivate static String__INVITATION_MAILConstants for invitation's mail propertyprivate static String__INVITATION_NODE_NAMEprivate static String__INVITATIONS_NODE_NAMEprivate static String__MEMBERS_MODULE_TAGTag on the main page holding the members moduleprivate static String__MODULE_TITLE_KEYModule i18n title keyprivate static String__NODETYPE_INVITATIONprivate static String__NODETYPE_INVITATIONSprivate static String__WORKSPACES_MEMBERS_NODE_NAMEWorkspaces members node nameprivate WorkspaceModuleExtensionPoint_moduleEPprivate Repository_repositorystatic 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, _observationManager, _pageDAO, _pluginName, _projectManager, _projectRightHelper, _resolver, _rightManager, _serviceEP, _skinsManager, _userHelper, _userManager
-
-
Constructor Summary
Constructors Constructor Description MembersWorkspaceModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private MembersWorkspaceModule.Invitation_getInvitation(Node node)private String_getProjectName(Node node)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.StringgetModuleName()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 projectprotected StringgetModuleTagName()Returns the tag of apply to module pageI18nizableTextgetModuleTitle()Get the module titleprotected 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, _deletePages, _getAmetysObject, _getDefaultXslt, _internalActivateModule, _internalDeactivateModule, activateModule, contextualize, deactivateModule, getModulePages, getModulePageTemplate, getModuleUrl, initializeSitemap, setPluginInfo
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
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
-
__MEMBERS_MODULE_TAG
private static final String __MEMBERS_MODULE_TAG
Tag on the main page holding the members module- See Also:
- Constant Field Values
-
__WORKSPACES_MEMBERS_NODE_NAME
private static final String __WORKSPACES_MEMBERS_NODE_NAME
Workspaces members node name- See Also:
- Constant Field Values
-
__MODULE_TITLE_KEY
private static final String __MODULE_TITLE_KEY
Module i18n title key- See Also:
- Constant Field Values
-
__INVITATIONS_NODE_NAME
private static final String __INVITATIONS_NODE_NAME
- See Also:
- Constant Field Values
-
__INVITATION_NODE_NAME
private static final String __INVITATION_NODE_NAME
- See Also:
- Constant Field Values
-
__NODETYPE_INVITATIONS
private static final String __NODETYPE_INVITATIONS
- See Also:
- Constant Field Values
-
__NODETYPE_INVITATION
private static final String __NODETYPE_INVITATION
- See Also:
- Constant Field Values
-
__INVITATION_DATE
private static final String __INVITATION_DATE
Constants for invitation's date property- See Also:
- Constant Field Values
-
__INVITATION_MAIL
private static final String __INVITATION_MAIL
Constants for invitation's mail property- See Also:
- Constant Field Values
-
__INVITATION_AUTHOR
private static final String __INVITATION_AUTHOR
Constants for invitation's author property- See Also:
- Constant Field Values
-
__INVITATION_ACL
private static final String __INVITATION_ACL
Constants for invitation's acl node- See Also:
- Constant Field Values
-
_moduleEP
private WorkspaceModuleExtensionPoint _moduleEP
-
_repository
private Repository _repository
-
-
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
-
getModuleName
public String getModuleName()
Description copied from interface:WorkspaceModuleGet the module name- Returns:
- the module name
-
getModuleTitle
public I18nizableText getModuleTitle()
Description copied from interface:WorkspaceModuleGet the module title- Returns:
- The title
-
getModulePageName
protected String getModulePageName()
Description copied from class:AbstractWorkspaceModuleReturns the module page's name- Specified by:
getModulePageNamein classAbstractWorkspaceModule- Returns:
- The module page's name
-
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
-
getModuleTagName
protected String getModuleTagName()
Description copied from class:AbstractWorkspaceModuleReturns the tag of apply to module page- Specified by:
getModuleTagNamein classAbstractWorkspaceModule- Returns:
- The tag for module page
-
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
-
_getInvitation
private MembersWorkspaceModule.Invitation _getInvitation(Node node) throws ValueFormatException, PathNotFoundException, RepositoryException
-
_getProjectName
private String _getProjectName(Node node)
-
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
-
-