com.googlecode.fascinator.harvester.workflow
Class WorkflowHarvester

java.lang.Object
  extended by com.googlecode.fascinator.common.harvester.impl.GenericHarvester
      extended by com.googlecode.fascinator.harvester.workflow.WorkflowHarvester
All Implemented Interfaces:
Harvester, Plugin

public class WorkflowHarvester
extends GenericHarvester

This plugin is a basic harvester for ingesting uploaded content into workflows. It creates the DigitalObject of a source object for the standard harvest/transform/index stack.

A trimmed down version of the file-system harvester but doesn't need recursion or caching.

Configuration

Sample configuration file for workflow harvester: workflow-harvester.json

Examples

  1. Below is the example of workflow stages:
       "stages": [
             {
                 "name": "pending",
                 "label": "Pending",
                 "security": ["metadata", "admin"],
                 "visibility": ["metadata", "editor", "admin"]
             },
             {
                 "name": "metadata",
                 "label": "Basic Metadata Check",
                 "security": ["editor", "admin"],
                 "visibility": ["metadata", "editor", "admin"],
                 "template": "workflows/basic-init"
             },
             {
                 "name": "live",
                 "label": "Live",
                 "security": ["editor", "admin"],
                 "visibility": ["guest"],
                 "template": "workflows/basic-live"
             }
         ]
     

Rule file

Sample rule file for the workflow harvester: workflow-harvester.py

Wiki Link

https://fascinator.usq.edu.au/trac/wiki/Fascinator/Documents/Plugins/ Harvester/Workflow

Author:
Greg Pendlebury

Constructor Summary
WorkflowHarvester()
          Basic constructor.
 
Method Summary
 Set<String> getObjectId(File uploadedFile)
          Get an individual uploaded file as a digital object.
 Set<String> getObjectIdList()
          Gets a list of digital object IDs.
 boolean hasMoreObjects()
          Tests whether there are more objects to retrieve.
 void init()
          Basic init() function.
 
Methods inherited from class com.googlecode.fascinator.common.harvester.impl.GenericHarvester
getDeletedObjectIdList, getId, getJsonConfig, getName, getPluginDetails, getStorage, hasMoreDeletedObjects, init, init, setStorage, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowHarvester

public WorkflowHarvester()
Basic constructor.

Method Detail

init

public void init()
          throws HarvesterException
Basic init() function. Notice the lack of parameters. This is not part of the Plugin API but from the GenericHarvester implementation. It will be called following the constructor verifies configuration is available.

Specified by:
init in class GenericHarvester
Throws:
HarvesterException - : If there are problems during instantiation

getObjectIdList

public Set<String> getObjectIdList()
                            throws HarvesterException
Gets a list of digital object IDs. If there are no objects, this method should return an empty list, not null.

Returns:
a list of object IDs, possibly empty
Throws:
HarvesterException - if there was an error retrieving the objects

getObjectId

public Set<String> getObjectId(File uploadedFile)
                        throws HarvesterException
Get an individual uploaded file as a digital object. For consistency this should be in a list.

Specified by:
getObjectId in interface Harvester
Overrides:
getObjectId in class GenericHarvester
Returns:
a list of one object ID
Throws:
HarvesterException - if there was an error retrieving the objects

hasMoreObjects

public boolean hasMoreObjects()
Tests whether there are more objects to retrieve. This method should return true if called before getObjects.

Returns:
true if there are more objects to retrieve, false otherwise


Copyright © 2009-2012. All Rights Reserved.