Hi Phil,
I agree with James that the TestRESTAPI class and the REST API docs are
the best resources for the REST API. To answer your question, if you are
just trying to update XML content in a datastream you don't need to do any
transformation, just do an PUT to
http://host:port/fedora/objects/PID/datastreamID/ and include your XML file
as multipart content on the request. If you're wanting to update other
datastream information you can use any of the available parameters listed in
the REST API doc.
Bill
On Fri, Nov 21, 2008 at 5:43 PM, James Chartrand <[EMAIL PROTECTED]>wrote:
> Hi Phil,
> I found two resources very helpful:
>
> 1. The TestRESTAPI class in SVN has extremely helpful working examples:
>
>
> http://fedora-commons.svn.sourceforge.net/viewvc/fedora-commons/fedora/tags/release-3.1/src/test/junit/fedora/test/api/TestRESTAPI.java
>
> The organization of the code might seem slightly off putting at first if
> you aren't familiar with testing methods (e.g., assertEquals.) It doesn't
> take at all long, however, to understand the flow of the code (provided you
> have some Java experience), after which you are flying.
>
> Even if you aren't familiar with Java, the class might still be helpful in
> constructing your calls.
>
> 2. The Fedora REST API documenation:
>
> http://fedora-commons.org/confluence/display/FCR30/Fedora+REST+API
>
> This might be better if you aren't familiar with Java.
>
> I found the two resources in combination to be excellent.
>
> james
>
> On Nov 21, 2008, at 3:58 PM, Phil Cryer wrote:
>
> How do I modify a datastream using REST? I dug into it today, and I
> don't have a grip on as I thought I did. I searched around and found plenty
> of documentation ON the functionality in FC, but not much on exactly how to
> use it. Currently I have XML files that need to be entered into Fedora to
> update EXISTING objects. Would I convert the XML -> FOXML and the call that
> file via a curl command to modify it? I think that's it, but am unsure of
> exactly how to do this. I found Matt's documentation on Mediashelf's site,
> and it lists this:
>
> curl -i -H "Content-type: text/xml" -XPUT "
> http://localhost:8080/fedora/objects/test:02/datastreams/DS1?dsLabel=hello&altIDs=3333"
> --data-binary @build.xml -u fedoraAdmin:fedoraAdmin
>
> So I'm assuming I'd plug in my pid, but after that I get lost. I know I
> want to use 'modifyObject' somewhere, but my attempts haven't worked. After
> that, do I call the XML file (as he's done here with build.xml) for it to
> update against, and again, XML or FOXML for that?
>
> Thanks for any advice or docs.
>
> P
> --
> Phil Cryer | Open Source Lead | Missouri Botanical Garden | skype
> phil.cryer
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
>
> http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
> Fedora-commons-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Fedora-commons-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers
>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fedora-commons-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers