You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by je...@apache.org on 2011/03/18 12:57:44 UTC
svn commit: r1082878 [2/3] - in /chemistry/site/trunk: content/internal/
content/java/ content/java/developing/ content/java/developing/client/
content/java/developing/repositories/ content/java/developing/tools/
content/java/examples/ content/java/how...
Added: chemistry/site/trunk/content/java/developing/dev-use-without-maven.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/developing/dev-use-without-maven.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/developing/dev-use-without-maven.mdtext (added)
+++ chemistry/site/trunk/content/java/developing/dev-use-without-maven.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,4 @@
+Title: Without using Maven
+
+# Without using Maven
+
Added: chemistry/site/trunk/content/java/developing/opencmis-client-api-class-diagram.png
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/developing/opencmis-client-api-class-diagram.png?rev=1082878&view=auto
==============================================================================
Binary file - no diff available.
Propchange: chemistry/site/trunk/content/java/developing/opencmis-client-api-class-diagram.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: chemistry/site/trunk/content/java/developing/repositories/dev-repositories-fileshare.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/developing/repositories/dev-repositories-fileshare.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/developing/repositories/dev-repositories-fileshare.mdtext (added)
+++ chemistry/site/trunk/content/java/developing/repositories/dev-repositories-fileshare.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,61 @@
+Title: OpenCMIS Repositories
+
+# OpenCMIS Fileshare Repository
+
+<a name="OpenCMISFileShareRepository-OpenCMISFileShareRepository"></a>
+
+**This repository is not intended for production use!**
+
+The FileShare repository uses the file system as its back-end store and
+provides read/write access to content and metadata. In other words, it puts
+a CMIS interface on top of your file system.
+
+The repository is restricted by the capabilities of the file system and
+therefore does not support relationships, policies, document versions,
+multi-filing, un-filing and query.
+
+By default it provides a repository "test" that uses your home directory as
+the repository root. It requires authentication. A user "test" with the
+password "test" is pre-configured.
+
+
+<a name="OpenCMISFileShareRepository-BuildandDeploytheTestRepository"></a>
+## Build and Deploy the Test Repository
+<br/>
+
+1. Follow this guide: [Build OpenCMIS](../../how-to/how-to-build.html).
+1. A ready-to-use WAR file should now exist in `/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/target`.
+1. Deploy the WAR file to your favorite servlet engine.
+1. AtomPub endpoint: `http://<host>:<port>/<context>/atom` <br/>
+ Web Services endpoint: `http://<host>:<port>/<context>/services/RepositoryService`
+
+
+<a name="OpenCMISFileShareRepository-ConfiguretheRepository"></a>
+## Configure the Repository
+
+The configuration file in the WAR file is
+`/WEB-INF/classes/repository.properties`.
+
+ :::properties
+ # Don't touch this line
+ class=org.apache.chemistry.opencmis.fileshare.FileShareServiceFactory
+
+ # Login configuration
+ # login.<no> = <user>:<password>
+ login.1 = test:test
+ login.2 = cmisuser:password
+ login.3 = reader:reader
+
+ # Type defintions (see example-type.xml)
+ # type.<no> = <absolute path to type definition XML file>
+ type.1 = /home/cmistest/type1.xml
+ type.2 = /home/cmistest/type2.xml
+
+ # Repository configuration
+ # repository.<repositoryId> = <absolute path to repository root folder>
+ # repository.<repositoryId>.readwrite = <comma separated list of login names>
+ # repository.<repositoryId>.readonly = <comma separated list of login names>
+ repository.test = /home/cmistest/myreproot
+ repository.test.readwrite = test, cmisuser
+ repository.test.readonly = reader
+
Added: chemistry/site/trunk/content/java/developing/repositories/dev-repositories-inmemory.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/developing/repositories/dev-repositories-inmemory.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/developing/repositories/dev-repositories-inmemory.mdtext (added)
+++ chemistry/site/trunk/content/java/developing/repositories/dev-repositories-inmemory.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,114 @@
+Title: OpenCMIS Repositories
+
+# OpenCMIS InMemory Repository
+<a name="OpenCMISInMemoryRepository-OpenCMISInMemoryRepository"></a>
+
+This repository is *obviously* not intended for production use!
+
+The OpenCMIS In-Memory Repository is an implementation of a CMIS repository
+that holds content and metadata in memory. Therefore, all data stored in
+the repository is lost after each restart. This implementation has two main
+purposes:
+
+1. Provide a fast backend for testing purposes without any additional
+dependencies or configuration.
+1. Provide a sample implementation for the server interface of OpenCMIS.
+
+
+<a name="OpenCMISInMemoryRepository-Status"></a>
+## Status
+
+The code is unstable and under development. Expect any interface to change at any time.
+The following features are implemented:
+
+ * Type System and Repository Service
+ * Navigation
+ * Object Service
+ * Versioning
+
+Not supported are currently:
+
+ * Query
+ * Relationships
+ * ACLs
+ * Policies
+ * Renditions
+ * Unfiling
+
+
+<a name="OpenCMISInMemoryRepository-BuildandDeploytheRepository"></a>
+## Build and Deploy the Repository
+<br/>
+
+1. Follow this guide: [Build OpenCMIS](../../how-to/how-to-build.html)
+1. A ready-to-use WAR file should now exist in `/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/target`.
+1. Deploy the WAR file to your favorite servlet engine.
+1. AtomPub endpoint: `http://<host>:<port>/<context>/atom`,<br/>
+ Web Services endpoint: `http://<host>:<port>/<context>/services/RepositoryService`
+
+
+<a name="OpenCMISInMemoryRepository-ConfiguretheRepository"></a>
+## Configure the Repository
+
+The CMIS specification does not currently provide support for creating a
+repository or administrative capabilities such as the creation of type
+definitions.
+
+The in-memory repository therefore provides settings that allows the server
+to bootstrap itself, so that on successful startup, the server is in a
+usable state. These settings include the repository id, its type
+definitions and an initial folder/document data set.
+
+The types to be made available must be provided in a Java class as code. By
+default, the class
+`org.apache.chemistry.opencmis.inmemory.types.DefaultTypeSystemCreator.java`
+is provided. You can take this as an example if you want to provide your
+own custom types. Such a class must implement the
+`org.apache.chemistry.opencmis.inmemory.TypeCreator` interface which
+consists of a single method that returns a list of `TypeDefinition`
+objects. This method will be called once during startup.
+
+Some clients just support read-only access. The in-memory repository
+supports such clients by providing the possibility to fill a repository on
+start-up with data (folders and documents). The folder and document types
+to be used can be configured and also the number of documents and folders
+that are created. Those configuration parameters start with the prefix
+`RepositoryFiller`.
+
+Bootstrap settings are set in the repository.properties file
+(`/WEB-INF/classes/repository.properties`).
+
+ :::properties
+ # In Memory Settings
+ # The class that enables the in-memory repository as server implementation
+ class=org.apache.chemistry.opencmis.inmemory.server.InMemoryServiceFactoryImpl
+
+ # A repository that is created on start-up
+ InMemoryServer.RepositoryId=A1
+
+ # The class that used to initialize the type system (creates all types that are available)
+ InMemoryServer.TypesCreatorClass=org.apache.chemistry.opencmis.inmemory.types.DefaultTypeSystemCreator
+
+ # settings to initialize a repository with data on start-up
+ # enable or disable
+ RepositoryFiller.Enable=true
+ # Type id of documents that are created
+ RepositoryFiller.DocumentTypeId=ComplexType
+ # Type id of folders that are created
+ RepositoryFiller.FolderTypeId=cmis:folder
+ # Number of documents created per folder
+ RepositoryFiller.DocsPerFolder=3
+ # Number of folders created per folder
+ RepositoryFiller.FolderPerFolder=2
+ # number of folder levels created (depth of hierarchy)
+ RepositoryFiller.Depth=3
+ # Size of content for documents (0=do not create content), default=0
+ RepositoryFiller.ContentSizeInKB=32
+ # properties to set for a document
+ RepositoryFiller.DocumentProperty.0=StringProp
+ #RepositoryFiller.DocumentProperty.1=StringPropMV
+ # properties to set for a folder
+ #RepositoryFiller.FolderProperty.0=StringFolderProp
+
+<br/>
+
Added: chemistry/site/trunk/content/java/developing/repositories/dev-repositories-jcr.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/developing/repositories/dev-repositories-jcr.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/developing/repositories/dev-repositories-jcr.mdtext (added)
+++ chemistry/site/trunk/content/java/developing/repositories/dev-repositories-jcr.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,33 @@
+Title: OpenCMIS JCR Repository
+Notice: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ .
+ http://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+Title: OpenCMIS JCR Repository
+Breadcrumb: opencmis:OpenCMIS
+
+# OpenCMIS JCR Repository
+
+The OpenCMIS JCR Repository component is a bridge between the CMIS
+and JCR standards. It makes content stored in a JCR repository
+available to CMIS clients.
+
+## Status
+
+The code is still under development, and changes should be expected
+at any time. See [CMIS-325][] for the latest status.
+
+[CMIS-325]: https://issues.apache.org/jira/browse/CMIS-325
\ No newline at end of file
Added: chemistry/site/trunk/content/java/developing/tools/dev-tools-browser.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/developing/tools/dev-tools-browser.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/developing/tools/dev-tools-browser.mdtext (added)
+++ chemistry/site/trunk/content/java/developing/tools/dev-tools-browser.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,23 @@
+Title: OpenCMIS Browser
+
+# OpenCMIS Browser
+
+The CMIS Browser is a simple web based tool to browse CMIS enabled
+repositories that support the AtomPub binding. It sits between the web
+browser of the end-user and the CMIS repository. It applies stylesheets to
+the Atom entries and feeds that repository returns and creates HTML pages
+that enable the end-user to navigate through the repository.
+
+The CMIS Browser consists of a small WAR file that doesn't require any
+configuration. Deploy it to a servlet engine and type
+`http://<host>/<context>/browse` in your web browser. Enter the URL of
+the AtomPub service document into the input box and start browsing.
+
+
+## Build and Deploy the CMIS Browser
+
+1. [Build OpenCMIS](../../how-to/how-to-build.html)
+1. A ready-to-use WAR file should now exist in `/chemistry-opencmis-test/chemistry-opencmis-test-browser-app/target`.
+1. Deploy the WAR file to your favorite servlet engine.
+
+
Added: chemistry/site/trunk/content/java/developing/tools/dev-tools-workbench.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/developing/tools/dev-tools-workbench.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/developing/tools/dev-tools-workbench.mdtext (added)
+++ chemistry/site/trunk/content/java/developing/tools/dev-tools-workbench.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,77 @@
+Title: CMIS Workbench
+
+# CMIS Workbench
+
+CMIS Workbench is CMIS desktop client for developers. It's a repository
+browser and an interactive testbed for the OpenCMIS client API.
+
+<a name="CMISWorkbench-BuildtheCMISWorkbench"></a>
+## Build the CMIS Workbench
+
+1. [Build the OpenCMIS Client Libraries](../../how-to/how-to-build.html).
+1. CMIS Workbench zip and tar.gz files should now exist in `/target`.
+1. Unpack one of them into an empty directory.
+1. Run `workbench.sh` (UNIX) or `workbench.bat` (Windows)
+
+
+<a name="CMISWorkbench-DownloadtheCMISWorkbench"></a>
+## Download the CMIS Workbench
+
+You can download the [latest release](http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/chemistry-opencmis-workbench-0.2.0-incubating-full.zip)
+ or a [nightly build](https://hudson.apache.org/hudson/job/Chemistry%20-%20OpenCMIS%20-%20install/lastSuccessfulBuild/org.apache.chemistry.opencmis$chemistry-opencmis-workbench/)
+ with the latest fixes and features.
+
+
+<a name="CMISWorkbench-PropertiesReference"></a>
+## Properties Reference
+
+The CMIS Workbench can be configured through system properties or
+additional properties in the expert login dialog.
+
+<a name="CMISWorkbench-Logindialog"></a>
+### Login dialog
+
+System Property | Function
+------------------------------|---------------------------------------------------
+cmis.workbench.url | preset URL
+cmis.workbench.user | preset user name
+cmis.workbench.password | preset password
+cmis.workbench.binding | preset binding (atompub/webservices)
+cmis.workbench.authentication | preset authentication method (none/standard/ntlm)
+cmis.workbench.compression | preset compression (on/off)
+
+<a name="CMISWorkbench-Folderoperationcontext"></a>
+### Folder operation context
+
+System Property | Function
+-----------------------------------------------|-----------
+cmis.workbench.folder.filter |
+cmis.workbench.folder.includeAcls |
+cmis.workbench.folder.includeAllowableActions |
+cmis.workbench.folder.includePolicies |
+cmis.workbench.folder.includeRelationships |
+cmis.workbench.folder.renditionFilter |
+cmis.workbench.folder.orderBy |
+cmis.workbench.folder.maxItemsPerPage |
+
+
+
+<a name="CMISWorkbench-Objectoperationcontext"></a>
+### Object operation context
+
+System Property | Function
+-----------------------------------------------|-----------
+cmis.workbench.object.filter |
+cmis.workbench.object.includeAcls |
+cmis.workbench.object.includeAllowableActions |
+cmis.workbench.object.includePolicies |
+cmis.workbench.object.includeRelationships |
+cmis.workbench.object.renditionFilter |
+
+
+<a name="CMISWorkbench-Others"></a>
+### Others
+
+System Property | Function
+--------------------------------------------|-------------------------------------------
+cmis.workbench.acceptSelfSignedCertificates | disable SSL certificate check (true/false)
Added: chemistry/site/trunk/content/java/download.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/download.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/download.mdtext (added)
+++ chemistry/site/trunk/content/java/download.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,45 @@
+Title: OpenCMIS Downloads
+
+# OpenCMIS Downloads
+<a name="OpenCMIS-0.2.0FullDownloadpage">
+## Incubation Release 0.2.0 [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)
+
+Package | zip | tar.gz
+------- | --- | ------
+OpenCMIS Client with dependencies | [Download] [19] | [Download] [20]
+OpenCMIS Server Framework | [Download] [17] | [Download] [18]
+OpenCMIS Server Webapp | [Download] [15] | [Download] [16]
+OpenCMIS Workbench | [Download] [13] | [Download] [14]
+OpenCMIS Docs | [Download] [11] | [Download] [12]
+OpenCMIS Sources | [Download] [9] | [Download] [10]
+
+<a name="OpenCMIS-0.1.0FullDownloadpage">
+## Incubation Release 0.1.0 [Full Download page](http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.1.0-incubating/)
+Package | zip | tar.gz
+------- | --- | ------
+OpenCMIS Client with dependencies | [Download] [7] | [Download] [8]
+OpenCMIS Server Webapp | [Download] [5] | [Download] [6]
+OpenCMIS Docs | [Download] [3] | [Download] [4]
+OpenCMIS Sources | [Download] [1] | [Download] [2]
+
+[1]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.1.0-incubating/chemistry-opencmis-0.1.0-incubating-source-release.zip
+[2]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.1.0-incubating/chemistry-opencmis-0.1.0-incubating-source-release.tar.gz
+[3]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.1.0-incubating/chemistry-opencmis-0.1.0-incubating-docs.zip
+[4]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.1.0-incubating/chemistry-opencmis-0.1.0-incubating-docs.tar.gz
+[5]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.1.0-incubating/chemistry-opencmis-dist-0.1.0-incubating-server-webapps.zip
+[6]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.1.0-incubating/chemistry-opencmis-dist-0.1.0-incubating-server-webapps.tar.gz
+[7]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.1.0-incubating/chemistry-opencmis-client-impl-0.1.0-incubating-with-dependencies.zip
+[8]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.1.0-incubating/chemistry-opencmis-client-impl-0.1.0-incubating-with-dependencies.tar.gz
+
+[9]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/chemistry-opencmis-0.2.0-incubating-source-release.zip
+[10]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/chemistry-opencmis-0.2.0-incubating-source-release.tar.gz
+[11]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/chemistry-opencmis-0.2.0-incubating-docs.zip
+[12]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/chemistry-opencmis-0.2.0-incubating-docs.tar.gz
+[13]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/chemistry-opencmis-workbench-0.2.0-incubating-full.zip
+[14]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/chemistry-opencmis-workbench-0.2.0-incubating-full.tar.gz
+[15]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.1.0-incubating/chemistry-opencmis-dist-0.1.0-incubating-server-webapps.zip
+[16]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.1.0-incubating/chemistry-opencmis-dist-0.1.0-incubating-server-webapps.tar.gz
+[17]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/chemistry-opencmis-dist-0.2.0-incubating-server.zip
+[18]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/chemistry-opencmis-dist-0.2.0-incubating-server.tar.gz
+[19]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/chemistry-opencmis-client-impl-0.2.0-incubating-with-dependencies.zip
+[20]: http://www.apache.org/dyn/closer.cgi/incubator/chemistry/opencmis/0.2.0-incubating/chemistry-opencmis-client-impl-0.2.0-incubating-with-dependencies.tar.gz
Added: chemistry/site/trunk/content/java/examples/example-connect-dotnet.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-connect-dotnet.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-connect-dotnet.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-connect-dotnet.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,219 @@
+Title: Connecting from a .Net client
+
+# Connecting from a .Net client via the Web Services binding
+
+This is a very simple C# example that demonstrates how to connect to an
+OpenCMIS server via the Web Services binding. Please note that .Net only
+allows UsernameTokens over HTTPS.
+(See also [DotCMIS](../../dotnet/dotcmis.html)).
+
+ :::C#
+ using System;
+ using System.ServiceModel;
+ using OpenCMISClient.OpenCMISServer;
+ using System.Net;
+
+ namespace OpenCMISClient
+ {
+ class CMISClientDemo
+ {
+ public void DoStuff()
+ {
+ try
+ {
+ // uncomment the next line if you are using a self signed SSL certificate
+ // ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
+
+ // get hold of the services
+ RepositoryServicePortClient repService = GetRepositoryService("https://localhost:8443/opencmis/services/RepositoryService?wsdl", "test", "test");
+ NavigationServicePortClient navService = GetNavigationService("https://localhost:8443/opencmis/services/NavigationService?wsdl", "test", "test");
+ ObjectServicePortClient objService = GetObjectService("https://localhost:8443/opencmis/services/ObjectService?wsdl", "test", "test");
+
+ // get the list of repositories
+ cmisRepositoryEntryType[](.html) repositoryEntries = repService.getRepositories(null);
+ foreach (cmisRepositoryEntryType repositoryEntry in repositoryEntries)
+ {
+ Console.WriteLine("Repository: " + repositoryEntry.repositoryName + " (" + repositoryEntry.repositoryId + ")");
+
+ // get repository info
+ cmisRepositoryInfoType repositoryInfo = repService.getRepositoryInfo(repositoryEntry.repositoryId, null);
+ Console.WriteLine(" Info:");
+ Console.WriteLine(" Description: " + repositoryInfo.repositoryDescription);
+ Console.WriteLine(" Product: " + repositoryInfo.vendorName + " / " + repositoryInfo.productName + " " + repositoryInfo.productVersion);
+
+ // get all base types of the repository
+ cmisTypeDefinitionListType typeList = repService.getTypeChildren(repositoryInfo.repositoryId, null, true, null, null, null);
+ Console.WriteLine(" Types:");
+ foreach (cmisTypeDefinitionType type in typeList.types)
+ {
+ Console.WriteLine(" " + type.displayName + " (" + type.id + ")");
+ }
+
+ // get all root folder children
+ cmisObjectInFolderListType children = navService.getChildren(repositoryInfo.repositoryId, repositoryInfo.rootFolderId, null, null, true, null, null, false, null, null, null);
+ Console.WriteLine(" Root folder:");
+ foreach (cmisObjectInFolderType objInFolder in children.objects)
+ {
+ cmisObjectType obj = objInFolder.@object;
+ String objId = GetIdPropertyValue(obj.properties, "cmis:objectId");
+ Console.WriteLine(" Name: " + GetStringPropertyValue(obj.properties, "cmis:name") + " (" + objId + ")");
+ Console.WriteLine(" Type: " + GetIdPropertyValue(obj.properties, "cmis:baseTypeId"));
+ Console.WriteLine(" Created by: " + GetStringPropertyValue(obj.properties, "cmis:createdBy"));
+ Console.WriteLine(" Creation date: " + GetDateTimePropertyValue(obj.properties, "cmis:creationDate"));
+
+ // if it is a document, get the size and the content
+ String baseType = GetIdPropertyValue(obj.properties, "cmis:baseTypeId");
+ if ("cmis:document".Equals(baseType))
+ {
+ // get the size
+ Int64? size = GetIntegerPropertyValue(obj.properties, "cmis:contentStreamLength");
+ Console.WriteLine(" Size: " + size);
+
+ // get the content
+ cmisContentStreamType content = objService.getContentStream(repositoryInfo.repositoryId, objId, null, null, null, null);
+ Console.WriteLine(" MIME type: " + content.mimeType);
+
+ // get the "stream"
+ byte[]bytes = content.stream; // really streaming requires some more work
+ Console.WriteLine(" Stream: " + (bytes.Length == size ? "ok" : "mismatch"));
+ }
+ }
+
+ }
+ }
+ catch (FaultException<cmisFaultType> fe)
+ {
+ Console.WriteLine("CMIS Exception: " + fe.Detail.message);
+ Console.WriteLine("Type: " + fe.Detail.type);
+ Console.WriteLine("Code: " + fe.Detail.code);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("Exception: " + e.Message);
+ Console.WriteLine(e.StackTrace);
+ }
+
+ Console.ReadKey();
+ }
+
+ public RepositoryServicePortClient GetRepositoryService(String wsdlUrl, String user, String password)
+ {
+ BasicHttpBinding binding = new BasicHttpBinding();
+ binding.MessageEncoding = WSMessageEncoding.Mtom;
+ binding.Security.Mode = BasicHttpSecurityMode.TransportWithMessageCredential;
+
+ RepositoryServicePortClient service = new RepositoryServicePortClient(binding, new EndpointAddress(wsdlUrl));
+
+ service.ClientCredentials.UserName.UserName = user;
+ service.ClientCredentials.UserName.Password = password;
+
+ return service;
+ }
+
+ public NavigationServicePortClient GetNavigationService(String wsdlUrl, String user, String password)
+ {
+ BasicHttpBinding binding = new BasicHttpBinding();
+ binding.MessageEncoding = WSMessageEncoding.Mtom;
+ binding.Security.Mode = BasicHttpSecurityMode.TransportWithMessageCredential;
+
+ NavigationServicePortClient service = new
+ NavigationServicePortClient(binding, new EndpointAddress(wsdlUrl));
+
+ service.ClientCredentials.UserName.UserName = user;
+ service.ClientCredentials.UserName.Password = password;
+
+ return service;
+ }
+
+ public ObjectServicePortClient GetObjectService(String wsdlUrl, String user, String password)
+ {
+ BasicHttpBinding binding = new BasicHttpBinding();
+ binding.MessageEncoding = WSMessageEncoding.Mtom;
+ binding.Security.Mode = BasicHttpSecurityMode.TransportWithMessageCredential;
+ binding.TransferMode = TransferMode.Streamed;
+
+ ObjectServicePortClient service = new ObjectServicePortClient(binding, new EndpointAddress(wsdlUrl));
+
+ service.ClientCredentials.UserName.UserName = user;
+ service.ClientCredentials.UserName.Password = password;
+
+ return service;
+ }
+
+ public String GetStringPropertyValue(cmisPropertiesType properties, String id)
+ {
+ String result = null;
+
+ foreach (cmisProperty property in properties.Items)
+ {
+ if (property.propertyDefinitionId.Equals(id))
+ {
+ if (property is cmisPropertyString)
+ {
+ result = ((cmisPropertyString)property).value[0](0.html);
+ }
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ public String GetIdPropertyValue(cmisPropertiesType properties, String id)
+ {
+ String result = null;
+
+ foreach (cmisProperty property in properties.Items)
+ {
+ if (property.propertyDefinitionId.Equals(id))
+ {
+ if (property is cmisPropertyId)
+ {
+ result = ((cmisPropertyId)property).value[0](0.html);
+ }
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ public Int64? GetIntegerPropertyValue(cmisPropertiesType properties, String id)
+ {
+ Int64? result = null;
+
+ foreach (cmisProperty property in properties.Items)
+ {
+ if (property.propertyDefinitionId.Equals(id))
+ {
+ if (property is cmisPropertyInteger)
+ {
+ result = Int64.Parse(((cmisPropertyInteger)property).value[0](0.html));
+ }
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ public DateTime? GetDateTimePropertyValue(cmisPropertiesType properties, String id)
+ {
+ DateTime? result = null;
+
+ foreach (cmisProperty property in properties.Items)
+ {
+ if (property.propertyDefinitionId.Equals(id))
+ {
+ if (property is cmisPropertyDateTime)
+ {
+ result = ((cmisPropertyDateTime)property).value[0](0.html);
+ }
+ break;
+ }
+ }
+
+ return result;
+ }
+ }
+ }
Added: chemistry/site/trunk/content/java/examples/example-create-session.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-create-session.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-create-session.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-create-session.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,55 @@
+Title: Create a session
+
+# Create a session
+This example explains the first steps required in each client application:
+How to create a session and connect to a repository.
+
+## Session Creation - AtomPub Binding
+<DIV class="codeHeader">Opening a Atom Pub Connection</DIV>
+
+ :::java
+ // default factory implementation of client runtime
+ SessionFactory f = SessionFactoryImpl.newInstance();
+ Map<String, String> parameter = new HashMap<String, String>();
+
+ // user credentials
+ parameter.put(SessionParameter.USER, "Otto");
+ parameter.put(SessionParameter.PASSWORD, "****");
+
+ // connection settings
+ parameter.put(SessionParameter.ATOMPUB_URL, "http://<host>:<port>/cmis/atom");
+ parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
+ parameter.put(SessionParameter.REPOSITORY_ID, "myRepository");
+
+ // create session
+ Session s = f.createSession(parameter);
+
+
+<a name="OpenCMISClientAPI-SessionCreation-WebServicesBinding"></a>
+## Session Creation - Web Services Binding
+<DIV class="codeHeader">Opening a Web Services Connection</DIV>
+
+ ::java
+ // default factory implementation of client runtime
+ SessionFactory f = SessionFactoryImpl.newInstance();
+ Map<String, String> parameter = new HashMap<String, String>();
+
+ // user credentials
+ parameter.put(SessionParameter.USER, "Otto");
+ parameter.put(SessionParameter.PASSWORD, "****");
+
+ // connection settings
+ parameter.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());
+ parameter.put(SessionParameter.REPOSITORY_ID, "myRepository");
+ parameter.put(SessionParameter.WEBSERVICES_ACL_SERVICE, "http://<host>:<port>/cmis/services/ACLService?wsdl");
+ parameter.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, "http://<host>:<port>/cmis/services/DiscoveryService?wsdl");
+ parameter.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, "http://<host>:<port>/cmis/services/MultiFilingService?wsdl");
+ parameter.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, "http://<host>:<port>/cmis/services/NavigationService?wsdl");
+ parameter.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, "http://<host>:<port>/cmis/services/ObjectService?wsdl");
+ parameter.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, "http://<host>:<port>/cmis/services/PolicyService?wsdl");
+ parameter.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, "http://<host>:<port>/cmis/services/RelationshipService?wsdl");
+ parameter.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, "http://<host>:<port>/cmis/services/RepositoryService?wsdl");
+ parameter.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, "http://<host>:<port>/cmis/services/VersioningService?wsdl");
+
+ // create session
+ Session s = f.createSession(parameter);
Added: chemistry/site/trunk/content/java/examples/example-create-update.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-create-update.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-create-update.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-create-update.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,5 @@
+Title: Creating and updating CMIS objects
+
+# Creating and updating CMIS objects
+
+TODO
\ No newline at end of file
Added: chemistry/site/trunk/content/java/examples/example-get-extension.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-get-extension.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-get-extension.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-get-extension.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,35 @@
+Title: Getting CMIS extensions
+
+# Getting CMIS extensions
+
+_(since OpenCMIS 0.2.0)_ <br/>
+The CMIS specification allows to add extensions at several points in CMIS
+data structures (object, properties, allowable actions, ACLs, policies,
+etc.).
+These extensions are XML fragments for the AtomPub and the Web Services
+binding. (It will be something simpler for the upcoming JSON binding.)
+Think of it as a tree structure with named node and leafs. Only the leafs
+can have a value.
+
+ :::java
+ // get an object from somewhere
+ CmisObject object = ...
+
+ // extensions can be attached to different levels
+ // in this example we get the extensions on the properties level
+ List<CmisExtensionElement> extensions = object.getExtensions(ExtensionLevel.PROPERTIES);
+
+ if(extensions == null) {
+ // this object has no extensions on this level
+ return;
+ }
+
+ // iterate through the extensions until we find the one we are looking for
+ for(CmisExtensionElement ext: extensions) {
+ if("myExtension".equals(ext.getName()) {
+ // found it, now print the values of the children
+ for(CmisExtensionElement child: ext.getChildren()) {
+ System.out.println(child.getName() + ": " + child.getValue());
+ }
+ }
+ }
Added: chemistry/site/trunk/content/java/examples/example-get-id-from-path.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-get-id-from-path.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-get-id-from-path.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-get-id-from-path.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,9 @@
+Title: Getting the id from path
+# Getting the id of an object from its path
+
+A code snippet how to get the id of an object when only a path is known:
+
+ :::java
+ String path = "/User Homes/customer1/document.odt"
+ CmisObject object = getSession().getObjectByPath(path);
+ String id = object.getId();
\ No newline at end of file
Added: chemistry/site/trunk/content/java/examples/example-index.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-index.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-index.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-index.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,18 @@
+Title: Debugging OpenCMIS
+
+# Examples for OpenCMIS
+
+Example code and code fragments for the OpenCMIS client API
+
+* [Connecting from .Net](example-connect-dotnet.html)
+* [Creating a session](example-create-session.html)
+* [Create and update a document](example-create-update.html)
+* [Get extension](example-get-extension.html)
+* [Listing a folder](example-list-folder.html)
+* [Processing a query](example-process-query-results.html)
+* [Reading a file](example-read-file.html)
+* [Reading metadata and content](example-read-meta-content.html)
+* [Reading properties](example-read-props.html)
+* [Reading the root folder](example-read-root.html)
+* [Retrieving the id from path](example-get-id-from-path.html)
+* [Using OSGI bundles](example-osgi.html)
Added: chemistry/site/trunk/content/java/examples/example-list-folder.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-list-folder.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-list-folder.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-list-folder.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,22 @@
+
+Title: List a folder with paging
+
+# Showing a folder's items, with results paging
+
+ :::java
+ int maxItemsPerPage = 5;
+ int skipCount = 10;
+
+ CmisObject object = session.getObject(session.createObjectId(folderId));
+ Folder folder = (Folder)object;
+ OperationContext operationContext = session.createOperationContext();
+ operationContext.setMaxItemsPerPage(maxItemsPerPage);
+
+ ItemIterable<CmisObject> children = folder.getChildren(operationContext);
+ ItemIterable<CmisObject> page = children.skipTo(skipCount).getPage();
+
+ Iterator<CmisObject> pageItems = page.iterator();
+ while(pageItems.hasNext()) {
+ CmisObject item = pageItems.next();
+ // Do something with the item.
+ }
Added: chemistry/site/trunk/content/java/examples/example-osgi.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-osgi.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-osgi.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-osgi.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,8 @@
+
+Title: Using OSGI with OpenCMIS
+
+# Using OSGI with OpenCMIS
+
+This example shows how to use OpenCMIS with OSGI bundles.
+
+TODO
Added: chemistry/site/trunk/content/java/examples/example-process-query-results.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-process-query-results.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-process-query-results.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-process-query-results.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,21 @@
+Title: Perform a query
+
+# Perform a query and process results
+
+ :::java
+ String myType = "my:documentType";
+
+ // get the query name of cmis:objectId
+ ObjectType type = session.getTypeDefinition(myType);
+ PropertyDefinition<?> objectIdPropDef = type.getPropertyDefinitions().get(PropertyIds.OBJECT_ID);
+ String objectIdQueryName = objectIdPropDef.getQueryName();
+
+ String queryString = "SELECT " + objectIdQueryName + " FROM " + type.getQueryName();
+
+ // execute query
+ ItemIterable<QueryResult> results = session.query(queryString, false);
+
+ for (QueryResult qResult : results) {
+ String objectId = qResult.getPropertyValueByQueryName(objectIdQueryName);
+ Document doc = (Document) session.getObject(session.createObjectId(objectId));
+ }
Added: chemistry/site/trunk/content/java/examples/example-read-file.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-read-file.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-read-file.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-read-file.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,9 @@
+Title: Reading a file
+
+# Reading a file
+
+ :::java
+ CmisObject object = getSession().getObject(session.createObjectId(fileId));
+ Document document = (Document)object;
+ String filename = document.getName();
+ InputStream stream = document.getContentStream().getStream();
\ No newline at end of file
Added: chemistry/site/trunk/content/java/examples/example-read-meta-content.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-read-meta-content.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-read-meta-content.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-read-meta-content.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,5 @@
+Title: Reading metadata and content from a CMIS repository
+
+# Reading metadata and content from a CMIS repository
+
+TODO
\ No newline at end of file
Added: chemistry/site/trunk/content/java/examples/example-read-props.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-read-props.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-read-props.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-read-props.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,40 @@
+Title: Reading Properties
+
+# Reading properties
+
+This example shows how to read properties from an object.
+
+<a name="OpenCMISClientAPI-ReadingProperties-SingleProperty"></a>
+## Reading Properties - Single Property
+<DIV class="codeHeader">Reading a Single Property</DIV>
+
+ :::java
+ ObjectId id = this.session.createObjectId("4711");
+ Document document = (Document) this.session.getObject(id);
+ Property<String> p = document.getProperty(PropertyIds.OBJECT_ID);
+
+ String s = p.getValue();
+
+
+<a name="OpenCMISClientAPI-ReadingProperties-AllProperties"></a>
+## Reading Properties - All Properties
+<DIV class="codeHeader">Reading all Properties</DIV>
+
+ :::java
+ ObjectId id = this.session.createObjectId("4711");
+ Document document = (Document) this.session.getObject(id);
+ List<Property<?>> l = document.getProperties();
+ Iterator<Property<?>> i = l.iterator();
+ while (i.hasNext()) {
+ Property<?> p = i.next();
+ Object value = p.getValue();
+ PropertyType t = p.getType();
+
+ switch (t) {
+ case INTEGER:
+ Integer n = (Integer) value;
+ System.out.println(p.getName() + " = " + n);
+ break;
+ case STRING:
+ [...]
+ }
Added: chemistry/site/trunk/content/java/examples/example-read-root.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/examples/example-read-root.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/examples/example-read-root.mdtext (added)
+++ chemistry/site/trunk/content/java/examples/example-read-root.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,14 @@
+Title: Reading the Root Fodler
+
+# Reading the Root Folder
+
+<DIV class="codeHeader">Reading the Root Collection</DIV>
+
+ :::java
+ Folder root = this.session.getRootFolder();
+
+ ItemIterable<CmisObject> pl = root.getChildren();
+
+ for (CmisObject o : pl) {
+ System.out.println(o.getName());
+ }
Added: chemistry/site/trunk/content/java/how-to/how-to-add-extension.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/how-to/how-to-add-extension.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/how-to/how-to-add-extension.mdtext (added)
+++ chemistry/site/trunk/content/java/how-to/how-to-add-extension.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,46 @@
+Title: Adding CMIS extensions
+
+# Adding CMIS extensions (Server)
+
+The CMIS standard offers to add implementation specific extensions in many places. Here is an
+example how to add extensions to an instance of ObjectData.
+
+_(since OpenCMIS 0.2.0)_ <br/>
+
+ :::java
+ // we want to attach an extension to an object
+ ObjectData object = ...
+
+ // some dummy data
+ String typeId = "MyType";
+ String objectId = "1111-2222-3333";
+ String name = "MyDocument";
+
+ // find a namespace for the extensions that is different from the CMIS namespaces
+ String ns = "http://apache.org/opencmis/example";
+
+ // create a list for the first level of our extension
+ List<CmisExtensionElement> extElements = new ArrayList<CmisExtensionElement>();
+
+ // set up an attribute (Avoid attributes! They will not work with the JSON binding!)
+ Map<String, String> attr = new HashMap<String, String>();
+ attr.put("type", typeId);
+
+ // add two leafs to the extension
+ extElements.add(new CmisExtensionElementImpl(ns, "objectId", attr, objectId));
+ extElements.add(new CmisExtensionElementImpl(ns, "name", null, name));
+
+ // set the extension list
+ List<CmisExtensionElement> extensions = new ArrayList<CmisExtensionElement>();
+ extensions.add(new CmisExtensionElementImpl(ns, "exampleExtension", null, extElements));
+ object.setExtensions(extensions);
+
+
+This should create something like that:
+
+ :::xml
+ <exampleExtension:exampleExtension xmlns="http://apache.org/opencmis/example" xmlns:exampleExtension="http://apache.org/opencmis/example">
+ <objectId type="MyType">1111-2222-3333</objectId>
+ <name>MyDocument</name>
+ </exampleExtension:exampleExtension>
+
Added: chemistry/site/trunk/content/java/how-to/how-to-build.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/how-to/how-to-build.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/how-to/how-to-build.mdtext (added)
+++ chemistry/site/trunk/content/java/how-to/how-to-build.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,78 @@
+Title: OpenCMIS how-to-build
+
+[TOC]
+
+# How to build OpenCMIS
+<a name="OpenCMIShow-to-build-HowtobuildOpenCMIS"></a>
+
+OpenCMIS releases are available [here](../../download.html).
+If you want to build the latest and greatest instead, follow these simple steps:
+
+* Make sure you have JDK 1.5 or higher, Maven 2.2.1 and a Subversion client installed. <br/>(The CMIS Workbench requires JDK 1.6!)
+* Fetch the source code via Subversion from here: [https://svn.apache.org/repos/asf/chemistry/opencmis/trunk](https://svn.apache.org/repos/asf/chemistry/opencmis/trunk)
+* And finally run:
+
+
+
+ mvn clean install -Dmaven.test.skip=true
+
+* To produce also commodity packages (ZIPs and Tarballs), source and javadoc JARs run:
+
+
+
+ mvn clean install -Papache-release
+
+
+
+<a name="OpenCMIShow-to-build-TheClientLibraries"></a>
+## The Client Libraries
+
+After the build, the OpenCMIS client libraries (with all dependencies) reside in the
+`/chemistry-opencmis-client/chemistry-opencmis-client-impl/target`
+directory. The zip file contains all libraries necessary to build a CMIS
+client.
+
+
+<a name="OpenCMIShow-to-build-TheServerFramework"></a>
+## The Server Framework
+
+Please refer to the [Server Framework](../../developing/dev-server.html)
+ page for more information where to find it and how to use it.
+
+
+<a name="OpenCMIShow-to-build-BuildJavaDoc"></a>
+
+## JavaDocs
+
+### Releases Javadocs
+
+You can access OpenCMIS releases Javadocs in the following ways:
+
+ 1. Every release publishes an online Javadoc version
+ 2. Javadocs are included in the `chemistry-opencmis-docs.zip` and `chemistry-opencmis-docs.tar.gz`
+packages for offline browsing
+
+
+To browse online Javadocs for latest/older releases check the [home page][1]'s Download section.
+
+
+### Latest Javadocs
+
+You can access OpenCMIS latest (trunk) Javadocs in the following ways:
+
+ 1. Build them from trunk using Maven
+
+* Checkout the [project trunk][2]
+* Run `mvn site` or `mvn javadoc:aggregate`
+* Open `./target/site/apidocs/index.html`
+
+ 2.Access the latest CI Javadoc
+
+* (**TODO**) <del>Latest Javadocs for current SNAPSHOT version (trunk) are produced by our build server
+and available [here][3]</del>
+
+
+
+ [1]: http://chemistry.apache.org/java/opencmis.html
+ [2]: http://svn.apache.org/repos/asf/chemistry/opencmis/trunk/
+ [3]: http://chemistry.apache.org/java/maven/apidocs/index.html
\ No newline at end of file
Added: 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=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/how-to/how-to-connect.mdtext (added)
+++ chemistry/site/trunk/content/java/how-to/how-to-connect.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,81 @@
+Title: Connecting to a repository
+
+# Connecting to a repository (Client)
+
+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.
+
+<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
+
+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.
+
+ :::java
+ CookieManager cm = new CookieManager(null, CookiePolicy.ACCEPT_ALL);
+ CookieHandler.setDefault(cm);
+
Added: chemistry/site/trunk/content/java/how-to/how-to-create-server.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/how-to/how-to-create-server.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/how-to/how-to-create-server.mdtext (added)
+++ chemistry/site/trunk/content/java/how-to/how-to-create-server.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,600 @@
+Title: How To Build A Server
+
+[TOC]
+
+# How to create a CMIS server using OpenCMIS
+<a name="HowToBuildAServer-HowtocreateaCMISserverusingOpenCMIS"></a>
+
+This document contains a step-by-step introduction how you can use opencmis
+to build an CMIS server. The document is divided into the following
+sections:
+
+Getting started. (download, setup Eclipse, etc.)
+
+1. Implementing the services
+1. The ServiceWrapper
+1. Differences between SOAP and AtomPub (ObjectHolder)
+1. Running the server
+1. Handling Authentication
+1. Testing the server
+
+<a name="HowToBuildAServer-Gettingstarted:"></a>
+## Getting started:
+
+The following step-by-step guide is a sample how to create a web
+application acting as CMIS server. It will support both bindings web
+services and AtomPub.
+
+The following section describes how to initially setup a project to compile
+a CMIS server. Please note that CMIS comes with two built-in servers. The
+fileshare and the in-memory server. It is a good hint for all upcoming
+questions to look at these implementations as example code containing
+working implementations.
+
+<a name="HowToBuildAServer-Usingmaven"></a>
+### Using maven
+
+Using maven is the easiest way to get started. OpenCMIS itself is using
+maven and you can get easily your setup and dependencies using maven. This
+requires that you have a working maven environment. In case you don't yet
+have one you can find instructions [here](http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html).
+
+The first step is to create your initial pom.xml file to build your project
+and to setup the dependencies. The following steps require that you have
+build opencmis and installed it to your local maven repository (`mvn
+install`). See [here](how-to-build.html)
+ for detailed instructions how to do this.
+
+You can create your initial setup using maven itself (adjust package name,
+version number and so on according to your needs):
+
+
+ mvn archetype:generate -DgroupId=org.mycmis -DartifactId= mycmissrv \
+ -DpackageName=local.mycmis -Dversion=0.1
+
+
+Then select option 18 `maven-archetype-webapp` and confirm settings.
+
+You will find a project setup then consisting of a directory `mycmissvr`
+and subdirectories for source code and test code and the Java packages. We
+need to adapt the `.pom` file so that maven creates a web application file
+that can be deployed in a servlet container (like Apache Tomcat or Jetty).
+We also need to setup the dependencies to opencmis and we need to instruct
+maven generating an overlay with the existing server code in opencmis.
+Please remove therefore the entire generated `src/webapp` directory and all
+included files (`*.jsp`, `web.xml`).
+The final `pom.xml` will look like this:
+
+ :::xml
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.mycmis</groupId>
+ <artifactId>mycmissrv</artifactId>
+ <packaging>war</packaging>
+ <version>0.1</version>
+ <name>mycmissrv Maven Webapp</name>
+ <url>http://maven.apache.org</url>
+
+ <properties>
+ <opencmisVersion>0.1.0-incubating-SNAPSHOT</opencmisVersion>
+ <opencmisGroupId>org.apache.chemistry.opencmis</opencmisGroupId>
+ </properties>
+
+ <build>
+ <finalName>mycmissrv</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <overlays>
+ <overlay>
+ </overlay>
+ <overlay>
+ <groupId>${opencmisGroupId}</groupId>
+ <artifactId>chemistry-opencmis-server-bindings</artifactId>
+ </overlay>
+ </overlays>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <target>1.5</target>
+ <source>1.5</source>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${opencmisGroupId}</groupId>
+ <artifactId>chemistry-opencmis-commons-api</artifactId>
+ <version>${opencmisVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>${opencmisGroupId}</groupId>
+ <artifactId>chemistry-opencmis-commons-impl</artifactId>
+ <version>${opencmisVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>${opencmisGroupId}</groupId>
+ <artifactId>chemistry-opencmis-test-util</artifactId>
+ <version>${opencmisVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>${opencmisGroupId}</groupId>
+ <artifactId>chemistry-opencmis-server-bindings</artifactId>
+ <version>${opencmisVersion}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>${opencmisGroupId}</groupId>
+ <artifactId>chemistry-opencmis-server-support</artifactId>
+ <version>${opencmisVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr-runtime</artifactId>
+ <version>3.1.3</version>
+ </dependency>
+ </dependencies>
+ </project>
+
+
+You will get your `web.xml` and other required files for your web
+application from opencmis which you may adjust according to your needs. You
+may run `mvn eclipse:eclipse` to generate the required `.projects` and
+`.classpath` files for Eclipse that you just need to import in your
+Eclipse workspace.
+
+
+### Without maven
+
+If you do not want to use maven to build your project you currently have to
+use maven to produce the binaries from the source code. Download the source
+code and run
+
+ mvn package
+
+
+to produce a binary version of all packaged files. To reuse the relevant
+files from the server implementation in opencmis type:
+
+ cd chemistry-opencmis-server
+ cd chemistry-opencmis-server-bindings
+
+
+Unzip the file
+`chemistry-opencmis-server-bindings-0.1-incubating-SNAPSHOT.jar` and copy
+the contents to your project. It includes all required jars, web.xml and
+other supporting files. In case you prefer an empty classes directory and
+use a jar instead you can use:
+
+ mvn jar:jar
+
+
+Then copy the file named `opencmis-server-impl-0.1-SNAPSHOT.jar` from the
+target directory to your project directory. Add all jar files from the
+`.war` and the one created in the previous step to your project setup.
+Add the `repository.properties` file to your classpath.
+
+Now you have an initial `web.xml` and the required support files for the
+web services binding. Unless you have specific requirements you do not need
+to modify them.
+
+
+## Implementing the services
+
+The first step is to tell opencmis where it can find your classes that
+implement the CMIS logic. For this purpose a file named
+repository.properties must be in the classpath. It must contain a property
+named class that refers to your service factory:
+
+ :::properties
+ class=local.mycmis.ServiceFactory
+
+
+The ServiceFactory class should extend the `AbstractServiceFactory` class
+from org.apache.chemistry.opencmis.commons.impl.server. You have to
+implement the interface CmisServiceFactory:
+
+ :::java
+ public void init(Map<String, String> parameters) {
+ }
+
+ public void destroy() {
+ }
+
+ public abstract CmisService getService(CallContext context);
+
+
+The `init()` method is used to perform initialization and passes a set of
+configuration parameters from repository.properties:
+
+ :::java
+ @Override
+ public void init(Map<String, String> parameters) {
+ }
+
+
+Typically you will create an instance of your service implementation.
+
+There is also wrapper classes is explained in the next section.
+
+The next step is that you need to implement the services according to the
+CMIS spec. We will do this here for one example call. The important piece
+is that your class implements `CmisService` which is central access point
+to all incoming calls. Here is an implementation of an example call
+`getRepositoryInfo()`:
+
+ :::java
+ public class MyCmisServiceImpl extends AbstractCmisService {
+
+ public RepositoryInfo getRepositoryInfo(CallContext context,
+ String repositoryId, ExtensionsData extension) {
+
+ RepositoryInfoImpl repoInfo = new RepositoryInfoImpl();
+ repoInfo.setRepositoryId(repositoryId);
+ repoInfo.setRepositoryName("My CMIS Repository");
+ repoInfo.setRepositoryDescription("Sample Repository");
+ repoInfo.setCmisVersionSupported("1.0");
+ repoInfo.setRepositoryCapabilities(null);
+ repoInfo.setRootFolder("MyRootFolderId");
+ repoInfo.setPrincipalAnonymous("anonymous");
+ repoInfo.setPrincipalAnyone("anyone");
+ repoInfo.setThinClientUri(null);
+ repoInfo.setChangesIncomplete(Boolean.TRUE);
+ repoInfo.setChangesOnType(null);
+ repoInfo.setLatestChangeLogToken(null);
+ repoInfo.setVendorName("ACME");
+ repoInfo.setProductName("ACME CMIS Connector");
+ repoInfo.setProductVersion("0.1");
+
+ // set capabilities
+ RepositoryCapabilitiesImpl caps = new RepositoryCapabilitiesImpl();
+ caps.setAllVersionsSearchable(false);
+ caps.setCapabilityAcl(CapabilityAcl.NONE);
+ caps.setCapabilityChanges(CapabilityChanges.PROPERTIES);
+
+ caps.setCapabilityContentStreamUpdates(CapabilityContentStreamUpdates.PWCONLY);
+ caps.setCapabilityJoin(CapabilityJoin.NONE);
+ caps.setCapabilityQuery(CapabilityQuery.METADATAONLY);
+ caps.setCapabilityRendition(CapabilityRenditions.NONE);
+ caps.setIsPwcSearchable(false);
+ caps.setIsPwcUpdatable(true);
+ caps.setSupportsGetDescendants(true);
+ caps.setSupportsGetFolderTree(true);
+ caps.setSupportsMultifiling(true);
+ caps.setSupportsUnfiling(true);
+ caps.setSupportsVersionSpecificFiling(false);
+ repoInfo.setRepositoryCapabilities(caps);
+
+ AclCapabilitiesDataImpl aclCaps = new AclCapabilitiesDataImpl();
+ aclCaps.setAclPropagation(AclPropagation.REPOSITORYDETERMINED);
+ aclCaps.setPermissionDefinitionData(null);
+ aclCaps.setPermissionMappingData(null);
+ repoInfo.setAclCapabilities(aclCaps);
+
+ return repoInfo;
+ }
+ // ...
+ }
+
+
+
+Now you can start implementing all the required methods with their methods.
+
+<a name="HowToBuildAServer-TheServiceWrapper"></a>
+### The ServiceWrapper
+
+For the CmisService interface exists a corresponding abstract class. This
+can be used as a starting point for your implementation. This is optional
+but gives you the benefit of providing many common null pointer checks and
+default values for optional parameters. The abstract class also provides a
+default implementation for generating the ObjectInfo needed for the AtomPub
+binding. This wrapper can reduce the code required in your service
+implementation. You should always start using the wrapper class and
+directly implement the CmisService interface only when necessary. It is
+strongly recommended however to provide a better implementation for create
+the ObjectInfo however (see next section for details).
+
+<a name="HowToBuildAServer-DifferencesbetweentheCMISbindings"></a>
+## Differences between the CMIS bindings
+
+OpenCMIS supports both the AtomPub and the web services binding interface.
+It hides all the details how to handle the protocol but there are some
+subtle differences that need to be reflected in the Java interfaces. This
+chapter explains where the differences are and why they are needed.
+
+<a name="HowToBuildAServer-TheObjectInfointerface"></a>
+### The ObjectInfo interface
+
+The methods in the interfaces `CmisService` are following the data model
+in the CMIS specification. The specification defines the following
+services:
+
+* AclService
+* DiscoveryService
+* ObjectService
+* MultifFlingService
+* NavigationService
+* PolicyService
+* RelationshipService
+* RepositoryService
+* Versioning Service
+
+For each of these services exists a corresponding interface in opencmis.
+CmisService is an interface that unifies all interfaces in one interface.
+The methods in this interface correspond to the methods in the
+specification. For the web service binding this is a one-to-one mapping.
+For the AtomPub binding this information is not sufficient in all cases.
+Take the creation of a document as an example. The web service returns in
+this case a single string value containing the id of the created document.
+A response in the AtomPub binding however consists of an AtomPub entry
+element which is an XML fragment (for an example look at
+`DocumentEntry.xml` in the examples directory of the CMIS specification).
+You will notice that generating this XML requires much more information
+than the create...() methods in the specification provide as return value.
+Your implementation needs to provide all the information so that opencmis
+can generate the complete response. For this purpose the `ObjectInfo` was
+introduced. `getObjectInfo` is the method of the `CmisService` interface
+that provides this information. The `AbstractCmisService` contains a
+member `objectInfoMap` that you can fill with this information. If you
+ignore this the class `AbstractCmisService` contains a default
+implementation which works but is very ineffecient. You should use this
+only as a starting point. Beware that a service can be called from multiple
+threads, so have to take care to handle threading issues properly.
+
+If the method you are implementing returns a list of objects and not only a
+single value (for example methods like `getChildren()`, `getDescendants()`
+in the navigation service) you need to provide an `ObjectInfo` for each
+element in the collection. `getObjectInfo` therefore returns a map with
+the object id for each object as key and the corresponding `ObjectInfo`
+as value. You can use the method `addObjectInfo` to add an element to the
+map.
+
+
+
+<a name="HowToBuildAServer-Thecreate()methods"></a>
+### The create() methods
+
+The web service binding has separate calls for each object type to be
+created: policies, relationships, documents and folders:
+
+* createDocument
+* createFolder
+* createRelationship
+* createPolicy
+
+In the AtomPub binding there is one general `create()` method that is
+used for all object types. The CmisObjectService interface therefore
+contains 5 `create()` methods, the four specific ones are used for the
+web service bindings and the general one for the AtomPub binding.
+
+
+<a name="HowToBuildAServer-ApplyingACLs"></a>
+### Applying ACLs
+
+The class `CmisAclService` has two methods `applyAcl()`. One uses two
+`AccessControlList`s with one `Acl` to add and one to remove. The other
+method contains only one `Acl` to be set on the target object. The web
+service binding uses the method with two parameters, the AtomPub binding
+uses the method with one parameter.
+
+<a name="HowToBuildAServer-RunningTheServer"></a>
+## Running The Server
+
+When your services are implemented (or parts of them) you can try to run
+the server in a servlet container like Tomcat. If you have used maven to
+setup your project you can run
+
+ mvn package
+
+
+to generate a war file that you will find in the target directory. If you
+have not used maven, create the war with the mechanisms of your build
+environment. Check the war contains a `web.xml`, the wsdl files in
+`WEB-INF` and all the required jars from opencmis and dependent libraries
+in `WEB-INF/lib`. For jetty maven contains a build-in integration that
+you may use if you like using `mvn jetty:run`. Adjust your `pom.xml` in
+this case accordingly.
+
+Deploy your application and start testing.
+
+<a name="HowToBuildAServer-HandlingAuthentication"></a>
+## Handling Authentication
+
+Opencmis does not provide or expect any specific mechanism how
+authentication is handled. It provides some basic mechanisms hot to extract
+user name and password depending on the protocol. For AtomPub binding http
+basic authentication is supported, for web services WS-Security 1.1 for
+Username Token Profile 1.1 is supported.
+
+If you want to use servlet filters dealing with authentication, just
+add them to your `web.xml` file. You also can handle authentication inside of
+your code. In this case derive a class from `BasicAuthCallContextHandler`
+and implement method `getCallContextMap()`. There you have access to user
+name and password as provided by the user. By default opencmis does not
+enforce authentication, so initially the map will be null. If you raise a
+`CmisPermissionDeniedException` the exception is caught by the server
+implementation and a `401` http return code is sent as response to the
+browser. This usually opens a dialog for user name and password then.
+
+ :::java
+ public class MyContextHandler
+ extends BasicAuthCallContextHandler
+ {
+ public Map<String, String> getCallContextMap(HttpServletRequest request){
+
+ // call superclass to get user and password via basic authentication
+ Map<String, String> ctxMap = super.getCallContextMap(request);
+
+ if (null == ctxMap)
+ // no user name, password given yet say: we need authentication:
+ throw new CmisPermissionDeniedException("Authentication required");
+
+ // call your authentication
+
+ MyAuthentication.login(
+ ctxMap.get(CallContext.USERNAME),
+ ctxMap.get(CallContext.PASSWORD));
+
+ return ctxMap;
+ }
+ }
+
+
+Beyond this it is up to you how to implement authentication. Creating
+tokens for example, using cookies, etc. is not covered by opencmis, but you
+can add it in your code.
+
+
+## Configuring your server
+
+Opencmis reads a file `repository.properties` on startup. By default you only
+have to configure the class of your service factory (see above). You can
+add additional properties in this file. These configuration parameters are
+then passed to the `init()` method of your `ServiceFactory` as key
+value pairs in a hashmap.
+
+<DIV class="codeHeader">repository.properties</DIV>
+
+ :::properties
+ class=local.mycmis.ServiceFactory
+ myparam=my-configuration-value
+
+
+<DIV class="codeHeader">local.mycmis.ServiceFactory.java</DIV>
+
+ :::java
+ // ...
+ @Override
+ public void init(Map<String, String> parameters) {
+ String myParamValue = parameters.get("myparam");
+ // use myParamValue
+ }
+ // ...
+
+
+
+## Testing the server
+
+There are various ways how you can test your implementation. You may add
+unit tests that directly call your service implementations as a first step.
+Opencmis also contains some basic tests that perform client-server
+communication. You can choose the protocol binding and whether read-only or
+read-write tests are performed. The amount of functionality tested depends
+on the capabilities returned in your getRepositoryInfo return value. You
+can run them using junit:
+
+Examples:
+
+Test class:
+
+ org.apache.chemistry.opencmis.client.bindings.atompub.SimpleReadOnlyTests
+
+
+Test Parameters (passed as JVM args):
+
+ -Dopencmis.test=true
+ -Dopencmis.test.username=myuser
+ -Dopencmis.test.password=mypasswd
+ -Dopencmis.test.repository=my_repository_id
+ -Dopencmis.test.atompub.url=[http://localhost:8080/opencmis/atom]
+
+
+The following test classes exist:
+
+ org.apache.opencmis.client.bindings.atompub.SimpleReadOnlyTests
+ org.apache.opencmis.client.bindings.atompub.SimpleReadWriteTests
+ org.apache.opencmis.client.bindings.webservices.SimpleReadOnlyTests
+ org.apache.opencmis.client.bindings.webservices.SimpleReadWriteTests
+
+
+For web services you need an additional parameter for the service endpoint:
+
+ -Dopencmis.test.webservices.url=[http://localhost:8080/opencmis/services/]
+
+
+### Test using curl
+
+Simple tests (which might be useful at the beginning) can also be done
+using tools like curl or wget (AtomPub binding only). A simple example for
+a `.BAT` file (Windows) would look like this:
+
+ :::bat
+ rem set PATH=...\libcurl-7.19.7;...\OpenSSL\bin;%PATH%
+ set CURL=curl.exe
+ set VIEWER="C:\Program Files\Mozilla Firefox\firefox.exe"
+ set USER=XXX
+ set PWD=YYY
+ set URLPREFIX=[http://localhost:8080/opencmis/atom]
+ SET OUTFILE=atom.xml
+
+ %CURL% \--user %USER%:%PWD% \--dump-header header.txt \--output %OUTFILE% %URLPREFIX%
+ IF ERRORLEVEL 0 %VIEWER% %OUTFILE%
+
+
+Another example how to get a document with id MyDocument:
+
+ %CURL% \--user %USER%:%PWD% \--dump-header header.txt \--output %OUTFILE% %URLPREFIX%/A1/entry?id=%%2FMyDocument
+
+
+You also can use this to create documents:
+
+ %CURL% \--user %USER%:%PWD% \--header "Content-Type: application/atom+xml;type=entry" \-d @post-item.xml \--output %OUTFILE% \--url %URLPREFIX%/A1/children?id=/
+
+
+The file `post-item.xml` must contain a valid Atom entry then:
+
+ :::xml
+ <?xml version="1.0" encoding="utf-8"?>
+ <entry xmlns="http://www.w3.org/2005/Atom"
+ xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/"
+ xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/"
+ xmlns:app="http://www.w3.org/2007/app">
+ <id>http://vmelcmis1:8080/cmis/atom/cd-library/main/Default-I10915</id>
+ <author>
+ <name>Admin</name>
+ </author>
+ <updated>2009-03-01T00:00:00.000Z</updated>
+ <title type="text">Content from Curl</title>
+ <cmisra:object>
+ <cmis:properties>
+ <cmis:propertyId propertyDefinitionId="cmis:name">
+ <cmis:value>Content from Curl</cmis:value>
+ </cmis:propertyId>
+ <cmis:propertyId propertyDefinitionId="cmis:objectTypeId">
+ <cmis:value>cmis:document</cmis:value>
+ </cmis:propertyId>
+ </cmis:properties>
+ </cmisra:object>
+
+ <cmisra:content type="text/plain">
+ <cmisra:base64>
+ RmF1c3Q6DQoNCk1laW4gc2No9m5lcyBGcuR1bGVpbiwgZGFyZiBpY2ggd2FnZW4sDQpNZWlu
+ ZW4gQXJtIHVuZCBHZWxlaXQgSWhyIGFuenV0cmFnZW4/DQoNCk1hcmdhcmV0ZToNCg0KQmlu
+ IHdlZGVyIEZy5HVsZWluLCB3ZWRlciBzY2j2biwNCkthbm4gdW5nZWxlaXRldCBuYWNoIEhh
+ dXNlIGdlaG4uDQoNCihTaWUgbWFjaHQgc2ljaCBsb3MgdW5kIGFiLikNCg0KRmF1c3Q6DQoN
+ CkJlaW0gSGltbWVsLCBkaWVzZXMgS2luZCBpc3Qgc2No9m4hDQpTbyBldHdhcyBoYWIgaWNo
+ IG5pZSBnZXNlaG4uDQpTaWUgaXN0IHNvIHNpdHQtIHVuZCB0dWdlbmRyZWljaCwNClVuZCBl
+ dHdhcyBzY2huaXBwaXNjaCBkb2NoIHp1Z2xlaWNoLg0KRGVyIExpcHBlIFJvdCwgZGVyIFdh
+ bmdlIExpY2h0LA0KRGllIFRhZ2UgZGVyIFdlbHQgdmVyZ2XfIGljaCdzIG5pY2h0IQ0KV2ll
+ IHNpZSBkaWUgQXVnZW4gbmllZGVyc2NobORndCwNCkhhdCB0aWVmIHNpY2ggaW4gbWVpbiBI
+ ZXJ6IGdlcHLkZ3Q7DQpXaWUgc2llIGt1cnogYW5nZWJ1bmRlbiB3YXIsDQpEYXMgaXN0IG51
+ biB6dW0gRW50evxja2VuIGdhciE=
+ </cmisra:base64>
+ </cmisra:content>
+ </entry>
+
Added: chemistry/site/trunk/content/java/how-to/how-to-index.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/how-to/how-to-index.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/how-to/how-to-index.mdtext (added)
+++ chemistry/site/trunk/content/java/how-to/how-to-index.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,15 @@
+Title: Debugging OpenCMIS
+
+# OpenCMIS How Tos
+
+Instructions how to perform frequently occuring tasks with OpenCMIS
+
+How to...
+
+ * [Add CMIS Extensions](how-to-add-extension.html)
+ * [Build OpenCMIS](how-to-build.html)
+ * [Connect to a repository](how-to-connect.html)
+ * [Create a Server](how-to-create-server.html)
+ * [Integrate with Spring](how-to-integrate-spring.html)
+ * [Process a Query](how-to-process-query.html)
+ * [Tune performance](how-to-tune-perfomance.html)
Added: chemistry/site/trunk/content/java/how-to/how-to-integrate-spring.mdtext
URL: http://svn.apache.org/viewvc/chemistry/site/trunk/content/java/how-to/how-to-integrate-spring.mdtext?rev=1082878&view=auto
==============================================================================
--- chemistry/site/trunk/content/java/how-to/how-to-integrate-spring.mdtext (added)
+++ chemistry/site/trunk/content/java/how-to/how-to-integrate-spring.mdtext Fri Mar 18 11:57:41 2011
@@ -0,0 +1,58 @@
+Title: Using Spring Framework (Server)
+
+# Using Spring Framework (Server)
+
+By default, the OpenCMIS services factory is set up by a context listner
+configured in the web.xml. If you want or need Spring to set up the
+services factory, remove the context listener from the `web.xml` and use a
+bean like this instead:
+
+ :::java
+ public class CmisLifecycleBean implements ServletContextAware,
+ InitializingBean, DisposableBean
+ {
+ private ServletContext servletContext;
+ private CmisServiceFactory factory;
+
+ @Override
+ public void setServletContext(ServletContext servletContext)
+ {
+ this.servletContext = servletContext;
+ }
+
+ public void setCmisServiceFactory(CmisServiceFactory factory)
+ {
+ this.factory = factory;
+ }
+
+ @Override
+ public void afterPropertiesSet() throws Exception
+ {
+ if (factory != null)
+ {
+ factory.init(new HashMap<String, String>());
+ servletContext.setAttribute(CmisRepositoryContextListener.SERVICES_FACTORY, factory);
+ }
+ }
+
+ @Override
+ public void destroy() throws Exception
+ {
+ if (factory != null)
+ {
+ factory.destroy();
+ }
+ }
+ }
+
+
+The Spring configuration could look like this:
+
+ :::xml
+ <bean id="CmisLifecycleBean" class="org.example.mycmisservice.CmisLifecycleBean">
+ <property name="cmisServiceFactory" ref="CmisServiceFactory" />
+ </bean>
+
+ <bean id="CmisServiceFactory" class="org.example.mycmisservice.MyCmisServiceFactory">
+ </bean>
+