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:
ModelAwareDataAwareAmetysObject,ModifiableModelAwareDataAwareAmetysObject,IndexableDataHolder,ModifiableIndexableDataHolder,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 ClassesModifier and TypeClassDescriptionstatic enumRights profilesstatic enumType of a Query -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty name for query authorstatic final StringProperty name for query contentstatic final StringProperty name for query last contributorstatic final StringProperty name for query creation datestatic final StringProperty name for query descriptionstatic final StringProperty name for query documentationstatic final StringProperty name for query last modification datestatic final StringProperty name for query titlestatic final StringProperty name for query typeFields inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
PROTECTED_PROPERTIESFields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX -
Constructor Summary
ConstructorsConstructorDescriptionQuery(javax.jcr.Node node, String parentPath, QueryFactory factory) Creates anQuery. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanMoveTo(AmetysObject newParent) Test if a move can be a success or if it is impossible (e.g.Get the author of the queryGet the content of the queryGet the last contributor of the queryGet the date of the last modification of the queryReturns theDataHolderof thisAmetysObject.Get the description of the queryGet the documentation of the queryGet the date of the last modification of the querygetTitle()Get the title of the querygetType()Get the type of the queryvoidmoveTo(AmetysObject newParent, boolean renameIfExist) Move the current object as a new child of the given object.voidorderBefore(AmetysObject siblingNode) Order a node before another sibling node (or as the last node)voidsetAuthor(UserIdentity author) Set the author of this query.voidsetContent(String content) Set the content of this query.voidsetContributor(UserIdentity contributor) Set the last contributor of this query.voidsetCreationDate(ZonedDateTime creationDate) Set the date of the creation.voidsetDescription(String description) Set the description of this query.voidsetDocumentation(String documentation) Set the documentation of this query.voidsetLastModificationDate(ZonedDateTime lastModificationDate) Set the date of the last modification.voidSet the title of this query.voidSet 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, switchToRevisionMethods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesMethods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCodeMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAXMethods inherited from interface org.ametys.cms.data.ametysobject.ModelAwareDataAwareAmetysObject
getSystemPropertyExtensionPoint, indexData, indexDataMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
dataToJSON, dataToJSONForEdition, dataToMap, dataToSAX, dataToSAXForEdition, getComments, getDataNames, getDefinition, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasComments, hasDefinition, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmptyMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
commentsToSAX, dataToJSON, dataToJSON, dataToJSON, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, getDataNames, getType, getValue, hasValue, hasValueOrEmpty, isMultipleMethods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChangesMethods inherited from interface org.ametys.plugins.repository.data.holder.ModifiableDataHolder
getRepositoryDataMethods inherited from interface org.ametys.cms.data.ametysobject.ModifiableModelAwareDataAwareAmetysObject
getComposite, getComposite, getExternalComposite, getExternalComposite, getExternalRepeater, getExternalRepeater, getLocalComposite, getLocalComposite, getLocalRepeater, getLocalRepeater, getParentDataHolder, getRepeater, getRepeater, getRootDataHolderMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModifiableModelAwareDataAwareAmetysObject
getRepositoryData, removeExternalizableMetadataIfExists, removeExternalValue, removeLocalValue, removeValue, setComments, setExternalValue, setLocalValue, setStatus, setValue, synchronizeValues, synchronizeValues, synchronizeValues, synchronizeValues
-
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:
-
DOCUMENTATION
Property name for query documentation- See Also:
-
CONTENT
Property name for query content- See Also:
-
AUTHOR
Property name for query author- See Also:
-
CONTRIBUTOR
Property name for query last contributor- See Also:
-
CREATIONDATE
Property name for query creation date- See Also:
-
LASTMODIFICATIONDATE
Property name for query last modification date- See Also:
-
-
Constructor Details
-
Query
Creates anQuery.- Parameters:
node- the node backing thisAmetysObjectparentPath- 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
-
setDocumentation
Set the documentation of this query.- Parameters:
documentation- the documentation
-
setContent
Set the content of this query.- Parameters:
content- the content
-
setAuthor
Set the author of this query.- Parameters:
author- the author
-
setContributor
Set the last contributor of this query.- Parameters:
contributor- the last contributor
-
setCreationDate
Set the date of the creation.- Parameters:
creationDate- the last modification date to set.
-
setLastModificationDate
Set the date of the last modification.- Parameters:
lastModificationDate- the last modification date to set.
-
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
-
getDocumentation
Get the documentation of the query- Returns:
- The documentation
-
getContent
Get the content of the query- Returns:
- The content
-
getAuthor
Get the author of the query- Returns:
- The author
-
getContributor
Get the last contributor of the query- Returns:
- The contributor
-
getCreationDate
Get the date of the last modification of the query- Returns:
- The date
-
getLastModificationDate
Get the date of the last modification of the query- Returns:
- The date
-
canMoveTo
Description copied from interface:MovableAmetysObjectTest if a move can be a success or if it is impossible (e.g. due to the implementation of the target)- Specified by:
canMoveToin 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:MovableAmetysObjectMove 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:
moveToin 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:MovableAmetysObjectOrder a node before another sibling node (or as the last node)- Specified by:
orderBeforein 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
Description copied from interface:DataAwareAmetysObjectReturns theDataHolderof thisAmetysObject.- Specified by:
getDataHolderin interfaceDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModelAwareDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModelAwareDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModifiableModelAwareDataAwareAmetysObject- Specified by:
getDataHolderin interfaceModifiableModelAwareDataAwareAmetysObject- Returns:
- the
DataHolderof thisAmetysObject
-