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
Fields Modifier and Type Field Description protected CategoryProviderExtensionPoint
_categoryProviderEP
The extension point for project's categoriesprotected Context
_context
The avalon contextprotected CurrentUserProvider
_currentUserProvider
Current user providerprotected GroupDirectoryContextHelper
_groupDirectoryContextHelper
Helper for group directory's contextprotected I18nUtils
_i18nUtils
Utils for i18nprotected KeywordProviderExtensionPoint
_keywordProviderEP
The extension point for project's keywordsprotected LanguagesManager
_languagesManager
The language managerprotected WorkspaceModuleExtensionPoint
_moduleManagerEP
The extension point for workspace's modulesprotected ObservationManager
_observationManager
The observation managerprotected PopulationContextHelper
_populationContextHelper
Helper for user populationprotected ProfileAssignmentStorageExtensionPoint
_profileAssignmentStorageExtensionPoint
The extension point for profiles' storageprotected ProjectManager
_projectManager
The project managerprotected ProjectMemberManager
_projectMemberManager
The project members' managerprotected ProjectRightHelper
_projectRightHelper
Helper for project's rightsprotected ProjectTagProviderExtensionPoint
_projectTagProviderEP
The extension point for project's tagsprotected AmetysObjectResolver
_resolver
Ametys Object Resolverprotected RightManager
_rightManager
The right managerprotected SiteConfigurationManager
_siteConfigurationManager
The site's configuration managerprotected SiteDAO
_siteDAO
The site daoprotected SourceResolver
_sourceResolver
The source resolverprotected UserManager
_userManager
The user managerstatic Set<String>
DEFAULT_MODULES
The identifier of modules that are always activestatic String
ROLE
Avalon Role
-
Constructor Summary
Constructors Constructor Description ProjectsCatalogueManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 moderatedvoid
contextualize(Context context)
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)
Create a projectMap<String,Object>
deleteProject(String projectId)
Delete a projectMap<String,Object>
detailedProject2json(Project project)
Transform aProject
into a json mapMap<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)
Edit an existing projectprotected String
getAddUserUrl(Project project, UserIdentity user)
Get the absolute url to add a user to a projectprotected String[]
getAllowedFormData()
Get the list of allowed data in the formMap<String,Object>
getUserAndPublicProjects()
Callable to get projects of the user and the public projects he can subscribe.List<Map<String,Object>>
getUserProjects()
Callable to get projects of the user.Map<String,Object>
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 Detail
-
DEFAULT_MODULES
public static final Set<String> DEFAULT_MODULES
The identifier of modules that are always active
-
_resolver
protected AmetysObjectResolver _resolver
Ametys Object Resolver
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
Current user provider
-
_projectMemberManager
protected ProjectMemberManager _projectMemberManager
The project members' manager
-
_rightManager
protected RightManager _rightManager
The right manager
-
_projectManager
protected ProjectManager _projectManager
The project manager
-
_projectRightHelper
protected ProjectRightHelper _projectRightHelper
Helper for project's rights
-
_languagesManager
protected LanguagesManager _languagesManager
The language manager
-
_sourceResolver
protected SourceResolver _sourceResolver
The source resolver
-
_siteConfigurationManager
protected SiteConfigurationManager _siteConfigurationManager
The site's configuration manager
-
_populationContextHelper
protected PopulationContextHelper _populationContextHelper
Helper for user population
-
_moduleManagerEP
protected WorkspaceModuleExtensionPoint _moduleManagerEP
The extension point for workspace's modules
-
_profileAssignmentStorageExtensionPoint
protected ProfileAssignmentStorageExtensionPoint _profileAssignmentStorageExtensionPoint
The extension point for profiles' storage
-
_userManager
protected UserManager _userManager
The user manager
-
_i18nUtils
protected I18nUtils _i18nUtils
Utils for i18n
-
_observationManager
protected ObservationManager _observationManager
The observation manager
-
_groupDirectoryContextHelper
protected GroupDirectoryContextHelper _groupDirectoryContextHelper
Helper for group directory's context
-
_projectTagProviderEP
protected ProjectTagProviderExtensionPoint _projectTagProviderEP
The extension point for project's tags
-
_categoryProviderEP
protected CategoryProviderExtensionPoint _categoryProviderEP
The extension point for project's categories
-
_keywordProviderEP
protected KeywordProviderExtensionPoint _keywordProviderEP
The extension point for project's keywords
-
-
Constructor Detail
-
ProjectsCatalogueManager
public ProjectsCatalogueManager()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- 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
public Map<String,Object> deleteProject(String projectId) throws IllegalAccessException
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
protected String getAddUserUrl(Project project, UserIdentity user)
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
protected String[] getAllowedFormData()
Get the list of allowed data in the form- Returns:
- the list of allowed data in the form
-
getUserAndPublicProjects
public Map<String,Object> 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
public List<Map<String,Object>> getUserProjects()
Callable to get projects of the user.- Returns:
- A map with the user projects
-
detailedProject2json
public Map<String,Object> detailedProject2json(Project project)
Transform aProject
into a json map- Parameters:
project
- the project to parse- Returns:
- a json map
-
saxProject
public void saxProject(ContentHandler contentHandler, Project project) throws SAXException
SAX a project- 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) throws SAXException
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
-
-