Package org.ametys.cms.repository
Interface Content
- All Superinterfaces:
ACLAmetysObject
,AmetysObject
,DataAwareAmetysObject
,DataHolder
,DublinCoreAwareAmetysObject
,IndexableDataHolder
,MetadataAwareAmetysObject
,ModelAwareDataAwareAmetysObject
,ModelAwareDataAwareAmetysObject
,ModelAwareDataHolder
,ModifiableACLAmetysObject
,TagAwareAmetysObject
- All Known Subinterfaces:
CommentableContent
,ModifiableContent
,ModifiableWebContent
,ModifiableWorkflowAwareContent
,SharedContent
,WebContent
,WorkflowAwareContent
- All Known Implementing Classes:
AbstractProgram
,AbstractProgramPart
,AbstractTraversableProgramPart
,Container
,Course
,CourseList
,CoursePart
,DefaultContent
,DefaultSharedContent
,DefaultWebContent
,DefaultWorkflowAwareContent
,ModifiableDefaultContent
,ModifiableDefaultWebContent
,OrgUnit
,Person
,Program
,SubProgram
public interface Content
extends ModelAwareDataAwareAmetysObject, MetadataAwareAmetysObject, DublinCoreAwareAmetysObject, TagAwareAmetysObject, ModifiableACLAmetysObject
Content abstraction defined by the following properties:
- type
- the content type (can only be set on creation)
- language
- the language (can only be set on creation)
- title
- the title
- creator
- the login of the creator
- creationDate
- the date when the content was created
- lastContributor
- the login of the last contributor
- lastModified
- the date when the last modification takes place
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final record
Record to get referencing contents with additional informations, we can get a limited number of referencing contents, then we would need the total number of refencing contents and if all references has been resolved. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Constants for title attributestatic final String
Deprecated.Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the creation date.Retrieves the login of the creator.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 theDataHolder
for 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.Returns all Contents referencing this Content (as a metadata).Retrieves the attachments root nodegetTitle()
Retrieves the title.Retrieves the title for the given locale.String[]
getTypes()
Retrieves the type identifiers of this content.boolean
Returnstrue
if there is at least one Content referencing this Content (as a metadata).searchReferencingContents
(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.void
setLanguage
(String language) Set the type of this Content.
This method may only be called on a new Content, ie.void
setMixinTypes
(String[] mixins) Set the mixins of this Content.void
Set the type of this contentvoid
Set the types of this Content.void
toSAX
(ContentHandler contentHandler, Locale locale, View view, boolean saxWorkflowStep) Generates SAX events representing this Content.Methods inherited from interface org.ametys.plugins.repository.ACLAmetysObject
getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, isInheritanceDisallowed
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, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getRepositoryData
Methods inherited from interface org.ametys.plugins.repository.dublincore.DublinCoreAwareAmetysObject
getDCContributor, getDCCoverage, getDCCreator, getDCDate, getDCDescription, getDCFormat, getDCIdentifier, getDCLanguage, getDCPublisher, getDCRelation, getDCRights, getDCSource, getDCSubject, getDCTitle, getDCType
Methods inherited from interface org.ametys.plugins.repository.metadata.MetadataAwareAmetysObject
getMetadataHolder
Methods inherited from interface org.ametys.cms.data.ametysobject.ModelAwareDataAwareAmetysObject
getComposite, getDataHolder, getExternalComposite, getExternalRepeater, getLocalComposite, getLocalRepeater, getParentDataHolder, getRepeater, getRootDataHolder, getSystemPropertyExtensionPoint, indexData, indexData
Methods 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, hasValueOrEmpty
Methods 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, isMultiple
Methods 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, removeDeniedUsers
Methods inherited from interface org.ametys.plugins.repository.tag.TagAwareAmetysObject
getTags
-
Field Details
-
ATTRIBUTE_TITLE
Constants for title attribute- See Also:
-
METADATA_TITLE
Deprecated.Constants for title Metadata Use ATTRIBUTE_TITLE- See Also:
-
-
Method Details
-
getTypes
Retrieves the type identifiers of this content.- Returns:
- the type identifiers of this content.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setType
Set the type of this content- Parameters:
type
- the type to set- Throws:
AmetysRepositoryException
- if an error occurs.
-
setTypes
Set the types of this Content.- Parameters:
types
- the types of this content.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getMixinTypes
Retrieves the mixin type identifiers of this content.- Returns:
- the mixin type identifiers of this content.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
setMixinTypes
Set the mixins of this Content.- Parameters:
mixins
- the mixins of this content.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getLanguage
Retrieves the language of this content.- Returns:
- the language of this content or
null
if the content is a multilingual content - Throws:
AmetysRepositoryException
- if an error occurs.
-
setLanguage
Set the type of this Content.
This method may only be called on a new Content, ie. before its first save.- Parameters:
language
- the language of this content.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getTitle
Retrieves the title for the given locale. If the locale is null or does not exist, the first locale will be used.- 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
Retrieves the title. This method is same asgetTitle(Locale)
with a null locale. Use this method only if you are manipulating no-multilingual content. If not sure, usegetTitle(Locale)
instead.- Returns:
- the title.
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getCreator
Retrieves the login of the creator.- Returns:
- the login of the creator.
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getCreationDate
Retrieves the creation date.- Returns:
- the creation date.
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getLastContributor
Retrieves the login of the last contributor.- Returns:
- the login of the last contributor.
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getLastModified
Retrieves the last modification date.- Returns:
- the last modification date.
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getFirstValidator
Retrieves 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.getFirstValidationDate()
is more reliable for this usage.- Returns:
- the first validator
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getFirstValidationDate
Retrieves the first validation date- Returns:
- the first validation date
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getLastValidator
Retrieves 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.getLastValidationDate()
is more reliable for this usage.- Returns:
- the last validator if the value exists
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getLastValidationDate
Retrieves the last validation date- Returns:
- the last validation date
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getLastMajorValidator
Retrieves 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.getLastMajorValidationDate()
is more reliable for this usage.- Returns:
- the last major validator
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getLastMajorValidationDate
Retrieves the last validation date resulting from a major modification. At least this is the first validation date- Returns:
- the last validation date resulting from a major modification
- Throws:
UnknownDataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getReferencingContents
Returns all Contents referencing this Content (as a metadata).- Returns:
- all Contents referencing this Content.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
searchReferencingContents
Content.ReferencingContentsSearch searchReferencingContents(int limit) throws AmetysRepositoryException 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.- 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
Returnstrue
if there is at least one Content referencing this Content (as a metadata).- Returns:
true
if there is at least one Content referencing this Content.- Throws:
AmetysRepositoryException
- if an error occurs.
-
getOutgoingReferences
Get the stored outgoing references of the content. This references can be used for different purposes, such as testing link consistency for example.- Returns:
- A non null map of outgoing references grouped by metadata (key are metadata path)
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getRootAttachments
Retrieves the attachments root node- 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.
-
toSAX
void toSAX(ContentHandler contentHandler, Locale locale, View view, boolean saxWorkflowStep) throws SAXException Generates SAX events representing this Content.- Parameters:
contentHandler
- theContentHandler
that will receive the SAX events.locale
- theLocale
to 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.
-
getInternalDataHolder
Returns theDataHolder
for internal data of thisContent
.- Returns:
- the
DataHolder
for internal data of thisContent
-