chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sklev...@apache.org
Subject svn commit: r912529 [1/2] - in /incubator/chemistry/trunk/opencmis: ./ opencmis-client/opencmis-client-api/ opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/ opencmis-client/opencmis-client-api/src/main/java/org/apache/o...
Date Mon, 22 Feb 2010 10:26:20 GMT
Author: sklevenz
Date: Mon Feb 22 10:26:19 2010
New Revision: 912529

URL: http://svn.apache.org/viewvc?rev=912529&view=rev
Log:
Synchronize latest code changes from BerliOS

https://issues.apache.org/jira/browse/CMIS-121

Adding missing licens headers

https://issues.apache.org/jira/browse/CMIS-116

Added:
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/PersistentSession.java   (with props)
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/util/Testable.java   (with props)
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentFolderImpl.java   (with props)
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java   (with props)
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/SessionFactoryImpl.java   (with props)
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/Cache.java   (with props)
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/CacheImpl.java   (with props)
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/objecttype/
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/PropertyFactoryImpl.java   (with props)
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/util/
Modified:
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/CmisObject.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/Session.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/SessionFactory.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/TransientSession.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/package.html
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/test/Fixture.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/test/suite/otx/OtxAtomPubCmisTestSuite.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/SessionParameter.java
    incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-impl/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-fileshare/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-impl/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-spi/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-browser/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-tck/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-tools/pom.xml
    incubator/chemistry/trunk/opencmis/opencmis-test/opencmis-test-util/pom.xml
    incubator/chemistry/trunk/opencmis/pom.xml
    incubator/chemistry/trunk/opencmis/src/site/site.xml

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/pom.xml?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/pom.xml (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/pom.xml Mon Feb 22 10:26:19 2010
@@ -1,5 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
+<!--
+   Licensed 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.
+  -->
+
 <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

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/CmisObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/CmisObject.java?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/CmisObject.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/CmisObject.java Mon Feb 22 10:26:19 2010
@@ -27,6 +27,7 @@
 import org.apache.opencmis.commons.enums.AclPropagation;
 import org.apache.opencmis.commons.enums.BaseObjectTypeIds;
 import org.apache.opencmis.commons.enums.RelationshipDirection;
+import org.apache.opencmis.commons.enums.UnfileObjects;
 
 /**
  * Base CMIS object.
@@ -139,7 +140,7 @@
 
   CmisObject move(Folder targetfolder);
 
-  void delete();
+  void delete(boolean allVersions);
 
   void updateProperties(List<Property<?>> properties);
 

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/PersistentSession.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/PersistentSession.java?rev=912529&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/PersistentSession.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/PersistentSession.java Mon Feb 22 10:26:19 2010
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+package org.apache.opencmis.client.api;
+
+/**
+ * All write operations of a persistent session will be forwarded to the back end system immediately.
+ */
+public interface PersistentSession extends Session {
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/PersistentSession.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/Session.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/Session.java?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/Session.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/Session.java Mon Feb 22 10:26:19 2010
@@ -26,148 +26,163 @@
 import org.apache.opencmis.client.api.repository.RepositoryInfo;
 import org.apache.opencmis.client.api.util.PagingList;
 
+/**
+ * A session is associated with a specific connection to a CMIS repository. A
+ * session belongs to one authenticated user and
+ */
 public interface Session {
 
-  /**
-   * Clear all cached data. This implies that all data will be reloaded from the repository
-   * (depending on the implementation, reloading might be done immediately or be deferred).
-   */
-  void clear();
-
-  // session context
-
-  /**
-   * Get the current session parameters for filtering and paging.
-   */
-  SessionContext getContext();
-
-  /**
-   * Set the current session parameters for filtering and paging.
-   * 
-   * @param context
-   *          the <code>SessionContext</code> to be used for the session; if <code>null</code>, a
-   *          default context is used
-   * @return the old <code>SessionContext</code> used before <code>setContext</code> was called
-   */
-  SessionContext setContext(SessionContext context);
-
-  // localization
-
-  /**
-   * Get the current locale to be used for this sesion.
-   */
-  Locale getLocale();
-
-  // extensions
-
-  // TODO : clarify extension handling
-
-  /*
-   * basic idea is: Application does something like startup: session.setExtensionHandler('action',
-   * handler); performing an action: session.set('action'); ... do some operations on the session
-   * ... --> handler.handleExtension('action') is called by runtime
-   */
-
-  /**
-   * Get an ID representing an 'extension context' (an action or something)?
-   */
-  String getExtensionContext();
-
-  /**
-   * Set an ID representing an 'extension context' (an action or something)? (null = default/no
-   * context)
-   * 
-   * @param context
-   * @return
-   */
-  String setExtensionContext(String context);
-
-  /**
-   * Get the <code>ExtensionHandler</code> for a given 'extension context'. (null = default)
-   * 
-   * @param context
-   * @return
-   */
-  ExtensionHandler getExtensionHandler(String context);
-
-  /**
-   * Set the <code>ExtensionHandler</code> for a given 'extension context'. (null = default)
-   * 
-   * @param context
-   * @param extensionHandler
-   * @return
-   */
-  ExtensionHandler setExtensionHandler(String context, ExtensionHandler extensionHandler);
-
-  // services
-
-  /**
-   * Repository service <code>getRepositoryInfo()</code>.
-   */
-  RepositoryInfo getRepositoryInfo();
-
-  /**
-   * Access to the object services <code>create</code><i>...</i>, plus factory methods to create
-   * <code>Acl</code>s, <code>Ace</code>s, and <code>ContentStream</code>.
-   */
-  ObjectFactory getObjectFactory();
-
-  /**
-   * Get the factory for <code>Property</code> objects.
-   */
-  PropertyFactory getPropertyFactory();
-
-  ObjectType getTypeDefinition(String typeId);
-
-  PagingList<ObjectType> getTypeChildren(ObjectType t, boolean includePropertyDefinitions, int itemsPerPage);
-
-  PagingList<ObjectType> getTypeDescendants(ObjectType t, int depth, boolean includePropertyDefinitions, int itemsPerPage);
-
-  // navigation
-
-  /**
-   * Get the root folder for the repository.
-   */
-  Folder getRootFolder();
-
-  /**
-   * Navigation service <code>getCheckedOutDocs</code>.
-   * 
-   * @param folder
-   * @param orderby
-   * @return @
-   */
-  PagingList<Document> getCheckedOutDocs(Folder folder, String orderby, int itemsPerPage);
-
-  /**
-   * Object service <code>getObject</code>.
-   * 
-   * @param objectid
-   * @return @
-   */
-  CmisObject getObject(String objectid);
-
-  /**
-   * Object service <code>getObjectByPath</code>.
-   * 
-   * @param path
-   * @return @
-   */
-  CmisObject getObjectByPath(String path);
-
-  // discovery
-
-  /**
-   * Discovery service <code>query</code>.
-   */
-  PagingList<CmisObject> query(String statement, boolean searchAllVersions, int itemsPerPage);
-
-  /**
-   * Discovery service <code>getContentChanges</code>.
-   * 
-   * @return
-   */
-  PagingList<ChangeEvent> getContentChanges(String changeLogToken, int itemsPerPage);
-
+	/**
+	 * Clear all cached data. This implies that all data will be reloaded from
+	 * the repository (depending on the implementation, reloading might be done
+	 * immediately or be deferred).
+	 */
+	void clear();
+
+	// session context
+
+	/**
+	 * Get the current session parameters for filtering and paging.
+	 */
+	SessionContext getContext();
+
+	/**
+	 * Set the current session parameters for filtering and paging.
+	 * 
+	 * @param context
+	 *            the <code>SessionContext</code> to be used for the session; if
+	 *            <code>null</code>, a default context is used
+	 * @return the old <code>SessionContext</code> used before
+	 *         <code>setContext</code> was called
+	 */
+	SessionContext setContext(SessionContext context);
+
+	// localization
+
+	/**
+	 * Get the current locale to be used for this session.
+	 */
+	Locale getLocale();
+
+	// extensions
+
+	// TODO : clarify extension handling
+
+	/*
+	 * basic idea is: Application does something like startup:
+	 * session.setExtensionHandler('action', handler); performing an action:
+	 * session.set('action'); ... do some operations on the session ... -->
+	 * handler.handleExtension('action') is called by runtime
+	 */
+
+	/**
+	 * Get an ID representing an 'extension context' (an action or something)?
+	 */
+	String getExtensionContext();
+
+	/**
+	 * Set an ID representing an 'extension context' (an action or something)?
+	 * (null = default/no context)
+	 * 
+	 * @param context
+	 * @return
+	 */
+	String setExtensionContext(String context);
+
+	/**
+	 * Get the <code>ExtensionHandler</code> for a given 'extension context'.
+	 * (null = default)
+	 * 
+	 * @param context
+	 * @return
+	 */
+	ExtensionHandler getExtensionHandler(String context);
+
+	/**
+	 * Set the <code>ExtensionHandler</code> for a given 'extension context'.
+	 * (null = default)
+	 * 
+	 * @param context
+	 * @param extensionHandler
+	 * @return
+	 */
+	ExtensionHandler setExtensionHandler(String context,
+			ExtensionHandler extensionHandler);
+
+	// services
+
+	/**
+	 * Repository service <code>getRepositoryInfo()</code>.
+	 */
+	RepositoryInfo getRepositoryInfo();
+
+	/**
+	 * Access to the object services <code>create</code><i>...</i>, plus factory
+	 * methods to create <code>Acl</code>s, <code>Ace</code>s, and
+	 * <code>ContentStream</code>.
+	 */
+	ObjectFactory getObjectFactory();
+
+	/**
+	 * Get the factory for <code>Property</code> objects.
+	 */
+	PropertyFactory getPropertyFactory();
+
+	ObjectType getTypeDefinition(String typeId);
+
+	PagingList<ObjectType> getTypeChildren(ObjectType t,
+			boolean includePropertyDefinitions, int itemsPerPage);
+
+	PagingList<ObjectType> getTypeDescendants(ObjectType t, int depth,
+			boolean includePropertyDefinitions, int itemsPerPage);
+
+	// navigation
+
+	/**
+	 * Get the root folder for the repository.
+	 */
+	Folder getRootFolder();
+
+	/**
+	 * Navigation service <code>getCheckedOutDocs</code>.
+	 * 
+	 * @param folder
+	 * @param orderby
+	 * @return @
+	 */
+	PagingList<Document> getCheckedOutDocs(Folder folder, String orderby,
+			int itemsPerPage);
+
+	/**
+	 * Object service <code>getObject</code>.
+	 * 
+	 * @param objectid
+	 * @return @
+	 */
+	CmisObject getObject(String objectid);
+
+	/**
+	 * Object service <code>getObjectByPath</code>.
+	 * 
+	 * @param path
+	 * @return @
+	 */
+	CmisObject getObjectByPath(String path);
+
+	// discovery
+
+	/**
+	 * Discovery service <code>query</code>.
+	 */
+	PagingList<CmisObject> query(String statement, boolean searchAllVersions,
+			int itemsPerPage);
+
+	/**
+	 * Discovery service <code>getContentChanges</code>.
+	 * 
+	 * @return
+	 */
+	PagingList<ChangeEvent> getContentChanges(String changeLogToken,
+			int itemsPerPage);
 
 }

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/SessionFactory.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/SessionFactory.java?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/SessionFactory.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/SessionFactory.java Mon Feb 22 10:26:19 2010
@@ -47,24 +47,24 @@
  * <br>parameters.put(SessionParameter.SESSION_TYPE, SessionType.TRANSIENT.value());
  * <br> ...
  * <br>
- * <br>TrasnientSession s = factory.createSession(parameters);
+ * <br>TransientSession s = factory.createSession(parameters);
  * </code>
  *<p>
  * If the <code>SessionType</code> parameter is not specified then the default
- * session is returned.
+ * persistent session is returned.
  * 
  */
 public interface SessionFactory {
 
 	/**
-	 * Obtain a new session.
+	 * Obtain a new session using parameter configuration.
 	 * 
+	 * @param T A from the {@code Session} interface derived sub type 
 	 * @param parameters
 	 *            a {@code Map} of name/value pairs with parameters for the
-	 *            session.
+	 *            session. See class {@code SessionParameter}.
 	 * @return a {@code session} to the CMIS repository specified by the {@code
-	 *         parameters}.
+	 *         parameters}. 
 	 */
 	<T extends Session> T createSession(Map<String, String> parameters);
-
 }

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/TransientSession.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/TransientSession.java?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/TransientSession.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/TransientSession.java Mon Feb 22 10:26:19 2010
@@ -18,6 +18,9 @@
  */
 package org.apache.opencmis.client.api;
 
+/**
+ * A transient session buffers all write operations in memory until the save operation is called.
+ */
 public interface TransientSession extends Session {
   /**
    * Save all pending actions for this session. Corresponds to a <code>commit</code> if the CMIS

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/package.html
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/package.html?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/package.html (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/package.html Mon Feb 22 10:26:19 2010
@@ -1,19 +1,22 @@
-<!--
- 
-  Copyright 2009 Alfresco Software Ltd / Open Text Corporation / SAP AG
+<!-- 
+
+ 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
 
-  Licensed 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
 
-    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.
 
-  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.
-  
  -->
 <html>
 <head>

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/util/Testable.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/util/Testable.java?rev=912529&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/util/Testable.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/util/Testable.java Mon Feb 22 10:26:19 2010
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+package org.apache.opencmis.client.api.util;
+
+import java.util.Map;
+
+/**
+ * Implemented by Session class and used by JUnit or other test applications to generate
+ * test data.
+ */
+public interface Testable {
+
+	static String ROOT_FOLDER_ID_PARAMETER = "org.apache.opencmis.root.id"; 
+	static String DOCUMENT_TYPE_ID_PARAMETER = "org.apache.opencmis.document.type.id"; 
+	static String FOLDER_TYPE_ID_PARAMETER = "org.apache.opencmis.folder.type.id"; 
+	
+	/**
+	 * Trigger a repository to generate test data
+	 * @param parameter reserved parameter map
+	 */
+	void generateTestData(Map<String, String> parameter);
+
+	/**
+	 * Clean up generated data
+	 */
+	void cleanUpTestData();
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-api/src/main/java/org/apache/opencmis/client/api/util/Testable.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/pom.xml?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/pom.xml (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/pom.xml Mon Feb 22 10:26:19 2010
@@ -1,5 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
+<!--
+   Licensed 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.
+  -->
+
 <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
@@ -39,6 +53,13 @@
     	<version>2.5.2</version>
     	<scope>test</scope>
     </dependency> 
+    <dependency>
+    	<groupId>org.opencmis</groupId>
+    	<artifactId>opencmis-test-util</artifactId>
+    	<version>0.1-SNAPSHOT</version>
+    	<type>jar</type>
+    	<scope>compile</scope>
+    </dependency>
   </dependencies>
 
 </project>

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentFolderImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentFolderImpl.java?rev=912529&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentFolderImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentFolderImpl.java Mon Feb 22 10:26:19 2010
@@ -0,0 +1,287 @@
+/*
+ * 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.
+ */
+package org.apache.opencmis.client.runtime;
+
+import java.util.GregorianCalendar;
+import java.util.List;
+import java.util.TreeMap;
+
+import org.apache.opencmis.client.api.Ace;
+import org.apache.opencmis.client.api.CmisObject;
+import org.apache.opencmis.client.api.ContentStream;
+import org.apache.opencmis.client.api.Document;
+import org.apache.opencmis.client.api.Folder;
+import org.apache.opencmis.client.api.Policy;
+import org.apache.opencmis.client.api.Property;
+import org.apache.opencmis.client.api.Relationship;
+import org.apache.opencmis.client.api.objecttype.ObjectType;
+import org.apache.opencmis.client.api.repository.AllowableActions;
+import org.apache.opencmis.client.api.util.AceList;
+import org.apache.opencmis.client.api.util.PagingList;
+import org.apache.opencmis.commons.enums.AclPropagation;
+import org.apache.opencmis.commons.enums.BaseObjectTypeIds;
+import org.apache.opencmis.commons.enums.RelationshipDirection;
+import org.apache.opencmis.commons.enums.UnfileObjects;
+import org.apache.opencmis.commons.enums.VersioningState;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.opencmis.commons.provider.ObjectData;
+
+public class PersistentFolderImpl implements Folder {
+
+	public PersistentFolderImpl(PersistentSessionImpl persistentSessionImpl,
+			ObjectData od) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public Document createDocument(String name) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public Document createDocument(String name, String typeId) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public Document createDocument(List<Property<?>> properties,
+			ContentStream contentstream, VersioningState versioningState,
+			List<Policy> policies, List<Ace> addACEs, List<Ace> removeACEs) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public Document createDocumentFromSource(Document source,
+			List<Property<?>> properties, VersioningState versioningState,
+			List<Policy> policies, List<Ace> addACEs, List<Ace> removeACEs) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public Folder createFolder(List<Property<?>> properties,
+			List<Policy> policies, List<Ace> addACEs, List<Ace> removeACEs) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public Policy createPolicy(List<Property<?>> properties,
+			List<Policy> policies, List<Ace> addACEs, List<Ace> removeACEs) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public List<String> deleteTree(boolean allversions, UnfileObjects unfile,
+			boolean continueOnFailure) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public List<ObjectType> getAllowedChildObjectTypes() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public PagingList<Document> getCheckedOutDocs(String orderby,
+			int itemsPerPage) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public PagingList<CmisObject> getChildren(String orderby, int itemsPerPage) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public TreeMap<String, CmisObject> getDescendants(int depth) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public Folder getFolderParent() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public TreeMap<String, CmisObject> getFolderTree(int depth) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void addAcl(List<Ace> addAces, AclPropagation aclPropagation) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void addToFolder(Folder folder, boolean allVersions) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AceList applyAcl(List<Ace> addAces, List<Ace> removeAces,
+			AclPropagation aclPropagation) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void applyPolicy(Policy policy) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void applyPolicy(String policyId) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void delete(boolean allVersions) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public List<Ace> getAcl() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AceList getAcl(boolean onlyBasicPermissions) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public AllowableActions getAllowableActions() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public ObjectType getBaseType() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public BaseObjectTypeIds getBaseTypeId() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public String getChangeToken() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public String getCreatedBy() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public GregorianCalendar getCreationDate() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public String getId() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public GregorianCalendar getLastModificationDate() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public String getLastModifiedBy() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public String getName() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public List<Folder> getParents() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public String getPath() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public String getPathSegment() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public List<Policy> getPolicies() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public List<Property<?>> getProperties() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public List<Property<?>> getProperties(String filter) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public <T> Property<T> getProperty(String id) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public <T> List<T> getPropertyMultivalue(String id) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public <T> T getPropertyValue(String id) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public List<Relationship> getRelationships() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public List<Relationship> getRelationships(
+			boolean includeSubRelationshipTypes,
+			RelationshipDirection relationshipDirection, ObjectType type) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public ObjectType getType() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public boolean isChanged() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public boolean isExactAcl() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public CmisObject move(Folder targetfolder) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void removeAcl(List<Ace> addAces, AclPropagation aclPropagation) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void removeFromFolder(Folder folder) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void removePolicy(Policy policy) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void removePolicy(String policyId) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void setName(String name) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public <T> void setProperty(String id, T value) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public <T> void setPropertyMultivalue(String id, List<T> value) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void setType(ObjectType type) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void setTypeId(String typeId) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void updateProperties(List<Property<?>> properties) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentFolderImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java?rev=912529&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java Mon Feb 22 10:26:19 2010
@@ -0,0 +1,370 @@
+/*
+ * 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.
+ */
+package org.apache.opencmis.client.runtime;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.opencmis.client.api.ChangeEvent;
+import org.apache.opencmis.client.api.CmisObject;
+import org.apache.opencmis.client.api.Document;
+import org.apache.opencmis.client.api.ExtensionHandler;
+import org.apache.opencmis.client.api.Folder;
+import org.apache.opencmis.client.api.PersistentSession;
+import org.apache.opencmis.client.api.Property;
+import org.apache.opencmis.client.api.SessionContext;
+import org.apache.opencmis.client.api.objecttype.ObjectType;
+import org.apache.opencmis.client.api.repository.ObjectFactory;
+import org.apache.opencmis.client.api.repository.PropertyFactory;
+import org.apache.opencmis.client.api.repository.RepositoryInfo;
+import org.apache.opencmis.client.api.util.PagingList;
+import org.apache.opencmis.client.api.util.Testable;
+import org.apache.opencmis.client.provider.factory.CmisProviderFactory;
+import org.apache.opencmis.client.runtime.cache.Cache;
+import org.apache.opencmis.client.runtime.cache.CacheImpl;
+import org.apache.opencmis.client.runtime.repository.PropertyFactoryImpl;
+import org.apache.opencmis.commons.SessionParameter;
+import org.apache.opencmis.commons.enums.CmisProperties;
+import org.apache.opencmis.commons.enums.IncludeRelationships;
+import org.apache.opencmis.commons.enums.UnfileObjects;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.opencmis.commons.provider.CmisProvider;
+import org.apache.opencmis.commons.provider.ObjectData;
+import org.apache.opencmis.util.repository.ObjectGenerator;
+
+public class PersistentSessionImpl implements PersistentSession, Testable,
+		Serializable {
+
+	/*
+	 * root folder containing generated test data
+	 * (not serializable)
+	 */
+	private transient Folder testRootFolder = null;
+
+	/*
+	 * session parameter
+	 * (serializable)
+	 */
+	private Map<String, String> parameters = null;
+
+	/*
+	 * CMIS provider
+	 * (not serializable)
+	 */
+	private transient CmisProvider provider = null;
+
+	/*
+	 * Session Locale, determined from session parameter
+	 * (serializable)
+	 */
+	private Locale locale = null;
+
+	/*
+	 * If not set explicitly then the repository id is returned by the repository
+	 * (serializable)
+	 */
+	private String repositoryId;
+
+	/*
+	 * helper factory
+	 * (non serializable)
+	 */
+	private transient PropertyFactory propertyFactory = new PropertyFactoryImpl();
+
+	/*
+	 * Object cache
+	 */
+	private Cache cache = new CacheImpl();
+	
+	/**
+	 * required for serialization
+	 */
+	private static final long serialVersionUID = -4287481628831198383L;
+
+	public PersistentSessionImpl(Map<String, String> parameters) {
+		this.parameters = parameters;
+		this.locale = this.determineLocale(parameters);
+		this.repositoryId = this.determineRepositoryId(parameters);
+	}
+
+	private String determineRepositoryId(Map<String, String> parameters) {
+		String repositoryId = parameters.get(SessionParameter.REPOSITORY_ID);
+		// if null then the provider will return a repository id (lazy)
+		return repositoryId;
+	}
+	
+	private Locale determineLocale(Map<String, String> parameters) {
+		Locale locale = null;
+		
+		String language = parameters
+				.get(SessionParameter.LOCALE_ISO639_LANGUAGE);
+		String country = parameters
+				.get(SessionParameter.LOCALE_ISO3166_COUNTRY);
+		String variant = parameters.get(SessionParameter.LOCALE_VARIANT);
+
+		if (variant != null) {
+			// all 3 parameter must not be null and valid 
+			locale = new Locale(language, country, variant);
+		}else {
+			if (country != null) {
+				// 2 parameter must not be null and valid 
+				locale = new Locale(language, country);
+			}else {
+				if (language != null) {
+					// 1 parameter must not be null and valid 
+					locale = new Locale(language);
+				} else {
+					locale = Locale.getDefault();
+				}
+			}
+		}
+		
+		return locale;
+	}
+
+	public void clear() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public PagingList<Document> getCheckedOutDocs(Folder folder,
+			String orderby, int itemsPerPage) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public PagingList<ChangeEvent> getContentChanges(String changeLogToken,
+			int itemsPerPage) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public SessionContext getContext() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public String getExtensionContext() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public ExtensionHandler getExtensionHandler(String context) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public Locale getLocale() {
+		return this.locale;
+	}
+
+	public CmisObject getObject(String objectid) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public CmisObject getObjectByPath(String path) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public ObjectFactory getObjectFactory() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public PropertyFactory getPropertyFactory() {
+		return this.propertyFactory;
+	}
+
+	public RepositoryInfo getRepositoryInfo() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public Folder getRootFolder() {
+		Folder rootFolder = null;
+		
+		if (this.cache.containsPath("/")) {
+			rootFolder = (Folder) this.cache.getByPath("/");
+		} else {
+			String rootFolderId = this.getRepositoryInfo().getRootFolderId();
+			ObjectData od = this.provider.getObjectService().getObject(this.repositoryId, rootFolderId, "", false, IncludeRelationships.NONE, "", false, false, null);
+			rootFolder = new PersistentFolderImpl(this, od);
+			this.cache.put(rootFolder);
+		}
+		
+		return rootFolder;
+	}
+
+	public PagingList<ObjectType> getTypeChildren(ObjectType t,
+			boolean includePropertyDefinitions, int itemsPerPage) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public ObjectType getTypeDefinition(String typeId) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public PagingList<ObjectType> getTypeDescendants(ObjectType t, int depth,
+			boolean includePropertyDefinitions, int itemsPerPage) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public PagingList<CmisObject> query(String statement,
+			boolean searchAllVersions, int itemsPerPage) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public SessionContext setContext(SessionContext context) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public String setExtensionContext(String context) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public ExtensionHandler setExtensionHandler(String context,
+			ExtensionHandler extensionHandler) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void generateTestData(Map<String, String> parameter) {
+		ObjectGenerator og = new ObjectGenerator(this.provider.getObjectFactory(), this.provider.getNavigationService(), this.provider.getObjectService(), this.repositoryId);
+		Folder rootFolder = null;
+		String documentTypeId = null;
+		String folderTypeId = null;
+
+		// check preconditions (mandatory parameter)
+		if (!parameter.containsKey(Testable.DOCUMENT_TYPE_ID_PARAMETER)) {
+			throw new CmisRuntimeException(
+					"Can't genereate test data! Paramter missing: "
+							+ Testable.DOCUMENT_TYPE_ID_PARAMETER);
+		} else {
+			documentTypeId = parameter.get(Testable.DOCUMENT_TYPE_ID_PARAMETER);
+		}
+		if (!parameter.containsKey(Testable.FOLDER_TYPE_ID_PARAMETER)) {
+			throw new CmisRuntimeException(
+					"Can't genereate test data! Paramter missing: "
+							+ Testable.FOLDER_TYPE_ID_PARAMETER);
+		} else {
+			folderTypeId = parameter.get(Testable.FOLDER_TYPE_ID_PARAMETER);
+		}
+
+		// optional test root folder:
+		if (parameter.containsKey(Testable.ROOT_FOLDER_ID_PARAMETER)) {
+			// test root folder
+			String testRootId = parameter
+					.get(Testable.ROOT_FOLDER_ID_PARAMETER);
+			rootFolder = (Folder) this.getObject(testRootId);
+		} else {
+			// repository root
+			rootFolder = this.getRootFolder();
+		}
+
+		// create test root folder
+		List<Property<?>> properties = new ArrayList<Property<?>>();
+		Property<String> nameProperty = this.getPropertyFactory()
+				.createCmisProperty(CmisProperties.NAME,
+						UUID.randomUUID().toString());
+		properties.add(nameProperty);
+		this.testRootFolder = rootFolder.createFolder(properties, null, null,
+				null);
+
+		og.setContentSizeInKB(10);
+		og.setDocumentTypeId(documentTypeId);
+		og.setFolderTypeId(folderTypeId);
+		og.setNumberOfDocumentsToCreatePerFolder(2);
+		og.setDocumentPropertiesToGenerate(null);
+		og.setFolderPropertiesToGenerate(null);
+
+		og.createFolderHierachy(2, 2, this.testRootFolder.getId());
+	}
+
+	public void cleanUpTestData() {
+		if (this.testRootFolder != null) {
+			this.testRootFolder.deleteTree(true, UnfileObjects.DELETE, true);
+			this.testRootFolder = null;
+		}
+	}
+
+	/**
+	 * Connect session object to the provider. This is the very first call after
+	 * a session is created.
+	 * <p>
+	 * In dependency of the parameter set an {@code AtomPub}, a {@code
+	 * WebService} or an {@code InMemory} provider is selected.
+	 */
+	public void connect() {
+		if (this.parameters == null || this.parameters.isEmpty()) {
+			throw new CmisRuntimeException("Session parameter not set!");
+		}
+		// Is the AtomPub URL set?
+		boolean isAtomPub = this.parameters
+				.containsKey(SessionParameter.ATOMPUB_URL) ? true : false;
+		// Are the WebService Prefix or all service URLS are set?
+		boolean isWebService = this.parameters
+				.containsKey(SessionParameter.WEBSERVICE_URL_PREFIX)
+				|| (this.parameters
+						.containsKey(SessionParameter.WEBSERVICES_ACL_SERVICE)
+						&& this.parameters
+								.containsKey(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE)
+						&& this.parameters
+								.containsKey(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE)
+						&& this.parameters
+								.containsKey(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE)
+						&& this.parameters
+								.containsKey(SessionParameter.WEBSERVICES_OBJECT_SERVICE)
+						&& this.parameters
+								.containsKey(SessionParameter.WEBSERVICES_POLICY_SERVICE)
+						&& this.parameters
+								.containsKey(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE)
+						&& this.parameters
+								.containsKey(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE) && this.parameters
+						.containsKey(SessionParameter.WEBSERVICES_VERSIONING_SERVICE)) ? true
+				: false;
+
+		if (!(isAtomPub ^ isWebService)) {
+			// Illegal parameter combination
+			throw new CmisRuntimeException("Ambiguous session parameter: "
+					+ this.parameters);
+		}
+
+		if (isAtomPub) {
+			this.provider = this.creaetAtomPubProvider(this.parameters);
+		} else if (isWebService) {
+			this.provider = this.creaetWebServiceProvider(this.parameters);
+		} else {
+			// Illegal parameter combination
+			throw new CmisRuntimeException("Ambiguous session parameter: "
+					+ this.parameters);
+		}
+
+	}
+
+	private CmisProvider creaetWebServiceProvider(Map<String, String> parameters) {
+		CmisProviderFactory factory = CmisProviderFactory.newInstance();
+		CmisProvider provider = factory
+				.createCmisWebServicesProvider(parameters);
+
+		return provider;
+	}
+
+	private CmisProvider creaetAtomPubProvider(Map<String, String> parameters) {
+		CmisProviderFactory factory = CmisProviderFactory.newInstance();
+		CmisProvider provider = factory.createCmisAtomPubProvider(parameters);
+
+		return provider;
+	}
+
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/SessionFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/SessionFactoryImpl.java?rev=912529&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/SessionFactoryImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/SessionFactoryImpl.java Mon Feb 22 10:26:19 2010
@@ -0,0 +1,79 @@
+/*
+ * 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.
+ */
+package org.apache.opencmis.client.runtime;
+
+import java.util.Map;
+
+import org.apache.opencmis.client.api.Session;
+import org.apache.opencmis.client.api.SessionFactory;
+import org.apache.opencmis.commons.SessionParameter;
+import org.apache.opencmis.commons.enums.SessionType;
+import org.apache.opencmis.commons.exceptions.CmisNotSupportedException;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+
+/**
+ * Default implementation of a session factory. Used by unit tests or
+ * applications that depend directly on runtime implementation.
+ * <p>
+ * <code>
+ * SessionFactory sf = new SessionFactoryImpl();<br>
+ * Session s = sf.create(...);
+ * </code>
+ * <p>
+ * Alternative factory lookup methods:
+ * <p>
+ * <p>
+ * <code>
+ * Context ctx = new DefaultContext();<br>
+ * SessionFactory = ctx.lookup(jndi_key);
+ * </code>
+ */
+public class SessionFactoryImpl implements SessionFactory {
+
+	@SuppressWarnings("unchecked")
+	public <T extends Session> T createSession(Map<String, String> parameters) {
+		Session s = null;
+		SessionType t = null;
+
+		// determine session type
+		if (parameters.containsKey(SessionParameter.SESSION_TYPE)) {
+			t = SessionType.fromValue(parameters
+					.get(SessionParameter.SESSION_TYPE));
+		} else {
+			// default session type if type is not set
+			t = SessionType.PERSISTENT;
+		}
+
+		switch (t) {
+		case PERSISTENT:
+			PersistentSessionImpl ps = new PersistentSessionImpl(parameters);
+			ps.connect();  // connect session with provider
+			s = ps;
+			break;
+		case TRANSIENT:
+			throw new CmisNotSupportedException("SessionType " + t
+					+ "not implemented!");
+		default:
+			throw new CmisRuntimeException("SessionType " + t + "not known!");
+		}
+
+		return (T) s;
+	}
+
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/SessionFactoryImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/Cache.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/Cache.java?rev=912529&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/Cache.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/Cache.java Mon Feb 22 10:26:19 2010
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+package org.apache.opencmis.client.runtime.cache;
+
+import java.util.List;
+
+import org.apache.opencmis.client.api.CmisObject;
+
+/**
+ * Implements a session cache providing following capabilities:
+ * <p>
+ * <lu>
+ * <li>access CmisObject by object id</li>
+ * <li>access CmisObject by object path</li>
+ * <li>access CmisObjects by paging parameter</li>
+ * </lu>
+ */
+public interface Cache {
+
+	boolean containsId(String objectId);
+	boolean containsPath(String path);
+
+	void put(CmisObject object);
+	// public void put(List<CmisObject> pageRange, int pageNumber);
+	
+	CmisObject get(String objectId);
+	CmisObject getByPath(String path);
+	// public List<CmisObject> get(int pageNumber);
+	
+	void clear();
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/Cache.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/CacheImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/CacheImpl.java?rev=912529&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/CacheImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/CacheImpl.java Mon Feb 22 10:26:19 2010
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+package org.apache.opencmis.client.runtime.cache;
+
+import java.io.Serializable;
+
+import org.apache.opencmis.client.api.CmisObject;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+
+public class CacheImpl implements Cache, Serializable {
+
+	/**
+	 * serialization
+	 */
+	private static final long serialVersionUID = 1978445442452564094L;
+
+	public boolean containsId(String objectId){
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void clear() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public boolean containsPath(String path) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public CmisObject get(String objectId) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public CmisObject getByPath(String path) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public void put(CmisObject object) {
+		throw new CmisRuntimeException("not implemented");
+	}
+	
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/cache/CacheImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/PropertyFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/PropertyFactoryImpl.java?rev=912529&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/PropertyFactoryImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/PropertyFactoryImpl.java Mon Feb 22 10:26:19 2010
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+package org.apache.opencmis.client.runtime.repository;
+
+import java.util.List;
+
+import org.apache.opencmis.client.api.Property;
+import org.apache.opencmis.client.api.repository.PropertyFactory;
+import org.apache.opencmis.commons.enums.CmisProperties;
+import org.apache.opencmis.commons.enums.PropertyType;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+
+public class PropertyFactoryImpl implements PropertyFactory {
+
+	public <T> Property<T> createCmisProperty(CmisProperties p, T value) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public <T> Property<T> createProperty(String id, PropertyType type, T value) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public <T> Property<T> createPropertyMultivalue(String id,
+			PropertyType type, List<T> value) {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/repository/PropertyFactoryImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/test/Fixture.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/test/Fixture.java?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/test/Fixture.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/test/Fixture.java Mon Feb 22 10:26:19 2010
@@ -22,124 +22,137 @@
 import java.util.Calendar;
 import java.util.GregorianCalendar;
 import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
 import org.apache.opencmis.client.api.Session;
 import org.apache.opencmis.client.api.SessionFactory;
+import org.apache.opencmis.client.api.util.Testable;
 import org.apache.opencmis.commons.SessionParameter;
 import org.apache.opencmis.test.mock.MockSessionFactory;
 
 /**
- * Definition of unit environment for running test cases. Default implementation supports InMemory
- * binding of OpenCMIS which can be used for stand alone test cases. Within test unit suite it is
- * possible to overwrite the fixture.
+ * Definition of unit environment for running test cases. Default implementation
+ * supports InMemory binding of OpenCMIS which can be used for stand alone test
+ * cases. Within test unit suite it is possible to overwrite the fixture.
  * 
  */
 public class Fixture {
 
-  public static String PROPERTY_FILTER = "*";
-  /*
-   * general
-   */
-  public static String TEST_ROOT_FOLDER_NAME = null;
-  public static String FOLDER_TYPE_ID = "test.folder";
-  public static String DOCUMENT_TYPE_ID = "test.file";
-  public static String QUERY = "SELECT * FROM cmis:document";
-  /*
-   * cmis objects
-   */
-  public static String FOLDER1_NAME = "folder.1";
-  public static String FOLDER2_NAME = "folder.2";
-  public static String DOCUMENT1_NAME = "document.1.txt";
-  public static String DOCUMENT2_NAME = "document.2.txt";
-
-  /*
-   * properties
-   */
-  public static String PROPERTY_NAME_STRING = "StringProperty";
-  public static String PROPERTY_VALUE_STRING = "abc";
-  public static String PROPERTY_NAME_INTEGER = "IntegerProperty";
-  public static Integer PROPERTY_VALUE_INTEGER = new Integer(4711);
-  public static String PROPERTY_NAME_BOOLEAN = "BooleanProperty";
-  public static Boolean PROPERTY_VALUE_BOOLEAN = new Boolean(true);
-  public static String PROPERTY_NAME_DOUBLE = "DoubleProperty";
-  public static Double PROPERTY_VALUE_DOUBLE = new Double(1.0);
-  public static String PROPERTY_NAME_FLOAT = "FloatProperty";
-  public static Float PROPERTY_VALUE_FLOAT = new Float(1.0);
-  public static String PROPERTY_NAME_ID = "DoubleProperty";
-  public static String PROPERTY_VALUE_ID = "xyz";
-  public static String PROPERTY_NAME_HTML = "HtmlProperty";
-  public static String PROPERTY_VALUE_HTML = "<body>";
-  public static String PROPERTY_NAME_DATETIME = "DateTimeProperty";
-  public static Calendar PROPERTY_VALUE_DATETIME = GregorianCalendar.getInstance();
-  public static String PROPERTY_NAME_URI = "UriProperty";
-  public static URI PROPERTY_VALUE_URI = URI.create("http://foo.com");
-  public static final String PROPERTY_NAME_STRING_MULTI_VALUED = "MultiValuedStringProperty";
-
-  static {
-    Fixture.TEST_ROOT_FOLDER_NAME = "test_" + UUID.randomUUID().toString();
-  }
-
-  /**
-   * @return session parameter
-   */
-  public static Map<String, String> getParamter() {
-    return paramter;
-  }
-
-  /**
-   * Overwriting default session parameter.
-   * 
-   * @param paramter
-   */
-  public static void setParamter(Map<String, String> paramter) {
-    Fixture.paramter = paramter;
-  }
-
-  /**
-   * session parameter.
-   */
-  private static Map<String, String> paramter = null;
-
-  /**
-   * Overwriting default session factory.
-   * 
-   * @param factory
-   */
-  public static void setSessionFactory(SessionFactory factory) {
-    Fixture.factory = factory;
-  }
-
-  /**
-   * @return factory
-   */
-  public static SessionFactory getSessionFactory() {
-    return Fixture.factory;
-  }
-
-  /**
-   * factory
-   */
-  private static SessionFactory factory = null;
-
-  static {
-    // Mock as default
-    Map<String, String> parameter = new HashMap<String, String>();
-
-    parameter.put(SessionParameter.USER, "Mr. Mock");
-    parameter.put(SessionParameter.PASSWORD, "*mock#");
-    parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, "EN");
-
-    Fixture.paramter = parameter;
-    Fixture.factory = new MockSessionFactory();
-  }
-
-  public static void setUpTestData(Session session) {
-
-  }
-
-  public static void teardownTestData(Session session) {
-
-  }
+	public static String PROPERTY_FILTER = "*";
+	/*
+	 * general
+	 */
+	public static String TEST_ROOT_FOLDER_NAME = null;
+	public static String FOLDER_TYPE_ID = "test.folder";
+	public static String DOCUMENT_TYPE_ID = "test.file";
+	public static String QUERY = "SELECT * FROM cmis:document";
+	/*
+	 * cmis objects
+	 */
+	public static String FOLDER1_NAME = "folder.1";
+	public static String FOLDER2_NAME = "folder.2";
+	public static String DOCUMENT1_NAME = "document.1.txt";
+	public static String DOCUMENT2_NAME = "document.2.txt";
+
+	/*
+	 * properties
+	 */
+	public static String PROPERTY_NAME_STRING = "StringProperty";
+	public static String PROPERTY_VALUE_STRING = "abc";
+	public static String PROPERTY_NAME_INTEGER = "IntegerProperty";
+	public static Integer PROPERTY_VALUE_INTEGER = new Integer(4711);
+	public static String PROPERTY_NAME_BOOLEAN = "BooleanProperty";
+	public static Boolean PROPERTY_VALUE_BOOLEAN = new Boolean(true);
+	public static String PROPERTY_NAME_DOUBLE = "DoubleProperty";
+	public static Double PROPERTY_VALUE_DOUBLE = new Double(1.0);
+	public static String PROPERTY_NAME_FLOAT = "FloatProperty";
+	public static Float PROPERTY_VALUE_FLOAT = new Float(1.0);
+	public static String PROPERTY_NAME_ID = "DoubleProperty";
+	public static String PROPERTY_VALUE_ID = "xyz";
+	public static String PROPERTY_NAME_HTML = "HtmlProperty";
+	public static String PROPERTY_VALUE_HTML = "<body>";
+	public static String PROPERTY_NAME_DATETIME = "DateTimeProperty";
+	public static Calendar PROPERTY_VALUE_DATETIME = GregorianCalendar
+			.getInstance();
+	public static String PROPERTY_NAME_URI = "UriProperty";
+	public static URI PROPERTY_VALUE_URI = URI.create("http://foo.com");
+	public static final String PROPERTY_NAME_STRING_MULTI_VALUED = "MultiValuedStringProperty";
+
+	static {
+		Fixture.TEST_ROOT_FOLDER_NAME = "test_" + UUID.randomUUID().toString();
+	}
+
+	/**
+	 * @return session parameter
+	 */
+	public static Map<String, String> getParamter() {
+		return paramter;
+	}
+
+	/**
+	 * Overwriting default session parameter.
+	 * 
+	 * @param paramter
+	 */
+	public static void setParamter(Map<String, String> paramter) {
+		Fixture.paramter = paramter;
+	}
+
+	/**
+	 * session parameter.
+	 */
+	private static Map<String, String> paramter = null;
+
+	/**
+	 * Overwriting default session factory.
+	 * 
+	 * @param factory
+	 */
+	public static void setSessionFactory(SessionFactory factory) {
+		Fixture.factory = factory;
+	}
+
+	/**
+	 * @return factory
+	 */
+	public static SessionFactory getSessionFactory() {
+		return Fixture.factory;
+	}
+
+	/**
+	 * factory
+	 */
+	private static SessionFactory factory = null;
+
+	static {
+		// Mock as default
+		Map<String, String> parameter = new HashMap<String, String>();
+
+		parameter.put(SessionParameter.USER, "Mr. Mock");
+		parameter.put(SessionParameter.PASSWORD, "*mock#");
+		parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, "EN");
+
+		Fixture.paramter = parameter;
+		Fixture.factory = new MockSessionFactory();
+	}
+
+	public static void setUpTestData(Session session) {
+		if (session instanceof Testable) {
+			Map<String, String> p = new Hashtable<String, String>();
+			p.put(Testable.FOLDER_TYPE_ID_PARAMETER, Fixture.FOLDER_TYPE_ID);
+			p
+					.put(Testable.DOCUMENT_TYPE_ID_PARAMETER,
+							Fixture.DOCUMENT_TYPE_ID);
+			((Testable) session).generateTestData(p);
+		}
+	}
+
+	public static void teardownTestData(Session session) {
+		if (session instanceof Testable) {
+			((Testable) session).cleanUpTestData();
+		}
+	}
 }

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/test/suite/otx/OtxAtomPubCmisTestSuite.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/test/suite/otx/OtxAtomPubCmisTestSuite.java?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/test/suite/otx/OtxAtomPubCmisTestSuite.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/test/suite/otx/OtxAtomPubCmisTestSuite.java Mon Feb 22 10:26:19 2010
@@ -19,25 +19,26 @@
 package org.apache.opencmis.test.suite.otx;
 
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 
+import org.apache.opencmis.client.runtime.SessionFactoryImpl;
+import org.apache.opencmis.commons.SessionParameter;
+import org.apache.opencmis.commons.enums.SessionType;
+import org.apache.opencmis.test.Fixture;
+import org.apache.opencmis.test.ReadOnlyCreateSessionTest;
+import org.apache.opencmis.test.ReadOnlySessionTest;
+import org.apache.opencmis.test.suite.AbstractCmisTestSuite;
 import org.junit.runner.RunWith;
 import org.junit.runners.Suite.SuiteClasses;
 import org.junit.runners.model.InitializationError;
 import org.junit.runners.model.RunnerBuilder;
-import org.apache.opencmis.test.Fixture;
-import org.apache.opencmis.test.ReadOnlyAclCapabilityTest;
-import org.apache.opencmis.test.ReadOnlyCreateSessionTest;
-import org.apache.opencmis.test.ReadOnlyObjectTest;
-import org.apache.opencmis.test.ReadOnlyRepositoryInfoTest;
-import org.apache.opencmis.test.suite.AbstractCmisTestSuite;
 
 /**
  * Test suite to run OTX AtomPub binding.
  */
 @RunWith(OtxAtomPubCmisTestSuite.class)
-@SuiteClasses( { ReadOnlyCreateSessionTest.class, ReadOnlyRepositoryInfoTest.class,
-    ReadOnlyObjectTest.class, ReadOnlyAclCapabilityTest.class })
+@SuiteClasses( { ReadOnlyCreateSessionTest.class, ReadOnlySessionTest.class })
 public class OtxAtomPubCmisTestSuite extends AbstractCmisTestSuite {
 
   public OtxAtomPubCmisTestSuite(Class<?> klass, RunnerBuilder r) throws InitializationError {
@@ -47,15 +48,30 @@
   @Override
   protected void initializeFixture() {
     Map<String, String> parameter = new HashMap<String, String>();
-    // parameter.put(Session.URL, "http://pwdf6227:8080/cmis/atom");
-    // parameter.put(Session.USER, "test");
-    // parameter.put(Session.PASSWORD, "test");
-    // parameter.put(Session.BINDING, "atompub");
-    // parameter.put(Session.PROVIDER, "otx");
-    // parameter.put(Session.REPOSITORY_ID, "myRepository");
 
+    parameter.put(SessionParameter.USER, "admin");
+    parameter.put(SessionParameter.PASSWORD, "livelink");
+    parameter.put(SessionParameter.SESSION_TYPE, SessionType.PERSISTENT.value());
+    parameter.put(SessionParameter.LOCALE_ISO3166_COUNTRY, Locale.GERMANY.getISO3Country());
+    parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, Locale.GERMANY.getISO3Language());
+    parameter.put(SessionParameter.ATOMPUB_URL, "http://pwdf6227:8080/cmis/atom");
+//    parameter.put(SessionParameter.WEBSERVICE_URL_PREFIX, "http://pwdf6227:8080/cmis/services");
+    
+    Fixture.DOCUMENT_TYPE_ID = "sap.doc";
+    Fixture.FOLDER_TYPE_ID = "sap.folder";
+    
+//    -Dopencmis.test=true
+//    -Dopencmis.test.username=admin
+//    -Dopencmis.test.password=livelink
+//    -Dopencmis.test.repository=testApp
+//    -Dopencmis.test.testfolder=default/F34485
+//    -Dopencmis.test.documenttype=sap.doc
+//    -Dopencmis.test.foldertype=sap.folder
+//    -Dopencmis.test.webservices.url=http://pwdf6227:8080/cmis/services/
+//    -Dopencmis.test.atompub.url=http://pwdf6227:8080/cmis/atom
+    
     Fixture.setParamter(parameter);
-    Fixture.setSessionFactory(null);
+    Fixture.setSessionFactory(new SessionFactoryImpl());
   }
 
 }

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/pom.xml?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/pom.xml (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/pom.xml Mon Feb 22 10:26:19 2010
@@ -1,5 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
+<!--
+   Licensed 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.
+  -->
+
 <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

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/pom.xml?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/pom.xml (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/pom.xml Mon Feb 22 10:26:19 2010
@@ -1,5 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
+<!--
+   Licensed 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.
+  -->
+
 <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

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/SessionParameter.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/SessionParameter.java?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/SessionParameter.java (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-api/src/main/java/org/apache/opencmis/commons/SessionParameter.java Mon Feb 22 10:26:19 2010
@@ -26,50 +26,56 @@
  */
 public final class SessionParameter {
 
-  private SessionParameter() {
-  }
+	private SessionParameter() {
+	}
 
-  // ---- general parameter ----
-  public static final String USER = "org.apache.opencmis.user";
-  public static final String PASSWORD = "org.apache.opencmis.password";
-
-  // ---- provider parameter ----
-  /** Class name of the binding class. */
-  public static final String BINDING_SPI_CLASS = "org.apache.opencmis.provider.binding.classname";
-
-  /** URL of the AtomPub service document. */
-  public static final String ATOMPUB_URL = "org.apache.opencmis.provider.atompub.url";
-
-  public static final String WEBSERVICES_REPOSITORY_SERVICE = "org.apache.opencmis.provider.webservices.RepositoryService";
-  public static final String WEBSERVICES_NAVIGATION_SERVICE = "org.apache.opencmis.provider.webservices.NavigationService";
-  public static final String WEBSERVICES_OBJECT_SERVICE = "org.apache.opencmis.provider.webservices.ObjectService";
-  public static final String WEBSERVICES_VERSIONING_SERVICE = "org.apache.opencmis.provider.webservices.VersioningService";
-  public static final String WEBSERVICES_DISCOVERY_SERVICE = "org.apache.opencmis.provider.webservices.DiscoveryService";
-  public static final String WEBSERVICES_RELATIONSHIP_SERVICE = "org.apache.opencmis.provider.webservices.RelationshipService";
-  public static final String WEBSERVICES_MULTIFILING_SERVICE = "org.apache.opencmis.provider.webservices.MultiFilingService";
-  public static final String WEBSERVICES_POLICY_SERVICE = "org.apache.opencmis.provider.webservices.PolicyService";
-  public static final String WEBSERVICES_ACL_SERVICE = "org.apache.opencmis.provider.webservices.ACLService";
-
-  /** Class name of the authentication provider. */
-  public static final String AUTHENTICATION_PROVIDER_CLASS = "org.apache.opencmis.provider.auth.classname";
-
-  /** Toggle for HTTP basic authentication. Evaluated by the standard authentication provider. */
-  public static final String AUTH_HTTP_BASIC = "org.apache.opencmis.provider.auth.http.basic";
-  /**
-   * Toggle for WS-Security UsernameToken authentication. Evaluated by the standard authentication
-   * provider.
-   */
-  public static final String AUTH_SOAP_USERNAMETOKEN = "org.apache.opencmis.provider.auth.soap.usernametoken";
-
-  public static final String CACHE_SIZE_REPOSITORIES = "org.apache.opencmis.provider.cache.repositories.size";
-  public static final String CACHE_SIZE_TYPES = "org.apache.opencmis.provider.cache.types.size";
-  public static final String CACHE_SIZE_OBJECTS = "org.apache.opencmis.provider.cache.objects.size";
-
-  // --- session control ---
-
-  public static final String LOCALE_ISO639_LANGUAGE = "org.apache.opencmis.locale.iso639";
-  public static final String LOCALE_ISO3166_COUNTRY = "org.apache.opencmis.locale.iso3166";
-  public static final String LOCALE_VARIANT = "org.apache.opencmis.locale.variant";
+	// ---- general parameter ----
+	public static final String USER = "org.apache.opencmis.user";
+	public static final String PASSWORD = "org.apache.opencmis.password";
+
+	// ---- provider parameter ----
+	/** Class name of the binding class. */
+	public static final String BINDING_SPI_CLASS = "org.apache.opencmis.provider.binding.classname";
+
+	/** URL of the AtomPub service document. */
+	public static final String ATOMPUB_URL = "org.apache.opencmis.provider.atompub.url";
+
+	public static final String WEBSERVICE_URL_PREFIX = "org.apache.opencmis.provider.webservices.url";
+
+	public static final String WEBSERVICES_REPOSITORY_SERVICE = "org.apache.opencmis.provider.webservices.RepositoryService";
+	public static final String WEBSERVICES_NAVIGATION_SERVICE = "org.apache.opencmis.provider.webservices.NavigationService";
+	public static final String WEBSERVICES_OBJECT_SERVICE = "org.apache.opencmis.provider.webservices.ObjectService";
+	public static final String WEBSERVICES_VERSIONING_SERVICE = "org.apache.opencmis.provider.webservices.VersioningService";
+	public static final String WEBSERVICES_DISCOVERY_SERVICE = "org.apache.opencmis.provider.webservices.DiscoveryService";
+	public static final String WEBSERVICES_RELATIONSHIP_SERVICE = "org.apache.opencmis.provider.webservices.RelationshipService";
+	public static final String WEBSERVICES_MULTIFILING_SERVICE = "org.apache.opencmis.provider.webservices.MultiFilingService";
+	public static final String WEBSERVICES_POLICY_SERVICE = "org.apache.opencmis.provider.webservices.PolicyService";
+	public static final String WEBSERVICES_ACL_SERVICE = "org.apache.opencmis.provider.webservices.ACLService";
+
+	/** Class name of the authentication provider. */
+	public static final String AUTHENTICATION_PROVIDER_CLASS = "org.apache.opencmis.provider.auth.classname";
+
+	/**
+	 * Toggle for HTTP basic authentication. Evaluated by the standard
+	 * authentication provider.
+	 */
+	public static final String AUTH_HTTP_BASIC = "org.apache.opencmis.provider.auth.http.basic";
+	/**
+	 * Toggle for WS-Security UsernameToken authentication. Evaluated by the
+	 * standard authentication provider.
+	 */
+	public static final String AUTH_SOAP_USERNAMETOKEN = "org.apache.opencmis.provider.auth.soap.usernametoken";
+
+	public static final String CACHE_SIZE_REPOSITORIES = "org.apache.opencmis.provider.cache.repositories.size";
+	public static final String CACHE_SIZE_TYPES = "org.apache.opencmis.provider.cache.types.size";
+	public static final String CACHE_SIZE_OBJECTS = "org.apache.opencmis.provider.cache.objects.size";
+
+	// --- session control ---
+
+	public static final String LOCALE_ISO639_LANGUAGE = "org.apache.opencmis.locale.iso639";
+	public static final String LOCALE_ISO3166_COUNTRY = "org.apache.opencmis.locale.iso3166";
+	public static final String LOCALE_VARIANT = "org.apache.opencmis.locale.variant";
 
-  public static final String SESSION_TYPE = "org.apache.opencmis.session.type";
+	public static final String SESSION_TYPE = "org.apache.opencmis.session.type";
+	public static final Object REPOSITORY_ID = "org.apache.opencmis.session.repository.id";
 }

Modified: incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-impl/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-impl/pom.xml?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-impl/pom.xml (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-commons/opencmis-commons-impl/pom.xml Mon Feb 22 10:26:19 2010
@@ -1,5 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
+<!--
+   Licensed 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.
+  -->
+
 <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

Modified: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-fileshare/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-fileshare/pom.xml?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-fileshare/pom.xml (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-fileshare/pom.xml Mon Feb 22 10:26:19 2010
@@ -1,5 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
+<!--
+   Licensed 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.
+  -->
+
 <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

Modified: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-impl/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-impl/pom.xml?rev=912529&r1=912528&r2=912529&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-impl/pom.xml (original)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-impl/pom.xml Mon Feb 22 10:26:19 2010
@@ -1,5 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
+<!--
+   Licensed 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.
+  -->
+
 <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



Mime
View raw message