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
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
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user providerprotected ProjectsCatalogueManager
The project catalog managerprotected ProjectManager
The project managerprotected ProjectMemberManager
The project memebers managerFields 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
generate()
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 Details
-
_projectManager
The project manager -
_projectMembers
The project memebers manager -
_projectCatalogManager
The project catalog manager -
_currentUserProvider
The current user provider
-
-
Constructor Details
-
ProjectsSuggestionsGenerator
public ProjectsSuggestionsGenerator()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableGenerator
- Throws:
ServiceException
-
generate
-
getSuggestedProjects
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
-