[ARVADOS] updated: 1c6bc4bcac86195a120e6be564703e7d2133dbe7
git at public.curoverse.com
git at public.curoverse.com
Wed May 7 11:08:43 EDT 2014
Summary of changes:
doc/sdk/java/index.html.textile.liquid | 25 ++++++++++-------
sdk/java/ArvadosSDKJavaExampleWithPrompt.java | 28 ++++++++++++-------
.../java/org/arvados/sdk/java/ArvadosTest.java | 2 +-
3 files changed, 34 insertions(+), 21 deletions(-)
via 1c6bc4bcac86195a120e6be564703e7d2133dbe7 (commit)
via 88590483c4d24904267b550cbb3af7d5a11d8953 (commit)
from 2376147b3d039acf08456a53015d59f04eabbf82 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 1c6bc4bcac86195a120e6be564703e7d2133dbe7
Author: radhika <radhika at curoverse.com>
Date: Wed May 7 11:07:42 2014 -0400
2525: update java sdk documentation to include ArvadosSDKJavaExampleWithPrompt
diff --git a/doc/sdk/java/index.html.textile.liquid b/doc/sdk/java/index.html.textile.liquid
index f39d9c5..11b1172 100644
--- a/doc/sdk/java/index.html.textile.liquid
+++ b/doc/sdk/java/index.html.textile.liquid
@@ -54,34 +54,39 @@ $ <code class="userinput">mvn -Dmaven.test.skip=true clean package</code>
h3. Implementing your code to use SDK
-<code class="userinput">$ARVADOS_HOME/sdk/java/ArvadosSDKJavaExample.java</code> serves as a sample
-implementation using the SDK.
+* The following two sample programs serve as sample implementations using the SDK.
+<code class="userinput">$ARVADOS_HOME/sdk/java/ArvadosSDKJavaExample.java</code> is a simple program
+ that makes a few calls to API server.
+<code class="userinput">$ARVADOS_HOME/sdk/java/ArvadosSDKJavaExampleWithPrompt.java</code> can be
+ used to make calls to API server interactively.
-Please use this file to see how you would want use the SDK from your java program.
+Please use these implementations to see how you would want use the SDK from your java program.
Also, refer to <code class="userinput">$ARVADOS_HOME/arvados/sdk/java/src/test/java/org/arvados/sdk/java/ArvadosTest.java</code>
for more sample API invocation examples.
-Below are the steps to compile and run this java program.
+Below are the steps to compile and run these java program.
-* <code class="userinput">ArvadosSDKJavaExample.java</code> creates an instance of Arvados SDK class and uses it to
+* These programs create an instance of Arvados SDK class and use it to
make various <code class="userinput">call</code> requests.
-* To compile ArvadosSDKJavaExample.java
+* To compile the examples
<notextile>
<pre>
$ <code class="userinput">javac -cp $ARVADOS_HOME/sdk/java/target/arvados-sdk-1.0-jar-with-dependencies.jar \
-ArvadosSDKJavaExample.java</code>
-This results in the generation of the ArvadosSDKJavaExample.class file
-in the same directory as the java file
+ArvadosSDKJavaExample*.java</code>
+This results in the generation of the ArvadosSDKJavaExample*.class files
+in the same directory as the java files
</pre>
</notextile>
-* To run the sample
+* To run the samples
<notextile>
<pre>
$ <code class="userinput">java -cp .:$ARVADOS_HOME/sdk/java/target/arvados-sdk-1.0-jar-with-dependencies.jar \
ArvadosSDKJavaExample</code>
+$ <code class="userinput">java -cp .:$ARVADOS_HOME/sdk/java/target/arvados-sdk-1.0-jar-with-dependencies.jar \
+ArvadosSDKJavaExampleWithPrompt</code>
</pre>
</notextile>
commit 88590483c4d24904267b550cbb3af7d5a11d8953
Author: radhika <radhika at curoverse.com>
Date: Wed May 7 10:55:03 2014 -0400
2525: more testing. also "=" works in place of "is_a" for a filter.
diff --git a/sdk/java/ArvadosSDKJavaExampleWithPrompt.java b/sdk/java/ArvadosSDKJavaExampleWithPrompt.java
index f70b0b6..a6efd80 100644
--- a/sdk/java/ArvadosSDKJavaExampleWithPrompt.java
+++ b/sdk/java/ArvadosSDKJavaExampleWithPrompt.java
@@ -32,27 +32,35 @@ public class ArvadosSDKJavaExampleWithPrompt {
String apiName = "arvados";
String apiVersion = "v1";
- System.out.print("Welcome to Arvados Java SDK");
- System.out.println("You can use this example to call API methods");
- System.out.println("Enter ^C when you want to quit");
+ System.out.print("Welcome to Arvados Java SDK.");
+ System.out.println("\nYou can use this example to call API methods interactively.");
+ System.out.println("\nTo make the calls, enter input data at the prompt.");
+ System.out.println("When entering parameters, you may enter a simple string or a well-formed json.");
+ System.out.println("For example to get a user you may enter: user, zzzzz-12345-67890");
+ System.out.println("Or to filter links, you may enter: filters, [[ \"name\", \"=\", \"can_manage\"]]");
+
+ System.out.println("\nEnter ^C when you want to quit");
// use configured env variables for API TOKEN, HOST and HOST_INSECURE
Arvados arv = new Arvados(apiName, apiVersion);
while (true) {
// prompt for resource
- System.out.println("\n\nEnter Resource name (for example users): ");
+ System.out.println("\n\nEnter Resource name (for example users)");
+ System.out.print("\n>>> ");
// read resource name
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String resourceName = in.readLine().trim();
// read method name
- System.out.println("\nEnter method name (for example get): ");
+ System.out.println("\nEnter method name (for example get)");
+ System.out.print("\n>>> ");
String methodName = in.readLine().trim();
// read method parameters
- System.out.println("\nEnter parameter name, value (for example uuid, uuid-value): ");
+ System.out.println("\nEnter parameter name, value (for example uuid, uuid-value)");
+ System.out.print("\n>>> ");
Map paramsMap = new HashMap();
String param = "";
try {
@@ -63,14 +71,14 @@ public class ArvadosSDKJavaExampleWithPrompt {
int index = param.indexOf(","); // first comma
String paramName = param.substring(0, index);
String paramValue = param.substring(index+1);
- System.out.println(paramName + " " + paramValue);
paramsMap.put(paramName.trim(), paramValue.trim());
- System.out.println("\nEnter parameter name, value (for example uuid, uuid-value): ");
+ System.out.println("\nEnter parameter name, value (for example uuid, uuid-value)");
+ System.out.print("\n>>> ");
} while (!param.isEmpty());
} catch (Exception e) {
System.out.println (e.getMessage());
- System.out.println ("\nStart over");
+ System.out.println ("\nSet up a new call");
continue;
}
@@ -92,7 +100,7 @@ public class ArvadosSDKJavaExampleWithPrompt {
}
} catch (Exception e){
System.out.println (e.getMessage());
- System.out.println ("\nStart over");
+ System.out.println ("\nSet up a new call");
}
}
}
diff --git a/sdk/java/src/test/java/org/arvados/sdk/java/ArvadosTest.java b/sdk/java/src/test/java/org/arvados/sdk/java/ArvadosTest.java
index 35b78f4..6f44da8 100644
--- a/sdk/java/src/test/java/org/arvados/sdk/java/ArvadosTest.java
+++ b/sdk/java/src/test/java/org/arvados/sdk/java/ArvadosTest.java
@@ -335,7 +335,7 @@ public class ArvadosTest {
String[] filters = new String[3];
filters[0] = "name";
- filters[1] = "is_a";
+ filters[1] = "=";
filters[2] = "can_manage";
params.put("filters", filters);
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list