You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2012/02/20 09:25:50 UTC
svn commit: r1291145 - in /chemistry/opencmis/trunk:
chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/
chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apach...
Author: fmui
Date: Mon Feb 20 08:25:50 2012
New Revision: 1291145
URL: http://svn.apache.org/viewvc?rev=1291145&view=rev
Log:
Moved the type cache class for the Browser Binding server into the right package
Added:
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/TypeCacheImpl.java (with props)
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/TypeCache.java
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/PolicyService.java
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RelationshipService.java
chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java
Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/TypeCache.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/TypeCache.java?rev=1291145&r1=1291144&r2=1291145&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/TypeCache.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/TypeCache.java Mon Feb 20 08:25:50 2012
@@ -18,46 +18,20 @@
*/
package org.apache.chemistry.opencmis.commons.impl;
-import java.util.HashMap;
-import java.util.Map;
-
import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
-import org.apache.chemistry.opencmis.commons.server.CmisService;
-import org.apache.chemistry.opencmis.commons.server.ObjectInfo;
/**
* Temporary type cache used for one call.
*/
-public class TypeCache {
-
- private final String repositoryId;
- private final CmisService service;
- private final Map<String, TypeDefinition> typeDefinitions;
-
- public TypeCache(String repositoryId, CmisService service) {
- this.repositoryId = repositoryId;
- this.service = service;
- typeDefinitions = new HashMap<String, TypeDefinition>();
- }
-
- public TypeDefinition getTypeDefinition(String typeId) {
- TypeDefinition type = typeDefinitions.get(typeId);
- if (type == null) {
- type = service.getTypeDefinition(repositoryId, typeId, null);
- if (type != null) {
- typeDefinitions.put(type.getId(), type);
- }
- }
-
- return type;
- }
-
- public TypeDefinition getTypeDefinitionForObject(String objectId) {
- ObjectInfo info = service.getObjectInfo(repositoryId, objectId);
- if (info == null) {
- return null;
- }
+public interface TypeCache {
- return getTypeDefinition(info.getTypeId());
- }
+ /**
+ * Gets the type definition by type id.
+ */
+ public TypeDefinition getTypeDefinition(String typeId);
+
+ /**
+ * Gets the type definition of an object.
+ */
+ public TypeDefinition getTypeDefinitionForObject(String objectId);
}
Added: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/TypeCacheImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/TypeCacheImpl.java?rev=1291145&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/TypeCacheImpl.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/TypeCacheImpl.java Mon Feb 20 08:25:50 2012
@@ -0,0 +1,64 @@
+/*
+ * 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.chemistry.opencmis.commons.impl.server;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
+import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+import org.apache.chemistry.opencmis.commons.server.CmisService;
+import org.apache.chemistry.opencmis.commons.server.ObjectInfo;
+
+/**
+ * Temporary type cache used for one call.
+ */
+public class TypeCacheImpl implements TypeCache {
+
+ private final String repositoryId;
+ private final CmisService service;
+ private final Map<String, TypeDefinition> typeDefinitions;
+
+ public TypeCacheImpl(String repositoryId, CmisService service) {
+ this.repositoryId = repositoryId;
+ this.service = service;
+ typeDefinitions = new HashMap<String, TypeDefinition>();
+ }
+
+ public TypeDefinition getTypeDefinition(String typeId) {
+ TypeDefinition type = typeDefinitions.get(typeId);
+ if (type == null) {
+ type = service.getTypeDefinition(repositoryId, typeId, null);
+ if (type != null) {
+ typeDefinitions.put(type.getId(), type);
+ }
+ }
+
+ return type;
+ }
+
+ public TypeDefinition getTypeDefinitionForObject(String objectId) {
+ ObjectInfo info = service.getObjectInfo(repositoryId, objectId);
+ if (info == null) {
+ return null;
+ }
+
+ return getTypeDefinition(info.getTypeId());
+ }
+}
Propchange: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/server/TypeCacheImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java?rev=1291145&r1=1291144&r2=1291145&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/DiscoveryService.java Mon Feb 20 08:25:50 2012
@@ -40,6 +40,7 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.impl.JSONConstants;
import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+import org.apache.chemistry.opencmis.commons.impl.server.TypeCacheImpl;
import org.apache.chemistry.opencmis.commons.server.CallContext;
import org.apache.chemistry.opencmis.commons.server.CmisService;
import org.apache.chemistry.opencmis.commons.spi.Holder;
@@ -76,7 +77,7 @@ public class DiscoveryService {
throw new CmisRuntimeException("Results are null!");
}
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonResults = JSONConverter.convert(results, typeCache, true);
response.setStatus(HttpServletResponse.SC_OK);
@@ -101,7 +102,7 @@ public class DiscoveryService {
ObjectList changes = service.getContentChanges(repositoryId, changeLogTokenHolder, includeProperties, filter,
includePolicyIds, includeAcl, maxItems, null);
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonChanges = JSONConverter.convert(changes, typeCache, false);
jsonChanges.put(JSONConstants.JSON_OBJECTLIST_CHANGE_LOG_TOKEN, changeLogTokenHolder.getValue());
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java?rev=1291145&r1=1291144&r2=1291145&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/MultiFilingService.java Mon Feb 20 08:25:50 2012
@@ -36,6 +36,7 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.impl.Constants;
import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+import org.apache.chemistry.opencmis.commons.impl.server.TypeCacheImpl;
import org.apache.chemistry.opencmis.commons.server.CallContext;
import org.apache.chemistry.opencmis.commons.server.CmisService;
import org.apache.chemistry.opencmis.commons.spi.Holder;
@@ -74,7 +75,7 @@ public class MultiFilingService {
response.setHeader("Location", location);
// return object
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
writeJSON(jsonObject, request, response);
@@ -107,7 +108,7 @@ public class MultiFilingService {
response.setHeader("Location", location);
// return object
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
writeJSON(jsonObject, request, response);
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java?rev=1291145&r1=1291144&r2=1291145&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/NavigationService.java Mon Feb 20 08:25:50 2012
@@ -49,6 +49,7 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+import org.apache.chemistry.opencmis.commons.impl.server.TypeCacheImpl;
import org.apache.chemistry.opencmis.commons.server.CallContext;
import org.apache.chemistry.opencmis.commons.server.CmisService;
import org.json.simple.JSONArray;
@@ -88,7 +89,7 @@ public final class NavigationService {
throw new CmisRuntimeException("Children are null!");
}
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonChildren = JSONConverter.convert(children, typeCache);
response.setStatus(HttpServletResponse.SC_OK);
@@ -119,7 +120,7 @@ public final class NavigationService {
throw new CmisRuntimeException("Descendants are null!");
}
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONArray jsonDescendants = new JSONArray();
for (ObjectInFolderContainer descendant : descendants) {
jsonDescendants.add(JSONConverter.convert(descendant, typeCache));
@@ -153,7 +154,7 @@ public final class NavigationService {
throw new CmisRuntimeException("Folder Tree are null!");
}
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONArray jsonDescendants = new JSONArray();
for (ObjectInFolderContainer descendant : folderTree) {
jsonDescendants.add(JSONConverter.convert(descendant, typeCache));
@@ -179,7 +180,7 @@ public final class NavigationService {
throw new CmisRuntimeException("Parent is null!");
}
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonObject = JSONConverter.convert(parent, typeCache, false);
response.setStatus(HttpServletResponse.SC_OK);
@@ -209,7 +210,7 @@ public final class NavigationService {
throw new CmisRuntimeException("Parents are null!");
}
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONArray jsonParents = new JSONArray();
for (ObjectParentData parent : parents) {
jsonParents.add(JSONConverter.convert(parent, typeCache));
@@ -243,7 +244,7 @@ public final class NavigationService {
throw new CmisRuntimeException("Checked out list is null!");
}
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonCheckedOut = JSONConverter.convert(checkedout, typeCache, false);
response.setStatus(HttpServletResponse.SC_OK);
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java?rev=1291145&r1=1291144&r2=1291145&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ObjectService.java Mon Feb 20 08:25:50 2012
@@ -79,6 +79,7 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.impl.MimeHelper;
import org.apache.chemistry.opencmis.commons.impl.ReturnVersion;
import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+import org.apache.chemistry.opencmis.commons.impl.server.TypeCacheImpl;
import org.apache.chemistry.opencmis.commons.server.CallContext;
import org.apache.chemistry.opencmis.commons.server.CmisService;
import org.apache.chemistry.opencmis.commons.spi.Holder;
@@ -107,7 +108,7 @@ public final class ObjectService {
// execute
ControlParser cp = new ControlParser(request);
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
String newObjectId = service.createDocument(repositoryId, createProperties(cp, null, typeCache), folderId,
createContentStream(request), versioningState, createPolicies(cp), createAddAcl(cp),
@@ -141,7 +142,7 @@ public final class ObjectService {
// execute
ControlParser cp = new ControlParser(request);
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
ObjectData sourceDoc = getSimpleObject(service, repositoryId, sourceId);
PropertyData<?> sourceTypeId = sourceDoc.getProperties().getProperties().get(PropertyIds.OBJECT_TYPE_ID);
@@ -179,7 +180,7 @@ public final class ObjectService {
// execute
ControlParser cp = new ControlParser(request);
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
String newObjectId = service.createFolder(repositoryId, createProperties(cp, null, typeCache), folderId,
createPolicies(cp), createAddAcl(cp), createRemoveAcl(cp), null);
@@ -210,7 +211,7 @@ public final class ObjectService {
// execute
ControlParser cp = new ControlParser(request);
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
String newObjectId = service.createPolicy(repositoryId, createProperties(cp, null, typeCache), folderId,
createPolicies(cp), createAddAcl(cp), createRemoveAcl(cp), null);
@@ -240,7 +241,7 @@ public final class ObjectService {
// execute
ControlParser cp = new ControlParser(request);
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
String newObjectId = service.createRelationship(repositoryId, createProperties(cp, null, typeCache),
createPolicies(cp), createAddAcl(cp), createRemoveAcl(cp), null);
@@ -273,7 +274,7 @@ public final class ObjectService {
// execute
ControlParser cp = new ControlParser(request);
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
Holder<String> objectIdHolder = new Holder<String>(objectId);
Holder<String> changeTokenHolder = (changeToken == null ? null : new Holder<String>(changeToken));
@@ -326,7 +327,7 @@ public final class ObjectService {
}
// return object
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonObject = JSONConverter.convert(properties, objectId, typeCache, false);
response.setStatus(HttpServletResponse.SC_OK);
@@ -366,7 +367,7 @@ public final class ObjectService {
}
// return object
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
response.setStatus(HttpServletResponse.SC_OK);
@@ -531,7 +532,7 @@ public final class ObjectService {
response.setStatus(HttpServletResponse.SC_OK);
// return object
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
writeJSON(jsonObject, request, response);
@@ -567,7 +568,7 @@ public final class ObjectService {
response.setHeader("Location", location);
// return object
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
writeJSON(jsonObject, request, response);
@@ -601,7 +602,7 @@ public final class ObjectService {
response.setHeader("Location", location);
// return object
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
writeJSON(jsonObject, request, response);
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/PolicyService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/PolicyService.java?rev=1291145&r1=1291144&r2=1291145&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/PolicyService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/PolicyService.java Mon Feb 20 08:25:50 2012
@@ -34,6 +34,7 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+import org.apache.chemistry.opencmis.commons.impl.server.TypeCacheImpl;
import org.apache.chemistry.opencmis.commons.server.CallContext;
import org.apache.chemistry.opencmis.commons.server.CmisService;
import org.json.simple.JSONArray;
@@ -59,7 +60,7 @@ public class PolicyService {
JSONArray jsonPolicies = new JSONArray();
if (policies != null) {
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
for (ObjectData policy : policies) {
jsonPolicies.add(JSONConverter.convert(policy, typeCache, false));
}
@@ -89,7 +90,7 @@ public class PolicyService {
// return object
response.setStatus(HttpServletResponse.SC_OK);
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
writeJSON(jsonObject, request, response);
@@ -115,7 +116,7 @@ public class PolicyService {
// return object
response.setStatus(HttpServletResponse.SC_OK);
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
writeJSON(jsonObject, request, response);
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RelationshipService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RelationshipService.java?rev=1291145&r1=1291144&r2=1291145&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RelationshipService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/RelationshipService.java Mon Feb 20 08:25:50 2012
@@ -41,6 +41,7 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+import org.apache.chemistry.opencmis.commons.impl.server.TypeCacheImpl;
import org.apache.chemistry.opencmis.commons.server.CallContext;
import org.apache.chemistry.opencmis.commons.server.CmisService;
import org.json.simple.JSONObject;
@@ -71,7 +72,7 @@ public class RelationshipService {
throw new CmisRuntimeException("Relationships are null!");
}
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonChildren = JSONConverter.convert(relationships, typeCache, false);
response.setStatus(HttpServletResponse.SC_OK);
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java?rev=1291145&r1=1291144&r2=1291145&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/VersioningService.java Mon Feb 20 08:25:50 2012
@@ -49,6 +49,7 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
import org.apache.chemistry.opencmis.commons.impl.JSONConverter;
import org.apache.chemistry.opencmis.commons.impl.TypeCache;
+import org.apache.chemistry.opencmis.commons.impl.server.TypeCacheImpl;
import org.apache.chemistry.opencmis.commons.server.CallContext;
import org.apache.chemistry.opencmis.commons.server.CmisService;
import org.apache.chemistry.opencmis.commons.spi.Holder;
@@ -82,7 +83,7 @@ public class VersioningService {
}
// return object
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONObject jsonObject = JSONConverter.convert(object, typeCache, false);
// set headers
@@ -126,7 +127,7 @@ public class VersioningService {
// execute
ControlParser cp = new ControlParser(request);
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
Holder<String> objectIdHolder = new Holder<String>(objectId);
service.checkIn(repositoryId, objectIdHolder, major, createProperties(cp, null, typeCache),
@@ -170,7 +171,7 @@ public class VersioningService {
throw new CmisRuntimeException("Versions are null!");
}
- TypeCache typeCache = new TypeCache(repositoryId, service);
+ TypeCache typeCache = new TypeCacheImpl(repositoryId, service);
JSONArray jsonVersions = new JSONArray();
for (ObjectData version : versions) {
jsonVersions.add(JSONConverter.convert(version, typeCache, false));