Class DefaultWebContent<F extends DefaultWebContentFactory>
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>
- 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
,WebContent
,SiteAwareAmetysObject
- Direct Known Subclasses:
DefaultSharedContent
,ModifiableDefaultWebContent
public class DefaultWebContent<F extends DefaultWebContentFactory>
extends DefaultContent<F>
implements WebContent
DefaultContent
which is TagAwareAmetysObject
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.cms.repository.Content
Content.ReferencingContentsSearch
Nested classes/interfaces inherited from interface org.ametys.cms.repository.ReactionableObject
ReactionableObject.ReactionType
-
Field Summary
Fields inherited from class org.ametys.cms.repository.DefaultContent
_mixins, _types, ATTACHMENTS_NODE_NAME, DEFAULT_CONTENT_LOCALE, METADATA_CONTENTTYPE, METADATA_CONTRIBUTOR, METADATA_CREATION, METADATA_CREATOR, METADATA_FIRST_VALIDATION, METADATA_FIRST_VALIDATOR, METADATA_LANGUAGE, METADATA_LAST_MAJOR_VALIDATOR, METADATA_LAST_MAJORVALIDATION, METADATA_LAST_VALIDATION, METADATA_LAST_VALIDATOR, 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
Fields inherited from interface org.ametys.web.repository.SiteAwareAmetysObject
METADATA_SITE
Fields inherited from interface org.ametys.web.repository.content.WebContent
PROPERTY_PRIVACY
-
Constructor Summary
ConstructorDescriptionDefaultWebContent
(javax.jcr.Node node, String parentPath, F factory) Creates aDefaultWebContent
. -
Method Summary
Modifier and TypeMethodDescriptioncopyTo
(ModifiableTraversableAmetysObject parent, String name) Copy the currentAmetysObject
to the given object.copyTo
(ModifiableTraversableAmetysObject parent, String name, int initWorkflowActionId, boolean checkpoint) Copy the currentDefaultWorkflowAwareContent
to the given object.<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 content's privacy levelReturns all pages referencing this Content.Returns all zone items referencing this Content.Retrieves the attachments root nodegetSite()
Returns this object's site.Returns this object's site name.boolean
Tests if this Object has at least one child with the given name.Methods inherited from class org.ametys.cms.repository.DefaultContent
addReaction, addReport, clearReports, copyTo, copyTo, copyTo, getCreationDate, getCreator, getDataHolder, getDCContributor, getDCCoverage, getDCCreator, getDCDate, getDCDescription, getDCFormat, getDCIdentifier, getDCLanguage, getDCPublisher, getDCRelation, getDCRights, getDCSource, getDCSubject, getDCTitle, getDCType, getFirstValidationDate, getFirstValidator, getInternalDataHolder, getLanguage, getLastContributor, getLastMajorValidationDate, getLastMajorValidator, getLastModified, getLastValidationDate, getLastValidator, getMixinTypes, getOutgoingReferences, getReactionUsers, getReferencingContents, getReportsCount, getSystemPropertyExtensionPoint, getTags, getTitle, getTitle, getTypes, hasReferencingContents, removeReaction, searchReferencingContents, 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, getFirstValidator, getInternalDataHolder, getLanguage, getLastContributor, getLastMajorValidationDate, getLastMajorValidator, getLastModified, getLastValidationDate, getLastValidator, getMixinTypes, getOutgoingReferences, getReferencingContents, getTitle, getTitle, getTypes, hasReferencingContents, searchReferencingContents, setLanguage, setMixinTypes, setType, setTypes, toSAX
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.jcr.JCRAmetysObject
getNode
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, hasDifferences, hasDifferences, 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.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
getChildAt, getChildPosition
-
Constructor Details
-
DefaultWebContent
Creates aDefaultWebContent
.- Parameters:
node
- the node backing thisDefaultWebContent
.parentPath
- the parent path in the Ametys hierarchy.factory
- theDefaultWebContentFactory
which creates the AmetysObject.
-
-
Method Details
-
copyTo
public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException Description copied from interface:CopiableAmetysObject
Copy the currentAmetysObject
to the given object. Be careful, this method save changes.- Specified by:
copyTo
in interfaceCopiableAmetysObject
- Overrides:
copyTo
in classDefaultContent<F extends DefaultWebContentFactory>
- 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 checkpoint) throws AmetysRepositoryException Copy the currentDefaultWorkflowAwareContent
to 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 idcheckpoint
- true to check the content in if it is versionable- Returns:
- the created object
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getReferencingPages
Description copied from interface:WebContent
Returns all pages referencing this Content.- Specified by:
getReferencingPages
in interfaceWebContent
- Returns:
- all pages referencing this Content.
-
getReferencingZoneItems
Description copied from interface:WebContent
Returns all zone items referencing this Content.- Specified by:
getReferencingZoneItems
in interfaceWebContent
- Returns:
- all zone items referencing this Content.
-
getRootAttachments
Description copied from interface:Content
Retrieves the attachments root node- Specified by:
getRootAttachments
in interfaceContent
- Specified by:
getRootAttachments
in interfaceWebContent
- Overrides:
getRootAttachments
in classDefaultContent<F extends DefaultWebContentFactory>
- 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.
-
getSite
Description copied from interface:SiteAwareAmetysObject
Returns this object's site.- Specified by:
getSite
in interfaceSiteAwareAmetysObject
- Returns:
- this object's site
-
getSiteName
Description copied from interface:SiteAwareAmetysObject
Returns this object's site name.- Specified by:
getSiteName
in interfaceSiteAwareAmetysObject
- Returns:
- this object's site name.
-
hasChild
Description copied from interface:TraversableAmetysObject
Tests if this Object has at least one child with the given name.- Specified by:
hasChild
in interfaceTraversableAmetysObject
- Overrides:
hasChild
in classDefaultContent<F extends DefaultWebContentFactory>
- Parameters:
name
- the name to test. Cannot benull
nor empty nor begin with a'/'
and it cannot contain'/'
.- Returns:
true
if the named child exists,false
otherwise.- Throws:
AmetysRepositoryException
- if an error occurs.
-
createChild
public <A extends AmetysObject> A createChild(String name, String type) throws AmetysRepositoryException, RepositoryIntegrityViolationException Description copied from interface:ModifiableTraversableAmetysObject
Creates a child below current object.- Specified by:
createChild
in interfaceModifiableTraversableAmetysObject
- Overrides:
createChild
in classDefaultContent<F extends DefaultWebContentFactory>
- 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:TraversableAmetysObject
Retrieves a given child from its relative path. The path cannot benull
, empty nor begin with a'/'
.- Specified by:
getChild
in interfaceTraversableAmetysObject
- Overrides:
getChild
in classDefaultContent<F extends DefaultWebContentFactory>
- 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:TraversableAmetysObject
Retrieves children of the current object.- Specified by:
getChildren
in interfaceTraversableAmetysObject
- Overrides:
getChildren
in classDefaultContent<F extends DefaultWebContentFactory>
- Type Parameters:
A
- the actual type ofAmetysObject
s.- Returns:
- the children or an empty
AmetysObjectIterable
. - Throws:
AmetysRepositoryException
- if an error occurs.
-
getPrivacyLevel
Description copied from interface:WebContent
Retrieves the content's privacy level- Specified by:
getPrivacyLevel
in interfaceWebContent
- Returns:
- the content's privacy level
-