GSHs
=====
  http://pine.nceas.ucsb.edu:8090/ogsa/services/org/ecoinformatics/ecogrid/EcoGridQueryInterfaceLevelOneService
  http://pine.nceas.ucsb.edu:8090/ogsa/services/org/ecoinformatics/ecogrid/EcoGridLevelOneAuthenticationService
  http://pine.nceas.ucsb.edu:8090/ogsa/services/org/ecoinformatics/ecogrid/EcoGridLevelOnePutService

Metacat Query
=============
  Users can query Metacat system by using Query operation in Ecogrid Query service. Ecogrid adopts a Query
  Document as a query language which is shown in our example, ./examples/metacat_query1.xml, and other 
  query examples.

  The syntax for Query operation client is:

                 $ java EcogridQueryClient query local_filename GSH

  , where query is a keyword and 'local_file' is a local file for the query document.

  e.g.
    $ source ./setenv.csh
    $ setenv QUERY_GSH http://pine.nceas.ucsb.edu:8090/ogsa/services/org/ecoinformatics/ecogrid/EcoGridQueryInterfaceLevelOneService
    $ java EcogridQueryClient query ./examples/metacat_query1.xml $QUERY_GSH

  For Windows users:
    $ setenv
    $ set QUERY_GSH=http://pine.nceas.ucsb.edu:8090/ogsa/services/org/ecoinformatics/ecogrid/EcoGridQueryInterfaceLevelOneService
    $ java EcogridQueryClient query ./examples/metacat_query1.xml %QUERY_GSH%

Metcat Get
==========
  The Get is an operation within Ecogrid Query service.  In Metacat, user can retrieve data or XML documents through
  Get operation.  The Syntax for Get operation is:

                $ java EcogridQueryClient get metacat_doc_id GSH

  , where 'get' is a keyword to tell the Query service it is a Get operation.

  e.g.
    $ source ./setenv.csh 
    $ setenv QUERY_GSH http://pine.nceas.ucsb.edu:8090/ogsa/services/org/ecoinformatics/ecogrid/EcoGridQueryInterfaceLevelOneService
    $ java EcogridQueryClient get obfs2.357.1 . $QUERY_GSH

    , where the '.' means to download file into local disk with same filename

  For Windows users:
    $ setenv
    $ set QUERY_GSH=http://pine.nceas.ucsb.edu:8090/ogsa/services/org/ecoinformatics/ecogrid/EcoGridQueryInterfaceLevelOneService
    $ java EcogridQueryClient get obfs2.357.1 . %QUERY_GSH%

Metacat login & logout
======================
  Syntax: 
                $ java EcogridAuthClient login username password GSH
                $ java EcogridAuthClient logout sessionId GSH

  The Ecogrid Authentication service for Metacat authenticates a user and then issues an session ID if the user
  is verified. The session ID then can be used for later Metacat operation such as Put Data and Put data. And
  an session ID is also used to create a service registry in Ecogrid.

  The session ID will expire immediately after a logout operaion.

  To get a Metacat account, submit a request at 
      http://ldap.ecoinformatics.org/cgi-bin/ldapweb.cgi?cfg=knb

  e.g.
     $ setenv AUTH_GSH http://pine.nceas.ucsb.edu:8090/ogsa/services/org/ecoinformatics/ecogrid/EcoGridLevelOneAuthenticationService
     $ java EcogridAuthClient login ""uid=testuser,o=sdsc,dc=ecoinformatics,dc=org"" testuser_pass $AUTH_GSH
       F87D929FC26A26215FE187FA5EAEAE11

      , the 'F87D929FC26A26215FE187FA5EAEAE11' is a session ID returned from  authentication service.
     $ ...
     $ java EcogridAuthClient logout F87D929FC26A26215FE187FA5EAEAE11 $AUTH_GSH

  For Windows Users:
     $ set AUTH_GSH=http://pine.nceas.ucsb.edu:8090/ogsa/services/org/ecoinformatics/ecogrid/EcoGridLevelOneAuthenticationService
     $ java EcogridAuthClient login "uid=testuser,o=sdsc,dc=ecoinformatics,dc=org" testuser_pass %AUTH_GSH%
       F87D929FC26A26215FE187FA5EAEAE11
     $ ...
     $ java EcogridAuthClient logout F87D929FC26A26215FE187FA5EAEAE11 %AUTH_GSH%

Metcata Put
===========
  The Ecogrid Put service in Metacat provides user data (file or xml document) uploading service. The Put service 
  requires a valid session ID which is return from Ecogrid's Authentication service. The Syntax for the Put
  service client is:

                $ java EcogridPutClient data|metadata localfile document_id sessioId GSH    

     data or metadata: are keywords to tell the ecogrid service the data being uploaded is a file or XML document.
     localfile: local filename for the data to be uploaded. If the keyword is data, the content of the localfile
                will be uploaded as a file into Metacat. If the keyword is metadata, the content of the local file
                is a xml document which will be uploaded into Metacat as a xml document.
     document_id: The document ID used within Metacat.
      

  e.g.  (Assumng the sessionID is 'F87D929FC26A26215FE187FA5EAEAE11'.)

    $ setenv SESSION_ID F87D929FC26A26215FE187FA5EAEAE11
    $ setenv PUT_GSH http://pine.nceas.ucsb.edu:8090/ogsa/services/org/ecoinformatics/ecogrid/EcoGridLevelOnePutService

    ### upload a file into Metacat  ----------
    $ java EcogridPutClient data ./examples/test.txt test.txt.1 $SESSION_ID $PUT_GSH

    ### upload a xml document into Metacat  ---------
    $ java EcogridPutClient metadata ./examples/digir_query1.xml digir_query1.xml.1 $SESSION_ID $PUT_GSH

  Foe Windows users:
    $ set SESSION_ID=F87D929FC26A26215FE187FA5EAEAE11
    $ set PUT_GSH=http://pine.nceas.ucsb.edu:8090/ogsa/services/org/ecoinformatics/ecogrid/EcoGridLevelOnePutService

    $ java EcogridPutClient data ./examples/test.txt test.txt.1 %SESSION_ID% %PUT_GSH%
    
    $ java EcogridPutClient metadata ./examples/digir_query1.xml digir_query1.xml.1 %SESSION_ID% %PUT_GSH% 

  Remark: In uploading Metacat data, the '.1' is required in the filename to service as a revision number. For example,
          assume the document name is 'shark_in_Pacific.dat'. Then the actual doc id ip uploading the file into metcat
          should be 'shark_in_Pacific.dat.1'.
