chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sklev...@apache.org
Subject svn commit: r915047 - in /incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src: main/java/org/apache/opencmis/client/runtime/ test/java/org/apache/opencmis/client/runtime/suite/otx/
Date Mon, 22 Feb 2010 20:24:14 GMT
Author: sklevenz
Date: Mon Feb 22 20:24:14 2010
New Revision: 915047

URL: http://svn.apache.org/viewvc?rev=915047&view=rev
Log:
Continuous runtime development

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

Added:
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java
Modified:
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxAtomPubCmisTestSuite.java

Modified: 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=915047&r1=915046&r2=915047&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
Mon Feb 22 20:24:14 2010
@@ -53,6 +53,7 @@
 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.commons.provider.RepositoryInfoData;
 import org.apache.opencmis.util.repository.ObjectGenerator;
 
 public class PersistentSessionImpl implements PersistentSession, Testable,
@@ -96,6 +97,12 @@
 	 */
 	private Cache cache = null;
 
+	/*
+	 * Lazy loaded repository info
+	 * (serializable)
+	 */
+	private RepositoryInfo repositoryInfo;
+
 	/**
 	 * required for serialization
 	 */
@@ -212,7 +219,11 @@
 	}
 
 	public RepositoryInfo getRepositoryInfo() {
-		throw new CmisRuntimeException("not implemented");
+		if (this.repositoryInfo == null) {
+			RepositoryInfoData riData = this.provider.getRepositoryService().getRepositoryInfo(this.repositoryId,
null);
+			this.repositoryInfo = new RepositoryInfoImpl(this, riData);
+		}
+		return this.repositoryInfo;
 	}
 
 	public Folder getRootFolder() {
@@ -223,8 +234,8 @@
 		} else {
 			String rootFolderId = this.getRepositoryInfo().getRootFolderId();
 			ObjectData od = this.provider.getObjectService().getObject(
-					this.repositoryId, rootFolderId, "", false,
-					IncludeRelationships.NONE, "", false, false, null);
+					this.repositoryId, rootFolderId, null, false,
+					IncludeRelationships.NONE, null, false, false, null);
 			rootFolder = new PersistentFolderImpl(this, od);
 			this.cache.put(rootFolder);
 		}

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java?rev=915047&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java
(added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java
Mon Feb 22 20:24:14 2010
@@ -0,0 +1,102 @@
+package org.apache.opencmis.client.runtime;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.apache.opencmis.client.api.repository.RepositoryAclCapabilities;
+import org.apache.opencmis.client.api.repository.RepositoryCapabilities;
+import org.apache.opencmis.client.api.repository.RepositoryInfo;
+import org.apache.opencmis.commons.enums.BaseObjectTypeIds;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.opencmis.commons.provider.RepositoryInfoData;
+
+public class RepositoryInfoImpl implements RepositoryInfo, Serializable {
+
+	/**
+	 * serialization
+	 */
+	private static final long serialVersionUID = -1297274972722405445L;
+
+	/*
+	 * provider data (serializable)
+	 */
+	private RepositoryInfoData riData;
+
+	/*
+	 * session (serializable)
+	 */
+	private PersistentSessionImpl session;
+
+	public RepositoryInfoImpl(PersistentSessionImpl session,
+			RepositoryInfoData riData) {
+		this.riData = riData;
+		this.session = session;
+	}
+
+	public boolean changesIncomplete() {
+		return this.riData.changesIncomplete();
+	}
+
+	public RepositoryAclCapabilities getAclCapabilities() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public RepositoryCapabilities getCapabilities() {
+		throw new CmisRuntimeException("not implemented");
+	}
+
+	public List<BaseObjectTypeIds> getChangesOnType() {
+		return this.riData.getChangesOnType();
+	}
+
+	public String getCmisVersionSupported() {
+		return this.riData.getCmisVersionSupported();
+	}
+
+	public String getDescription() {
+		return this.riData.getRepositoryDescription();
+	}
+
+	public String getId() {
+		return this.riData.getRepositoryId();
+	}
+
+	public String getLatestChangeLogToken() {
+		return this.riData.getLatestChangeLogToken();
+	}
+
+	public String getName() {
+		return this.riData.getRepositoryName();
+	}
+
+	public String getPrincipalIdAnonymous() {
+		return this.riData.getPrincipalAnonymous();
+	}
+
+	public String getPrincipalIdAnyone() {
+		return this.riData.getPrincipalAnyone();
+	}
+
+	public String getProductName() {
+		return this.riData.getProductName();
+
+	}
+
+	public String getProductVersion() {
+		return this.getProductVersion();
+	}
+
+	public String getRootFolderId() {
+		return this.riData.getRootFolderId();
+	}
+
+	public String getThinClientUri() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getVendorName() {
+		return this.riData.getThinClientUri();
+	}
+
+}

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/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/client/runtime/suite/otx/OtxAtomPubCmisTestSuite.java?rev=915047&r1=915046&r2=915047&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxAtomPubCmisTestSuite.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/test/java/org/apache/opencmis/client/runtime/suite/otx/OtxAtomPubCmisTestSuite.java
Mon Feb 22 20:24:14 2010
@@ -26,6 +26,7 @@
 import org.apache.opencmis.client.runtime.ReadOnlyCreateSessionTest;
 import org.apache.opencmis.client.runtime.ReadOnlySessionTest;
 import org.apache.opencmis.client.runtime.SessionFactoryImpl;
+import org.apache.opencmis.client.runtime.misc.CacheTest;
 import org.apache.opencmis.client.runtime.suite.AbstractCmisTestSuite;
 import org.apache.opencmis.commons.SessionParameter;
 import org.apache.opencmis.commons.enums.BindingType;
@@ -39,7 +40,7 @@
  * Test suite to run OTX AtomPub binding.
  */
 @RunWith(OtxAtomPubCmisTestSuite.class)
-@SuiteClasses( { ReadOnlyCreateSessionTest.class, ReadOnlySessionTest.class })
+@SuiteClasses( { CacheTest.class, ReadOnlyCreateSessionTest.class, ReadOnlySessionTest.class
})
 public class OtxAtomPubCmisTestSuite extends AbstractCmisTestSuite {
 
   public OtxAtomPubCmisTestSuite(Class<?> klass, RunnerBuilder r) throws InitializationError
{
@@ -57,6 +58,7 @@
     parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, Locale.GERMANY.getISO3Language());
     parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOM.value());
     parameter.put(SessionParameter.ATOMPUB_URL, "http://pwdf6227:8080/cmis/atom");
+    parameter.put(SessionParameter.REPOSITORY_ID, "testApp");
     
     Fixture.DOCUMENT_TYPE_ID = "sap.doc";
     Fixture.FOLDER_TYPE_ID = "sap.folder";



Mime
View raw message