[seek-dev] Re: need a new upload() method in MetacatClient.java
Matt Jones
jones at nceas.ucsb.edu
Fri Sep 3 08:57:14 PDT 2004
Bing,
In addition to the client-side read, you can also look at the document
on the web (if you've set access permissions or logged in) using a url
of this form:
http://ecogrid.ecoinformatics.org/ogsa/metacat?action=read&qformat=xml&docid=knb.1.1
Saurabh Garg wrote:
> Bing Zhu wrote:
>>
>> Notice (2) is equivalent to Ecogrid's put. But (2) needs Metacat URL
>> which
>> is not mentioned in our 'put' syntax and not in Ecogrid's design
>> document
>> either. So I guess the 'objectID' will a combination of URL and
>> metacat doc id.
>> e.g. if I want to upload a file with Metacat ID, test108.1.1, via
>> Ecogrid's put,
>> The object ID in this call will be:
>> http://indus.nceas.ucsb.edu/knb-oracle/metacat/test108.1.1
I don't think you should do it this way. The Metacat URL is implicit in
the EcoGrid node, so it need not (and should not) be part of the
identifer. All your identifier really needs is "test108.1.1". In the
past meetings we've discussed trying to standardize our identifier
formats, but so far none of the systems (srb, metacat, etc) will accept
identifers of the format we've discussed. If I remember from Edinburgh
correctly, our proposed ID format was:
urn:ecogrid://scope/localIdentifier
where scope is a symbolic name from the registry that can be used to
look up the wsdl (and therefore endpoint) of the EcoGrid query service.
However, we've also discussed using LSID's as the taxon group is doing,
which take the form:
URN:LSID:authority:namespace:objectId:revision
The revision is optional, and taxon and ecogrid have both agreed that it
should NOT be used (and that any versioning information belongs in the
metadata). The authority is a DNS name that resolves via DNS to a
service that can be used to resolve the LSID to actual physical
locations. 'Namespace' is analogous to our 'scope', and 'objectId' is
analogous to our 'localIdentifier'. So, this is similar to our proposal
above, but relies on DNS instead of our registry for the resolution service.
I think we need to make a decision about this ASAP. Dave Thau has a
test LSID service up and running I think, so we could use that. I have
put together a Wiki page to track our ongoing dialogue on this issue:
http://seek.ecoinformatics.org/Wiki.jsp?page=EcoGridIdentifiers
Matt
>>
>> BTW, after I called logout for a valid sessionID with the following
>> code
>> MetacatClient mc =
>> (MetacatClient)MetacatFactory.createMetacatConnection(metacatUrl);
>> mc.setSessionId(sessionId);
>> mc.logout();
>> Somehow I still can upload files using the same 'sessionID'. i.e. The
>> 'sessionId' does not expire imeediately
>> after 'mc.logout()'.
>>
>> 2. Is there a quick way to view the Metacat docs I created?
>>
>> Sincerely,
>> Bing
>>
>>
>>
>>
>>
>> -----Original Message-----
>> From: Saurabh Garg [mailto:sgarg at nceas.ucsb.edu]
>> Sent: Thursday, September 02, 2004 2:56 PM
>> To: bzhu at sdsc.edu
>> Cc: Matt Jones; Jing Tao; Bertram Ludaescher; Arcot Rajasekar; Seek-Dev
>> Subject: Re: need a new upload() method in MetacatClient.java
>>
>>
>> Bing,
>>
>> I have checked in a new method into metacat cvs. It is
>>
>> public String upload(String docid, String filename, InputStream
>> fileData, int fileSize)
>>
>> instead of
>>
>> public String upload(String docid, byte[] bytes)
>>
>> The reason is that we dont want to store the file in metacat client
>> code. If
>> a user passes bytes array which is more than the memory size, it will
>> crash
>> the metacat client. So instead of that, we take an InputStream object.
>>
>> You will have to update both utilities and metacat cvs modules for
>> this to
>> work. For sample code, look in
>> edu.ucsb.nceas.metacattest.client.MetacatClientTest (upload_stream()
>> function)
>>
>> Any questions, let me know
>>
>> -Sid
>>
>>
>>
>> ----- Original Message -----
>> From: "Bing Zhu" <bzhu at sdsc.edu>
>> To: "Sid" <sgarg at nceas.ucsb.edu>
>> Cc: "Matt Jones" <jones at nceas.ucsb.edu>; "Jing Tao" <tao at nceas.ucsb.edu>;
>> "Bertram Ludaescher" <ludaesch at sdsc.edu>; "Arcot Rajasekar"
>> <sekar at sdsc.edu>; "Seek-Dev" <seek-dev at ecoinformatics.org>
>> Sent: Tuesday, August 31, 2004 10:53 AM
>> Subject: need a new upload() method in MetacatClient.java
>>
>>
>>
>>
>>> Sid,
>>>
>>> In implemeting Ecogrid's 'put' for Metacat, it will be more
>>> efficient to have a new upload method for the Ecogrid's
>>> put service.
>>> public String upload(String docid, byte[] bytes)
>>>
>>> Currently I can only find the existing one,
>>> public String upload(String docid, File file),
>>> with which the Ecogrid's put service has to save the input byte array
>>> into a file and then call this method. I am going to implement
>>> it for now. Once the new method is available, I can just directly
>>> call the new one. Thanks.
>>>
>>> Bing
>>>
>>>
--
-------------------------------------------------------------------
Matt Jones jones at nceas.ucsb.edu
http://www.nceas.ucsb.edu/ Fax: 425-920-2439 Ph: 907-789-0496
National Center for Ecological Analysis and Synthesis (NCEAS)
University of California Santa Barbara
Interested in ecological informatics? http://www.ecoinformatics.org
-------------------------------------------------------------------
More information about the Seek-dev
mailing list