F
- the actual type of factory.public class DefaultWebContent<F extends DefaultWebContentFactory> extends DefaultContent<F> implements WebContent
DefaultContent
which is TagAwareAmetysObject
.Modifier and Type | Field and Description |
---|---|
static String |
METADATA_SITE
Constants for site Metadata.
|
ATTACHMENTS_NODE_NAME, METADATA_CONTENTTYPE, METADATA_CONTRIBUTOR, METADATA_CREATION, METADATA_CREATOR, METADATA_LANGUAGE, METADATA_LAST_MAJORVALIDATION, METADATA_LAST_VALIDATION, METADATA_MIXINCONTENTTYPES, METADATA_MODIFIED, METADATA_OUTGOING_REFERENCE_PROPERTY, METADATA_OUTGOING_REFERENCES, METADATA_OUTGOING_REFERENCES_PATH_PROPERTY, METADATA_ROOT_OUTGOING_REFERENCES, METADATA_TITLE
PROTECTED_PROPERTIES
Constructor and Description |
---|
DefaultWebContent(Node node,
String parentPath,
F factory)
Creates a
DefaultWebContent . |
Modifier and Type | Method and Description |
---|---|
ModifiableContent |
copyTo(ModifiableTraversableAmetysObject parent,
String name)
Copy the current
AmetysObject to the given object. |
<A extends AmetysObject> |
createChild(String name,
String type)
Creates a child below current object.
|
<A extends AmetysObject> |
getChild(String path)
Retrieves a given child from its relative path.
|
<A extends AmetysObject> |
getChildren()
Retrieves children of the current object.
|
Collection<Page> |
getReferencingPages()
Returns all pages referencing this Content.
|
Collection<ZoneItem> |
getReferencingZoneItems()
Returns all zone items referencing this Content.
|
ResourceCollection |
getRootAttachments()
Retrieves the attachments root node
|
Site |
getSite()
Returns this object's site.
|
String |
getSiteName()
Returns this object's site name.
|
boolean |
hasChild(String name)
Tests if this Object has at least one child with the given name.
|
copyTo, copyTo, copyTo, getCreationDate, getCreator, getDCContributor, getDCCoverage, getDCCreator, getDCDate, getDCDescription, getDCFormat, getDCIdentifier, getDCLanguage, getDCPublisher, getDCRelation, getDCRights, getDCSource, getDCSubject, getDCTitle, getDCType, getLanguage, getLastContributor, getLastMajorValidationDate, getLastModified, getLastValidationDate, getMixinTypes, getOutgoingReferences, getReferencingContents, getTags, getTitle, getTypes
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, addLabel, checkpoint, copyNode, getAllLabels, getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getAllRevisions, getBaseNode, getBaseVersion, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers, getLabels, getLabels, getNode, getRevision, getRevisionTimestamp, getRevisionTimestamp, getUnversionedMetadataHolder, getVersionHistory, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers, removeLabel, restoreFromLabel, restoreFromNode, restoreFromRevision, switchToLabel, switchToRevision
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
equals, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getCreationDate, getCreator, getLanguage, getLastContributor, getLastMajorValidationDate, getLastModified, getLastValidationDate, getMixinTypes, getOutgoingReferences, getReferencingContents, getTitle, getTypes
getMetadataHolder
getDCContributor, getDCCoverage, getDCCreator, getDCDate, getDCDescription, getDCFormat, getDCIdentifier, getDCLanguage, getDCPublisher, getDCRelation, getDCRights, getDCSource, getDCSubject, getDCTitle, getDCType
getTags
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers
equals, getId, getName, getParent, getParentPath, getPath, hashCode
getChildAt, getChildPosition
getNode
needsSave, rename, revertChanges, saveChanges
remove
public static final String METADATA_SITE
public DefaultWebContent(Node node, String parentPath, F factory)
DefaultWebContent
.node
- the node backing this DefaultWebContent
.parentPath
- the parent path in the Ametys hierarchy.factory
- the DefaultWebContentFactory
which creates the AmetysObject.public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException
CopiableAmetysObject
AmetysObject
to the given object. Be careful, this method save changes.copyTo
in interface CopiableAmetysObject
copyTo
in class DefaultContent<F extends DefaultWebContentFactory>
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 objectAmetysRepositoryException
- if an error occurs.public Collection<Page> getReferencingPages()
WebContent
getReferencingPages
in interface WebContent
public Collection<ZoneItem> getReferencingZoneItems()
WebContent
getReferencingZoneItems
in interface WebContent
public ResourceCollection getRootAttachments() throws AmetysRepositoryException
Content
getRootAttachments
in interface Content
getRootAttachments
in interface WebContent
getRootAttachments
in class DefaultContent<F extends DefaultWebContentFactory>
AmetysRepositoryException
- if an error occurs.public Site getSite()
SiteAwareAmetysObject
getSite
in interface SiteAwareAmetysObject
public String getSiteName()
SiteAwareAmetysObject
getSiteName
in interface SiteAwareAmetysObject
public boolean hasChild(String name) throws AmetysRepositoryException
TraversableAmetysObject
hasChild
in interface TraversableAmetysObject
hasChild
in class DefaultContent<F extends DefaultWebContentFactory>
name
- the name to test. Cannot be null
nor empty nor
begin with a '/'
and it cannot contain '/'
.true
if the named child exists,
false
otherwise.AmetysRepositoryException
- if an error occurs.public <A extends AmetysObject> A createChild(String name, String type) throws AmetysRepositoryException, RepositoryIntegrityViolationException
ModifiableTraversableAmetysObject
createChild
in interface ModifiableTraversableAmetysObject
createChild
in class DefaultContent<F extends DefaultWebContentFactory>
A
- the actual type of AmetysObject
.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.AmetysRepositoryException
- if an error occurs.RepositoryIntegrityViolationException
- if an object with the same name already
exists and same name siblings is not allowed.public <A extends AmetysObject> A getChild(String path) throws AmetysRepositoryException, UnknownAmetysObjectException
TraversableAmetysObject
null
, empty nor begin with a '/'
.getChild
in interface TraversableAmetysObject
getChild
in class DefaultContent<F extends DefaultWebContentFactory>
A
- the actual type of AmetysObject
.path
- the path of the child which can contains a position with.
[n]
if same name sibling is allowed.AmetysRepositoryException
- if an error occurs.UnknownAmetysObjectException
- if the object does not exist.public <A extends AmetysObject> AmetysObjectIterable<A> getChildren() throws AmetysRepositoryException
TraversableAmetysObject
getChildren
in interface TraversableAmetysObject
getChildren
in class DefaultContent<F extends DefaultWebContentFactory>
A
- the actual type of AmetysObject
s.AmetysObjectIterable
.AmetysRepositoryException
- if an error occurs.