2525: Address review feedback.
authorradhika <radhika@curoverse.com>
Wed, 7 May 2014 01:33:26 +0000 (21:33 -0400)
committerradhika <radhika@curoverse.com>
Wed, 7 May 2014 01:33:26 +0000 (21:33 -0400)
doc/sdk/java/index.html.textile.liquid
sdk/java/ArvadosSDKJavaExample.java
sdk/java/pom.xml

index d24983520eb448a58f127ace646315e59b5b5f19..f39d9c503ed71fb7b449d59b650a2b9899df3ce3 100644 (file)
@@ -14,9 +14,7 @@ h3. Introdution
   
 * The Java SDK is implemented as a maven project. Hence, you would need a working
 maven environment to be able to build the source code. If you do not have maven setup,
-you may find the following link useful. 
-
-<code class="userinput">http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html</code>
+you may find the "Maven in 5 Minutes":http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html link useful. 
 
 * In this document $ARVADOS_HOME is used to refer to the directory where
 arvados code is cloned in your system. For ex: $ARVADOS_HOME = $HOME/arvados
@@ -24,27 +22,23 @@ arvados code is cloned in your system. For ex: $ARVADOS_HOME = $HOME/arvados
 
 h3. Setting up the environment
 
-* The SDK requires a running Arvados API server. The information about the
-         API server needs to be passed to the SDK using environment variables or
-         during the construction of the Arvados instance.
-         
-* Below are the details about the environment variables and example setup
-         statements for a .bashrc file.
-       
+* The SDK requires a running Arvados API server. The following information
+         about the API server needs to be passed to the SDK using environment
+         variables or during the construction of the Arvados instance.
+
 <notextile>
 <pre>
 ARVADOS_API_TOKEN: API client token to be used to authorize with API server.
-$ <code class="userinput">export ARVADOS_API_TOKEN=z40gplmla6i58rsg96jhg5u41ewdl5rj4g1py2s6e2lsc3</code>
 
 ARVADOS_API_HOST: Host name of the API server.
-$ <code class="userinput">export ARVADOS_API_HOST=localhost:3001</code>
 
 ARVADOS_API_HOST_INSECURE: Set this to true if you are using self-signed
-certificates and would like to bypass certificate validations.
-$ <code class="userinput">export ARVADOS_API_HOST_INSECURE=true</code>
+    certificates and would like to bypass certificate validations.
 </pre>
 </notextile>
 
+* Please see "api-tokens":{{site.baseurl}}/user/reference/api-tokens.html for full details.
+         
 
 h3. Building the Arvados SDK
 
@@ -116,15 +110,26 @@ h3. Using the SDK in eclipse
 
 * To develop in eclipse, you can use the provided <code class="userinput">eclipse project</code>
 
-* Install <code class="userinput">m2eclipse</code> plugin in your eclipse
-* Set <code class="userinput">M2_REPO</code> in eclipse to your <code class="userinput">.m2/repository</code> directory
+* Install "m2eclipse":https://www.eclipse.org/m2e/ plugin in your eclipse
+
+* Set <code class="userinput">M2_REPO</code> classpath variable in eclipse to point to your local repository.
+The local repository is usually located in your home directory at <code class="userinput">$HOME/.m2/repository</code>.
 
-* Open the SDK project in eclipse
 <notextile>
 <pre>
-File -> Import -> Existing Projects into Workspace -> Next -> Browse
-and select $ARVADOS_HOME/sdk/java
+In Eclipse IDE:
+Window -> Preferences -> Java -> Build Path -> Classpath Variables
+    Click on the "New..." button and add a new 
+    M2_REPO variable and set it to your local Maven repository
 </pre>
 </notextile>
 
 
+* Open the SDK project in eclipse
+<notextile>
+<pre>
+In Eclipse IDE:
+File -> Import -> Existing Projects into Workspace -> Next -> Browse
+    and select $ARVADOS_HOME/sdk/java
+</pre>
+</notextile>
index 40ff9b6624776700b849ad30a46b638445b246ee..3c47f668b785b30b49b6182852481ee6b3b45b66 100644 (file)
@@ -14,7 +14,14 @@ import java.util.Map;
 
 public class ArvadosSDKJavaExample {
   /** Make sure the following environment variables are set before using Arvados:
-   *      ARVADOS_API_TOKEN, ARVADOS_API_HOST, ARVADOS_API_HOST_INSECURE
+   *      ARVADOS_API_TOKEN, ARVADOS_API_HOST and ARVADOS_API_HOST_INSECURE 
+   *      Set ARVADOS_API_HOST_INSECURE to true if you are using self-singed
+   *      certificates in development and want to bypass certificate validations.
+   *
+   *  If you are not using env variables, you can pass them to Arvados constructor.
+   *
+   *  Please refer to http://doc.arvados.org/api/index.html for a complete list
+   *      of the available API methods.
    */
   public static void main(String[] args) throws Exception {
     String apiName = "arvados";
@@ -22,7 +29,8 @@ public class ArvadosSDKJavaExample {
 
     Arvados arv = new Arvados(apiName, apiVersion);
 
-    // Make a users.list call
+    // Make a users list call. Here list on users is the method being invoked.
+    // Expect a Map containing the list of users as the response.
     System.out.println("Making an arvados users.list api call");
 
     Map<String, Object> params = new HashMap<String, Object>();
@@ -36,15 +44,15 @@ public class ArvadosSDKJavaExample {
     Map firstUser = (Map)items.get(0);
     String userUuid = (String)firstUser.get("uuid");
     
-    // Make a users.get call on the uuid obtained above
-    System.out.println("Making a users.get call for " + userUuid);
+    // Make a users get call on the uuid obtained above
+    System.out.println("\n\n\nMaking a users.get call for " + userUuid);
     params = new HashMap<String, Object>();
     params.put("uuid", userUuid);
     response = arv.call("users", "get", params);
     System.out.println("Arvados users.get:\n" + response);
 
-    // Make a pipeline_templates.list call
-    System.out.println("Making a pipeline_templates.list call.");
+    // Make a pipeline_templates list call
+    System.out.println("\n\n\nMaking a pipeline_templates.list call.");
 
     params = new HashMap<String, Object>();
     response = arv.call("pipeline_templates", "list", params);
index b89e482a8e521207192114dbae29ce9a20bea2f5..53e8f756310a345ed3c85eae379f11a7f899107c 100644 (file)
       <artifactId>log4j</artifactId>
       <version>1.2.16</version>
     </dependency>
+    <dependency>
+      <groupId>com.googlecode.json-simple</groupId>
+      <artifactId>json-simple</artifactId>
+      <version>1.1.1</version>
+    </dependency>
 
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>4.8.1</version>
     </dependency>
-    <dependency>
-      <groupId>com.googlecode.json-simple</groupId>
-      <artifactId>json-simple</artifactId>
-      <version>1.1.1</version>
-    </dependency>
   </dependencies>
 
   <build>