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
,DataAwareAmetysObject
,ModelAwareDataAwareAmetysObject
,ModifiableModelAwareDataAwareAmetysObject
,DataHolder
,ModelAwareDataHolder
,ModifiableDataHolder
,ModifiableModelAwareDataHolder
,JCRAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,MovableAmetysObject
,RemovableAmetysObject
,DataAndVersionAwareAmetysObject
,ModifiableDataAwareVersionableAmetysObject
,VersionableAmetysObject
,VersionAwareAmetysObject
public class Query extends DefaultAmetysObject<QueryFactory> implements ModifiableModelAwareDataAwareAmetysObject, MovableAmetysObject
Class representing a query, backed by a JCR node.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Query.QueryProfile
Rights profilesstatic class
Query.Type
Type of a Query
-
Field Summary
Fields Modifier and Type Field Description static String
AUTHOR
Property name for query authorstatic String
CONTENT
Property name for query contentstatic String
CONTRIBUTOR
Property name for query last contributorstatic String
CREATIONDATE
Property name for query creation datestatic String
DESCRIPTION
Property name for query descriptionstatic String
DOCUMENTATION
Property name for query documentationstatic String
LASTMODIFICATIONDATE
Property name for query last modification datestatic String
TITLE
Property name for query titlestatic String
TYPE
Property name for query type-
Fields inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
PROTECTED_PROPERTIES
-
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description Query(Node node, String parentPath, QueryFactory factory)
Creates anQuery
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canMoveTo(AmetysObject newParent)
Test if a move can be a success or if it is impossible (e.g.UserIdentity
getAuthor()
Get the author of the queryString
getContent()
Get the content of the queryUserIdentity
getContributor()
Get the last contributor of the queryZonedDateTime
getCreationDate()
Get the date of the last modification of the queryModifiableModelAwareDataHolder
getDataHolder()
Returns theDataHolder
of thisAmetysObject
.String
getDescription()
Get the description of the queryString
getDocumentation()
Get the documentation of the queryZonedDateTime
getLastModificationDate()
Get the date of the last modification of the queryString
getTitle()
Get the title of the queryString
getType()
Get the type 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
setContributor(UserIdentity contributor)
Set the last contributor of this query.void
setCreationDate(ZonedDateTime creationDate)
Set the date of the creation.void
setDescription(String description)
Set the description of this query.void
setDocumentation(String documentation)
Set the documentation of this query.void
setLastModificationDate(ZonedDateTime lastModificationDate)
Set the date of the last modification.void
setTitle(String title)
Set the title of this query.void
setType(String type)
Set the type of this query.-
Methods 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.data.ametysobject.DataAwareAmetysObject
copyTo, dataToSAX, dataToSAX
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
getComments, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasComments, hasDefinition, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmpty
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
commentsToSAX, dataToMap, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, dataToSAX, dataToSAXForEdition, getDataNames, getType, getValue, hasValue, hasValueOrEmpty, isMultiple
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModifiableModelAwareDataAwareAmetysObject
getComposite, getComposite, getExternalComposite, getExternalComposite, getExternalRepeater, getExternalRepeater, getLocalComposite, getLocalComposite, getLocalRepeater, getLocalRepeater, getParentDataHolder, getRepeater, getRepeater, getRepositoryData, getRootDataHolder, removeExternalizableMetadataIfExists, removeExternalValue, removeLocalValue, removeValue, setComments, setExternalValue, setLocalValue, setStatus, setValue, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues
-
-
-
-
Field Detail
-
TITLE
public static final String TITLE
Property name for query title- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
Property name for query type- See Also:
- Constant Field Values
-
DESCRIPTION
public static final String DESCRIPTION
Property name for query description- See Also:
- Constant Field Values
-
DOCUMENTATION
public static final String DOCUMENTATION
Property name for query documentation- See Also:
- Constant Field Values
-
CONTENT
public static final String CONTENT
Property name for query content- See Also:
- Constant Field Values
-
AUTHOR
public static final String AUTHOR
Property name for query author- See Also:
- Constant Field Values
-
CONTRIBUTOR
public static final String CONTRIBUTOR
Property name for query last contributor- See Also:
- Constant Field Values
-
CREATIONDATE
public static final String CREATIONDATE
Property name for query creation date- See Also:
- Constant Field Values
-
LASTMODIFICATIONDATE
public static final String LASTMODIFICATIONDATE
Property name for query last modification date- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Query
public Query(Node node, String parentPath, QueryFactory factory)
Creates anQuery
.- Parameters:
node
- the node backing thisAmetysObject
parentPath
- the parentPath in the Ametys hierarchyfactory
- the DefaultAmetysObjectFactory which created the AmetysObject
-
-
Method Detail
-
setTitle
public void setTitle(String title)
Set the title of this query.- Parameters:
title
- the description
-
setType
public void setType(String type)
Set the type of this query.- Parameters:
type
- the description
-
setDescription
public void setDescription(String description)
Set the description of this query.- Parameters:
description
- the description
-
setDocumentation
public void setDocumentation(String documentation)
Set the documentation of this query.- Parameters:
documentation
- the documentation
-
setContent
public void setContent(String content)
Set the content of this query.- Parameters:
content
- the content
-
setAuthor
public void setAuthor(UserIdentity author)
Set the author of this query.- Parameters:
author
- the author
-
setContributor
public void setContributor(UserIdentity contributor)
Set the last contributor of this query.- Parameters:
contributor
- the last contributor
-
setCreationDate
public void setCreationDate(ZonedDateTime creationDate)
Set the date of the creation.- Parameters:
creationDate
- the last modification date to set.
-
setLastModificationDate
public void setLastModificationDate(ZonedDateTime lastModificationDate)
Set the date of the last modification.- Parameters:
lastModificationDate
- the last modification date to set.
-
getDescription
public String getDescription()
Get the description of the query- Returns:
- The description
-
getDocumentation
public String getDocumentation()
Get the documentation of the query- Returns:
- The documentation
-
getContent
public String getContent()
Get the content of the query- Returns:
- The content
-
getAuthor
public UserIdentity getAuthor()
Get the author of the query- Returns:
- The author
-
getContributor
public UserIdentity getContributor()
Get the last contributor of the query- Returns:
- The contributor
-
getCreationDate
public ZonedDateTime getCreationDate()
Get the date of the last modification of the query- Returns:
- The date
-
getLastModificationDate
public ZonedDateTime getLastModificationDate()
Get the date of the last modification of the query- Returns:
- The date
-
canMoveTo
public boolean canMoveTo(AmetysObject newParent) throws AmetysRepositoryException
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
public void orderBefore(AmetysObject siblingNode) throws AmetysRepositoryException
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.
-
getDataHolder
public ModifiableModelAwareDataHolder getDataHolder()
Description copied from interface:DataAwareAmetysObject
Returns theDataHolder
of thisAmetysObject
.- Specified by:
getDataHolder
in interfaceDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModelAwareDataAwareAmetysObject
- Specified by:
getDataHolder
in interfaceModifiableModelAwareDataAwareAmetysObject
- Returns:
- the
DataHolder
of thisAmetysObject
-
-