Class DefaultSharedContent<F extends DefaultSharedContentFactory>
- 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>
-
- org.ametys.web.repository.content.jcr.DefaultWebContent<F>
-
- org.ametys.web.repository.content.jcr.DefaultSharedContent<F>
-
- Type Parameters:
F
- the actual type of factory.
- All Implemented Interfaces:
Content
,ReactionableObject
,ReportableObject
,TagAwareAmetysObject
,TaggableAmetysObject
,ACLAmetysObject
,AmetysObject
,CopiableAmetysObject
,DataAwareAmetysObject
,ModelAwareDataAwareAmetysObject
,DataHolder
,ModelAwareDataHolder
,DublinCoreAwareAmetysObject
,JCRAmetysObject
,JCRTraversableAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,RemovableAmetysObject
,TraversableAmetysObject
,DataAndVersionAwareAmetysObject
,ModifiableDataAwareVersionableAmetysObject
,VersionableAmetysObject
,VersionAwareAmetysObject
,SharedContent
,WebContent
,ModifiableSiteAwareAmetysObject
,SiteAwareAmetysObject
public class DefaultSharedContent<F extends DefaultSharedContentFactory> extends DefaultWebContent<F> implements SharedContent
DefaultSharedContent
implementation, backed by a JCR node.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.cms.repository.ReactionableObject
ReactionableObject.ReactionType
-
-
Field Summary
Fields Modifier and Type Field Description static String
INITIAL_CONTENT_PROPERTY
The initial content property.-
Fields inherited from class org.ametys.web.repository.content.jcr.DefaultWebContent
METADATA_SITE
-
Fields inherited from class org.ametys.cms.repository.DefaultContent
ATTACHMENTS_NODE_NAME, DEFAULT_CONTENT_LOCALE, METADATA_CONTENTTYPE, METADATA_CONTRIBUTOR, METADATA_CREATION, METADATA_CREATOR, METADATA_FIRST_VALIDATION, METADATA_LANGUAGE, METADATA_LAST_MAJORVALIDATION, METADATA_LAST_VALIDATION, METADATA_MIXINCONTENTTYPES, METADATA_MODIFIED, METADATA_OUTGOING_REFERENCE_NODETYPE, METADATA_OUTGOING_REFERENCE_PROPERTY, METADATA_OUTGOING_REFERENCES, METADATA_OUTGOING_REFERENCES_PATH_PROPERTY, METADATA_ROOT_OUTGOING_REFERENCES
-
Fields inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
PROTECTED_PROPERTIES
-
Fields inherited from interface org.ametys.cms.repository.Content
ATTRIBUTE_TITLE, METADATA_TITLE
-
Fields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description DefaultSharedContent(Node node, String parentPath, F factory)
Creates aDefaultSharedContent
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ModifiableModelAwareDataHolder
getDataHolder()
Returns theDataHolder
of thisAmetysObject
.Content
getInitialContent()
Get the initial content.Site
getSite()
Returns this object's site.String
getSiteName()
Returns this object's site name.void
setCreationDate(Date creationDate)
Set the creation date.void
setCreator(UserIdentity user)
Set the login of the creator.void
setFirstValidationDate(Date validationDate)
Set the first validation datevoid
setLanguage(String language)
Set the type of this Content.
This method may only be called on a new Content, ie.void
setLastContributor(UserIdentity user)
Set the login of the last contributor.void
setLastMajorValidationDate(Date validationDate)
Set the last validation date resulting from a major modificationvoid
setLastModified(Date lastModified)
Set the last modification date.void
setLastValidationDate(Date validationDate)
Set the last validation datevoid
setSiteName(String siteName)
Set the site name.void
setTitle(String title)
Deprecated.void
setTitle(String title, Locale locale)
Set the title from the given localevoid
setType(String type)
Set the type of this Content.
This method may only be called on a new Content, ie.void
setTypes(String[] types)
Set the types of this Content.
This method may only be called on a new Content, ie.void
tag(String tag)
Tags.void
untag(String tag)
Untags.-
Methods inherited from class org.ametys.web.repository.content.jcr.DefaultWebContent
copyTo, createChild, getChild, getChildren, getReferencingPages, getReferencingZoneItems, getRootAttachments, hasChild
-
Methods inherited from class org.ametys.cms.repository.DefaultContent
addReaction, addReport, clearReports, copyTo, copyTo, copyTo, copyTo, getCreationDate, getCreator, getDCContributor, getDCCoverage, getDCCreator, getDCDate, getDCDescription, getDCFormat, getDCIdentifier, getDCLanguage, getDCPublisher, getDCRelation, getDCRights, getDCSource, getDCSubject, getDCTitle, getDCType, getFirstValidationDate, getLanguage, getLastContributor, getLastMajorValidationDate, getLastModified, getLastValidationDate, getMixinModels, getMixinTypes, getModels, getOutgoingReferences, getReactionUsers, getReferencingContents, getReportsCount, getTags, getTitle, getTitle, getTypes, hasReferencingContents, removeReaction, setReportsCount, toSAX
-
Methods inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, addLabel, checkpoint, copyNode, disallowInheritance, getAllLabels, getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getAllRevisions, getBaseNode, getBaseVersion, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers, getLabels, getLabels, getNode, 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.ACLAmetysObject
getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers, isInheritanceDisallowed
-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCode
-
Methods inherited from interface org.ametys.cms.repository.Content
getCreationDate, getCreator, getFirstValidationDate, getLanguage, getLastContributor, getLastMajorValidationDate, getLastModified, getLastValidationDate, getMixinTypes, getOutgoingReferences, getReferencingContents, getTitle, getTitle, getTypes, hasReferencingContents, toSAX
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, dataToSAX, getRepositoryData
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.DataHolder
dataToSAX
-
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.jcr.JCRAmetysObject
getNode
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
dataToSAX, getComposite, getDataNames, getDefinition, getExternalComposite, getExternalRepeater, getExternalValue, getLocalComposite, getLocalRepeater, getLocalValue, getModel, getRepeater, getStatus, getValue, getValue, hasDefinition, hasExternalValue, hasLocalValue, hasValue
-
Methods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToSAX, dataToSAX, dataToSAX, 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.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
Methods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolder
-
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
-
Methods inherited from interface org.ametys.cms.repository.TagAwareAmetysObject
getTags
-
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChild, getChildAt, getChildPosition, getChildren, hasChild
-
Methods inherited from interface org.ametys.web.repository.content.WebContent
getReferencingPages, getReferencingZoneItems, getRootAttachments
-
-
-
-
Field Detail
-
INITIAL_CONTENT_PROPERTY
public static final String INITIAL_CONTENT_PROPERTY
The initial content property.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultSharedContent
public DefaultSharedContent(Node node, String parentPath, F factory)
Creates aDefaultSharedContent
.- Parameters:
node
- the node backing thisAmetysObject
parentPath
- the parentPath in the Ametys hierarchyfactory
- the DefaultSharedContentFactory which created the AmetysObject.
-
-
Method Detail
-
getInitialContent
public Content getInitialContent() throws AmetysRepositoryException
Description copied from interface:SharedContent
Get the initial content.- Specified by:
getInitialContent
in interfaceSharedContent
- Returns:
- the initial content, can be null if the initial content was removed.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getSite
public Site getSite()
Description copied from interface:SiteAwareAmetysObject
Returns this object's site.- Specified by:
getSite
in interfaceSiteAwareAmetysObject
- Overrides:
getSite
in classDefaultWebContent<F extends DefaultSharedContentFactory>
- Returns:
- this object's site
-
getSiteName
public String getSiteName()
Description copied from interface:SiteAwareAmetysObject
Returns this object's site name.- Specified by:
getSiteName
in interfaceSiteAwareAmetysObject
- Overrides:
getSiteName
in classDefaultWebContent<F extends DefaultSharedContentFactory>
- Returns:
- this object's site name.
-
setSiteName
public void setSiteName(String siteName)
Description copied from interface:ModifiableSiteAwareAmetysObject
Set the site name.- Specified by:
setSiteName
in interfaceModifiableSiteAwareAmetysObject
- Parameters:
siteName
- the site name.
-
setType
public void setType(String type) throws AmetysRepositoryException
Set the type of this Content.
This method may only be called on a new Content, ie. before its first save.- Parameters:
type
- the type of this content.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setTypes
public void setTypes(String[] types) throws AmetysRepositoryException
Set the types of this Content.
This method may only be called on a new Content, ie. before its first save.- Parameters:
types
- the types of this content.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setLanguage
public 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.
-
setTitle
@Deprecated public void setTitle(String title) throws AmetysRepositoryException
Deprecated.Set the title.- Parameters:
title
- the title.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setTitle
public void setTitle(String title, Locale locale) throws AmetysRepositoryException
Set the title from the given locale- Parameters:
title
- the title.locale
- The locale- Throws:
AmetysRepositoryException
- if an error occurs.
-
setCreator
public void setCreator(UserIdentity user) throws AmetysRepositoryException
Set the login of the creator.- Parameters:
user
- the creator.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setCreationDate
public void setCreationDate(Date creationDate) throws AmetysRepositoryException
Set the creation date.- Parameters:
creationDate
- the creation date.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setLastContributor
public void setLastContributor(UserIdentity user)
Set the login of the last contributor.- Parameters:
user
- the last contributor.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setLastModified
public void setLastModified(Date lastModified) throws AmetysRepositoryException
Set the last modification date.- Parameters:
lastModified
- the last modification date.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setFirstValidationDate
public void setFirstValidationDate(Date validationDate) throws AmetysRepositoryException
Set the first validation date- Parameters:
validationDate
- the validation date.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setLastValidationDate
public void setLastValidationDate(Date validationDate) throws AmetysRepositoryException
Set the last validation date- Parameters:
validationDate
- the validation date.- Throws:
AmetysRepositoryException
- if an error occurs.
-
setLastMajorValidationDate
public void setLastMajorValidationDate(Date validationDate) throws AmetysRepositoryException
Set the last validation date resulting from a major modification- Parameters:
validationDate
- the validation date.- 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
- Overrides:
getDataHolder
in classDefaultContent<F extends DefaultSharedContentFactory>
- Returns:
- the
DataHolder
of thisAmetysObject
-
tag
public void tag(String tag) throws AmetysRepositoryException
Description copied from interface:TaggableAmetysObject
Tags.- Specified by:
tag
in interfaceTaggableAmetysObject
- Parameters:
tag
- the tag to add.- Throws:
AmetysRepositoryException
- if an error occurs.
-
untag
public void untag(String tag) throws AmetysRepositoryException
Description copied from interface:TaggableAmetysObject
Untags.- Specified by:
untag
in interfaceTaggableAmetysObject
- Parameters:
tag
- the tag to remove.- Throws:
AmetysRepositoryException
- if an error occurs.
-
-