Class ProjectsCatalogueManager
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.plugins.workspaces.project.ProjectsCatalogueManager
- All Implemented Interfaces:
Component
,Contextualizable
,LogEnabled
,Serviceable
public class ProjectsCatalogueManager
extends AbstractLogEnabled
implements Serviceable, Component, Contextualizable
Manager for the Projects Catalogue service
-
Field Summary
Modifier and TypeFieldDescriptionprotected CategoryProviderExtensionPoint
The extension point for project's categoriesprotected Context
The avalon contextprotected CurrentUserProvider
Current user providerprotected GroupDirectoryContextHelper
Helper for group directory's contextprotected I18nUtils
Utils for i18nprotected KeywordProviderExtensionPoint
The extension point for project's keywordsprotected LanguagesManager
The language managerprotected WorkspaceModuleExtensionPoint
The extension point for workspace's modulesprotected ObservationManager
The observation managerprotected PopulationContextHelper
Helper for user populationprotected ProfileAssignmentStorageExtensionPoint
The extension point for profiles' storageprotected ProjectManager
The project managerprotected ProjectMemberManager
The project members' managerprotected ProjectRightHelper
Helper for project's rightsprotected ProjectTagProviderExtensionPoint
The extension point for project's tagsprotected AmetysObjectResolver
Ametys Object Resolverprotected RightManager
The right managerprotected SiteConfigurationManager
The site's configuration managerprotected SiteDAO
The site daoprotected SourceResolver
The source resolverprotected UserManager
The user managerThe identifier of modules that are always activestatic final String
Avalon Role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaskToJoinProject
(String projectId, String message) Send a demand to join a project to the project's manager, if the project's inscriptions are moderatedvoid
contextualize
(Context context) createProject
(String zoneItemId, String title, String description, Object illustration, String category, List<Object> keywords, Integer visibility, String defaultProfile, String language, List<String> managers, List<String> modules) Create a projectdeleteProject
(String projectId) Delete a projectdetailedProject2json
(Project project) Transform aProject
into a json mapeditProject
(String projectId, String title, String description, Object illustration, String category, List<Object> keywords, Integer visibility, String defaultProfile, List<String> managers, List<String> modules) Edit an existing projectprotected String
getAddUserUrl
(Project project, UserIdentity user) Get the absolute url to add a user to a projectprotected String[]
Get the list of allowed data in the formCallable to get projects of the user and the public projects he can subscribe.Callable to get projects of the user.joinProject
(String projectId) Add the current user to the project, if the project's inscriptions are openedvoid
saxCategory
(ContentHandler contentHandler, Project project) SAX the project's categoryvoid
saxCategory
(ContentHandler contentHandler, Project project, String tagName) SAX the project's categoryvoid
saxProject
(ContentHandler contentHandler, Project project) SAX a projectvoid
service
(ServiceManager manager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
Avalon Role -
DEFAULT_MODULES
The identifier of modules that are always active -
_resolver
Ametys Object Resolver -
_currentUserProvider
Current user provider -
_projectMemberManager
The project members' manager -
_rightManager
The right manager -
_projectManager
The project manager -
_projectRightHelper
Helper for project's rights -
_languagesManager
The language manager -
_sourceResolver
The source resolver -
_siteDAO
The site dao -
_siteConfigurationManager
The site's configuration manager -
_populationContextHelper
Helper for user population -
_moduleManagerEP
The extension point for workspace's modules -
_profileAssignmentStorageExtensionPoint
The extension point for profiles' storage -
_userManager
The user manager -
_i18nUtils
Utils for i18n -
_observationManager
The observation manager -
_groupDirectoryContextHelper
Helper for group directory's context -
_projectTagProviderEP
The extension point for project's tags -
_categoryProviderEP
The extension point for project's categories -
_keywordProviderEP
The extension point for project's keywords -
_context
The avalon context
-
-
Constructor Details
-
ProjectsCatalogueManager
public ProjectsCatalogueManager()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
createProject
public Map<String,Object> createProject(String zoneItemId, String title, String description, Object illustration, String category, List<Object> keywords, Integer visibility, String defaultProfile, String language, List<String> managers, List<String> modules) throws IllegalAccessException Create a project- Parameters:
zoneItemId
- The id of the zoneitem holding the catalog servicetitle
- The titledescription
- The description (can be empty)illustration
- The illustration (can be a File or a local path)category
- The categorykeywords
- The project keywordsvisibility
- The visibilitydefaultProfile
- For public projects, profile for self registered userslanguage
- The language codemanagers
- The managers urlmodules
- The selected modules- Returns:
- Information about the new project
- Throws:
IllegalAccessException
- If user has no right to create tags and ask to
-
editProject
public Map<String,Object> editProject(String projectId, String title, String description, Object illustration, String category, List<Object> keywords, Integer visibility, String defaultProfile, List<String> managers, List<String> modules) throws IllegalAccessException Edit an existing project- Parameters:
projectId
- The id of the projecttitle
- New titledescription
- New descriptionillustration
- New illustrationcategory
- New categorykeywords
- The project keywordsvisibility
- New visibilitydefaultProfile
- New default profilemanagers
- New managersmodules
- New modules- Returns:
- The success map with project description
- Throws:
IllegalAccessException
- if user has not the convenient rights
-
deleteProject
Delete a project- Parameters:
projectId
- The project id- Returns:
- The result
- Throws:
IllegalAccessException
- if an error occurred
-
joinProject
public Map<String,Object> joinProject(String projectId) throws jakarta.mail.MessagingException, IOException Add the current user to the project, if the project's inscriptions are opened- Parameters:
projectId
- The project id- Returns:
- The result
- Throws:
jakarta.mail.MessagingException
- If an error occurred sending a notification mail to the project managerIOException
- If an error occurred sending the email to the project's manager
-
askToJoinProject
public Map<String,Object> askToJoinProject(String projectId, String message) throws jakarta.mail.MessagingException, IOException Send a demand to join a project to the project's manager, if the project's inscriptions are moderated- Parameters:
projectId
- The project to joinmessage
- A message to send to the project's manager.- Returns:
- The result
- Throws:
jakarta.mail.MessagingException
- If an error occurred sending the email to the project's managerIOException
- If an error occurred sending the email to the project's manager
-
getAddUserUrl
Get the absolute url to add a user to a project- Parameters:
project
- The projectuser
- the identity of user to add- Returns:
- the absolute page url
-
getAllowedFormData
Get the list of allowed data in the form- Returns:
- the list of allowed data in the form
-
getUserAndPublicProjects
Callable to get projects of the user and the public projects he can subscribe.- Returns:
- A map with three entries an entry for user projects, another one for public projects and finally one for the project's creation right
-
getUserProjects
Callable to get projects of the user.- Returns:
- A map with the user projects
-
detailedProject2json
Transform aProject
into a json map- Parameters:
project
- the project to parse- Returns:
- a json map
-
saxProject
SAX a project- Parameters:
contentHandler
- The content handler to sax intoproject
- the project- Throws:
SAXException
- if an error occurred while saxing
-
saxCategory
SAX the project's category- Parameters:
contentHandler
- the content handler to sax intoproject
- the project- Throws:
SAXException
- if an error occurred while saxing
-
saxCategory
public void saxCategory(ContentHandler contentHandler, Project project, String tagName) throws SAXException SAX the project's category- Parameters:
contentHandler
- the content handler to sax intoproject
- the projecttagName
- the tag name for category- Throws:
SAXException
- if an error occurred while saxing
-