Class ProjectsSuggestionsGenerator
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.xml.AbstractXMLProducer
-
- org.apache.cocoon.generation.AbstractGenerator
-
- org.apache.cocoon.generation.ServiceableGenerator
-
- org.ametys.plugins.workspaces.suggestions.ProjectsSuggestionsGenerator
-
- All Implemented Interfaces:
Poolable
,Recyclable
,Disposable
,Component
,LogEnabled
,Serviceable
,Generator
,SitemapModelComponent
,XMLProducer
public class ProjectsSuggestionsGenerator extends ServiceableGenerator
Generator for suggested projects. The suggestion projects are:<br/> - those of same categories OR with common keywords with the current project<br/> - those the current user is not already a member<br/> - sorted by common keywords
-
-
Field Summary
Fields Modifier and Type Field Description protected CurrentUserProvider
_currentUserProvider
The current user providerprotected ProjectsCatalogueManager
_projectCatalogManager
The project catalog managerprotected ProjectManager
_projectManager
The project managerprotected ProjectMemberManager
_projectMembers
The project memebers manager-
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
-
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
-
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
-
-
Constructor Summary
Constructors Constructor Description ProjectsSuggestionsGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generate()
protected List<Project>
getSuggestedProjects(String projectName, UserIdentity user, int max)
Get the suggested projects for a given project and a uservoid
service(ServiceManager smanager)
-
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose
-
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator
recycle, setup
-
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
-
-
-
-
Field Detail
-
_projectManager
protected ProjectManager _projectManager
The project manager
-
_projectMembers
protected ProjectMemberManager _projectMembers
The project memebers manager
-
_projectCatalogManager
protected ProjectsCatalogueManager _projectCatalogManager
The project catalog manager
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider
-
-
Constructor Detail
-
ProjectsSuggestionsGenerator
public ProjectsSuggestionsGenerator()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableGenerator
- Throws:
ServiceException
-
generate
public void generate() throws IOException, SAXException, ProcessingException
-
getSuggestedProjects
protected List<Project> getSuggestedProjects(String projectName, UserIdentity user, int max)
Get the suggested projects for a given project and a user- Parameters:
projectName
- the project nameuser
- the usermax
- the max number of suggestions- Returns:
- the related projects
-
-