You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Description

Several actors and workflows were developed to test Fedora's REST API from within Kepler. In particular, they test the basic functionality of the JyFedoREST and FCRepoKepler packages. The source for the actors and workflows in this project are attached to this page and can be downloaded from https://fedora-commons.svn.sourceforge.net/svnroot/fedora-commons/incubator/kepler/trunk/jython/workflows/fcrepo.

Kepler Actors

The PythonActor was used extensively in this project. It is based on the Jython interpreter which provides standard Python functionality within a Java application. Because Jython is implemented in Java, it also provides access to any Java class or class library available to the JVM. In this way, it provides a rapid prototyping tool that supports coding in both Java and Python.

FCRepoGETActor

This actor establishes a connection to a Fedora Repository and sends a request using the Fedora REST API.

Source file :

FCRepoGETActor.py

Input ports :
  • repository : StringToken containing the base URL of the Fedora Repository.
  • method_uri : StringToken containing the URI for the REST API method to be executed.
  • username : StringToken containing the name of a Fedora Repository user with sufficient access authority to execute the method.
  • password : StringToken containing the password corresponding to the username.
Output ports:
  • out - ObjectToken - a Jython object containing the results of the method execution.

The "FCRepo REST GET" PythonActor is used in the following workflows:

  • REST-API-Test1
  • REST-API-Test2
  • REST-API-Test3
  • REST-API-Test4

FormatSerializerActor

This actor is a helper that determines the type of object returned by a GET request and reformats the output so that other Kepler actors can handle it.

Source file :

FormatSerializerActor.py

Input port:
  • in : ObjectToken containing the results of the method executed by a "FCRepo REST GET" actor.
Output ports:
  • image_out : AWTImageToken containg an AWT Image. It is broadcast only if the an image was supplied to the "in" port.
  • string_out : StringToken. It is broadcast only if a string was supplied to the "in" port.

The "FCRepo Serialzer" PythonActor is used in the following workflows:

  • REST-API-Test1
  • REST-API-Test2
  • REST-API-Test3
  • REST-API-Test4
  • REST-API-Test5

FCRepoDialogActor

This actor displays a SWING dialog that allows the user to enter parameters required to connect to a Fedora Repository.

Source file :

FCRepoDialogActor.py

Input ports :
  • None
Output port :
  • out : ObjectToken containing a Jython dictionary with name/value pairs for all input fields in the form. This object contains the following keys:
    • passalong = name of button pressed.
    • fcrepoURL = base URL of the Fedora Repository.
    • username = name of a Fedora Repository user.
    • password = password corresponding to the username.

The "FC Repository Dialog" PythonActor is used in the following workflows:

  • REST-API-Test3
  • REST-API-Test4

FCRepoDatastreamDialogActor

This actor displays a SWING dialog that allows the user to enter parameters required to connect to a Fedora Repository and access a particular datastream.

Source file :

FCRepoDatastreamDialogActor.py

Input port :
  • None
Output port:
  • out : ObjectToken containing a Jython dictionary with name/value pairs for all input fields in the form. This object contains the following keys:
    • passalong = name of button pressed.
    • fcrepoURL = base URL of the Fedora Repository.
    • username = name of a Fedora Repository user.
    • password = password corresponding to the username.
    • pid = identifier for object to be accessed.
    • dsid = identifier of datastream to be accessed.

The "FCRepo Datastream Dialog" PythonActor is used in the following workflows:

  • REST-API-Test5

DatastreamDisseminationActor

Source file :
  • DatastreamDisseminationActor.py
Input port:
  • dialog_info : ObjectToken containing a Jython dictionary containing data from a form usbmitted via "FCRepo Datastream Dialog". Alternately, any Jython dictionary with the following keys:
    • fcrepoURL = base URL of the Fedora Repository.
    • username = name of a Fedora Repository user.
    • password = password corresponding to the username.
    • pid = identifier for object to be queried.
    • dsid = identifier of datastream to be queried.
Output port:
  • out : ObjectToken containing a Jython object with the data returned by the request for a dissemnation.

The "FCRepo Dissemination" PythonActor is used in the following workflows:

  • REST-API-Test5

Kepler Workflows

.

  • No labels