Package org.ametys.cms.repository
Class DefaultContent<F extends ContentFactory>
java.lang.Object
org.ametys.plugins.repository.AbstractAmetysObject
org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
org.ametys.plugins.repository.jcr.DefaultAmetysObject<F>
org.ametys.cms.repository.DefaultContent<F>
- Type Parameters:
F- the actual type of factory.
- All Implemented Interfaces:
ModelAwareDataAwareAmetysObject,IndexableDataHolder,Content,ReactionableObject,ReportableObject,ACLAmetysObject,AmetysObject,CopiableAmetysObject,DataAwareAmetysObject,ModelAwareDataAwareAmetysObject,DataHolder,ModelAwareDataHolder,DublinCoreAwareAmetysObject,JCRAmetysObject,JCRTraversableAmetysObject,MetadataAwareAmetysObject,ModifiableMetadataAwareAmetysObject,ModifiableACLAmetysObject,ModifiableAmetysObject,ModifiableTraversableAmetysObject,RemovableAmetysObject,TagAwareAmetysObject,TraversableAmetysObject,DataAndVersionAwareAmetysObject,ModifiableDataAwareVersionableAmetysObject,VersionableAmetysObject,VersionAwareAmetysObject
- Direct Known Subclasses:
DefaultWebContent,DefaultWorkflowAwareContent,ModifiableDefaultContent
public class DefaultContent<F extends ContentFactory>
extends DefaultAmetysObject<F>
implements Content, CopiableAmetysObject, JCRTraversableAmetysObject, ReactionableObject, ReportableObject
Default implementation of a
Content, also versionable, lockable and workflow-aware.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.cms.repository.Content
Content.ReferencingContentsSearchNested classes/interfaces inherited from interface org.ametys.cms.repository.ReactionableObject
ReactionableObject.ReactionType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]The mixin type identifiers of this contentprotected Map<String, OutgoingReferences> Store already retrieved outgoing references, if anyprotected String[]The type identifiers of this contentstatic final StringConstant for the attachment node name.static final LocaleThe default locale for contentstatic final StringConstants for contentType Metadata*static final StringConstants for last contributor Metadata*static final StringConstants for lastModified Metadata*static final StringConstants for author Metadata*static final StringConstants for firstValidationDate Metadata*static final StringConstants for the first validator metadatastatic final StringConstants for language Metadata*static final StringConstants for last major validator Metadata*static final StringConstants for lastMajorValidationDate Metadata*static final StringConstants for lastValidationDate Metadata*static final StringConstants for last validator Metadata*static final StringConstants for contentType Metadata*static final StringConstants for lastModified Metadata*static final StringConstants for the outgoing reference nodetypestatic final StringConstants for the outgoing reference propertystatic final StringConstants for the outgoing references nodestatic final StringConstants for the outgoing references path propertystatic final StringConstants for the root outgoing references nodeFields inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
__VERSION_COMPARATOR, PROTECTED_PROPERTIESFields inherited from interface org.ametys.cms.repository.Content
ATTRIBUTE_TITLEFields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIX -
Constructor Summary
ConstructorsConstructorDescriptionDefaultContent(javax.jcr.Node node, String parentPath, F factory) Creates a JCR-based Content. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReaction(UserIdentity user, ReactionableObject.ReactionType reactionType) Add the user reactionvoidAdd a report to the objectvoidRemove all reports on the objectcopyTo(ModifiableTraversableAmetysObject parent, String name) Copy the currentAmetysObjectto the given object.copyTo(ModifiableTraversableAmetysObject parent, String name, int initWorkflowActionId, boolean notifyObservers, boolean checkpoint) Copy the currentDefaultWorkflowAwareContentto the given object.copyTo(ModifiableTraversableAmetysObject parent, String name, String lang, int initWorkflowActionId, boolean notifyObservers, boolean checkpoint, boolean waitAsyncObservers, boolean copyACL, DataContext context) Copy the currentDefaultWorkflowAwareContentto the given object.copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) Copy the currentAmetysObjectto the given object if it is not in the restriction list.<A extends AmetysObject>
AcreateChild(String name, String type) Creates a child below current object.<A extends AmetysObject>
ARetrieves a given child from its relative path.<A extends AmetysObject>
AmetysObjectIterable<A> Retrieves children of the current object.Retrieves the creation date.Retrieves the login of the creator.Returns theDataHolderof thisAmetysObject.Get the Dublin Core contributor.Get the Dublin Core coverage.Get the Dublin Core creator.Get the Dublin Core date.Get the Dublin Core description.Get the Dublin Core format.Get the Dublin Core identifier.Get the Dublin Core language.Get the Dublin Core publisher.Get the Dublin Core relation.Get the Dublin Core rights.Get the Dublin Core source.String[]Get the Dublin Core subject.Get the Dublin Core title.Get the Dublin Core type.Retrieves the first validation dateRetrieves the identity of the first validator An empty value should not be considered as a content never being validated.Returns theDataHolderfor internal data of thisContent.Retrieves the language of this content.Retrieves the login of the last contributor.Retrieves the last validation date resulting from a major modification.Retrieves the identity of the last major validator An empty value should not be considered as a content never being validated.Retrieves the last modification date.Retrieves the last validation dateRetrieves the identity of the last validator.String[]Retrieves the mixin type identifiers of this content.Get the stored outgoing references of the content.getReactionUsers(ReactionableObject.ReactionType reactionType) Get the list of users who reactReturns all Contents referencing this Content (as a metadata).longRetrieves the number of reports on the objectRetrieves the attachments root nodeRetrieves the system properties extension point of thisAmetysObject, or an emptyOptionalif this object does not support system propertiesgetTags()Retrieves current tags.getTitle()Retrieves the title.Retrieves the title for the given locale.String[]getTypes()Retrieves the type identifiers of this content.booleanTests if this Object has at least one child with the given name.booleanReturnstrueif there is at least one Content referencing this Content (as a metadata).voidremoveReaction(UserIdentity user, ReactionableObject.ReactionType reactionType) Remove the user reactionsearchReferencingContents(int limit) Returns an object for a limited search of referencing contents with the total of referencing contents, a collection of referencing contents limited to the given limit, and a boolean indicates if there are other references.voidsetLanguage(String language) Set the type of this Content.
This method may only be called on a new Content, ie.voidsetMixinTypes(String[] mixins) Set the mixins of this Content.voidsetReportsCount(long reportsCount) Sets the number of reports on the objectvoidSet the type of this contentvoidSet the types of this Content.voidtoSAX(ContentHandler contentHandler, Locale locale, View view, boolean saxWorkflowStep) Generates SAX events representing this Content.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.ACLAmetysObject
getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, isInheritanceDisallowedMethods 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, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getRepositoryDataMethods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNodeMethods inherited from interface org.ametys.cms.data.ametysobject.ModelAwareDataAwareAmetysObject
getComposite, getExternalComposite, getExternalRepeater, getLocalComposite, getLocalRepeater, getParentDataHolder, getRepeater, getRootDataHolder, indexData, indexDataMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
dataToJSON, dataToJSONForEdition, dataToMap, dataToSAX, dataToSAXForEdition, getDataNames, getDefinition, getDifferences, getDifferences, getDifferences, getDifferences, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasDefinition, hasDifferences, hasDifferences, hasDifferences, hasDifferences, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmptyMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToJSON, dataToJSON, dataToJSON, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, getDataNames, getType, getValue, hasValue, hasValueOrEmpty, isMultipleMethods inherited from interface org.ametys.plugins.repository.ModifiableACLAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, disallowInheritance, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsersMethods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChangesMethods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolderMethods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
removeMethods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
Field Details
-
METADATA_ROOT_OUTGOING_REFERENCES
Constants for the root outgoing references node- See Also:
-
METADATA_OUTGOING_REFERENCES
Constants for the outgoing references node- See Also:
-
METADATA_OUTGOING_REFERENCES_PATH_PROPERTY
Constants for the outgoing references path property- See Also:
-
METADATA_OUTGOING_REFERENCE_PROPERTY
Constants for the outgoing reference property- See Also:
-
METADATA_OUTGOING_REFERENCE_NODETYPE
Constants for the outgoing reference nodetype- See Also:
-
METADATA_LANGUAGE
Constants for language Metadata*- See Also:
-
METADATA_CREATOR
Constants for author Metadata*- See Also:
-
METADATA_CREATION
Constants for lastModified Metadata*- See Also:
-
METADATA_FIRST_VALIDATOR
Constants for the first validator metadata- See Also:
-
METADATA_FIRST_VALIDATION
Constants for firstValidationDate Metadata*- See Also:
-
METADATA_LAST_VALIDATOR
Constants for last validator Metadata*- See Also:
-
METADATA_LAST_VALIDATION
Constants for lastValidationDate Metadata*- See Also:
-
METADATA_LAST_MAJOR_VALIDATOR
Constants for last major validator Metadata*- See Also:
-
METADATA_LAST_MAJORVALIDATION
Constants for lastMajorValidationDate Metadata*- See Also:
-
METADATA_CONTRIBUTOR
Constants for last contributor Metadata*- See Also:
-
METADATA_MODIFIED
Constants for lastModified Metadata*- See Also:
-
METADATA_CONTENTTYPE
Constants for contentType Metadata*- See Also:
-
METADATA_MIXINCONTENTTYPES
Constants for contentType Metadata*- See Also:
-
ATTACHMENTS_NODE_NAME
Constant for the attachment node name.- See Also:
-
DEFAULT_CONTENT_LOCALE
The default locale for content -
_types
The type identifiers of this content -
_mixins
The mixin type identifiers of this content -
_outgoingReferences
Store already retrieved outgoing references, if any
-
-
Constructor Details
-
DefaultContent
Creates a JCR-based Content.- Parameters:
node- the JCR Node backing this Content.parentPath- the parent path in the Ametys hierarchy.factory- the correspondingContentFactory.
-
-
Method Details
-
getTypes
Description copied from interface:ContentRetrieves the type identifiers of this content.- Specified by:
getTypesin interfaceContent- Returns:
- the type identifiers of this content.
- Throws:
AmetysRepositoryException- if an error occurs.
-
setType
Description copied from interface:ContentSet the type of this content- Specified by:
setTypein interfaceContent- Parameters:
type- the type to set- Throws:
AmetysRepositoryException- if an error occurs.
-
setTypes
Description copied from interface:ContentSet the types of this Content.- Specified by:
setTypesin interfaceContent- Parameters:
types- the types of this content.- Throws:
AmetysRepositoryException- if an error occurs.
-
getMixinTypes
Description copied from interface:ContentRetrieves the mixin type identifiers of this content.- Specified by:
getMixinTypesin interfaceContent- Returns:
- the mixin type identifiers of this content.
- Throws:
AmetysRepositoryException- if an error occurs.
-
setMixinTypes
Description copied from interface:ContentSet the mixins of this Content.- Specified by:
setMixinTypesin interfaceContent- Parameters:
mixins- the mixins of this content.- Throws:
AmetysRepositoryException- if an error occurs.
-
getLanguage
Description copied from interface:ContentRetrieves the language of this content.- Specified by:
getLanguagein interfaceContent- Returns:
- the language of this content or
nullif the content is a multilingual content - Throws:
AmetysRepositoryException- if an error occurs.
-
setLanguage
Description copied from interface:ContentSet the type of this Content.
This method may only be called on a new Content, ie. before its first save.- Specified by:
setLanguagein interfaceContent- Parameters:
language- the language of this content.- Throws:
AmetysRepositoryException- if an error occurs.
-
getTitle
Description copied from interface:ContentRetrieves the title for the given locale. If the locale is null or does not exist, the first locale will be used.- Specified by:
getTitlein interfaceContent- Parameters:
locale- The locale. Can be null if the content is not a multilingual content or to get the title in the default locale.- Returns:
- the title.
- Throws:
UnknownDataException- if this property does not exist.AmetysRepositoryException- if an error occurs.
-
getTitle
Description copied from interface:ContentRetrieves the title. This method is same asContent.getTitle(Locale)with a null locale. Use this method only if you are manipulating no-multilingual content. If not sure, useContent.getTitle(Locale)instead.- Specified by:
getTitlein interfaceContent- Returns:
- the title.
- Throws:
UnknownDataException- if this property does not exist.AmetysRepositoryException- if an error occurs.
-
getCreator
Description copied from interface:ContentRetrieves the login of the creator.- Specified by:
getCreatorin interfaceContent- Returns:
- the login of the creator.
- Throws:
UnknownDataException- if this property does not exist.AmetysRepositoryException- if an error occurs.
-
getCreationDate
Description copied from interface:ContentRetrieves the creation date.- Specified by:
getCreationDatein interfaceContent- Returns:
- the creation date.
- Throws:
UnknownDataException- if this property does not exist.AmetysRepositoryException- if an error occurs.
-
getLastContributor
Description copied from interface:ContentRetrieves the login of the last contributor.- Specified by:
getLastContributorin interfaceContent- Returns:
- the login of the last contributor.
- Throws:
UnknownDataException- if this property does not exist.AmetysRepositoryException- if an error occurs.
-
getLastModified
Description copied from interface:ContentRetrieves the last modification date.- Specified by:
getLastModifiedin interfaceContent- Returns:
- the last modification date.
- Throws:
UnknownDataException- if this property does not exist.AmetysRepositoryException- if an error occurs.
-
getFirstValidator
public Optional<UserIdentity> getFirstValidator() throws UnknownDataException, AmetysRepositoryExceptionDescription copied from interface:ContentRetrieves the identity of the first validator An empty value should not be considered as a content never being validated. Old content could have been validated before the introduction of this value and have not be updated.Content.getFirstValidationDate()is more reliable for this usage.- Specified by:
getFirstValidatorin interfaceContent- Returns:
- the first validator
- Throws:
AmetysRepositoryException- if an error occurs.UnknownDataException
-
getFirstValidationDate
public ZonedDateTime getFirstValidationDate() throws UnknownDataException, AmetysRepositoryExceptionDescription copied from interface:ContentRetrieves the first validation date- Specified by:
getFirstValidationDatein interfaceContent- Returns:
- the first validation date
- Throws:
UnknownDataException- if this property does not exist.AmetysRepositoryException- if an error occurs.
-
getLastValidator
Description copied from interface:ContentRetrieves the identity of the last validator. An empty value should not be considered as a content never being validated. Old content could have been validated before the introduction of this value and have not be updated.Content.getLastValidationDate()is more reliable for this usage.- Specified by:
getLastValidatorin interfaceContent- Returns:
- the last validator if the value exists
- Throws:
AmetysRepositoryException- if an error occurs.
-
getLastValidationDate
Description copied from interface:ContentRetrieves the last validation date- Specified by:
getLastValidationDatein interfaceContent- Returns:
- the last validation date
- Throws:
UnknownDataException- if this property does not exist.AmetysRepositoryException- if an error occurs.
-
getLastMajorValidator
public Optional<UserIdentity> getLastMajorValidator() throws UnknownDataException, AmetysRepositoryExceptionDescription copied from interface:ContentRetrieves the identity of the last major validator An empty value should not be considered as a content never being validated. Old content could have been validated before the introduction of this value and have not be updated.Content.getLastMajorValidationDate()is more reliable for this usage.- Specified by:
getLastMajorValidatorin interfaceContent- Returns:
- the last major validator
- Throws:
AmetysRepositoryException- if an error occurs.UnknownDataException
-
getLastMajorValidationDate
Description copied from interface:ContentRetrieves the last validation date resulting from a major modification. At least this is the first validation date- Specified by:
getLastMajorValidationDatein interfaceContent- Returns:
- the last validation date resulting from a major modification
- Throws:
AmetysRepositoryException- if an error occurs.
-
getTags
Description copied from interface:TagAwareAmetysObjectRetrieves current tags.- Specified by:
getTagsin interfaceTagAwareAmetysObject- Returns:
- the current tags.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getOutgoingReferences
Description copied from interface:ContentGet the stored outgoing references of the content. This references can be used for different purposes, such as testing link consistency for example.- Specified by:
getOutgoingReferencesin interfaceContent- Returns:
- A non null map of outgoing references grouped by metadata (key are metadata path)
- Throws:
AmetysRepositoryException- if an error occurs.
-
getReferencingContents
Description copied from interface:ContentReturns all Contents referencing this Content (as a metadata).- Specified by:
getReferencingContentsin interfaceContent- Returns:
- all Contents referencing this Content.
- Throws:
AmetysRepositoryException- if an error occurs.
-
searchReferencingContents
public Content.ReferencingContentsSearch searchReferencingContents(int limit) throws AmetysRepositoryException Description copied from interface:ContentReturns an object for a limited search of referencing contents with the total of referencing contents, a collection of referencing contents limited to the given limit, and a boolean indicates if there are other references.- Specified by:
searchReferencingContentsin interfaceContent- Parameters:
limit- The limit for resolved contents- Returns:
- a record with total number of contents, resolved contents and a boolean indicates if there are more references.
- Throws:
AmetysRepositoryException- if an error occurs
-
hasReferencingContents
Description copied from interface:ContentReturnstrueif there is at least one Content referencing this Content (as a metadata).- Specified by:
hasReferencingContentsin interfaceContent- Returns:
trueif there is at least one Content referencing this Content.- Throws:
AmetysRepositoryException- if an error occurs.
-
copyTo
public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) throws AmetysRepositoryException Description copied from interface:CopiableAmetysObjectCopy the currentAmetysObjectto the given object if it is not in the restriction list. Be careful, this method save changes.- Specified by:
copyToin interfaceCopiableAmetysObject- Parameters:
parent- The parent of the new object. Can not be null.name- Name of the new object. Can be null. If null, the new name will be get from the copied objectrestrictTo- A restrict list ofCopiableAmetysObjectauthorized to be copied- Returns:
- the created object
- Throws:
AmetysRepositoryException- if an error occurs.
-
copyTo
public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException Description copied from interface:CopiableAmetysObjectCopy the currentAmetysObjectto the given object. Be careful, this method save changes.- Specified by:
copyToin interfaceCopiableAmetysObject- Parameters:
parent- The parent of the new object. Can not be null.name- Name of the new object. Can be null. If null, the new name will be get from the copied object- Returns:
- the created object
- Throws:
AmetysRepositoryException- if an error occurs.
-
copyTo
public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name, int initWorkflowActionId, boolean notifyObservers, boolean checkpoint) throws AmetysRepositoryException Copy the currentDefaultWorkflowAwareContentto the given object. Be careful, this method save changes, but do not create a new version (checkpoint)- Parameters:
parent- The parent of the new object. Can not be null.name- Name of the new object. Can be null. If null, the new name will be get from the copied object.initWorkflowActionId- The initial workflow action idnotifyObservers- Set to false to do not fire observer eventscheckpoint- true to check the content in if it is versionable- Returns:
- the created object
- Throws:
AmetysRepositoryException- if an error occurs.
-
copyTo
public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name, String lang, int initWorkflowActionId, boolean notifyObservers, boolean checkpoint, boolean waitAsyncObservers, boolean copyACL, DataContext context) throws AmetysRepositoryException Copy the currentDefaultWorkflowAwareContentto the given object. Be careful, this method save changes, but do not create a new version (checkpoint)- Parameters:
parent- The parent of the new object. Can not be null.name- Name of the new object. Can be null. If null, the new name will be get from the copied object.lang- Language of the new object. Can be null. If null, the new language will be get from the copied object.initWorkflowActionId- The initial workflow action idnotifyObservers- Set to false to do not fire observer eventscheckpoint- true to check the content in if it is versionablewaitAsyncObservers- if true, waits if necessary for the asynchronous observers to completecopyACL- true to copy ACL of source contentcontext- The context of the data to copy- Returns:
- the created object
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCTitle
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core title.- Specified by:
getDCTitlein interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core title. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCCreator
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core creator.- Specified by:
getDCCreatorin interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core creator. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCSubject
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core subject.- Specified by:
getDCSubjectin interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core subject. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCDescription
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core description.- Specified by:
getDCDescriptionin interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core description. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCPublisher
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core publisher.- Specified by:
getDCPublisherin interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core publisher. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCContributor
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core contributor.- Specified by:
getDCContributorin interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core contributor. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCDate
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core date.- Specified by:
getDCDatein interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core date. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCType
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core type.- Specified by:
getDCTypein interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core type. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCFormat
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core format.- Specified by:
getDCFormatin interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core format. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCIdentifier
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core identifier.- Specified by:
getDCIdentifierin interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core identifier. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCSource
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core source.- Specified by:
getDCSourcein interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core source. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCLanguage
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core language.- Specified by:
getDCLanguagein interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core language. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCRelation
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core relation.- Specified by:
getDCRelationin interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core relation. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCCoverage
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core coverage.- Specified by:
getDCCoveragein interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core coverage. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDCRights
Description copied from interface:DublinCoreAwareAmetysObjectGet the Dublin Core rights.- Specified by:
getDCRightsin interfaceDublinCoreAwareAmetysObject- Returns:
- the Dublin Core rights. Can be null.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getRootAttachments
Description copied from interface:ContentRetrieves the attachments root node- Specified by:
getRootAttachmentsin interfaceContent- Returns:
- The attachments root node, or null if the content is working on an (unmodifiable) old version and the attachments root is missing.
- Throws:
AmetysRepositoryException- if an error occurs.
-
hasChild
Description copied from interface:TraversableAmetysObjectTests if this Object has at least one child with the given name.- Specified by:
hasChildin interfaceTraversableAmetysObject- Parameters:
name- the name to test. Cannot benullnor empty nor begin with a'/'and it cannot contain'/'.- Returns:
trueif the named child exists,falseotherwise.- Throws:
AmetysRepositoryException- if an error occurs.
-
createChild
public <A extends AmetysObject> A createChild(String name, String type) throws AmetysRepositoryException, RepositoryIntegrityViolationException Description copied from interface:ModifiableTraversableAmetysObjectCreates a child below current object.- Specified by:
createChildin interfaceModifiableTraversableAmetysObject- Type Parameters:
A- the actual type ofAmetysObject.- Parameters:
name- the name of the child, position ([n]) are not supported for same name sibling, the child will be added at the end of the children list.type- the type of the object.- Returns:
- the new object created.
- Throws:
AmetysRepositoryException- if an error occurs.RepositoryIntegrityViolationException- if an object with the same name already exists and same name siblings is not allowed.
-
getChild
public <A extends AmetysObject> A getChild(String path) throws AmetysRepositoryException, UnknownAmetysObjectException Description copied from interface:TraversableAmetysObjectRetrieves a given child from its relative path. The path cannot benull, empty nor begin with a'/'.- Specified by:
getChildin interfaceTraversableAmetysObject- Type Parameters:
A- the actual type ofAmetysObject.- Parameters:
path- the path of the child which can contains a position with.[n]if same name sibling is allowed.- Returns:
- the child found.
- Throws:
AmetysRepositoryException- if an error occurs.UnknownAmetysObjectException- if the object does not exist.
-
getChildren
public <A extends AmetysObject> AmetysObjectIterable<A> getChildren() throws AmetysRepositoryExceptionDescription copied from interface:TraversableAmetysObjectRetrieves children of the current object.- Specified by:
getChildrenin interfaceTraversableAmetysObject- Type Parameters:
A- the actual type ofAmetysObjects.- Returns:
- the children or an empty
AmetysObjectIterable. - 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- Returns:
- the
DataHolderof thisAmetysObject
-
getInternalDataHolder
Description copied from interface:ContentReturns theDataHolderfor internal data of thisContent.- Specified by:
getInternalDataHolderin interfaceContent- Returns:
- the
DataHolderfor internal data of thisContent
-
getSystemPropertyExtensionPoint
Description copied from interface:ModelAwareDataAwareAmetysObjectRetrieves the system properties extension point of thisAmetysObject, or an emptyOptionalif this object does not support system properties- Specified by:
getSystemPropertyExtensionPointin interfaceModelAwareDataAwareAmetysObject- Returns:
- the system properties extension point of this
AmetysObject
-
addReaction
Description copied from interface:ReactionableObjectAdd the user reaction- Specified by:
addReactionin interfaceReactionableObject- Parameters:
user- the userreactionType- the reaction type
-
removeReaction
Description copied from interface:ReactionableObjectRemove the user reaction- Specified by:
removeReactionin interfaceReactionableObject- Parameters:
user- the userreactionType- the reaction type
-
getReactionUsers
Description copied from interface:ReactionableObjectGet the list of users who react- Specified by:
getReactionUsersin interfaceReactionableObject- Parameters:
reactionType- the reaction type- Returns:
- the list of users
-
addReport
Description copied from interface:ReportableObjectAdd a report to the object- Specified by:
addReportin interfaceReportableObject
-
setReportsCount
Description copied from interface:ReportableObjectSets the number of reports on the object- Specified by:
setReportsCountin interfaceReportableObject- Parameters:
reportsCount- the number of reports to set
-
clearReports
Description copied from interface:ReportableObjectRemove all reports on the object- Specified by:
clearReportsin interfaceReportableObject
-
getReportsCount
Description copied from interface:ReportableObjectRetrieves the number of reports on the object- Specified by:
getReportsCountin interfaceReportableObject- Returns:
- the number of reports
-
toSAX
public void toSAX(ContentHandler contentHandler, Locale locale, View view, boolean saxWorkflowStep) throws SAXException Description copied from interface:ContentGenerates SAX events representing this Content.- Specified by:
toSAXin interfaceContent- Parameters:
contentHandler- theContentHandlerthat will receive the SAX events.locale- theLocaleto use for eg. multilingual attributes.view- the associated View, or null to generate SAX events for all attributes from the model.saxWorkflowStep- if true, also generates SAX events for the current workflow step.- Throws:
SAXException- if an error occurs during the SAX events generation.
-