CMIS Server: verschil tussen versies
Geen bewerkingssamenvatting |
Geen bewerkingssamenvatting |
||
Regel 1: | Regel 1: | ||
= Archivematica CMIS Server User Manual = | |||
This manual will cover the way how to access AIPs and AIP files | This manual will cover the way how to access AIPs and AIP files | ||
Regel 5: | Regel 5: | ||
that were ingested and stored in Archivematica Storage Service. | that were ingested and stored in Archivematica Storage Service. | ||
'''Links and References:''' | |||
<ul> | |||
<li><p>[http://docs.oasis-open.org/cmis/CMIS/v1.1/errata01/os/CMIS-v1.1-errata01-os-complete.html CMIS Specification]</p></li> | |||
<li><p>[https://chemistry.apache.org/java/opencmis.html Apache Chemistry Open CMIS]</p> | |||
<p>This resorce gathered all needed information for Developers and Users of CMIS Protocol.</p></li> | |||
<li><p>[https://chemistry.apache.org/java/developing/tools/dev-tools-workbench.html CMIS Workbench]</p> | |||
<p>Useful tool for Browsing and Testing CMIS Server.</p></li></ul> | |||
'''Features Implemented:''' | |||
<ul> | |||
<li><p>Segregated User Access to AIPs per Location.</p> | |||
<p>User can access AIPs from particular location.</p></li> | |||
<li><p>Browse All Ingested AIPs in Location.</p></li> | |||
<li><p>Browse File&Folders structure of AIP.</p></li> | |||
<li><p>Download whole AIP.</p></li> | |||
<li><p>Download particular AIP’s File.</p></li></ul> | |||
== Connecting to CMIS == | |||
==Connecting to CMIS== | |||
Current implementation of CMIS allows only | Current implementation of CMIS allows only | ||
[ | [http://docs.oasis-open.org/cmis/CMIS/v1.1/errata01/os/CMIS-v1.1-errata01-os-complete.html#x1-5360005 Browser Binding] connections. So CMIS Clients must use Browser Binding only. | ||
Before connection to CMIS Server make sure you have your credentials (user and password) | Before connection to CMIS Server make sure you have your credentials (user and password) | ||
Regel 43: | Regel 36: | ||
Example: | Example: | ||
* Username | * Username – <code>demo</code> | ||
* Password – <code>demo</code> | |||
* Password | * URL – <code>http://pic-devel.edepot.picturae.com/</code> | ||
* URL | |||
For testing purposes it is recommended to use CMIS Workbench (see link above). | For testing purposes it is recommended to use CMIS Workbench (see link above). | ||
Regel 55: | Regel 46: | ||
For Development bare CMIS Clients you can follow steps from Next Paragraph | For Development bare CMIS Clients you can follow steps from Next Paragraph | ||
==Browser Binding API== | === Browser Binding API === | ||
All requests to CMIS Server must include [ | All requests to CMIS Server must include [https://tools.ietf.org/html/rfc7617 HTTP Basic Authentication] | ||
with your Username and Password. | with your Username and Password. | ||
Regel 63: | Regel 54: | ||
Example HTTP Request: | Example HTTP Request: | ||
<source lang="http"> | |||
GET / HTTP/1.1 | GET / HTTP/1.1 | ||
Regel 70: | Regel 60: | ||
Authorization: Basic ZGVtbzpkZW1v | Authorization: Basic ZGVtbzpkZW1v | ||
</source> | |||
Authorization header contains base64 encoded string with credentials <code>demo:demo</code>. | |||
Authorization header contains base64 encoded string with credentials | |||
In the following sections we assume that all request includes Authorization header | In the following sections we assume that all request includes Authorization header | ||
and requests are sent to CMIS Endpoint URL. For example | and requests are sent to CMIS Endpoint URL. For example <code>GET /</code> will be translated to | ||
HTTP Request as following: | HTTP Request as following: | ||
<source lang="http"> | |||
GET / | GET / | ||
Regel 88: | Regel 75: | ||
Authorization: Basic <YOUR ENCODED CREDENTIALS> | Authorization: Basic <YOUR ENCODED CREDENTIALS> | ||
</source> | |||
==== Getting CMIS Repository ==== | |||
Request: | |||
Request | |||
: | |||
<source lang="http"> | |||
GET / | GET / | ||
</source> | |||
Response: | Response: | ||
<source lang="json"> | |||
{ | { | ||
Regel 188: | Regel 167: | ||
} | } | ||
</source> | |||
Response contains a list of single Repository that user can access. | Response contains a list of single Repository that user can access. | ||
Regel 197: | Regel 174: | ||
Repository Info contains few major parts which must be used in next sections: | Repository Info contains few major parts which must be used in next sections: | ||
<ul> | |||
<li><p><code>repositoryId</code> – this field contains unique repositoryId</p></li> | |||
<li><p><code>rootFolderId</code> – CMIS Object ID for root folder to repository.</p> | |||
<p>In current implementation it is always <code>root</code></p></li> | |||
<li><p><code>repositoryUrl</code> and <code>rootFolderUrl</code> – these urls MUST be used as entrypoints for further</p> | |||
<p>communication with Repository (like Get Object, Get Children, Get Content, etc… )</p> | |||
<p>Repository URL and Root Folder URL will use current CMIS Server Hostname and Repository ID</p></li></ul> | |||
==== Getting List of Ingested AIPs ==== | |||
==Getting List of Ingested AIPs== | |||
In order to obtain the list of your ingested AIPs use following URL | In order to obtain the list of your ingested AIPs use following URL | ||
<source lang="http"> | |||
GET {rootFolderUrl}/?cmisselector=children&succinct=true | GET {rootFolderUrl}/?cmisselector=children&succinct=true | ||
</source> | |||
Response Example: | Response Example: | ||
<source lang="json"> | |||
{ | { | ||
Regel 312: | Regel 281: | ||
} | } | ||
</source> | |||
Response will contain a list of Ingested AIPs in format Name + UUID. | Response will contain a list of Ingested AIPs in format Name + UUID. | ||
The full list of fields is described in [ | The full list of fields is described in [http://docs.oasis-open.org/cmis/CMIS/v1.1/errata01/os/CMIS-v1.1-errata01-os-complete.html#x1-220002 CMIS Object] | ||
Let’s focus on major parts that will be used in following sections. | |||
* | * <code>object.id</code> – contains AIP UUID. | ||
* <code>object.succinctProperties.cmis:name</code> – contains AIP Name + UUID. That name will be displayed in CMIS Workbench. | |||
* <code>object.succinctProperties.cmis:path</code> – contains Path via what this object (AIP) can be accessed. | |||
So now we can browse | So now we can browse AIP’s file structure. | ||
==Browse File and Folder Structure of AIP== | ==== Browse File and Folder Structure of AIP ==== | ||
From previous step we can obtain AIP Object ID (UUID) or AIP Access Path. | From previous step we can obtain AIP Object ID (UUID) or AIP Access Path. | ||
And we can browse its internal structure. Request: | And we can browse its internal structure. Request: | ||
<source lang="http"> | |||
GET {rootFolderUrl}/{AIP_Path}?cmisselector=children&succinct=true | GET {rootFolderUrl}/{AIP_Path}?cmisselector=children&succinct=true | ||
</source> | |||
Or: | Or: | ||
<source lang="http"> | |||
GET {repositoryUrl}?objectId={AIP UUID}&cmisselector=children&succinct=true | GET {repositoryUrl}?objectId={AIP UUID}&cmisselector=children&succinct=true | ||
</source> | |||
According to CMIS Specification object can be accessed through Path URL or by ObjectID including to Repository URL. Read more about it in | According to CMIS Specification object can be accessed through Path URL or by ObjectID including to Repository URL. Read more about it in | ||
[ | [http://docs.oasis-open.org/cmis/CMIS/v1.1/errata01/os/CMIS-v1.1-errata01-os-complete.html#x1-5580004 CMIS Specification] | ||
Response: | Response: | ||
<source lang="json"> | |||
{ | { | ||
Regel 450: | Regel 408: | ||
} | } | ||
</source> | |||
The result is presented in the same format as for requesting List of AIPS. | The result is presented in the same format as for requesting List of AIPS. | ||
Because in terms of CMIS Protocol it is same actions | Because in terms of CMIS Protocol it is same actions – Get Children of an Object. | ||
In that particular example we can see ingested file from AIP Files. | In that particular example we can see ingested file from AIP Files. | ||
All files has | All files has <code>cmis:objectTypeId</code> property set to <code>cmis:document</code>. | ||
For folders it is | For folders it is <code>cmis:folder</code>. | ||
In current implementation of CMIS Server Object IDs are equals to theirs Paths. | In current implementation of CMIS Server Object IDs are equals to theirs Paths. | ||
Regel 471: | Regel 427: | ||
Response contains following properties that can be used to download particular file: | Response contains following properties that can be used to download particular file: | ||
<ul> | |||
<li><p><code>object.succinctProperties.cmis:contentStreamId</code> –</p> | |||
<p>Contains an Content Stream ID that should be used to download File Content.</p> | |||
<p>In current Implementation Content Stream ID is equal to Object ID and thus its path.</p></li> | |||
<li><p><code>object.succinctProperties.cmis:contentStreamFileName</code> –</p> | |||
<p>Contains File Name that can be used as name of downloaded file.</p></li></ul> | |||
Following Content Stream related properties needs to be Implemented in the Future: | Following Content Stream related properties needs to be Implemented in the Future: | ||
<ul> | |||
<li><p><code>cmis:contentStreamLength</code> – should be used to provide File Size information.</p> | |||
<p>Right now it’s always <code>0</code>.</p></li> | |||
<li><p><code>cmis:contentStreamMimeType</code> – should be used to provide File Content MIME type. To discover file type.</p> | |||
<p>Right now it is always <code>test/plain</code></p></li></ul> | |||
==== Downloading File from AIP ==== | |||
==Downloading File from AIP== | |||
As described above to Download AIP File you have to use its Stream ID which is the same | As described above to Download AIP File you have to use its Stream ID which is the same | ||
Regel 497: | Regel 448: | ||
as Object ID or Object Path. So request to download a file is following: | as Object ID or Object Path. So request to download a file is following: | ||
<source lang="http"> | |||
GET {rootFolderUrl}/{File Path}?cmisselector=content | GET {rootFolderUrl}/{File Path}?cmisselector=content | ||
</source> | |||
Response will Redirect with Http status <code>302 Found</code> to File Location. | |||
<source lang="http"> | |||
HTTP/1.1 302 Found | HTTP/1.1 302 Found | ||
Regel 512: | Regel 459: | ||
Location: /ss-content-proxy/5def6da9-9c70-4800-84e9-5e501bc6687e/Test_grootbestand_20180725_1-5def6da9-9c70-4800-84e9-5e501bc6687e/data/objects/GDBA-7774-02.pdf | Location: /ss-content-proxy/5def6da9-9c70-4800-84e9-5e501bc6687e/Test_grootbestand_20180725_1-5def6da9-9c70-4800-84e9-5e501bc6687e/data/objects/GDBA-7774-02.pdf | ||
</source> | |||
So your CMIS Client has to follow HTTP Redirect in order to Download a file. | So your CMIS Client has to follow HTTP Redirect in order to Download a file. | ||
=Accessing files without CMIS= | == Accessing files without CMIS == | ||
As presented in section above CMIS will redirect a HTTP Client to specific File location to | As presented in section above CMIS will redirect a HTTP Client to specific File location to | ||
Regel 528: | Regel 473: | ||
* You have to know exact Repository ID. Which is an Archivematica Location UUID assigned to your user. | * You have to know exact Repository ID. Which is an Archivematica Location UUID assigned to your user. | ||
* You have to know exact AIP Name (including name and UUID). | * You have to know exact AIP Name (including name and UUID). | ||
* You have to know exact path of needed file inside of AIP Package. | * You have to know exact path of needed file inside of AIP Package. | ||
Regel 537: | Regel 480: | ||
The rules are following: | The rules are following: | ||
<code>{CMIS Endpoint}</code> + <code>/ss-content-proxy/</code> + <code>{Repository ID}</code> + <code>/{AIP Name}</code> + <code>/{File Path inside AIP}</code> | |||
For example this url: | For example this url: | ||
<code>https://pic-devel-cmis.edepot.picturae.com/ss-content-proxy/5def6da9-9c70-4800-84e9-5e501bc6687e/Test_grootbestand_20180725_1-5def6da9-9c70-4800-84e9-5e501bc6687e/data/objects/GDBA-7774-02.pdf</code> | |||
It contains following parts: | It contains following parts: | ||
<ul> | |||
<li><p>CMIS Endpoint – <code>https://pic-devel-cmis.edepot.picturae.com</code></p></li> | |||
<li><p>Repository ID – <code>5def6da9-9c70-4800-84e9-5e501bc6687e</code></p></li> | |||
<li><p>AIP Name – <code>Test_grootbestand_20180725_1-5def6da9-9c70-4800-84e9-5e501bc6687e</code></p></li> | |||
<li><p>File Path – <code>data/objects/GDBA-7774-02.pdf</code></p> | |||
<p>Please notice that file location contains root folder <code>data</code> which is not presented in CMIS AIP Structure. So you have to include it explicitly.</p></li></ul> | |||
So now you can download needed file without using CMIS. | So now you can download needed file without using CMIS. | ||
'''Note''' Downloading big files may be slow. Because it requires some time to Extract file from an AIP Archive. | |||
==CMIS Workbench== | == CMIS Workbench == | ||
=Installation= | === Installation === | ||
In order to connect via CMIS Workbench you need to install [ | In order to connect via CMIS Workbench you need to install [https://java.com/en/download/ Java]. | ||
Follow instruction from official Java Web site to download and install it on your Machine (Windows, MacOS, Linux, | Follow instruction from official Java Web site to download and install it on your Machine (Windows, MacOS, Linux, etc… ). | ||
Once you have Java installed, check that it is accessible from your terminal. type: | Once you have Java installed, check that it is accessible from your terminal. type: | ||
<code>java --version</code> to see that it is working. | |||
Example: | Example: | ||
<source lang="bash"> | |||
$ java --version | $ java --version | ||
Regel 582: | Regel 521: | ||
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode) | Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode) | ||
</source> | |||
Now you can download CMIS Workbench from [http://www-eu.apache.org/dist/chemistry/opencmis/1.1.0/chemistry-opencmis-workbench-1.1.0-full.zip official mirror] | |||
Now you can download CMIS Workbench from [ | |||
Unpack it to your favorite location. Example (MacOS, Linux): | Unpack it to your favorite location. Example (MacOS, Linux): | ||
<source lang="bash"> | |||
curl -o cmis-workbench.zip http://www-eu.apache.org/dist/chemistry/opencmis/1.1.0/chemistry-opencmis-workbench-1.1.0-full.zip | curl -o cmis-workbench.zip http://www-eu.apache.org/dist/chemistry/opencmis/1.1.0/chemistry-opencmis-workbench-1.1.0-full.zip | ||
Regel 598: | Regel 534: | ||
cd cmis-workbench/ | cd cmis-workbench/ | ||
</source> | |||
After you unzipped the package you can run it <code>./workbench.command</code> | |||
=== Usage === | |||
==Usage== | |||
After starting CMIS workbench you should see following window: | After starting CMIS workbench you should see following window: | ||
[[File:assets/cmis-open.png|thumb|none|alt=CMIS|CMIS]] | |||
Now you need to login. | Now you need to login. | ||
* URL | * URL – this is your CMIS Server endpoint. (Example: <code>https://pic-devel-cmis.edepot.picturae.com</code>) | ||
* Binding – Browser | |||
* Binding | * Username – Your username (Example: <code>demo</code>) | ||
* Password – Your password (Example: <code>demo</code>) | |||
* Username | * Authentication – Standard | ||
* Password | |||
* Authentication | |||
* Rest parameters leave As Is. | * Rest parameters leave As Is. | ||
Then click on | Then click on <code>Load Repositories</code> button and after it loads Repositories List click on Login. | ||
Now you should see following window: | Now you should see following window: | ||
[[File:assets/cmis-browse.png|thumb|none|alt=CMIS Browse|CMIS Browse]] | |||
On the left side you can see list of ingested AIPs and on the right side CMIS Object Details. | On the left side you can see list of ingested AIPs and on the right side CMIS Object Details. | ||
You can double-click on Folders (AIP Packages) in order to browse its file & folder structure. | You can double-click on Folders (AIP Packages) in order to browse its file & folder structure. | ||
Once you reached needed file Right Click on it and select Download. | Once you reached needed file Right Click on it and select Download. | ||
[[File:assets/cmis-download.png|thumb|none|alt=CMIS File Download|CMIS File Download]] | |||
Ignore MIME Error message. This is an issue with CMIS Workbench. | Ignore MIME Error message. This is an issue with CMIS Workbench. | ||
After you clicked on the Download Button it may take some time to extract the file from AIP and start downloading it. | After you clicked on the Download Button it may take some time to extract the file from AIP and start downloading it. |
Versie van 6 mrt 2019 16:55
Archivematica CMIS Server User Manual
This manual will cover the way how to access AIPs and AIP files
that were ingested and stored in Archivematica Storage Service.
Links and References:
-
This resorce gathered all needed information for Developers and Users of CMIS Protocol.
-
Useful tool for Browsing and Testing CMIS Server.
Features Implemented:
Segregated User Access to AIPs per Location.
User can access AIPs from particular location.
Browse All Ingested AIPs in Location.
Browse File&Folders structure of AIP.
Download whole AIP.
Download particular AIP’s File.
Connecting to CMIS
Current implementation of CMIS allows only
Browser Binding connections. So CMIS Clients must use Browser Binding only.
Before connection to CMIS Server make sure you have your credentials (user and password)
and CMIS Endpoint to access it.
Example:
- Username –
demo
- Password –
demo
- URL –
http://pic-devel.edepot.picturae.com/
For testing purposes it is recommended to use CMIS Workbench (see link above).
That can help to understand the overall CMIS Protocol and its Data Structures.
For Development bare CMIS Clients you can follow steps from Next Paragraph
Browser Binding API
All requests to CMIS Server must include HTTP Basic Authentication
with your Username and Password.
Example HTTP Request:
<source lang="http"> GET / HTTP/1.1
Host: pic-devel-cmis.edepot.picturae.com
Authorization: Basic ZGVtbzpkZW1v
</source>
Authorization header contains base64 encoded string with credentials demo:demo
.
In the following sections we assume that all request includes Authorization header
and requests are sent to CMIS Endpoint URL. For example GET /
will be translated to
HTTP Request as following:
<source lang="http"> GET /
Host: your-cmis-server-endpoint.nl
Authorization: Basic <YOUR ENCODED CREDENTIALS> </source>
Getting CMIS Repository
Request:
<source lang="http"> GET / </source> Response:
<source lang="json"> {
"ea550466-7dff-4b57-844e-c1163b3a7168": {
"repositoryId": "ea550466-7dff-4b57-844e-c1163b3a7168",
"repositoryName": "Archivematica Repository",
"repositoryDescription": "Repository for Accessing Archivematica AIPs",
"vendorName": "Picturae",
"productName": "Picturae CMIS Server",
"productVersion": "0.0.1",
"rootFolderId": "root",
"latestChangeLogToken": null,
"capabilities": {
"capabilityACL": "none",
"capabilityAllVersionsSearchable": false,
"capabilityChanges": "none",
"capabilityContentStreamUpdatability": "none",
"capabilityGetDescendants": false,
"capabilityGetFolderTree": false,
"capabilityOrderBy": "none",
"capabilityMultifiling": false,
"capabilityPWCSearchable": false,
"capabilityPWCUpdatable": false,
"capabilityQuery": "none",
"capabilityRenditions": "read",
"capabilityUnfiling": false,
"capabilityVersionSpecificFiling": false,
"capabilityJoin": "none",
"capabilityCreatablePropertyTypes": null,
"capabilityNewTypeSettableAttributes": null
},
"aclCapability": null,
"cmisVersionSupported": "1.1",
"thinClientURI": null,
"changesIncomplete": null,
"changesOnType": [],
"principalAnonymous": null,
"principalAnyone": null,
"extendedFeatures": [],
"rootFolderUrl": "https://pic-devel-cmis.edepot.picturae.com/ea550466-7dff-4b57-844e-c1163b3a7168/root",
"repositoryUrl": "https://pic-devel-cmis.edepot.picturae.com/ea550466-7dff-4b57-844e-c1163b3a7168"
}
} </source> Response contains a list of single Repository that user can access.
(multiple repositories is not yet supported).
Repository Info contains few major parts which must be used in next sections:
repositoryId
– this field contains unique repositoryIdrootFolderId
– CMIS Object ID for root folder to repository.In current implementation it is always
root
repositoryUrl
androotFolderUrl
– these urls MUST be used as entrypoints for furthercommunication with Repository (like Get Object, Get Children, Get Content, etc… )
Repository URL and Root Folder URL will use current CMIS Server Hostname and Repository ID
Getting List of Ingested AIPs
In order to obtain the list of your ingested AIPs use following URL
<source lang="http"> GET {rootFolderUrl}/?cmisselector=children&succinct=true </source> Response Example:
<source lang="json"> {
"numItems": 1,
"moreItems": false,
"objects": [
{
"object": {
"id": "aba7175b-856e-4b03-9201-e9ce551c0f9f",
"relationship": [],
"changeEventInfo": null,
"acl": null,
"exactACL": null,
"policyIds": null,
"renditions": [
{
"streamId": "aba7175b-856e-4b03-9201-e9ce551c0f9f",
"mimeType": "application/x-tar",
"length": 17408095,
"kind": "package",
"title": "Archived Package",
"height": null,
"width": null,
"renditionDocumentId": null
}
],
"succinctProperties": {
"cmis:name": "Test_dubbellebestanden2_20180727_2-aba7175b-856e-4b03-9201-e9ce551c0f9f",
"cmis:description": "Test_dubbellebestanden2_20180727_2-aba7175b-856e-4b03-9201-e9ce551c0f9f",
"cmis:objectId": "aba7175b-856e-4b03-9201-e9ce551c0f9f",
"cmis:baseTypeId": "cmis:folder",
"cmis:objectTypeId": "cmis:folder",
"cmis:secondaryObjectTypeIds": null,
"cmis:createdBy": "Admin",
"cmis:creationDate": 946681200,
"cmis:lastModifiedBy": "Admin",
"cmis:lastModificationDate": 946681200,
"cmis:changeToken": "946681200",
"cmis:parentId": "root",
"cmis:path": "/Test_dubbellebestanden2_20180727_2-aba7175b-856e-4b03-9201-e9ce551c0f9f",
"cmis:allowedChildObjectTypeIds": null
}
},
"pathSegment": "Test_dubbellebestanden2_20180727_2-aba7175b-856e-4b03-9201-e9ce551c0f9f"
}
]
} </source> Response will contain a list of Ingested AIPs in format Name + UUID.
The full list of fields is described in CMIS Object
Let’s focus on major parts that will be used in following sections.
object.id
– contains AIP UUID.object.succinctProperties.cmis:name
– contains AIP Name + UUID. That name will be displayed in CMIS Workbench.object.succinctProperties.cmis:path
– contains Path via what this object (AIP) can be accessed.
So now we can browse AIP’s file structure.
Browse File and Folder Structure of AIP
From previous step we can obtain AIP Object ID (UUID) or AIP Access Path.
And we can browse its internal structure. Request:
<source lang="http"> GET {rootFolderUrl}/{AIP_Path}?cmisselector=children&succinct=true </source> Or:
<source lang="http"> GET {repositoryUrl}?objectId={AIP UUID}&cmisselector=children&succinct=true </source> According to CMIS Specification object can be accessed through Path URL or by ObjectID including to Repository URL. Read more about it in
Response:
<source lang="json"> {
"numItems": 5,
"moreItems": false,
"objects": [
{
"object": {
"id": "/Test_grootbestand_20180725_1-5def6da9-9c70-4800-84e9-5e501bc6687e/objects/GDBA-7774-01.pdf",
"relationship": [],
"changeEventInfo": null,
"acl": null,
"exactACL": null,
"policyIds": null,
"renditions": [],
"succinctProperties": {
"cmis:name": "GDBA-7774-01.pdf",
"cmis:description": "GDBA-7774-01.pdf",
"cmis:objectId": "/Test_grootbestand_20180725_1-5def6da9-9c70-4800-84e9-5e501bc6687e/objects/GDBA-7774-01.pdf",
"cmis:baseTypeId": "cmis:document",
"cmis:objectTypeId": "cmis:document",
"cmis:secondaryObjectTypeIds": null,
"cmis:createdBy": "Admin",
"cmis:creationDate": 946681200,
"cmis:lastModifiedBy": "Admin",
"cmis:lastModificationDate": 946681200,
"cmis:changeToken": "946681200",
"cmis:isImmutable": true,
"cmis:isLatestVersion": null,
"cmis:isMajorVersion": null,
"cmis:isLatestMajorVersion": null,
"cmis:isPrivateWorkingCopy": null,
"cmis:versionLabel": null,
"cmis:versionSeriesId": null,
"cmis:isVersionSeriesCheckedOut": null,
"cmis:versionSeriesCheckedOutBy": null,
"cmis:versionSeriesCheckedOutId": null,
"cmis:checkinComment": null,
"cmis:contentStreamLength": 0,
"cmis:contentStreamMimeType": "text/plain",
"cmis:contentStreamFileName": "GDBA-7774-01.pdf",
"cmis:contentStreamId": "/Test_grootbestand_20180725_1-5def6da9-9c70-4800-84e9-5e501bc6687e/objects/GDBA-7774-01.pdf"
}
},
"pathSegment": "GDBA-7774-01.pdf"
},
...
]
} </source> The result is presented in the same format as for requesting List of AIPS.
Because in terms of CMIS Protocol it is same actions – Get Children of an Object.
In that particular example we can see ingested file from AIP Files.
All files has cmis:objectTypeId
property set to cmis:document
.
For folders it is cmis:folder
.
In current implementation of CMIS Server Object IDs are equals to theirs Paths.
This is useful for accessing object either via ObjectID or via Path.
Difference between files and folders is that File can have Content Stream to download.
Response contains following properties that can be used to download particular file:
object.succinctProperties.cmis:contentStreamId
–Contains an Content Stream ID that should be used to download File Content.
In current Implementation Content Stream ID is equal to Object ID and thus its path.
object.succinctProperties.cmis:contentStreamFileName
–Contains File Name that can be used as name of downloaded file.
Following Content Stream related properties needs to be Implemented in the Future:
cmis:contentStreamLength
– should be used to provide File Size information.Right now it’s always
0
.cmis:contentStreamMimeType
– should be used to provide File Content MIME type. To discover file type.Right now it is always
test/plain
Downloading File from AIP
As described above to Download AIP File you have to use its Stream ID which is the same
as Object ID or Object Path. So request to download a file is following:
<source lang="http">
GET {rootFolderUrl}/{File Path}?cmisselector=content
</source>
Response will Redirect with Http status 302 Found
to File Location.
<source lang="http"> HTTP/1.1 302 Found
...
Location: /ss-content-proxy/5def6da9-9c70-4800-84e9-5e501bc6687e/Test_grootbestand_20180725_1-5def6da9-9c70-4800-84e9-5e501bc6687e/data/objects/GDBA-7774-02.pdf </source> So your CMIS Client has to follow HTTP Redirect in order to Download a file.
Accessing files without CMIS
As presented in section above CMIS will redirect a HTTP Client to specific File location to
download file. It is possible to combine the URL request in order to download needed file without
using CMIS even.
However there are few requirements:
- You have to know exact Repository ID. Which is an Archivematica Location UUID assigned to your user.
- You have to know exact AIP Name (including name and UUID).
- You have to know exact path of needed file inside of AIP Package.
If requirements above are met you are able to build an URL to download needed file.
The rules are following:
{CMIS Endpoint}
+ /ss-content-proxy/
+ {Repository ID}
+ /{AIP Name}
+ /{File Path inside AIP}
For example this url:
It contains following parts:
CMIS Endpoint –
https://pic-devel-cmis.edepot.picturae.com
Repository ID –
5def6da9-9c70-4800-84e9-5e501bc6687e
AIP Name –
Test_grootbestand_20180725_1-5def6da9-9c70-4800-84e9-5e501bc6687e
File Path –
data/objects/GDBA-7774-02.pdf
Please notice that file location contains root folder
data
which is not presented in CMIS AIP Structure. So you have to include it explicitly.
So now you can download needed file without using CMIS.
Note Downloading big files may be slow. Because it requires some time to Extract file from an AIP Archive.
CMIS Workbench
Installation
In order to connect via CMIS Workbench you need to install Java.
Follow instruction from official Java Web site to download and install it on your Machine (Windows, MacOS, Linux, etc… ).
Once you have Java installed, check that it is accessible from your terminal. type:
java --version
to see that it is working.
Example:
<source lang="bash"> $ java --version
java 10.0.1 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode) </source> Now you can download CMIS Workbench from official mirror
Unpack it to your favorite location. Example (MacOS, Linux):
<source lang="bash"> curl -o cmis-workbench.zip http://www-eu.apache.org/dist/chemistry/opencmis/1.1.0/chemistry-opencmis-workbench-1.1.0-full.zip
mkdir cmis-workbench
unzip -d cmis-workbench/
cd cmis-workbench/
</source>
After you unzipped the package you can run it ./workbench.command
Usage
After starting CMIS workbench you should see following window:
Now you need to login.
- URL – this is your CMIS Server endpoint. (Example:
https://pic-devel-cmis.edepot.picturae.com
) - Binding – Browser
- Username – Your username (Example:
demo
) - Password – Your password (Example:
demo
) - Authentication – Standard
- Rest parameters leave As Is.
Then click on Load Repositories
button and after it loads Repositories List click on Login.
Now you should see following window:
On the left side you can see list of ingested AIPs and on the right side CMIS Object Details.
You can double-click on Folders (AIP Packages) in order to browse its file & folder structure.
Once you reached needed file Right Click on it and select Download.
Ignore MIME Error message. This is an issue with CMIS Workbench.
After you clicked on the Download Button it may take some time to extract the file from AIP and start downloading it.