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 class
MembersWorkspaceModule.Invitation
Bean representing a invitation by email
-
Field Summary
Fields Modifier and Type Field Description private static String
__INVITATION_ACL
Constants for invitation's acl nodeprivate static String
__INVITATION_AUTHOR
Constants for invitation's author propertyprivate static String
__INVITATION_DATE
Constants for invitation's date propertyprivate static String
__INVITATION_MAIL
Constants for invitation's mail propertyprivate static String
__INVITATION_NODE_NAME
private static String
__INVITATIONS_NODE_NAME
private static String
__MEMBERS_MODULE_TAG
Tag on the main page holding the members moduleprivate static String
__MODULE_TITLE_KEY
Module i18n title keyprivate static String
__NODETYPE_INVITATION
private static String
__NODETYPE_INVITATIONS
private static String
__WORKSPACES_MEMBERS_NODE_NAME
Workspaces members node nameprivate WorkspaceModuleExtensionPoint
_moduleEP
private Repository
_repository
static String
MEMBERS_MODULE_ID
The id of members modulestatic String
MEMBERS_SERVICE_ID
Id 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.Invitation
addInvitation(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 moduleString
getId()
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 dateNode
getInvitationsRootNode(Project project, boolean create)
Get the node holding the invitationsString
getInvitationXPathQuery(Project project, Expression invitExpression, SortCriteria sortCriteria)
Creates the XPath query corresponding to specifiedExpression
.String
getModuleName()
Get the module nameprotected String
getModulePageName()
Returns the module page's nameprotected I18nizableText
getModulePageTitle()
Returns the module page's title as i18nModifiableResourceCollection
getModuleRoot(Project project, boolean create)
Get the module root node for the given projectprotected String
getModuleTagName()
Returns the tag of apply to module pageI18nizableText
getModuleTitle()
Get the module titleprotected void
initializeModulePage(ModifiablePage memberPage)
Initialize the module pageboolean
invitationExists(Project project, String mail)
Determines if a invitation already exists for this emailboolean
removeInvitation(Project project, String mail)
Remove a invitationvoid
service(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:
service
in interfaceServiceable
- Overrides:
service
in classAbstractWorkspaceModule
- Throws:
ServiceException
-
getId
public String getId()
Description copied from interface:WorkspaceModule
Get the module Id- Returns:
- The module ID
-
getModuleName
public String getModuleName()
Description copied from interface:WorkspaceModule
Get the module name- Returns:
- the module name
-
getModuleTitle
public I18nizableText getModuleTitle()
Description copied from interface:WorkspaceModule
Get the module title- Returns:
- The title
-
getModulePageName
protected String getModulePageName()
Description copied from class:AbstractWorkspaceModule
Returns the module page's name- Specified by:
getModulePageName
in classAbstractWorkspaceModule
- Returns:
- The module page's name
-
getModulePageTitle
protected I18nizableText getModulePageTitle()
Description copied from class:AbstractWorkspaceModule
Returns the module page's title as i18n- Specified by:
getModulePageTitle
in classAbstractWorkspaceModule
- Returns:
- The module page's title
-
getModuleTagName
protected String getModuleTagName()
Description copied from class:AbstractWorkspaceModule
Returns the tag of apply to module page- Specified by:
getModuleTagName
in classAbstractWorkspaceModule
- Returns:
- The tag for module page
-
initializeModulePage
protected void initializeModulePage(ModifiablePage memberPage)
Description copied from class:AbstractWorkspaceModule
Initialize the module page- Specified by:
initializeModulePage
in classAbstractWorkspaceModule
- Parameters:
memberPage
- The module page
-
getModuleRoot
public ModifiableResourceCollection getModuleRoot(Project project, boolean create)
Description copied from interface:WorkspaceModule
Get 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:WorkspaceModule
Get 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
-
-