chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmpas...@apache.org
Subject svn commit: r1390490 - /chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/README
Date Wed, 26 Sep 2012 13:57:01 GMT
Author: jmpascal
Date: Wed Sep 26 13:57:01 2012
New Revision: 1390490

URL: http://svn.apache.org/viewvc?rev=1390490&view=rev
Log:
Add Readme File to the project to explain first steps.

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/README

Added: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/README
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/README?rev=1390490&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/README
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/README
Wed Sep 26 13:57:01 2012
@@ -0,0 +1,128 @@
+OpenCMIS Android Client
+===========================
+
+The OpenCMIS Android Client provides a collection of methods to access and manage CMIS Repository.
+
+
+Android Version Supported
+-------------------------
+Previous versions of Android don’t contain all dependencies required to run and use
OpenCMIS Android client.  
+It’s only since Android 2.3 (aka Gingerbread) everything works. 
+In other terms, Android client supports Android 2.3 and above
+
+-------------------------
+ !!! IMPORTANT NOTE !!!
+-------------------------
+OpenCMIS Android Client is a SYNCHRONOUS library ! 
+It's highly recommended that you encapsulate all CMIS operations in background thread. 
+In Android It’s possible to use
+•	Services
+•	Loaders
+•	AsyncTask
+•	Thread/Handler
+
+For more information on Thread and background task : <http://developer.android.com/guide/components/processes-and-threads.html>
+
+
+Importing the Android OpenCMIS Client into your Android Project
+---------------------------------------------------------------
+
+The Android OpenCMIS Client requires SLF4J for android.
+Download it from here: <http://www.slf4j.org/android/>
+
+Put the Android OpenCMIS Client Jar and SLF4J jar into your Android project libs folder.

+Now you're ready to use OpenCMIS inside your project.
+
+For more information on Project libs folder : <http://tools.android.com/recent/dealingwithdependenciesinandroidprojects>
+
+Importing the Android OpenCMIS Client with Maven 
+------------------------------------------------
+If you use Maven to build your Android Project, it's possible to add this library as Maven
dependency.
+
+Add to your pom project : 
+
+<dependencies>
+	...
+	<dependency>
+		<groupId>com.google.android</groupId>
+		<artifactId>annotations</artifactId>
+	</dependency>
+	<dependency>
+		<groupId>org.apache.chemistry.opencmis</groupId>
+		<artifactId>chemistry-opencmis-android-client</artifactId>
+		<version>0.8.0</version>
+		<exclusions>
+			<exclusion>
+				<groupId>org.slf4j</groupId>
+				<artifactId>slf4j-api</artifactId>
+			</exclusion>
+		</exclusions>
+	</dependency>
+	<dependency>
+		<groupId>org.slf4j</groupId>
+		<artifactId>slf4j-android</artifactId>
+		<version>1.6.1-RC1</version>
+	</dependency>
+	...
+</dependencies>
+
+
+Code sample
+-----------
+This code sample illustrates how to display in a simple TextView a list of folder children.
+  
+public class FirstOpenCMISActivity extends Activity {
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_main);
+        new FirstOpenCMISAsyncTask().execute();
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        getMenuInflater().inflate(R.menu.activity_main, menu);
+        return true;
+    }
+    
+    
+    private class FirstOpenCMISAsyncTask extends AsyncTask<Void, Void, String>
+    {
+    	@Override
+    	protected String doInBackground(Void... arg0) {
+    		
+    		SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
+    		Map<String, String> parameter = new HashMap<String, String>();
+    		parameter.put(SessionParameter.USER, "admin");
+    		parameter.put(SessionParameter.PASSWORD, "admin");
+    		parameter.put(SessionParameter.ATOMPUB_URL, "http://192.168.1.100:8080/inmemory/atom/");
+    		parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
+    		Repository repository = sessionFactory.getRepositories(parameter).get(0);
+    		parameter.put(SessionParameter.REPOSITORY_ID, repository.getId());
+    		Session session = sessionFactory.createSession(parameter);
+    		
+    		String listChildren = "";
+    		Folder mediaFolder = (Folder) session.getObjectByPath("/media");
+    		ItemIterable<CmisObject> children = mediaFolder.getChildren();
+    	    for (CmisObject o : children) {
+    	    	listChildren += o.getName() + " - " + o.getType().getDisplayName() + " - " + o.getCreatedBy()
+ "\b\n";
+    	    }
+    		
+    		return listChildren;
+    	}
+
+    	@Override
+    	protected void onPostExecute(String result) {
+    		TextView tv = (TextView) (FirstOpenCMISActivity.this).findViewById(R.id.opencmis_text);
+    		tv.setText(result);
+    	}
+    }
+}
+
+
+License
+-------
+
+Apache License, Version 2.0
+Please see <http://www.apache.org/licenses/LICENSE-2.0>.



Mime
View raw message