CI Server: http://jenkins.discoverygarden.ca
- Summary
- Requirements
- Installation
- Configuration
- Documentation
- Describe Existing Workflow Datastream
- Get Last Workflow Entry
- Add Workflow Entry
- Test object for a given stamp category or status
- [List all PIDs with a given stamp/category and status within an optional collection] (#list-all-pids-with-a-given-stampcategory-and-status-within-an-optional-collection)
- Todo
This module provides a number of REST end points for fetching/manipulating workflow items.
By Default, the previous/last workflow entry is not included in email notifications. After configuring the Real Name module as you like, you can add these entry's to the notification email by navigating to {your_site}/admin/config/messaging/privatemsg navigate to the email notify tab, and add the following (including brackets) to the "Body of notification messages" field:
[privatemsg_message:body]
Configure the Real Name module by preforming the following steps
- Navigate to {your_site}/admin/config/people/accounts/fields
- Add a new field (ex: field_full_name) as Field Type 'Text', click 'Save'
- Navigate to {your_site}/admin/config/people/realname, click browse available tokens
- Select the new field you created, and click 'Save configuration'
Assumes the following global XACML polices have been removed from:
$FEDORA_HOME/data/fedora-xacml-policies/repository-policies/default
- deny-inactive-or-deleted-objects-or-datastreams-if-not-administrator.xml
- deny-policy-management-if-not-administrator.xml
- deny-purge-datastream-if-active-or-inactive.xml
- deny-purge-object-if-active-or-inactive.xml
This module will still function with those policies in place but the tests this module defines will fail. Also when installing Islandora don't forget to deploy the policies it includes!
For each of the REST end-points defined below in the documentation section there exists a corresponding Drupal Endpoint. Making GET requests to these endpoints produces a JSON object representative of the requested task.
{variable} Required Parameter.
[variable] Optional Parameter no default defined, NULL or empty string likely be used.
[variable, ’default’] Optional Parameter and it’s default.
Unless otherwise specified each end-point can return the following responses.
In general 401 means an anonymous user attempted some action and was denied. Either the action is not granted to anonymous uses in the Drupal permissions, or XACML denied the action for the anonymous user.
In general 403 means an authenticated user attempted some action and was denied. Either the authenticated user does not have a Drupal role that grants him/her permission to perform that action, or XACML denied the action for that user.
In general a 404 will occur, when a user tries to perform an action on a object or datastream that doesn't not exist. Or XACML is hiding that object or datastream from the user.
404 Responses can be returned even if the user was not determined to have permission to perform the requested action, as the resource must be first fetched from fedora before the users permission can be determined.
Name | Description |
---|---|
message | A detail description of the error. |
Any problem can trigger a 500 error, but in general you'll find that this is typically an error returned by Fedora.
islandora_workflow_rest/v1/get_full_workflow/{params}
GET
Accept: application/json
Name | Description | Optional |
---|---|---|
PID | Persistent identifier of the object | Required |
Name | Description |
---|---|
workflow | A Workflow array, with each entry representing a workflow item. |
{
"cwrc":{
"#text":[],
"workflow":[
{
"attributes":{
"date":"2014-01-16",
"userID":"1",
"time":"18:20:54",
"workflowID":"islandora_9_wk_0"
},
"activity":{
"attributes":{
"category":"sample_category",
"stamp":"niso:AO",
"status":"sample_status"
},
"note":"This is the body of the note element"
},
"assigned":{
"attributes":{
"category":"content_contribution"
},
"message":{
"recipient":{
"attributes":{
"userID":"Me"
}
},
"subject":"Test Subject",
"body":"This is a test entry. Additonal text required."
}
}
}
]
}
}
islandora_workflow_rest/v1/get_last_workflow/{params}
GET
Accept: application/json
Name | Description | Optional |
---|---|---|
PID | The fedora identifier to find the last workflow entry for. | Required |
{
"response":{
"workflow":{
"attributes":{
"date":"2014-01-16",
"userID":"1",
"time":"19:54:48",
"workflowID":"islandora_9_wk_3"
},
"activity":{
"attributes":{
"category":"sample remote",
"stamp":"niso:AO",
"status":"foo_bar"
},
"note":"sample text body"
},
"assigned":{
"attributes":{
"category":"content_contribution"
},
"message":{
"recipient":{
"attributes":{
"userID":"herbie"
}
},
"subject":"muhaha",
"body":"sample remote text for body"
}
}
}
}
}
islandora_workflow_rest/v1/add_workflow/{params}
GET
Accept: application/json
Content-Type: application/json
Name | Description | Optional |
---|---|---|
PID | Persistent identifier of the object. | Required |
toolID | The tool identifier to add to the workflow | Optional |
activity | JSON with keys category, stamp, status | Required |
assigned | JSON with keys category | Optional |
Both activity and assigned, have the optional keys note, recipient, subject, and body. A notification email will only be sent if recipient, subject, and body are all set.
{
"category":"content_contribution",
"stamp":"nis:AO",
"status":"foo_bar",
"note":"Note text",
}
{
"category":"content_contribution",
"recipient":"user",
"subject":"foo_bar",
"body":"The body text",
}
Name | Description |
---|---|
response | JSON workflow item. |
{
"response":{
"workflow":{
"attributes":{
"date":"2014-01-16",
"userID":"1",
"time":"19:54:48",
"workflowID":"islandora_9_wk_3"
},
"activity":{
"attributes":{
"category":"sample remote",
"stamp":"niso:AO",
"status":"foo_bar"
},
"note":"sample text body"
},
"assigned":{
"attributes":{
"category":"content_contribution"
},
"message":{
"recipient":{
"attributes":{
"userID":"herbie"
}
},
"subject":"muhaha",
"body":"sample remote text for body"
}
}
}
}
}
islandora_workflow_rest/v1/has_entry/{params}
GET
Name | Description | Optional |
---|---|---|
PID | Persistent identifier of the object. | Required |
stamp | The stamp to check for. | Optional |
category | The category to check for. | Optional |
status | The status to check for. | Optional |
simple | Full workflow entries or simple check. | Optional (Default: false) |
Name | Description |
---|---|
response | JSON object array of workflow item(s). |
{
"response":{
"stamp":[
{
"response":{
"workflow":{
"attributes":{
"date":"2014-03-04",
"userID":"1",
"time":"13:29:34",
"workflowID":"islandora_root_wk_0"
},
"activity":{
"attributes":{
"category":"CREATED",
"stamp":"islandora:AO",
"status":"In Progress"
},
"note":"dsafsafa",
"message":{
"recipient":{
"attributes":{
"userID":"usera,userb"
}
},
"subject":"mememe",
"body":"go away."
}
}
}
}
},
{
"response":{
"workflow":{
"attributes":{
"date":"2014-03-04",
"userID":"1",
"time":"13:32:50",
"workflowID":"islandora_root_wk_1"
},
"activity":{
"attributes":{
"category":"CREATED",
"stamp":"islandora:AO",
"status":"In Progress"
},
"note":"sadfasfasdf",
"message":{
"recipient":{
"attributes":{
"userID":"usera,userb"
}
},
"subject":"me",
"body":"mess"
}
}
}
}
}
],
}
}
{
"response": {
"stamp": "TRUE"
}
}
islandora_workflow_rest/v1/workflow_query/{params}
GET
Accept: application/json
Name | Description | Optional |
---|---|---|
PID | Limit workflow query to a collection by collection PID. | Optional |
required | Limit workflow query VIA required attribute fields | Optional |
query | SOLR query string EX: 'PID:*'. | Optional |
The collection_pid parameter and required parameter will be still be applied to the query string if present.
{
"workflow_workflowID_ms":"islandora_root_wk_1"
}
A JSON array with each field containing the following values.
Name | Description |
---|---|
pids | JSON Object array of pids matching the supplied query. |
[{
"islandora:1",
"islandora:2",
"islandora:3"...
}]
- Add input form for workflow.
- Implement workflow reports.
- Add table to view/edit workflow steps.