F - the actual type of factory.public class DefaultContent<F extends ContentFactory> extends DefaultAmetysObject<F> implements Content, CopiableAmetysObject, JCRTraversableAmetysObject
Content, also versionable, lockable and workflow-aware.| Modifier and Type | Field and Description |
|---|---|
private boolean |
_lockAlreadyChecked |
static String |
ATTACHMENTS_NODE_NAME
Constant for the attachment node name.
|
static String |
METADATA_CONTENTTYPE
Constants for contentType Metadata*
|
static String |
METADATA_CONTRIBUTOR
Constants for last contributor Metadata*
|
static String |
METADATA_CREATION
Constants for lastModified Metadata*
|
static String |
METADATA_CREATOR
Constants for author Metadata*
|
static String |
METADATA_LANGUAGE
Constants for language Metadata*
|
static String |
METADATA_LAST_MAJORVALIDATION
Constants for lastMajorValidationDate Metadata*
|
static String |
METADATA_LAST_VALIDATION
Constants for lastValidationDate Metadata*
|
static String |
METADATA_MIXINCONTENTTYPES
Constants for contentType Metadata*
|
static String |
METADATA_MODIFIED
Constants for lastModified Metadata*
|
static String |
METADATA_OUTGOING_REFERENCE_PROPERTY
Constants for the outgoing reference property
|
static String |
METADATA_OUTGOING_REFERENCES
Constants for the outgoing references node
|
static String |
METADATA_OUTGOING_REFERENCES_PATH_PROPERTY
Constants for the outgoing references path property
|
static String |
METADATA_ROOT_OUTGOING_REFERENCES
Constants for the root outgoing references node
|
static String |
METADATA_TITLE
Constants for title Metadata*
|
PROTECTED_PROPERTIES| Constructor and Description |
|---|
DefaultContent(Node node,
String parentPath,
F factory)
Creates a JCR-based Content.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
_checkLock() |
ModifiableContent |
copyTo(ModifiableTraversableAmetysObject parent,
String name)
Copy the current
AmetysObject to the given object. |
ModifiableContent |
copyTo(ModifiableTraversableAmetysObject parent,
String name,
int initWorkflowActionId)
Copy the current
DefaultWorkflowAwareContent to the given object. |
ModifiableContent |
copyTo(ModifiableTraversableAmetysObject parent,
String name,
List<String> restrictTo)
Copy the current
AmetysObject to the given object if it is not in the restriction list. |
ModifiableContent |
copyTo(ModifiableTraversableAmetysObject parent,
String name,
String lang,
int initWorkflowActionId)
Copy the current
DefaultWorkflowAwareContent 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.
|
Date |
getCreationDate()
Retrieves the creation date.
|
UserIdentity |
getCreator()
Retrieves the login of the creator.
|
String |
getDCContributor()
Get the Dublin Core contributor.
|
String |
getDCCoverage()
Get the Dublin Core coverage.
|
String |
getDCCreator()
Get the Dublin Core creator.
|
Date |
getDCDate()
Get the Dublin Core date.
|
String |
getDCDescription()
Get the Dublin Core description.
|
String |
getDCFormat()
Get the Dublin Core format.
|
String |
getDCIdentifier()
Get the Dublin Core identifier.
|
String |
getDCLanguage()
Get the Dublin Core language.
|
String |
getDCPublisher()
Get the Dublin Core publisher.
|
String |
getDCRelation()
Get the Dublin Core relation.
|
String |
getDCRights()
Get the Dublin Core rights.
|
String |
getDCSource()
Get the Dublin Core source.
|
String[] |
getDCSubject()
Get the Dublin Core subject.
|
String |
getDCTitle()
Get the Dublin Core title.
|
String |
getDCType()
Get the Dublin Core type.
|
String |
getLanguage()
Retrieves the language of this content.
This method may only be called on a new Content, ie. |
UserIdentity |
getLastContributor()
Retrieves the login of the last contributor.
|
Date |
getLastMajorValidationDate()
Retrieves the last validation date resulting from a major modification.
|
Date |
getLastModified()
Retrieves the last modification date.
|
Date |
getLastValidationDate()
Retrieves the last validation date
|
String[] |
getMixinTypes()
Retrieves the mixin types of this content.
|
Map<String,OutgoingReferences> |
getOutgoingReferences()
Get the stored outgoing references of the content.
|
Collection<Content> |
getReferencingContents()
Returns all Contents referencing this Content (as a metadata).
|
ResourceCollection |
getRootAttachments()
Retrieves the attachments root node
|
Set<String> |
getTags()
Retrieves current tags.
|
String |
getTitle()
Retrieves the title.
|
String[] |
getTypes()
Retrieves the types of this content.
|
boolean |
hasChild(String name)
Tests if this Object has at least one child with the given name.
|
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, saveChangesequals, hashCode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsersgetAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsersgetNodeneedsSave, rename, revertChanges, saveChangesequals, getId, getName, getParent, getParentPath, getPath, hashCoderemovegetChildAt, getChildPositionpublic static final String METADATA_ROOT_OUTGOING_REFERENCES
public static final String METADATA_OUTGOING_REFERENCES
public static final String METADATA_OUTGOING_REFERENCES_PATH_PROPERTY
public static final String METADATA_OUTGOING_REFERENCE_PROPERTY
public static final String METADATA_LANGUAGE
public static final String METADATA_TITLE
public static final String METADATA_CREATOR
public static final String METADATA_CREATION
public static final String METADATA_LAST_VALIDATION
public static final String METADATA_LAST_MAJORVALIDATION
public static final String METADATA_CONTRIBUTOR
public static final String METADATA_MODIFIED
public static final String METADATA_CONTENTTYPE
public static final String METADATA_MIXINCONTENTTYPES
public static final String ATTACHMENTS_NODE_NAME
private boolean _lockAlreadyChecked
public DefaultContent(Node node, String parentPath, F factory)
node - the JCR Node backing this Content.parentPath - the parent path in the Ametys hierarchy.factory - the corresponding ContentFactory.public String[] getTypes() throws AmetysRepositoryException
ContentgetTypes in interface ContentAmetysRepositoryException - if an error occurs.public String[] getMixinTypes() throws AmetysRepositoryException
ContentgetMixinTypes in interface ContentAmetysRepositoryException - if an error occurs.public String getLanguage() throws AmetysRepositoryException
ContentgetLanguage in interface ContentAmetysRepositoryException - if an error occurs.public String getTitle() throws UnknownMetadataException, AmetysRepositoryException
ContentgetTitle in interface ContentUnknownMetadataException - if this property does not exist.AmetysRepositoryException - if an error occurs.public UserIdentity getCreator() throws UnknownMetadataException, AmetysRepositoryException
ContentgetCreator in interface ContentUnknownMetadataException - if this property does not exist.AmetysRepositoryException - if an error occurs.public Date getCreationDate() throws UnknownMetadataException, AmetysRepositoryException
ContentgetCreationDate in interface ContentUnknownMetadataException - if this property does not exist.AmetysRepositoryException - if an error occurs.public UserIdentity getLastContributor() throws UnknownMetadataException, AmetysRepositoryException
ContentgetLastContributor in interface ContentUnknownMetadataException - if this property does not exist.AmetysRepositoryException - if an error occurs.public Date getLastModified() throws UnknownMetadataException, AmetysRepositoryException
ContentgetLastModified in interface ContentUnknownMetadataException - if this property does not exist.AmetysRepositoryException - if an error occurs.public Date getLastValidationDate() throws UnknownMetadataException, AmetysRepositoryException
ContentgetLastValidationDate in interface ContentUnknownMetadataException - if this property does not exist.AmetysRepositoryException - if an error occurs.public Date getLastMajorValidationDate() throws AmetysRepositoryException
ContentgetLastMajorValidationDate in interface ContentUnknownMetadataException - if this property does not exist.AmetysRepositoryException - if an error occurs.public Set<String> getTags() throws AmetysRepositoryException
TagAwareAmetysObjectgetTags in interface TagAwareAmetysObjectAmetysRepositoryException - if an error occurs.public Map<String,OutgoingReferences> getOutgoingReferences() throws AmetysRepositoryException
ContentgetOutgoingReferences in interface ContentAmetysRepositoryException - if an error occurs.public Collection<Content> getReferencingContents() throws AmetysRepositoryException
ContentgetReferencingContents in interface ContentAmetysRepositoryException - if an error occurs.public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) throws AmetysRepositoryException
CopiableAmetysObjectAmetysObject to the given object if it is not in the restriction list. Be careful, this method save changes.copyTo in interface CopiableAmetysObjectparent - 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 objectrestrictTo - A restrict list of CopiableAmetysObject authorized to be copiedAmetysRepositoryException - if an error occurs.public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException
CopiableAmetysObjectAmetysObject to the given object. Be careful, this method save changes.copyTo in interface CopiableAmetysObjectparent - 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 ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name, int initWorkflowActionId) throws AmetysRepositoryException
DefaultWorkflowAwareContent to the given object. Be careful, this method save changes, but do not create a new version (checkpoint)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 idAmetysRepositoryException - if an error occurs.public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name, String lang, int initWorkflowActionId) throws AmetysRepositoryException
DefaultWorkflowAwareContent to the given object. Be careful, this method save changes, but do not create a new version (checkpoint)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.lang - Language of the new object. Can be null. If null, the new language will be get from the copied object.initWorkflowActionId - The initial workflow action idAmetysRepositoryException - if an error occurs.void _checkLock() throws RepositoryException
RepositoryExceptionpublic String getDCTitle() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCTitle in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getDCCreator() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCCreator in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String[] getDCSubject() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCSubject in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getDCDescription() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCDescription in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getDCPublisher() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCPublisher in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getDCContributor() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCContributor in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public Date getDCDate() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCDate in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getDCType() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCType in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getDCFormat() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCFormat in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getDCIdentifier() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCIdentifier in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getDCSource() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCSource in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getDCLanguage() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCLanguage in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getDCRelation() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCRelation in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getDCCoverage() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCCoverage in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public String getDCRights() throws AmetysRepositoryException
DublinCoreAwareAmetysObjectgetDCRights in interface DublinCoreAwareAmetysObjectAmetysRepositoryException - if an error occurs.public ResourceCollection getRootAttachments() throws AmetysRepositoryException
ContentgetRootAttachments in interface ContentAmetysRepositoryException - if an error occurs.public boolean hasChild(String name) throws AmetysRepositoryException
TraversableAmetysObjecthasChild in interface TraversableAmetysObjectname - 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
ModifiableTraversableAmetysObjectcreateChild in interface ModifiableTraversableAmetysObjectA - 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
TraversableAmetysObjectnull, empty nor begin with a '/'.getChild in interface TraversableAmetysObjectA - 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
TraversableAmetysObjectgetChildren in interface TraversableAmetysObjectA - the actual type of AmetysObjects.AmetysObjectIterable.AmetysRepositoryException - if an error occurs.