Wiki Markup |
{div:style= Div |
---|
style | font-weight:bold;font-size:1.2em; |
---|
| }[PublicItem Service Home]
{div} |
|
Brief Description
Wiki Markup |
---|
{multi-excerpt-include:PublicItem Service Description and Assumptions|name=brief-description|nopanel=true} |
For a full description, visit the
Service Description and Assumptions page.
Assumptions
Wiki Markup |
---|
{multi-excerpt-include:PublicItem Service Description and Assumptions|name=brief-assumptions|nopanel=true} |
For a complete list of assumptions, visit the
Service Description and Assumptions page.
References
PublicItem Service Description and Assumptions
REST-based API
The PublicItem Service offers a REST-based Application Programming Interface (API) to CRUD (create, read, update, and delete) operations on individual PublicItem instances. These follow the Common model for CollectionSpace REST services.
...
Creates a new PublicItem record. Assigns a unique, service-specified CollectionSpace ID (CSID) /wiki/spaces/collectionspace/pages/666274321 to that PublicItem record. Follows standard Create model. See the documentation of the PublicItem schema, below. Example:
Code Block |
---|
POST /cspace-services/publicitems HTTP/1.1
<?xml version="1.0" encoding="UTF-8"?>
<document name="articles">
<ns2:articles_common xmlns:ns2="http://collectionspace.org/services/article">
<articleNumber>articleNumber-1360362561804</articleNumber>
<articleContentName>contentname-articleNumber-1360362561804</articleContentName>
<articleContentRepositoryId>42640780-82eb-4650-8a70</articleContentRepositoryId>
<articleContentUrl>https://github.com/collectionspace/services/blob/CSPACE-5564-REM-A/services/article/jaxb/src/main/resources/articles-common.xsd</articleContentUrl>
<articleJobId>articleJobId-1360362561804</articleJobId>
<articleSource>utf-8-data-fragment:??WO</articleSource>
<accessExpirationDate/>
<accessedCount>3</accessedCount>
<accessedCountLimit>5</accessedCountLimit>
</ns2:articles_common>
</document>
|
|
Create a PublicItem and Publish an Artifact
Code Block |
---|
POST /cspace-services/publicitems HTTP/1.1
<Currently a private service available only to other public services like the Media, Blob, and Report services.>
|
|
Read a PublicItem
Reads an existing PublicItem record, specified by its CollectionSpace ID (CSID) /wiki/spaces/collectionspace/pages/666274321. Follows standard Read model. See the documentation of the PublicItem schema, below. Example:
Code Block |
---|
GET /cspace-services/publicitems/{id} HTTP/1.1
<?xml version="1.0" encoding="UTF-8"?>
<document name="articles">
<ns2:collectionspace_core xmlns:ns2="http://collectionspace.org/collectionspace_core/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tenantId>1</tenantId>
<updatedAt>2013-01-24T22:38:07Z</updatedAt>
<workflowState>project</workflowState>
<createdBy>admin@core.collectionspace.org</createdBy>
<createdAt>2013-01-24T22:38:07Z</createdAt>
<refName> urn:cspace:core.collectionspace.org:articles:id(9bb60379-0633-4914-b1ef) </refName>
<uri>/articles/9bb60379-0633-4914-b1ef</uri>
<updatedBy>admin@core.collectionspace.org</updatedBy>
</ns2:collectionspace_core>
<ns2:articles_common xmlns:ns2="http://collectionspace.org/services/article"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<articleJobId>articleJobId-1360362561804</articleJobId>
<articleContentUrl>
https://github.com/collectionspace/services/blob/CSPACE-5564-REM-A/services/article/jaxb/src/main/resources/articles-common.xsd </articleContentUrl>
<articleNumber>articleNumber-1360362561804</articleNumber>
<articleContentName>contentname-articleNumber-1360362561804</articleContentName>
<articleContentRepositoryId>42640780-82eb-4650-8a70</articleContentRepositoryId>
<accessedCount>3</accessedCount>
<articleSource>utf-8-data-fragment:??WO</articleSource>
<accessedCountLimit>5</accessedCountLimit>
</ns2:articles_common>
<ns2:account_permission xmlns:ns2="http://collectionspace.org/services/authorization">
<account>
<accountId>eb4fbcf9-8830-4476-92f7-a639aa85b507</accountId>
<screenName>Administrator</screenName>
<userId>admin@core.collectionspace.org</userId>
<tenantId>1</tenantId>
</account>
</ns2:account_permission>
</document>
|
|
Read a PublicItem's Published Artifact
Reads an existing PublicItem's published artifact (an image, report, attachment, etc), specified by its CollectionSpace ID (CSID) /wiki/spaces/collectionspace/pages/666274321. Follows standard Read model. See the documentation of the PublicItem schema, below. Example:
Code Block |
GET /cspace-services/publicitems/{id}/{tenantId}/content HTTP/1.1
|
---|
|
Update a PublicItem
Updates an existing PublicItem record, specified by its CollectionSpace ID (CSID) /wiki/spaces/collectionspace/pages/666274321. Follows standard Update model. See the documentation of the PublicItem schema, below. Example:
Code Block |
---|
PUT /cspace-services/publicitems/{id} HTTP/1.1
<?xml version="1.0" encoding="UTF-8"?>
<document name="articles">
<ns2:articles_common xmlns:ns2="http://collectionspace.org/services/article">
<articleNumber>articleNumber-1357537624314</articleNumber>
</ns2:articles_common>
</document>
|
|
Delete a PublicItem
Deletes an existing PublicItem record, specified by its CollectionSpace ID (CSID) /wiki/spaces/collectionspace/pages/666274321. Follows standard Delete model. Example:
Code Block |
DELETE /cspace-services/publicitems/{id} HTTP/1.1
|
---|
|
List PublicItem instances
...
- pgSz for page size
- pgNum for page size
Examples:
Code Block |
GET /cspace-services/publicitems/ HTTP/1.1
GET /cspace-services/publicitems/?pgSz=10 HTTP/1.1
|
---|
|
Example Result:
Code Block |
<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
<pageNum>0</pageNum>
<pageSize>40</pageSize>
<itemsInPage>3</itemsInPage>
<totalItems>3</totalItems>
<fieldsReturned>
csid|uri|refName|updatedAt|workflowState|articleNumber|articleSource|articleContentUrl </fieldsReturned>
<list-item>
<csid>ce8a5fee-bdd1-4464-8116</csid>
<uri>/articles/ce8a5fee-bdd1-4464-8116</uri>
<refName> urn:cspace:core.collectionspace.org:articles:id(ce8a5fee-bdd1-4464-8116) </refName>
<updatedAt>2013-01-24T21:30:08Z</updatedAt>
<workflowState>project</workflowState>
<articleSource>Reports</articleSource>
<articleContentUrl>
http://localhost:8180/cspace-services/articles/ce8a5fee-bdd1-4464-8116/1/content
</articleContentUrl>
</list-item>
<list-item>
<csid>3db80d54-dded-40c3-919d</csid>
<uri>/articles/3db80d54-dded-40c3-919d</uri>
<refName> urn:cspace:core.collectionspace.org:articles:id(3db80d54-dded-40c3-919d) </refName>
<updatedAt>2013-01-24T21:29:35Z</updatedAt>
<workflowState>project</workflowState>
<articleSource>Blobs</articleSource>
<articleContentUrl>
http://localhost:8180/cspace-services/articles/3db80d54-dded-40c3-919d/1/content
</articleContentUrl>
</list-item>
<list-item>
<csid>75408e93-80b9-4987-b27d</csid>
<uri>/articles/75408e93-80b9-4987-b27d</uri>
<refName> urn:cspace:core.collectionspace.org:articles:id(75408e93-80b9-4987-b27d) </refName>
<updatedAt>2013-01-24T21:16:35Z</updatedAt>
<workflowState>project</workflowState>
<articleSource>Blobs</articleSource>
<articleContentUrl>
http://localhost:8180/cspace-services/articles/75408e93-80b9-4987-b27d/1/content
</articleContentUrl>
</list-item>
</ns2:abstract-common-list>
|
---|
|
PublicItem REST payload schemas
...
Create and Update should use something like the following XML payload.
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?>
<document name="articles">
<ns2:articles_common xmlns:ns2="http://collectionspace.org/services/article">
<articleNumber>articleNumber-1357537624314</articleNumber>
<articleJobId>articleJobId-1357537624314</articleJobId>
...
<articleSource>utf-8-data-fragment:??WO</articleSource>
</ns2:articles_common>
</document>
|
|
Read results in the something like the following example XML payload.
Code Block |
---|
<document name="articles">
<ns2:collectionspace_core xmlns:ns2="http://collectionspace.org/collectionspace_core/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<tenantId>1</tenantId>
<updatedAt>2013-01-24T21:30:08Z</updatedAt>
<workflowState>project</workflowState>
<createdBy>admin@core.collectionspace.org</createdBy>
<createdAt>2013-01-24T21:30:08Z</createdAt>
<refName> urn:cspace:core.collectionspace.org:articles:id(ce8a5fee-bdd1-4464-8116) </refName>
<uri>/articles/ce8a5fee-bdd1-4464-8116</uri>
<updatedBy>admin@core.collectionspace.org</updatedBy>
</ns2:collectionspace_core>
<ns2:articles_common xmlns:ns2="http://collectionspace.org/services/article"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<articleContentUrl>
http://localhost:8180/cspace-services/articles/ce8a5fee-bdd1-4464-8116/1/content </articleContentUrl>
<articleContentName>acq_basic.pdf</articleContentName>
<articleContentRepositoryId>094168c7-a14c-4714-9520-83cce0e2cf22</articleContentRepositoryId>
<articleSource>Reports</articleSource>
</ns2:articles_common>
<ns2:account_permission xmlns:ns2="http://collectionspace.org/services/authorization">
<account>
<accountId>eb4fbcf9-8830-4476-92f7-a639aa85b507</accountId>
<screenName>Administrator</screenName>
<userId>admin@core.collectionspace.org</userId>
<tenantId>1</tenantId>
</account>
</ns2:account_permission>
</document>
</document>
|
|
PublicItem-List schema
List (and variants) will return something like the following XML payload:
Code Block |
<ns2:abstract-common-list xmlns:ns2="http://collectionspace.org/services/jaxb">
<pageNum>0</pageNum>
<pageSize>40</pageSize>
<itemsInPage>3</itemsInPage>
<totalItems>3</totalItems>
<fieldsReturned>
csid|uri|refName|updatedAt|workflowState|articleNumber|articleSource|articleContentUrl </fieldsReturned>
<list-item>
<csid>ce8a5fee-bdd1-4464-8116</csid>
<uri>/articles/ce8a5fee-bdd1-4464-8116</uri>
<refName> urn:cspace:core.collectionspace.org:articles:id(ce8a5fee-bdd1-4464-8116) </refName>
<updatedAt>2013-01-24T21:30:08Z</updatedAt>
<workflowState>project</workflowState>
<articleSource>Reports</articleSource>
<articleContentUrl>
http://localhost:8180/cspace-services/articles/ce8a5fee-bdd1-4464-8116/1/content
</articleContentUrl>
</list-item>
<list-item>
<csid>3db80d54-dded-40c3-919d</csid>
<uri>/articles/3db80d54-dded-40c3-919d</uri>
<refName> urn:cspace:core.collectionspace.org:articles:id(3db80d54-dded-40c3-919d) </refName>
<updatedAt>2013-01-24T21:29:35Z</updatedAt>
<workflowState>project</workflowState>
<articleSource>Blobs</articleSource>
<articleContentUrl>
http://localhost:8180/cspace-services/articles/3db80d54-dded-40c3-919d/1/content
</articleContentUrl>
</list-item>
<list-item>
<csid>75408e93-80b9-4987-b27d</csid>
<uri>/articles/75408e93-80b9-4987-b27d</uri>
<refName> urn:cspace:core.collectionspace.org:articles:id(75408e93-80b9-4987-b27d) </refName>
<updatedAt>2013-01-24T21:16:35Z</updatedAt>
<workflowState>project</workflowState>
<articleSource>Blobs</articleSource>
<articleContentUrl>
http://localhost:8180/cspace-services/articles/75408e93-80b9-4987-b27d/1/content
</articleContentUrl>
</list-item>
</ns2:abstract-common-list>
|
---|
|