Package org.ametys.cms.repository
Interface Content
-
- All Superinterfaces:
ACLAmetysObject,AmetysObject,DataAwareAmetysObject,DataHolder,DublinCoreAwareAmetysObject,MetadataAwareAmetysObject,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
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTRIBUTE_TITLEConstants for title attributestatic StringMETADATA_TITLEDeprecated.-
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, COMMENTS_SUFFIX, STATUS_SUFFIX
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DategetCreationDate()Retrieves the creation date.UserIdentitygetCreator()Retrieves the login of the creator.DategetFirstValidationDate()Retrieves the first validation dateModifiableModelLessDataHoldergetInternalDataHolder()Returns theDataHolderfor internal data of thisContent.StringgetLanguage()Retrieves the language of this content.UserIdentitygetLastContributor()Retrieves the login of the last contributor.DategetLastMajorValidationDate()Retrieves the last validation date resulting from a major modification.DategetLastModified()Retrieves the last modification date.DategetLastValidationDate()Retrieves the last validation dateString[]getMixinTypes()Retrieves the mixin type identifiers of this content.Map<String,OutgoingReferences>getOutgoingReferences()Get the stored outgoing references of the content.Collection<Content>getReferencingContents()Returns all Contents referencing this Content (as a metadata).ResourceCollectiongetRootAttachments()Retrieves the attachments root nodeStringgetTitle()Retrieves the title.StringgetTitle(Locale locale)Retrieves the title for the given locale.String[]getTypes()Retrieves the type identifiers of this content.booleanhasReferencingContents()Returnstrueif there is at least one Content referencing this Content (as a metadata).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.voidsetType(String type)Set the type of this contentvoidsetTypes(String[] types)Set the types of this Content.voidtoSAX(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, 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.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
getComments, getComposite, getDataHolder, getDataNames, getDefinition, getExternalComposite, getExternalRepeater, getExternalValue, getLocalComposite, getLocalRepeater, getLocalValue, getModel, getParentDataHolder, getRepeater, getRootDataHolder, 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, getType, getValue, 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 Detail
-
ATTRIBUTE_TITLE
static final String ATTRIBUTE_TITLE
Constants for title attribute- See Also:
- Constant Field Values
-
METADATA_TITLE
@Deprecated static final String METADATA_TITLE
Deprecated.Constants for title Metadata Use ATTRIBUTE_TITLE- See Also:
- Constant Field Values
-
-
Method Detail
-
getTypes
String[] getTypes() throws AmetysRepositoryException
Retrieves the type identifiers of this content.- Returns:
- the type identifiers of this content.
- Throws:
AmetysRepositoryException- if an error occurs.
-
setType
void setType(String type) throws AmetysRepositoryException
Set the type of this content- Parameters:
type- the type to set- Throws:
AmetysRepositoryException- if an error occurs.
-
setTypes
void setTypes(String[] types) throws AmetysRepositoryException
Set the types of this Content.- Parameters:
types- the types of this content.- Throws:
AmetysRepositoryException- if an error occurs.
-
getMixinTypes
String[] getMixinTypes() throws AmetysRepositoryException
Retrieves the mixin type identifiers of this content.- Returns:
- the mixin type identifiers of this content.
- Throws:
AmetysRepositoryException- if an error occurs.
-
setMixinTypes
void setMixinTypes(String[] mixins) throws AmetysRepositoryException
Set the mixins of this Content.- Parameters:
mixins- the mixins of this content.- Throws:
AmetysRepositoryException- if an error occurs.
-
getLanguage
String getLanguage() throws AmetysRepositoryException
Retrieves the language of this content.- Returns:
- the language of this content or
nullif the content is a multilingual content - Throws:
AmetysRepositoryException- if an error occurs.
-
setLanguage
void setLanguage(String language) throws AmetysRepositoryException
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
String getTitle(Locale locale) throws UnknownDataException, AmetysRepositoryException
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
String getTitle() throws UnknownDataException, AmetysRepositoryException
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
UserIdentity getCreator() throws UnknownDataException, AmetysRepositoryException
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
Date getCreationDate() throws UnknownDataException, AmetysRepositoryException
Retrieves the creation date.- Returns:
- the creation date.
- Throws:
UnknownDataException- if this property does not exist.AmetysRepositoryException- if an error occurs.
-
getLastContributor
UserIdentity getLastContributor() throws UnknownDataException, AmetysRepositoryException
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
Date getLastModified() throws UnknownDataException, AmetysRepositoryException
Retrieves the last modification date.- Returns:
- the last modification date.
- Throws:
UnknownDataException- if this property does not exist.AmetysRepositoryException- if an error occurs.
-
getFirstValidationDate
Date getFirstValidationDate() throws UnknownDataException, AmetysRepositoryException
Retrieves the first validation date- Returns:
- the first validation date
- Throws:
UnknownDataException- if this property does not exist.AmetysRepositoryException- if an error occurs.
-
getLastValidationDate
Date getLastValidationDate() throws UnknownDataException, AmetysRepositoryException
Retrieves the last validation date- Returns:
- the last validation date
- Throws:
UnknownDataException- if this property does not exist.AmetysRepositoryException- if an error occurs.
-
getLastMajorValidationDate
Date getLastMajorValidationDate() throws UnknownDataException, AmetysRepositoryException
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
Collection<Content> getReferencingContents() throws AmetysRepositoryException
Returns all Contents referencing this Content (as a metadata).- Returns:
- all Contents referencing this Content.
- Throws:
AmetysRepositoryException- if an error occurs.
-
hasReferencingContents
boolean hasReferencingContents() throws AmetysRepositoryException
Returnstrueif there is at least one Content referencing this Content (as a metadata).- Returns:
trueif there is at least one Content referencing this Content.- Throws:
AmetysRepositoryException- if an error occurs.
-
getOutgoingReferences
Map<String,OutgoingReferences> getOutgoingReferences() throws AmetysRepositoryException
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
ResourceCollection getRootAttachments() throws AmetysRepositoryException
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- 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.
-
getInternalDataHolder
ModifiableModelLessDataHolder getInternalDataHolder()
Returns theDataHolderfor internal data of thisContent.- Returns:
- the
DataHolderfor internal data of thisContent
-
-