public class ProjectsCatalogueManager extends AbstractLogEnabled implements Serviceable, Component, Contextualizable
Constructor and Description |
---|
ProjectsCatalogueManager() |
Modifier and Type | Method and Description |
---|---|
private void |
_assignPopulationsAndManager(Project project,
Map<String,Object> formData) |
private Project |
_createProject(String parentId,
Map<String,Object> formData,
CompositeMetadata serviceParameters,
Map<String,Object> siteConfiguration,
List<String> errors) |
private Map<String,Object> |
_getNewSiteConfiguration(Map<String,Object> formData,
CompositeMetadata serviceParameters) |
private Map<String,Object> |
_getProjectParameters(String projectId,
CompositeMetadata serviceParameters) |
private Map<String,Object> |
_getSiteConfiguration(String siteName) |
private Map<String,Object> |
_node2Json(Object treeNode,
boolean includeProjects,
List<String> filterCategories) |
private void |
_sendAskToJoinMail(String message,
Project project,
UserIdentity joiningUser) |
private void |
_setProjectIllustration(Project project,
Map<String,Object> formData,
Part illustration) |
private void |
_updateCategory(Project project,
Map<String,Object> formData) |
private void |
_updateModules(Project project,
Map<String,Object> formData) |
private void |
_updateProject(Project project,
Map<String,Object> formData,
CompositeMetadata serviceParameters) |
private void |
_updateSiteConfiguration(Project project,
Map<String,Object> formData,
CompositeMetadata serviceParameters,
List<String> errors) |
Map<String,Object> |
askToJoinProject(String projectId,
String message)
Send a demand to join a project to the project's manager, if the project's inscriptions are moderated
|
void |
contextualize(Context context) |
Map<String,Object> |
createProject(Map<String,Object> formData,
String zoneItemId)
Create a new project
|
Map<String,Object> |
createProject(Part illustration,
Map<String,Object> formData,
String zoneItemId)
Create a new project
|
Map<String,Object> |
deleteProject(String projectId)
Delete a project
|
Map<String,Object> |
editProject(Part illustration,
String projectId,
Map<String,Object> formData,
String zoneItemId)
edit a project
|
Map<String,Object> |
editProject(String projectId,
Map<String,Object> formData,
String zoneItemId)
edit a project
|
List<Map<String,Object>> |
getCategoriesTree(String id)
Get the categories tree
|
Map<String,Object> |
getNewProjectData(String zoneItemId)
Retrieve the data required to create a new project
|
Map<String,Object> |
getProjectData(String projectId,
String zoneItemId)
Retrieve the data of a project to edit, or the data for a new project
|
List<Map<String,Object>> |
getProjectTreeNode(String id,
boolean includeProjects)
Get the node information of a specific project or category from the project tree
|
List<Map<String,Object>> |
getProjectTreeNode(String id,
boolean includeProjects,
boolean memberOnly)
Get the node information of a specific project or category from the project tree
|
List<Map<String,Object>> |
getProjectTreeNode(String id,
boolean includeProjects,
boolean memberOnly,
List<String> filterCategories)
Get the node information of a specific project or category from the project tree
|
List<Map<String,Object>> |
getProjectTreeNode(String id,
String zoneItemId,
boolean includeProjects)
Get the node information of a specific project or category from the project tree
|
Map<String,Object> |
getRights()
Get the rights to create, edit or delete projects, for the current user
|
Map<String,Object> |
joinProject(String projectId)
Add the current user to the project, if the project's inscriptions are opened
|
void |
service(ServiceManager manager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private static final String __RIGHT_PROJECT_CREATE
private static final String __RIGHT_PROJECT_EDIT
private static final String __RIGHT_PROJECT_DELETE
private static final String __RIGHT_PROJECT_FO_CREATE
private static final String __RIGHT_PROJECT_FO_EDIT
private static final String __RIGHT_PROJECT_FO_DELETE
private RightManager _rightManager
private ProjectManager _projectManager
private ProjectMemberManager _projectMemberManager
private CurrentUserProvider _currentUserProvider
private ProjectRightHelper _projectRightHelper
private AmetysObjectResolver _resolver
private LanguagesManager _languagesManager
private SourceResolver _sourceResolver
private SiteConfigurationExtensionPoint _siteConfigurationEP
private PopulationContextHelper _populationContextHelper
private WorkspaceModuleExtensionPoint _moduleManagerEP
private SiteConfigurationExtensionPoint _siteConfiguration
private ProfileAssignmentStorageExtensionPoint _profileAssignmentStorageExtensionPoint
private UserManager _userManager
private I18nUtils _i18nUtils
private ObservationManager _observationManager
private GroupDirectoryContextHelper _groupDirectoryContextHelper
public ProjectsCatalogueManager()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public Map<String,Object> getRights()
public List<Map<String,Object>> getCategoriesTree(String id)
id
- The tree root. Can be nullpublic List<Map<String,Object>> getProjectTreeNode(String id, boolean includeProjects)
id
- The category or project idincludeProjects
- False to only get the categories treepublic List<Map<String,Object>> getProjectTreeNode(String id, String zoneItemId, boolean includeProjects)
id
- The category or project idzoneItemId
- The zone item of the project catalogueincludeProjects
- False to only get the categories treepublic List<Map<String,Object>> getProjectTreeNode(String id, boolean includeProjects, boolean memberOnly)
id
- The category or project idincludeProjects
- False to only get the categories treememberOnly
- Only return projects for which the current user is a memberpublic List<Map<String,Object>> getProjectTreeNode(String id, boolean includeProjects, boolean memberOnly, List<String> filterCategories)
id
- The category or project idincludeProjects
- False to only get the categories treememberOnly
- Only return projects for which the current user is a memberfilterCategories
- The list of categories to filter. Can be null to ignoreprivate Map<String,Object> _node2Json(Object treeNode, boolean includeProjects, List<String> filterCategories)
public Map<String,Object> getNewProjectData(String zoneItemId)
zoneItemId
- The zone item of the project cataloguepublic Map<String,Object> getProjectData(String projectId, String zoneItemId)
projectId
- The project id. Can be null.zoneItemId
- The zone item of the project catalogprivate Map<String,Object> _getProjectParameters(String projectId, CompositeMetadata serviceParameters)
public Map<String,Object> createProject(Map<String,Object> formData, String zoneItemId) throws IllegalAccessException, AmetysRepositoryException, IOException
formData
- The project datazoneItemId
- The zone item of the project catalogueIllegalAccessException
- If an error occurredIOException
- If an error occurredAmetysRepositoryException
- If an error occurredpublic Map<String,Object> createProject(Part illustration, Map<String,Object> formData, String zoneItemId) throws IllegalAccessException, AmetysRepositoryException, IOException
illustration
- The project illustration file. Can be nullformData
- The project datazoneItemId
- The zone item of the project catalogueIllegalAccessException
- If an error occurredIOException
- If an error occurredAmetysRepositoryException
- If an error occurredprivate Map<String,Object> _getNewSiteConfiguration(Map<String,Object> formData, CompositeMetadata serviceParameters)
private Project _createProject(String parentId, Map<String,Object> formData, CompositeMetadata serviceParameters, Map<String,Object> siteConfiguration, List<String> errors)
private void _assignPopulationsAndManager(Project project, Map<String,Object> formData)
public Map<String,Object> editProject(String projectId, Map<String,Object> formData, String zoneItemId) throws IllegalAccessException, AmetysRepositoryException, RepositoryException, IOException
projectId
- the project idformData
- The project datazoneItemId
- The zone item of the project catalogueIllegalAccessException
- If an error occurredRepositoryException
- If an error occurredAmetysRepositoryException
- If an error occurredIOException
- If an error occurredpublic Map<String,Object> editProject(Part illustration, String projectId, Map<String,Object> formData, String zoneItemId) throws IllegalAccessException, AmetysRepositoryException, RepositoryException, IOException
illustration
- The project illustration file. Can be nullprojectId
- the project idformData
- The project datazoneItemId
- The zone item of the project catalogueIllegalAccessException
- If an error occurredRepositoryException
- If an error occurredAmetysRepositoryException
- If an error occurredIOException
- If an error occurredprivate void _updateProject(Project project, Map<String,Object> formData, CompositeMetadata serviceParameters)
private void _updateSiteConfiguration(Project project, Map<String,Object> formData, CompositeMetadata serviceParameters, List<String> errors)
private Map<String,Object> _getSiteConfiguration(String siteName)
private void _updateCategory(Project project, Map<String,Object> formData) throws AmetysRepositoryException, RepositoryException
private void _updateModules(Project project, Map<String,Object> formData)
private void _setProjectIllustration(Project project, Map<String,Object> formData, Part illustration) throws AmetysRepositoryException, IOException
AmetysRepositoryException
IOException
public Map<String,Object> deleteProject(String projectId) throws IllegalAccessException
projectId
- The project idIllegalAccessException
- if an error occurredpublic Map<String,Object> joinProject(String projectId) throws javax.mail.MessagingException
projectId
- The project idjavax.mail.MessagingException
- If an error occurred sending a notification mail to the project managerpublic Map<String,Object> askToJoinProject(String projectId, String message) throws javax.mail.MessagingException
projectId
- The project to joinmessage
- A message to send to the project's manager.javax.mail.MessagingException
- If an error occurred sending the email to the project's managerprivate void _sendAskToJoinMail(String message, Project project, UserIdentity joiningUser) throws javax.mail.MessagingException
javax.mail.MessagingException