Package org.ametys.plugins.explorer.cmis
Class CMISResource
- java.lang.Object
-
- org.ametys.plugins.explorer.cmis.CMISResource
-
- All Implemented Interfaces:
Resource
,AmetysObject
,DublinCoreAwareAmetysObject
public class CMISResource extends Object implements Resource
Implementation of anResource
, backed by a server CMIS.
-
-
Field Summary
Fields Modifier and Type Field Description private Document
_cmisDocument
private AmetysObject
_parent
private CMISRootResourcesCollection
_root
-
Constructor Summary
Constructors Constructor Description CMISResource(Document document, CMISRootResourcesCollection root, AmetysObject parent)
Creates aCMISResource
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Document
getCmisDocument()
Retrieves theFolder
CMISRootResourcesCollection
getCmisRoot()
Retrieves theCMISRootResourcesCollection
Date
getCreationDate()
Retrieves the creation date.UserIdentity
getCreator()
Returns the last contributor of this resource.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
getId()
Retrieves the unique identifier of this AmetysObject.
It must be unique in the whole repository and must never be null.
It must conform to the URI syntax:
<protocol>://<protocol-specific-part>
InputStream
getInputStream()
Returns the data stream.String[]
getKeywords()
Returns the keywords of this resource, as a String array.String
getKeywordsAsString()
Returns the keywords of this resource, as a comme-separated String.UserIdentity
getLastContributor()
Retrieves the login of the last contributor.Date
getLastModified()
Returns the last modification date.long
getLength()
Returns the length of the data stream.String
getMimeType()
Returns the data mime-type.String
getName()
Retrieves the name of the current object.AmetysObject
getParent()
Returns the parent object in the Ametys hierarchy.String
getParentPath()
Returns the path of the parent object in the Ametys hierarchy.String
getPath()
Retrieves the path of the current object.String
getResourcePath()
Returns the path of this resource in its hierarchy (which is a subset of the whole repository).-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, hashCode
-
-
-
-
Field Detail
-
_cmisDocument
private final Document _cmisDocument
-
_root
private final CMISRootResourcesCollection _root
-
_parent
private AmetysObject _parent
-
-
Constructor Detail
-
CMISResource
public CMISResource(Document document, CMISRootResourcesCollection root, AmetysObject parent)
Creates aCMISResource
- Parameters:
document
- The CMIS documentroot
- The root of the virtual treeparent
- the parentAmetysObject
if known
-
-
Method Detail
-
getCmisRoot
public CMISRootResourcesCollection getCmisRoot()
Retrieves theCMISRootResourcesCollection
- Returns:
- the
CMISRootResourcesCollection
-
getCmisDocument
public Document getCmisDocument()
Retrieves theFolder
- Returns:
- the
Folder
-
getId
public String getId() throws AmetysRepositoryException
Description copied from interface:AmetysObject
Retrieves the unique identifier of this AmetysObject.
It must be unique in the whole repository and must never be null.
It must conform to the URI syntax:
<protocol>://<protocol-specific-part>
- Specified by:
getId
in interfaceAmetysObject
- Returns:
- the unique identifier of this AmetysObject
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getName
public String getName()
Description copied from interface:AmetysObject
Retrieves the name of the current object.- Specified by:
getName
in interfaceAmetysObject
- Returns:
- the name.
-
getParent
public AmetysObject getParent() throws AmetysRepositoryException
Description copied from interface:AmetysObject
Returns the parent object in the Ametys hierarchy.- Specified by:
getParent
in interfaceAmetysObject
- Returns:
- the parent object or
null
if current object is the root. - Throws:
AmetysRepositoryException
- if an error occurs.
-
getParentPath
public String getParentPath() throws AmetysRepositoryException
Description copied from interface:AmetysObject
Returns the path of the parent object in the Ametys hierarchy.- Specified by:
getParentPath
in interfaceAmetysObject
- Returns:
- the path of the parent object.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getPath
public String getPath() throws AmetysRepositoryException
Description copied from interface:AmetysObject
Retrieves the path of the current object.- Specified by:
getPath
in interfaceAmetysObject
- Returns:
- the path.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getCreator
public UserIdentity getCreator()
Description copied from interface:Resource
Returns the last contributor of this resource.- Specified by:
getCreator
in interfaceResource
- Returns:
- the last contributor of this resource.
-
getInputStream
public InputStream getInputStream() throws AmetysRepositoryException
Description copied from interface:Resource
Returns the data stream.- Specified by:
getInputStream
in interfaceResource
- Returns:
- the data stream.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getLastModified
public Date getLastModified()
Description copied from interface:Resource
Returns the last modification date.- Specified by:
getLastModified
in interfaceResource
- Returns:
- the last modification date.
-
getLength
public long getLength()
Description copied from interface:Resource
Returns the length of the data stream.
-
getMimeType
public String getMimeType() throws AmetysRepositoryException
Description copied from interface:Resource
Returns the data mime-type.- Specified by:
getMimeType
in interfaceResource
- Returns:
- the data mime-type.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getKeywords
public String[] getKeywords() throws AmetysRepositoryException
Description copied from interface:Resource
Returns the keywords of this resource, as a String array.- Specified by:
getKeywords
in interfaceResource
- Returns:
- the keywords of this resource.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getKeywordsAsString
public String getKeywordsAsString() throws AmetysRepositoryException
Description copied from interface:Resource
Returns the keywords of this resource, as a comme-separated String.- Specified by:
getKeywordsAsString
in interfaceResource
- Returns:
- the keywords of this resource.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getResourcePath
public String getResourcePath() throws AmetysRepositoryException
Description copied from interface:Resource
Returns the path of this resource in its hierarchy (which is a subset of the whole repository).- Specified by:
getResourcePath
in interfaceResource
- Returns:
- the path of this resource in its hierarchy.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCTitle
public String getDCTitle() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core title.- Specified by:
getDCTitle
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core title. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCCreator
public String getDCCreator() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core creator.- Specified by:
getDCCreator
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core creator. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCSubject
public String[] getDCSubject() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core subject.- Specified by:
getDCSubject
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core subject. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCDescription
public String getDCDescription() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core description.- Specified by:
getDCDescription
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core description. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCPublisher
public String getDCPublisher() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core publisher.- Specified by:
getDCPublisher
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core publisher. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCContributor
public String getDCContributor() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core contributor.- Specified by:
getDCContributor
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core contributor. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCDate
public Date getDCDate() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core date.- Specified by:
getDCDate
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core date. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCType
public String getDCType() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core type.- Specified by:
getDCType
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core type. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCFormat
public String getDCFormat() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core format.- Specified by:
getDCFormat
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core format. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCIdentifier
public String getDCIdentifier() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core identifier.- Specified by:
getDCIdentifier
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core identifier. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCSource
public String getDCSource() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core source.- Specified by:
getDCSource
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core source. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCLanguage
public String getDCLanguage() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core language.- Specified by:
getDCLanguage
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core language. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCRelation
public String getDCRelation() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core relation.- Specified by:
getDCRelation
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core relation. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCCoverage
public String getDCCoverage() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core coverage.- Specified by:
getDCCoverage
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core coverage. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDCRights
public String getDCRights() throws AmetysRepositoryException
Description copied from interface:DublinCoreAwareAmetysObject
Get the Dublin Core rights.- Specified by:
getDCRights
in interfaceDublinCoreAwareAmetysObject
- Returns:
- the Dublin Core rights. Can be null.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getCreationDate
public Date getCreationDate() throws UnknownMetadataException, AmetysRepositoryException
Description copied from interface:Resource
Retrieves the creation date.- Specified by:
getCreationDate
in interfaceResource
- Returns:
- the creation date.
- Throws:
UnknownMetadataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
getLastContributor
public UserIdentity getLastContributor() throws UnknownMetadataException, AmetysRepositoryException
Description copied from interface:Resource
Retrieves the login of the last contributor.- Specified by:
getLastContributor
in interfaceResource
- Returns:
- the login of the last contributor.
- Throws:
UnknownMetadataException
- if this property does not exist.AmetysRepositoryException
- if an error occurs.
-
-