Feature #501
Support for using (reading) Disseminators
| Status: | New | Start: | 10/02/2009 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | Fedora CMA | Spent time: | - | |
| Target version: | - | |||
| Sponsor: |
Description
RubyFedora should provide an accessor to the disseminators listed when you call /methods on an object in Fedora's REST API.
Using demo:SmileyStuff as an example:
The REST API returns this when you call /demo:SmileyStuff/methods
<objectMethods xsi:schemaLocation="http://www.fedora.info/definitions/1/0/access/ http://localhost:8080/listMethods.xsd" pid="demo:SmileyStuff" baseURL="http://localhost:8080/fedora/"> <sDef pid="demo:Collection"> <method name="list"/> <method name="view"/> </sDef> <sDef pid="fedora-system:3"> <method name="viewObjectProfile"/> <method name="viewMethodIndex"/> <method name="viewItemIndex"/> <method name="viewDublinCore"/> </sDef> </objectMethods>So calling
obj.inner_object.disseminatorsshould return a hash with the methods listed by sDef. ie.
{:pid="demo:SmileyStuff",
:baseURL="http://localhost:8080/fedora/",
"demo:Collection"=>["list","view"],
"fedora-system:3"=>["viewObjectProfile","viewMethodIndex","viewItemIndex","viewDublinCore"]}
Calling
obj.call_disseminator("demo:Collection", "list") should call that disseminator on the object and return the result.
For completeness, the call_disseminator method in ActiveFedora should rely on a RubyFedora method like this
Fedora::Repository.instance.call_disseminator(obj.pid, "demo:Collection", "list")