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.ReferencingContentsSearchNested classes/interfaces inherited from interface org.ametys.cms.repository.ReactionableObject
ReactionableObject.ReactionType -
Field Summary
Fields inherited from class org.ametys.cms.repository.DefaultContent
_mixins, _outgoingReferences, _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_REFERENCESFields inherited from class org.ametys.plugins.repository.jcr.DefaultAmetysObject
__VERSION_COMPARATOR, PROTECTED_PROPERTIESFields inherited from interface org.ametys.cms.repository.Content
ATTRIBUTE_TITLEFields inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
ALTERNATIVE_SUFFIX, STATUS_SUFFIXFields inherited from interface org.ametys.web.repository.SiteAwareAmetysObject
METADATA_SITEFields inherited from interface org.ametys.web.repository.content.WebContent
PROPERTY_PRIVACY -
Constructor Summary
ConstructorsConstructorDescriptionDefaultWebContent(javax.jcr.Node node, String parentPath, F factory) Creates aDefaultWebContent. -
Method Summary
Modifier and TypeMethodDescriptioncopyTo(ModifiableTraversableAmetysObject parent, String name) Copy the currentAmetysObjectto the given object.copyTo(ModifiableTraversableAmetysObject parent, String name, int initWorkflowActionId, boolean checkpoint) Copy the currentDefaultWorkflowAwareContentto 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.booleanTests 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, toSAXMethods 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, switchToRevisionMethods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChangesMethods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ametys.plugins.repository.ACLAmetysObject
getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, isInheritanceDisallowedMethods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, getId, getName, getParent, getParentPath, getPath, hashCodeMethods 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, toSAXMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.DataAwareAmetysObject
copyTo, copyTo, dataToJSON, dataToJSON, dataToSAX, dataToSAX, getRepositoryDataMethods inherited from interface org.ametys.plugins.repository.dublincore.DublinCoreAwareAmetysObject
getDCContributor, getDCCoverage, getDCCreator, getDCDate, getDCDescription, getDCFormat, getDCIdentifier, getDCLanguage, getDCPublisher, getDCRelation, getDCRights, getDCSource, getDCSubject, getDCTitle, getDCTypeMethods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNodeMethods inherited from interface org.ametys.cms.data.ametysobject.ModelAwareDataAwareAmetysObject
getComposite, getDataHolder, getExternalComposite, getExternalRepeater, getLocalComposite, getLocalRepeater, getParentDataHolder, getRepeater, getRootDataHolder, getSystemPropertyExtensionPoint, indexData, indexDataMethods inherited from interface org.ametys.plugins.repository.data.ametysobject.ModelAwareDataAwareAmetysObject
dataToJSON, dataToJSONForEdition, dataToMap, dataToSAX, dataToSAXForEdition, getDataNames, getDefinition, getDifferences, getDifferences, getDifferences, getDifferences, getExternalValue, getLocalValue, getModel, getStatus, getValue, getValue, hasDefinition, hasDifferences, hasDifferences, hasDifferences, hasDifferences, hasExternalValue, hasExternalValueOrEmpty, hasLocalValue, hasLocalValueOrEmpty, hasValue, hasValueOrEmptyMethods inherited from interface org.ametys.plugins.repository.data.holder.ModelAwareDataHolder
dataToJSON, dataToJSON, dataToJSON, dataToMap, dataToMap, dataToMap, dataToSAX, dataToSAX, dataToSAX, getDataNames, getType, getValue, hasValue, hasValueOrEmpty, isMultipleMethods 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, removeDeniedUsersMethods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChangesMethods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolderMethods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
removeMethods inherited from interface org.ametys.plugins.repository.tag.TagAwareAmetysObject
getTagsMethods 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- theDefaultWebContentFactorywhich creates the AmetysObject.
-
-
Method Details
-
copyTo
public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException Description copied from interface:CopiableAmetysObjectCopy the currentAmetysObjectto the given object. Be careful, this method save changes.- Specified by:
copyToin interfaceCopiableAmetysObject- Overrides:
copyToin 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 currentDefaultWorkflowAwareContentto 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:WebContentReturns all pages referencing this Content.- Specified by:
getReferencingPagesin interfaceWebContent- Returns:
- all pages referencing this Content.
-
getReferencingZoneItems
Description copied from interface:WebContentReturns all zone items referencing this Content.- Specified by:
getReferencingZoneItemsin interfaceWebContent- Returns:
- all zone items referencing this Content.
-
getRootAttachments
Description copied from interface:ContentRetrieves the attachments root node- Specified by:
getRootAttachmentsin interfaceContent- Specified by:
getRootAttachmentsin interfaceWebContent- Overrides:
getRootAttachmentsin 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:SiteAwareAmetysObjectReturns this object's site.- Specified by:
getSitein interfaceSiteAwareAmetysObject- Returns:
- this object's site
-
getSiteName
Description copied from interface:SiteAwareAmetysObjectReturns this object's site name.- Specified by:
getSiteNamein interfaceSiteAwareAmetysObject- Returns:
- this object's site name.
-
hasChild
Description copied from interface:TraversableAmetysObjectTests if this Object has at least one child with the given name.- Specified by:
hasChildin interfaceTraversableAmetysObject- Overrides:
hasChildin classDefaultContent<F extends DefaultWebContentFactory>- Parameters:
name- the name to test. Cannot benullnor empty nor begin with a'/'and it cannot contain'/'.- Returns:
trueif the named child exists,falseotherwise.- Throws:
AmetysRepositoryException- if an error occurs.
-
createChild
public <A extends AmetysObject> A createChild(String name, String type) throws AmetysRepositoryException, RepositoryIntegrityViolationException Description copied from interface:ModifiableTraversableAmetysObjectCreates a child below current object.- Specified by:
createChildin interfaceModifiableTraversableAmetysObject- Overrides:
createChildin 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:TraversableAmetysObjectRetrieves a given child from its relative path. The path cannot benull, empty nor begin with a'/'.- Specified by:
getChildin interfaceTraversableAmetysObject- Overrides:
getChildin 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:TraversableAmetysObjectRetrieves children of the current object.- Specified by:
getChildrenin interfaceTraversableAmetysObject- Overrides:
getChildrenin classDefaultContent<F extends DefaultWebContentFactory>- Type Parameters:
A- the actual type ofAmetysObjects.- Returns:
- the children or an empty
AmetysObjectIterable. - Throws:
AmetysRepositoryException- if an error occurs.
-
getPrivacyLevel
Description copied from interface:WebContentRetrieves the content's privacy level- Specified by:
getPrivacyLevelin interfaceWebContent- Returns:
- the content's privacy level
-