Package org.ametys.plugins.cart
Class Cart
- All Implemented Interfaces:
ACLAmetysObject
,AmetysObject
,JCRAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,RemovableAmetysObject
,DataAndVersionAwareAmetysObject
,ModifiableDataAwareVersionableAmetysObject
,VersionableAmetysObject
,VersionAwareAmetysObject
Class representing a cart, backed by a JCR node.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Types of CartElementstatic enum
Rights profilesstatic enum
Visibility of a Cart -
Field Summary
Fields inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
PROTECTED_PROPERTIES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_removeContent
(String contentIdToRemove) Remove a content from the cartprotected void
_removeQuery
(String queryIdToRemove) Remove a query from the cartprotected void
_removeResource
(String resourceIdToRemove) Remove a resource from the cartvoid
addContent
(String contentId) Add a content to the cartvoid
addQuery
(UserIdentity author, String title, String description) Add a query to the cartvoid
addResource
(String resourceId) Add a resource to the cartboolean
canRead
(UserIdentity user) Determines if an user has READ access to this cart.boolean
canWrite
(UserIdentity user) Determines if an user has WRITE access to this cart.Get the author of the cartGet the contents of the cartGet the description of the cartGet the elements of the cartgetGrantedGroups
(Cart.CartProfile profile) Get the granted groupsgetGrantedUsers
(Cart.CartProfile profile) Get the granted usersGet the queries of the cartGet the resources of the cartgetTitle()
Get the title of the cartGet the visibility of the cartvoid
removeElement
(String elmtId, Cart.CartElementType elmtType) Delete an elementvoid
setAuthor
(UserIdentity author) Set the author of this cart.void
setDescription
(String description) Set the description of this cart.void
setGrantedGroups
(Cart.CartProfile profile, Set<GroupIdentity> groups) Set the granted groupsvoid
setGrantedUsers
(Cart.CartProfile profile, Set<UserIdentity> users) Set the granted usersvoid
Set the title of this cart.void
setVisibility
(Cart.Visibility visibility) Set the cart visibilityMethods inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, addLabel, checkpoint, copyNode, disallowInheritance, getAllLabels, getAllRevisions, getBaseNode, getBaseVersion, getLabels, getLabels, getNode, getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, getRevision, getRevisionTimestamp, getRevisionTimestamp, getUnversionedDataHolder, getVersionHistory, isInheritanceDisallowed, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers, removeLabel, restoreFromLabel, restoreFromNode, restoreFromRevision, switchToLabel, switchToRevision
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, 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.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
Constructor Details
-
Cart
Creates anCart
.- Parameters:
node
- the node backing thisAmetysObject
parentPath
- the parentPath in the Ametys hierarchyfactory
- the DefaultAmetysObjectFactory which created the AmetysObject
-
-
Method Details
-
setTitle
Set the title of this cart.- Parameters:
title
- the description
-
setDescription
Set the description of this cart.- Parameters:
description
- the description
-
setAuthor
Set the author of this cart.- Parameters:
author
- the author
-
setVisibility
Set the cart visibility- Parameters:
visibility
- the visibility
-
getTitle
Get the title of the cart- Returns:
- The title
-
getDescription
Get the description of the cart- Returns:
- The description
-
getAuthor
Get the author of the cart- Returns:
- The author
-
getVisibility
Get the visibility of the cart- Returns:
- The visibility
-
getGrantedUsers
Get the granted users- Parameters:
profile
- the cart's profile- Returns:
- the granted users
-
getGrantedGroups
Get the granted groups- Parameters:
profile
- the cart's profile- Returns:
- the logins of granted groups
-
canRead
Determines if an user has READ access to this cart.- Parameters:
user
- The user- Returns:
true
if the user has read access,false
otherwise
-
canWrite
Determines if an user has WRITE access to this cart.- Parameters:
user
- The user- Returns:
true
if the user has write access,false
otherwise
-
setGrantedUsers
Set the granted users- Parameters:
profile
- the cart's profileusers
- the granted users
-
setGrantedGroups
Set the granted groups- Parameters:
profile
- the cart's profilegroups
- the granted groups
-
addContent
Add a content to the cart- Parameters:
contentId
- The content id
-
addResource
Add a resource to the cart- Parameters:
resourceId
- The resource id
-
addQuery
Add a query to the cart- Parameters:
author
- The author of the querytitle
- The title of the querydescription
- The query as string
-
removeElement
Delete an element- Parameters:
elmtId
- The id of element to removeelmtType
- The type of element to remove
-
_removeResource
Remove a resource from the cart- Parameters:
resourceIdToRemove
- The id of the resource to remove
-
_removeContent
Remove a content from the cart- Parameters:
contentIdToRemove
- The id of the content to remove
-
_removeQuery
Remove a query from the cart- Parameters:
queryIdToRemove
- The id of the query to remove
-
getElements
Get the elements of the cart- Returns:
- The elements of the cart
-
getContentCartElements
Get the contents of the cart- Returns:
- The elements of the cart
- Throws:
RepositoryException
- if an exception occurs while exploring the repository
-
getResourceCartElements
Get the resources of the cart- Returns:
- The elements of the cart
- Throws:
RepositoryException
- if an exception occurs while exploring the repository
-
getQueryCartElements
Get the queries of the cart- Returns:
- The elements of the cart
- Throws:
RepositoryException
- if an exception occurs while exploring the repository
-