Skip to content
This repository
Browse code

Update README, add json_simple-1.1.jar for lib (not in maven repo)

  • Loading branch information...
commit 2a11ac028e517a2a026c6468fd123c7d9e529474 1 parent 54f2281
Hoat Le authored May 20, 2011
39  README
@@ -6,13 +6,46 @@ http://exoplatform.org/company/en/platform/exo-extended-services/exo-social
6 6
 1. How to build
7 7
 
8 8
 * Dependencies:
9  
-  + json_simple-1.1.1 (compiled)
  9
+  + json_simple-1.1.1 (compiled): http://code.google.com/p/json-simple/
10 10
 
11 11
   + junit-4.8.2 (test)
12 12
 
13 13
 
14 14
 * Use maven, tested on maven-3.x, should work well on maven-2.x.
15  
-* Use json-simple library which is not on maven repositiy, need to install this artifact on local repositiy.
  15
+* Use json-simple library which is not on maven repository, need to install this artifact on local repository.
16 16
 
17  
-  + Install json-simple
  17
+  + cd to lib, run this maven command:
  18
+  mvn install:install-file -Dfile=json_simple-1.1.jar -DgroupId=com.google.code -DartifactId=json_simple -Dversion=1.1 -Dpackaging=jar
  19
+
  20
+* Use this command to build project: mvn clean install
  21
+
  22
+
  23
+ 2. How to use this library
  24
+
  25
+ * Sample code:
  26
+
  27
+    //Create the client context object
  28
+    ClientContext clientContext = new ClientContextImpl();
  29
+    //AuthSchema can be any supported auth schema, currently basic auth;
  30
+    // later, must use OAuth
  31
+    AuthSchema basicAuthSchema = new BasicAuthSchemaImpl();
  32
+    basicAuthSchema.setUsername("demo");
  33
+    basicAuthSchema.setPassword("gtn");
  34
+    clientContext.setAuthSchema(basicAuthSchema);
  35
+    clientContext.setHost("http://localhost");
  36
+    clientContext.setPort("8080"); //80 as default
  37
+    clientContext.setPortalContainerName("socialdemo");
  38
+    clientContext.setRestContextName("rest-socialdemo");
  39
+    clientContext.setRestVersion("1");
  40
+
  41
+    //Set client context to Client object
  42
+
  43
+    Client client = new ClientImpl();
  44
+    client.setClientContext(clientContext);
  45
+
  46
+    //it's all for Client to work, now just get the Service to use
  47
+    ActivityService activityService = client.getActivityService();
  48
+
  49
+    IdentityService identityService = client.getIdentityService();
  50
+    //...
18 51
 
BIN  lib/json_simple-1.1.jar
Binary file not shown

0 notes on commit 2a11ac0

Please sign in to comment.
Something went wrong with that request. Please try again.