You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2011/03/21 16:51:18 UTC
svn commit: r1083847 - in /chemistry/site/trunk/content/java:
developing/dev-known-repo-issues.mdtext
developing/dev-use-with-maven.mdtext download.mdtext
how-to/how-to-connect.mdtext how-to/how-to-tune-perfomance.mdtext
Author: fmui
Date: Mon Mar 21 15:51:17 2011
New Revision: 1083847
URL: http://svn.apache.org/viewvc?rev=1083847&view=rev
Log:
more clean up
Modified:
chemistry/site/trunk/content/java/developing/dev-known-repo-issues.mdtext
chemistry/site/trunk/content/java/developing/dev-use-with-maven.mdtext
chemistry/site/trunk/content/java/download.mdtext
chemistry/site/trunk/content/java/how-to/how-to-connect.mdtext
chemistry/site/trunk/content/java/how-to/how-to-tune-perfomance.mdtext
Modified: chemistry/site/trunk/content/java/developing/dev-known-repo-issues.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/developing/dev-known-repo-issues.mdtext?rev=1083847&r1=1083846&r2=1083847&view=diff
==============================================================================
--- chemistry/site/trunk/content/java/developing/dev-known-repo-issues.mdtext (original)
+++ chemistry/site/trunk/content/java/developing/dev-known-repo-issues.mdtext Mon Mar 21 15:51:17 2011
@@ -6,3 +6,27 @@ This is a loose collection of current kn
of existing CMIS repositories.
TODO
+
+
+## Connecting to SharePoint 2010
+
+While connecting via AtomPub is straight forward, connecting via Web Services is a bit tricky.
+
+### AtomPub
+
+The service document URL is `http://<host>/_vti_bin/cmis/rest/<SPList>?getrepositoryinfo`.
+Since this sends the password as plain text, HTTPS is strongly recommended.
+
+
+### Web Services
+
+1. Download the WSDL with a web browser and store it on your local disk. The WSDL URL is `http://<host>/_vti_bin/cmissoapwsdl.aspx?wsdl`.
+1. Provide `file://`... URLs to the downloaded WSDL for all OpenCMIS WSDL session parameters.
+1. Activate the OpenCMIS NTLM authentication provider.
+
+ :::java
+ parameters.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS, CmisBindingFactory.NTLM_AUTHENTICATION_PROVIDER);
+
+
+(The NTLM authentication provider uses [java.net.Authenticator](http://download-llnw.oracle.com/javase/6/docs/api/java/net/Authenticator.html)
+ under the hood. If this interferes with your environment, you are on your own.)
Modified: chemistry/site/trunk/content/java/developing/dev-use-with-maven.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/developing/dev-use-with-maven.mdtext?rev=1083847&r1=1083846&r2=1083847&view=diff
==============================================================================
--- chemistry/site/trunk/content/java/developing/dev-use-with-maven.mdtext (original)
+++ chemistry/site/trunk/content/java/developing/dev-use-with-maven.mdtext Mon Mar 21 15:51:17 2011
@@ -2,8 +2,6 @@ Title: Using Maven
# Using Maven
-## Use OpenCMIS with Maven
-
You can use OpenCMIS with [Maven](http://maven.apache.org/).
Check the latest version available by [searching the Apache repository](https://repository.apache.org/index.html#nexus-search;quick~opencmis).
Modified: chemistry/site/trunk/content/java/download.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/download.mdtext?rev=1083847&r1=1083846&r2=1083847&view=diff
==============================================================================
--- chemistry/site/trunk/content/java/download.mdtext (original)
+++ chemistry/site/trunk/content/java/download.mdtext Mon Mar 21 15:51:17 2011
@@ -3,7 +3,7 @@ Title: OpenCMIS Downloads
# OpenCMIS Downloads
<a name="OpenCMIS-0.2.0FullDownloadpage">
## Incubation Release 0.2.0 (2011-01-21)
-[Full Download page](http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/) and [Release Notes](https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&&pid=12310936&fixfor=12315134&sorter/field=priority&sorter/order=DESC)
+[Full Download page](http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/) and [Release Notes](https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&&pid=12310936&fixfor=12315134&sorter/field=priority&sorter/order=DESC). OpenCMIS is also available [via Maven](developing/dev-use-with-maven.html).
Package | zip | tar.gz |
------- | --- | ------ | -----
@@ -14,7 +14,6 @@ OpenCMIS Workbench | [Dow
OpenCMIS Docs | [Download] [11] | [Download] [12] | Documentation and JavaDoc.
OpenCMIS Sources | [Download] [9] | [Download] [10] | OpenCMIS source code.
-OpenCMIS is also available [via Maven](developing/dev-use-with-maven.html).
<a name="OpenCMIS-0.1.0FullDownloadpage">
## Incubation Release 0.1.0 (2010-09-17)
Modified: chemistry/site/trunk/content/java/how-to/how-to-connect.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/how-to/how-to-connect.mdtext?rev=1083847&r1=1083846&r2=1083847&view=diff
==============================================================================
--- chemistry/site/trunk/content/java/how-to/how-to-connect.mdtext (original)
+++ chemistry/site/trunk/content/java/how-to/how-to-connect.mdtext Mon Mar 21 15:51:17 2011
@@ -1,79 +1,17 @@
Title: Connecting to a repository
-# Connecting to a repository (Client)
+# Connecting to a repository
-This section explains how to use the client API to connect to a repository using the
-different bindings. Authentication, cookie handling and special considerations for
-MS Sharepoint are considered.
+In order to connect to a CMIS repository you have to [create a session](../examples/example-create-session.html).
-<a name="OpenCMISCookbook-ConnectingtoaCMISrepositorybyAtomPub"></a>
-## Connecting to a CMIS repository by AtomPub
-
- :::java
- // Default factory implementation of client runtime.
- SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
- Map<String, String> parameter = new HashMap<String, String>();
-
- // User credentials.
- parameter.put(SessionParameter.USER, "user");
- parameter.put(SessionParameter.PASSWORD, "password");
-
- // Connection settings.
- parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/service/cmis"); // URL to your CMIS server.
- // parameter.put(SessionParameter.REPOSITORY_ID, "myRepository"); // Only necessary if there is more than one repository.
- parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
-
- // Create session.
- Session session = null;
- try {
- // This supposes only one repository is available at the URL.
- Repository soleRepository = sessionFactory.getRepositories(parameter).get(0);
- session = soleRepository.createSession();
- }
- catch(CmisConnectionException e) {
- // The server is unreachable
- }
- catch(CmisRuntimeException e) {
- // The user/password have probably been rejected by the server.
- }
-
-
-
-## Connecting to SharePoint 2010
-
-While connecting via AtomPub is straight forward, connecting via Web
-Services is a bit tricky.
-
-### AtomPub
+A few repositories need [special treatment](../developing/dev-known-repo-issues.html).
-The service document URL is `http://<host>/_vti_bin/cmis/rest/<SPList>?getrepositoryinfo`.
-Since this sends the password as plain text, HTTPS is strongly recommended.
-
-
-### Web Services
-
-1. Download the WSDL with a web browser and store it on your local disk. The WSDL URL is `http://<host>/_vti_bin/cmissoapwsdl.aspx?wsdl`.
-1. Provide `file://`... URLs to the downloaded WSDL for all OpenCMIS WSDL session parameters.
-1. Activate the OpenCMIS NTLM authentication provider.
-
-
-
- :::java
- parameters.put(SessionParameter.AUTHENTICATION_PROVIDER_CLASS, CmisBindingFactory.NTLM_AUTHENTICATION_PROVIDER);
-
-
-(The NTLM authentication provider uses [java.net.Authenticator](http://download-llnw.oracle.com/javase/6/docs/api/java/net/Authenticator.html)
- under the hood. If this interferes with your environment, you are on your own.)
-
## Using Cookies
-Some repositories are sending HTTP cookies to maintain state (although CMIS
-is stateless) or accelerate authentication for subsequent calls. OpenCMIS
-ignores these cookies by default. The following code snippet activates
-cookies for your application and OpenCMIS.
-See [this page](http://java.sun.com/docs/books/tutorial/networking/cookies/cookiemanager.html)
- for details.
+Some repositories are sending HTTP cookies to maintain state (although CMIS is stateless) or accelerate authentication for subsequent calls. OpenCMIS
+ignores these cookies by default. The following code snippet activates cookies for your application and OpenCMIS.
+See [this page](http://java.sun.com/docs/books/tutorial/networking/cookies/cookiemanager.html) for details.
:::java
CookieManager cm = new CookieManager(null, CookiePolicy.ACCEPT_ALL);
Modified: chemistry/site/trunk/content/java/how-to/how-to-tune-perfomance.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/how-to/how-to-tune-perfomance.mdtext?rev=1083847&r1=1083846&r2=1083847&view=diff
==============================================================================
--- chemistry/site/trunk/content/java/how-to/how-to-tune-perfomance.mdtext (original)
+++ chemistry/site/trunk/content/java/how-to/how-to-tune-perfomance.mdtext Mon Mar 21 15:51:17 2011
@@ -9,7 +9,7 @@ possible. In order to be effective, you
object for each call decreases the performance drastically. Session objects and CMIS objects are thread-safe and
can/should be reused across threads.
-OperationContext objects control which data (properties, renditions, relationships, allowable actions, ACLs,
+[OperationContext](../developing/dev-operation-context.html) objects control which data (properties, renditions, relationships, allowable actions, ACLs,
policies, etc.) is requested from the repository. The more data is requested, the longer it takes to transmit and
process it. By default, OpenCMIS fetches more data than most applications need. Tuning the OperationContext,
and especially the property filter, can result in a significant performance improvement.
@@ -22,9 +22,7 @@ If this is the case, it returns the obje
There are multiple ways to deal with that:
-* Refresh the object data that is returned from `getObject()`.
-
-
+* Refresh the object data that is returned from `getObject()`:
:::java
CmisObject object = session.getObject(id);
@@ -32,17 +30,13 @@ There are multiple ways to deal with tha
object.refreshIfOld(60 * 1000); // ... or refreshes the object only if the data is older than a minute
-* Turn off the session cache completely.
-
-
+* Turn off the session cache completely:
:::java
session.getDefaultContext().setCacheEnabled(false);
-* Turn off caching for this `getObject()` call.
-
-
+* Turn off caching for this `getObject()` call:
:::java
OperationContext oc = session.createOperationContext();
@@ -51,9 +45,7 @@ There are multiple ways to deal with tha
CmisObject object = session.getObject(id, oc);
-* Clear the session cache (not recommended).
-
-
+* Clear the session cache (not recommended!):
:::java
session.clear();