Class Query
java.lang.Object
org.ametys.plugins.repository.AbstractAmetysObject
org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
org.ametys.plugins.repository.jcr.DefaultAmetysObject<QueryFactory>
org.ametys.plugins.queriesdirectory.Query
- All Implemented Interfaces:
ACLAmetysObject
,AmetysObject
,JCRAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,MovableAmetysObject
,RemovableAmetysObject
,DataAndVersionAwareAmetysObject
,ModifiableDataAwareVersionableAmetysObject
,VersionableAmetysObject
,VersionAwareAmetysObject
Class representing a query, backed by a JCR node.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Rights profilesstatic enum
Type of a Querystatic enum
Visibility of a Query -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Property name for query authorstatic final String
Property name for query contentstatic final String
Property name for query descriptionstatic final String
Property name for query groupsstatic final String
Property name for query last modification datestatic final String
Property name for query read accessstatic final String
Property name for query write accessstatic final String
Property name for query titlestatic final String
Property name for query typestatic final String
Property name for query usersstatic final String
Property name for query visibilityFields inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
PROTECTED_PROPERTIES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canMoveTo
(AmetysObject newParent) Test if a move can be a success or if it is impossible (e.g.boolean
canRead
(UserIdentity user) Determines if an user has READ access to this query.boolean
canWrite
(UserIdentity user) Determines if an user has WRITE access to this query.Get the author of the queryGet the content of the queryGet the description of the querygetGrantedGroups
(Query.QueryProfile profile) Get the granted groupsgetGrantedUsers
(Query.QueryProfile profile) Get the granted usersGet the date of the last modification of the querygetTitle()
Get the title of the querygetType()
Get the type of the queryGet the visibility of the queryvoid
moveTo
(AmetysObject newParent, boolean renameIfExist) Move the current object as a new child of the given object.void
orderBefore
(AmetysObject siblingNode) Order a node before another sibling node (or as the last node)void
setAuthor
(UserIdentity author) Set the author of this query.void
setContent
(String content) Set the content of this query.void
setDescription
(String description) Set the description of this query.void
setGrantedGroups
(Query.QueryProfile profile, Set<GroupIdentity> groups) Set the granted groupsvoid
setGrantedUsers
(Query.QueryProfile profile, Set<UserIdentity> users) Set the granted usersvoid
setLastModificationDate
(Date lastModificationDate) Set the date of the last modification.void
Set the title of this query.void
Set the type of this query.void
setVisibility
(Query.Visibility visibility) Set the query 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
-
Field Details
-
TITLE
Property name for query title- See Also:
-
TYPE
Property name for query type- See Also:
-
DESCRIPTION
Property name for query description- See Also:
-
CONTENT
Property name for query content- See Also:
-
AUTHOR
Property name for query author- See Also:
-
LASTMODIFICATIONDATE
Property name for query last modification date- See Also:
-
VISIBILITY
Property name for query visibility- See Also:
-
PROFILE_READ_ACCESS
Property name for query read access- See Also:
-
PROFILE_WRITE_ACCESS
Property name for query write access- See Also:
-
GROUPS
Property name for query groups- See Also:
-
USERS
Property name for query users- See Also:
-
-
Constructor Details
-
Query
Creates anQuery
.- 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 query.- Parameters:
title
- the description
-
setType
Set the type of this query.- Parameters:
type
- the description
-
setDescription
Set the description of this query.- Parameters:
description
- the description
-
setContent
Set the content of this query.- Parameters:
content
- the content
-
setAuthor
Set the author of this query.- Parameters:
author
- the author
-
setLastModificationDate
Set the date of the last modification.- Parameters:
lastModificationDate
- the last modification date to set.
-
setVisibility
Set the query visibility- Parameters:
visibility
- the visibility
-
getTitle
Get the title of the query- Returns:
- The title
-
getType
Get the type of the query- Returns:
- The type
-
getDescription
Get the description of the query- Returns:
- The description
-
getContent
Get the content of the query- Returns:
- The content
-
getAuthor
Get the author of the query- Returns:
- The author
-
getVisibility
Get the visibility of the query- Returns:
- The visibility
-
getGrantedUsers
Get the granted users- Parameters:
profile
- teh query profile- Returns:
- the logins of granted users
-
getGrantedGroups
Get the granted groups- Parameters:
profile
- the query profile- Returns:
- the granted groups
-
canRead
Determines if an user has READ access to this query.- Parameters:
user
- The user- Returns:
true
if the user has read access,false
otherwise
-
canWrite
Determines if an user has WRITE access to this query.- Parameters:
user
- The user- Returns:
true
if the user has write access,false
otherwise
-
setGrantedUsers
Set the granted users- Parameters:
profile
- the query profileusers
- the granted users
-
setGrantedGroups
Set the granted groups- Parameters:
profile
- the query profilegroups
- the granted groups
-
getLastModificationDate
Get the date of the last modification of the query- Returns:
- The date
-
canMoveTo
Description copied from interface:MovableAmetysObject
Test if a move can be a success or if it is impossible (e.g. due to the implementation of the target)- Specified by:
canMoveTo
in interfaceMovableAmetysObject
- Parameters:
newParent
- See moveTo.- Returns:
- true if the move operation may succeed. If false is returned and you call moveTo anyway, you may encontered a RuntimeException (such as UnsupportedOperationException)
- Throws:
AmetysRepositoryException
- if an error occurs.
-
moveTo
public void moveTo(AmetysObject newParent, boolean renameIfExist) throws AmetysRepositoryException, RepositoryIntegrityViolationException Description copied from interface:MovableAmetysObject
Move the current object as a new child of the given object. This node will be the last child. You should call canMoveTo to know if this is a supported operation.- Specified by:
moveTo
in interfaceMovableAmetysObject
- Parameters:
newParent
- The new parent for the current object. Can not be null. Can not be a child of the current node. Must be a TraversableAmetyObject.renameIfExist
- true to rename moved page if a page with same name already exist- Throws:
AmetysRepositoryException
- if an error occurs.RepositoryIntegrityViolationException
- if a page with the same name already exists.
-
orderBefore
Description copied from interface:MovableAmetysObject
Order a node before another sibling node (or as the last node)- Specified by:
orderBefore
in interfaceMovableAmetysObject
- Parameters:
siblingNode
- The node that will be the next sibling node of the current node. Must have the same parent as the current node. Can be null to set the current node as the last node.- Throws:
AmetysRepositoryException
- if an error occurs.
-