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
,ACLAmetysObject
,AmetysObject
,CopiableAmetysObject
,DataAwareAmetysObject
,ModelAwareDataAwareAmetysObject
,DataHolder
,ModelAwareDataHolder
,DublinCoreAwareAmetysObject
,JCRAmetysObject
,JCRTraversableAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableACLAmetysObject
,ModifiableAmetysObject
,ModifiableTraversableAmetysObject
,RemovableAmetysObject
,TagAwareAmetysObject
,TaggableAmetysObject
,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, COMMENTS_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
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
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, getInternalDataHolder, getLanguage, getLastContributor, getLastMajorValidationDate, getLastModified, getLastValidationDate, getMixinTypes, getOutgoingReferences, getReactionUsers, getReferencingContents, getReportsCount, getTags, getTitle, getTitle, getTypes, hasReferencingContents, removeReaction, setLanguage, setMixinTypes, setReportsCount, setType, setTypes, toSAX
-
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, 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
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.cms.repository.Content
getCreationDate, getCreator, getFirstValidationDate, getInternalDataHolder, getLanguage, getLastContributor, getLastMajorValidationDate, getLastModified, getLastValidationDate, getMixinTypes, getOutgoingReferences, getReferencingContents, getTitle, getTitle, getTypes, hasReferencingContents, setLanguage, setMixinTypes, setType, setTypes, toSAX
-
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.jcr.JCRAmetysObject
getNode
-
Methods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
getComments, getComposite, 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.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.plugins.repository.tag.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.
-
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.
-
-