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, saveChanges
equals, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
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
getNode
needsSave, rename, revertChanges, saveChanges
equals, getId, getName, getParent, getParentPath, getPath, hashCode
remove
getChildAt, getChildPosition
public 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
Content
getTypes
in interface Content
AmetysRepositoryException
- if an error occurs.public String[] getMixinTypes() throws AmetysRepositoryException
Content
getMixinTypes
in interface Content
AmetysRepositoryException
- if an error occurs.public String getLanguage() throws AmetysRepositoryException
Content
getLanguage
in interface Content
AmetysRepositoryException
- if an error occurs.public String getTitle() throws UnknownMetadataException, AmetysRepositoryException
Content
getTitle
in interface Content
UnknownMetadataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.public UserIdentity getCreator() throws UnknownMetadataException, AmetysRepositoryException
Content
getCreator
in interface Content
UnknownMetadataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.public Date getCreationDate() throws UnknownMetadataException, AmetysRepositoryException
Content
getCreationDate
in interface Content
UnknownMetadataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.public UserIdentity getLastContributor() throws UnknownMetadataException, AmetysRepositoryException
Content
getLastContributor
in interface Content
UnknownMetadataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.public Date getLastModified() throws UnknownMetadataException, AmetysRepositoryException
Content
getLastModified
in interface Content
UnknownMetadataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.public Date getLastValidationDate() throws UnknownMetadataException, AmetysRepositoryException
Content
getLastValidationDate
in interface Content
UnknownMetadataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.public Date getLastMajorValidationDate() throws AmetysRepositoryException
Content
getLastMajorValidationDate
in interface Content
UnknownMetadataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.public Set<String> getTags() throws AmetysRepositoryException
TagAwareAmetysObject
getTags
in interface TagAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public Map<String,OutgoingReferences> getOutgoingReferences() throws AmetysRepositoryException
Content
getOutgoingReferences
in interface Content
AmetysRepositoryException
- if an error occurs.public Collection<Content> getReferencingContents() throws AmetysRepositoryException
Content
getReferencingContents
in interface Content
AmetysRepositoryException
- if an error occurs.public ModifiableContent copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) throws AmetysRepositoryException
CopiableAmetysObject
AmetysObject
to the given object if it is not in the restriction list. Be careful, this method save changes.copyTo
in interface CopiableAmetysObject
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 objectrestrictTo
- A restrict list of CopiableAmetysObject
authorized to be copiedAmetysRepositoryException
- if an error occurs.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
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 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
RepositoryException
public String getDCTitle() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCTitle
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getDCCreator() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCCreator
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String[] getDCSubject() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCSubject
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getDCDescription() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCDescription
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getDCPublisher() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCPublisher
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getDCContributor() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCContributor
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public Date getDCDate() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCDate
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getDCType() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCType
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getDCFormat() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCFormat
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getDCIdentifier() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCIdentifier
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getDCSource() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCSource
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getDCLanguage() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCLanguage
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getDCRelation() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCRelation
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getDCCoverage() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCCoverage
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public String getDCRights() throws AmetysRepositoryException
DublinCoreAwareAmetysObject
getDCRights
in interface DublinCoreAwareAmetysObject
AmetysRepositoryException
- if an error occurs.public ResourceCollection getRootAttachments() throws AmetysRepositoryException
Content
getRootAttachments
in interface Content
AmetysRepositoryException
- if an error occurs.public boolean hasChild(String name) throws AmetysRepositoryException
TraversableAmetysObject
hasChild
in interface TraversableAmetysObject
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
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
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
A
- the actual type of AmetysObject
s.AmetysObjectIterable
.AmetysRepositoryException
- if an error occurs.