Class Project
- java.lang.Object
-
- org.ametys.plugins.repository.AbstractAmetysObject
-
- org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
-
- org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<ProjectFactory>
-
- org.ametys.plugins.workspaces.project.objects.Project
-
- All Implemented Interfaces:
ACLAmetysObject
,AmetysObject
,DataAwareAmetysObject
,ModelLessDataAwareAmetysObject
,ModifiableModelLessDataAwareAmetysObject
,DataHolder
,ModelLessDataHolder
,ModifiableDataHolder
,ModifiableModelLessDataHolder
,EventHolder
,JCRAmetysObject
,JCRTraversableAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,RemovableAmetysObject
,TraversableAmetysObject
public class Project extends DefaultTraversableAmetysObject<ProjectFactory> implements ModifiableModelLessDataAwareAmetysObject, EventHolder
AmetysObject
for storing project informations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Project.InscriptionStatus
The inscription status of the project
-
Field Summary
Fields Modifier and Type Field Description static String
DATA_SITES
Metadata name for project 's sitesstatic String
NODE_TYPE
Project node type name.
-
Constructor Summary
Constructors Constructor Description Project(Node node, String parentPath, ProjectFactory factory)
Creates aProject
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCategory(String category)
Add a category to the projectvoid
addModule(String moduleId)
Add a module to the list of activated modulesvoid
coverImageToSAX(ContentHandler contentHandler)
Generates SAX events for the project's cover imageSet<String>
getCategories()
Retrieve the list of categoriesBinary
getCoverImage()
Returns the cover image of the projectZonedDateTime
getCreationDate()
Retrieves the date of creation.ModifiableModelLessDataHolder
getDataHolder()
Returns theDataHolder
of thisAmetysObject
.String
getDefaultProfile()
Get the default profile for new members of the projectString
getDescription()
Retrieves the description.NodeIterator
getEvents()
Returns the events' nodesNode
getEventsRootNode()
Returns the node holding the eventsAmetysObjectIterable<ExplorerNode>
getExplorerNodes()
Retrieves the explorer nodes.ExplorerNode
getExplorerRootNode()
Retrieves the explorer nodes.Project.InscriptionStatus
getInscriptionStatus()
Get the inscription status of the projectString[]
getKeywords()
Retrieve the list of keywords for the projectString
getMailingList()
Retrieves the mailing list.UserIdentity[]
getManagers()
Get the project managers user identitiesString[]
getModules()
Retrieve the list of activated modules for the projectModifiableTraversableAmetysObject
getRootPlugins()
Get the root for pluginsCollection<Site>
getSites()
Get the sites of the projectSet<String>
getTags()
Retrieve the list of tagsString
getTitle()
Retrieves the title.void
removeCategory(String category)
Remove a category from the projectvoid
removeDescription()
Remove the description.void
removeMailingList()
Remove the mailing list.void
removeModule(String moduleId)
Remove a module from the list of activated modulesvoid
setCategoryTags(List<String> categoryTags)
Set the category tags of the projectvoid
setCoverImage(InputStream is, String mimeType, String filename, ZonedDateTime lastModificationDate)
Set the cover image of the sitevoid
setCreationDate(ZonedDateTime creationDate)
Set the date of creation.void
setDefaultProfile(String profileId)
Set the default profile for the members of the projectvoid
setDescription(String description)
Set the description.void
setInscriptionStatus(String inscriptionStatus)
Set the inscription status of the projectvoid
setInscriptionStatus(Project.InscriptionStatus inscriptionStatus)
Set the inscription status of the projectvoid
setKeywords(String[] keywords)
Set the list of keywordss for the projectvoid
setMailingList(String mailingList)
Set the mailing list.void
setManagers(UserIdentity[] user)
Set the project managersvoid
setModules(String[] modules)
Set the list of activated modules for the projectvoid
setSites(Collection<String> sites)
Set the sites of the projectvoid
setTags(List<String> tags)
Set the project tagsvoid
setTitle(String title)
Set the title.void
tag(String tag)
Add a tag to the projectvoid
untag(String tag)
Remove a tag from the project-
Methods inherited from class org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, disallowInheritance, getChild, getChildren, getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, hasChild, isInheritanceDisallowed, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
-
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
-
Methods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, dataToSAX, dataToSAX, getDataNames
-
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelLessDataAwareAmetysObject
dataToSAX, getType, getValue, getValue, getValueOfType, getValueOfType, hasValue, hasValueOrEmpty, isMultiple
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelLessDataHolder
dataToSAX, hasValue, hasValueOrEmpty
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
Methods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolder
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModifiableModelLessDataAwareAmetysObject
getComposite, getComposite, getParentDataHolder, getRepositoryData, getRootDataHolder, removeValue, setValue, setValue, synchronizeValues
-
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
-
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
-
-
-
Field Detail
-
NODE_TYPE
public static final String NODE_TYPE
Project node type name.- See Also:
- Constant Field Values
-
DATA_SITES
public static final String DATA_SITES
Metadata name for project 's sites- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Project
public Project(Node node, String parentPath, ProjectFactory factory)
Creates aProject
.- Parameters:
node
- the node backing thisAmetysObject
.parentPath
- the parent path in the Ametys hierarchy.factory
- theProjectFactory
which creates the AmetysObject.
-
-
Method Detail
-
getDataHolder
public ModifiableModelLessDataHolder getDataHolder()
Description copied from interface:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelLessDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModifiableModelLessDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
getTitle
public String getTitle() throws AmetysRepositoryException
Retrieves the title.- Returns:
- the title.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setTitle
public void setTitle(String title) throws AmetysRepositoryException
Set the title.- Parameters:
title
- the title.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDescription
public String getDescription() throws AmetysRepositoryException
Retrieves the description.- Returns:
- the description.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setDescription
public void setDescription(String description) throws AmetysRepositoryException
Set the description.- Parameters:
description
- the description.- Throws:
AmetysRepositoryException
- if an error occurs.
-
removeDescription
public void removeDescription() throws AmetysRepositoryException
Remove the description.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getExplorerRootNode
public ExplorerNode getExplorerRootNode() throws AmetysRepositoryException
Retrieves the explorer nodes.- Returns:
- the explorer nodes or an empty
AmetysObjectIterable
. - Throws:
AmetysRepositoryException
- if an error occurs.
-
getExplorerNodes
public AmetysObjectIterable<ExplorerNode> getExplorerNodes() throws AmetysRepositoryException
Retrieves the explorer nodes.- Returns:
- the explorer nodes or an empty
AmetysObjectIterable
. - Throws:
AmetysRepositoryException
- if an error occurs.
-
getMailingList
public String getMailingList() throws AmetysRepositoryException
Retrieves the mailing list.- Returns:
- the mailing list.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setMailingList
public void setMailingList(String mailingList) throws AmetysRepositoryException
Set the mailing list.- Parameters:
mailingList
- the mailing list.- Throws:
AmetysRepositoryException
- if an error occurs.
-
removeMailingList
public void removeMailingList() throws AmetysRepositoryException
Remove the mailing list.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getCreationDate
public ZonedDateTime getCreationDate() throws AmetysRepositoryException
Retrieves the date of creation.- Returns:
- the date of creation.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setCreationDate
public void setCreationDate(ZonedDateTime creationDate) throws AmetysRepositoryException
Set the date of creation.- Parameters:
creationDate
- the date of creation- Throws:
AmetysRepositoryException
- if an error occurs.
-
getEventsRootNode
public Node getEventsRootNode() throws RepositoryException
Description copied from interface:EventHolder
Returns the node holding the events- Specified by:
getEventsRootNode
in interfaceEventHolder
- Returns:
- the node holding the events
- Throws:
RepositoryException
- if failed to get event holder node
-
getEvents
public NodeIterator getEvents() throws RepositoryException
Description copied from interface:EventHolder
Returns the events' nodes- Specified by:
getEvents
in interfaceEventHolder
- Returns:
- The events
- Throws:
RepositoryException
- if failed to get events' nodes
-
getSites
public Collection<Site> getSites()
Get the sites of the project- Returns:
- The collection of sites
-
setSites
public void setSites(Collection<String> sites)
Set the sites of the project- Parameters:
sites
- The names of the site
-
getManagers
public UserIdentity[] getManagers()
Get the project managers user identities- Returns:
- The managers
-
setManagers
public void setManagers(UserIdentity[] user)
Set the project managers- Parameters:
user
- The managers
-
getModules
public String[] getModules()
Retrieve the list of activated modules for the project- Returns:
- The list of modules ids
-
setModules
public void setModules(String[] modules)
Set the list of activated modules for the project- Parameters:
modules
- The list of modules
-
addModule
public void addModule(String moduleId)
Add a module to the list of activated modules- Parameters:
moduleId
- The module id
-
removeModule
public void removeModule(String moduleId)
Remove a module from the list of activated modules- Parameters:
moduleId
- The module id
-
getInscriptionStatus
public Project.InscriptionStatus getInscriptionStatus()
Get the inscription status of the project- Returns:
- The inscription status
-
setInscriptionStatus
public void setInscriptionStatus(String inscriptionStatus)
Set the inscription status of the project- Parameters:
inscriptionStatus
- The inscription status
-
setInscriptionStatus
public void setInscriptionStatus(Project.InscriptionStatus inscriptionStatus)
Set the inscription status of the project- Parameters:
inscriptionStatus
- The inscription status
-
getDefaultProfile
public String getDefaultProfile()
Get the default profile for new members of the project- Returns:
- The default profile
-
setDefaultProfile
public void setDefaultProfile(String profileId)
Set the default profile for the members of the project- Parameters:
profileId
- The ID of the profile
-
getRootPlugins
public ModifiableTraversableAmetysObject getRootPlugins() throws AmetysRepositoryException
Get the root for plugins- Returns:
- the root for plugins
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getTags
public Set<String> getTags() throws AmetysRepositoryException
Retrieve the list of tags- Returns:
- The list of tags
- Throws:
AmetysRepositoryException
- if an error occurs
-
tag
public void tag(String tag) throws AmetysRepositoryException
Add a tag to the project- Parameters:
tag
- The tag- Throws:
AmetysRepositoryException
- if an error occurs
-
untag
public void untag(String tag) throws AmetysRepositoryException
Remove a tag from the project- Parameters:
tag
- The tag- Throws:
AmetysRepositoryException
- if an error occurs
-
setTags
public void setTags(List<String> tags)
Set the project tags- Parameters:
tags
- The list of tags
-
getCategories
public Set<String> getCategories() throws AmetysRepositoryException
Retrieve the list of categories- Returns:
- The categories
- Throws:
AmetysRepositoryException
- if an error occurs
-
addCategory
public void addCategory(String category) throws AmetysRepositoryException
Add a category to the project- Parameters:
category
- The category- Throws:
AmetysRepositoryException
- if an error occurs
-
removeCategory
public void removeCategory(String category) throws AmetysRepositoryException
Remove a category from the project- Parameters:
category
- The category- Throws:
AmetysRepositoryException
- if an error occurs
-
setCategoryTags
public void setCategoryTags(List<String> categoryTags)
Set the category tags of the project- Parameters:
categoryTags
- The category tags
-
setCoverImage
public void setCoverImage(InputStream is, String mimeType, String filename, ZonedDateTime lastModificationDate) throws IOException
Set the cover image of the site- Parameters:
is
- The input stream of the cover imagemimeType
- The mimetype of the cover imagefilename
- The filename of the cover imagelastModificationDate
- The last modification date of the cover image- Throws:
IOException
- if an error occurs while setting the cover image
-
getCoverImage
public Binary getCoverImage()
Returns the cover image of the project- Returns:
- the cover image of the project
-
coverImageToSAX
public void coverImageToSAX(ContentHandler contentHandler) throws SAXException, IOException
Generates SAX events for the project's cover image- Parameters:
contentHandler
- theContentHandler
that will receive the SAX events- Throws:
SAXException
- if error occurs during the SAX events generationIOException
- if an I/O error occurs while reading the cover image
-
getKeywords
public String[] getKeywords()
Retrieve the list of keywords for the project- Returns:
- The list of keywords
-
setKeywords
public void setKeywords(String[] keywords)
Set the list of keywordss for the project- Parameters:
keywords
- The list of keywords
-
-