Nils,
If you have a look at fedora.client.FedoraClient, you'll find the use of
the Fedora Upload Servlet (/fedora/management/upload), which accepts
HTTP POSTs and returns an identifier you can use as the dsLocation for
your subsequent add/modify datastream requests.
Eddie
On 09/29/2008 11:06 PM, Nils Weinander is rumored to have said:
> Nils Weinander wrote:
>> What am I doing wrong when api-m addDatastream always
>> fails with
>>
>> fedora.server.errors.GeneralException: Error with null
>
> To try and answer my own question, the code in
> DefaultManagement.java indicates that I cannot
> add an empty data stream.
>
> if (controlGroup.equals("X")) {
> ds = new DatastreamXMLMetadata();
> ds.DSInfoType = ""; // field is now deprecated
> try {
> InputStream in;
> MIMETypedStream mimeTypedStream = null;
> if
> (dsLocation.startsWith(DatastreamManagedContent.UPLOADED_SCHEME)) {
> in = getTempStream(dsLocation);
> } else {
> mimeTypedStream =
> m_contentManager.getExternalContent(dsLocation,
>
> context);
> in = mimeTypedStream.getStream();
> }
> ((DatastreamXMLMetadata) ds).xmlContent =
> getEmbeddableXML(in);
>
> that is, dsLocation should be used even though
> this is an X data stream, not M or R. Is that correct?
>
> If so, is there an API to create a resource with
> DatastreamManagedContent.UPLOADED_SCHEME which I can refer
> to?
>
> If not that, how are you supposed to go about to add a
> new datastream to an existing object?
>
-------------------------------------------------------------------------
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-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users