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 2013/04/15 17:21:58 UTC
svn commit: r1468114 [3/3] - in /chemistry/opencmis/trunk:
chemistry-opencmis-android/chemistry-opencmis-android-client/
chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webser...
Propchange: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/WSConverter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.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/XMLConverter.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/main/java/org/apache/chemistry/opencmis/commons/impl/XMLConverter.java Mon Apr 15 15:21:57 2013
@@ -294,7 +294,6 @@ public class XMLConverter {
writeExtensions(writer, newTypeSettableAttributes);
writer.writeEndElement();
}
-
}
writeExtensions(writer, source);
Modified: chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/ConverterTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/ConverterTest.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/ConverterTest.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-impl/src/test/java/org/apache/chemistry/opencmis/commons/impl/misc/ConverterTest.java Mon Apr 15 15:21:57 2013
@@ -44,8 +44,9 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.enums.CapabilityJoin;
import org.apache.chemistry.opencmis.commons.enums.CapabilityQuery;
import org.apache.chemistry.opencmis.commons.enums.CapabilityRenditions;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
import org.apache.chemistry.opencmis.commons.enums.ContentStreamAllowed;
-import org.apache.chemistry.opencmis.commons.impl.Converter;
+import org.apache.chemistry.opencmis.commons.impl.WSConverter;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.AclCapabilitiesDataImpl;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.DocumentTypeDefinitionImpl;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectDataImpl;
@@ -56,16 +57,13 @@ import org.apache.chemistry.opencmis.com
/**
* Tests converter methods.
- *
- * @author <a href="mailto:fmueller@opentext.com">Florian Müller</a>
- *
*/
public class ConverterTest extends TestCase {
public void testRepositoryInfo() throws Exception {
// dry run
RepositoryInfoImpl obj1 = new RepositoryInfoImpl();
- RepositoryInfo obj2 = Converter.convert(Converter.convert(obj1));
+ RepositoryInfo obj2 = WSConverter.convert(WSConverter.convert(obj1, CmisVersion.CMIS_1_1));
assertDataObjectsEquals("RepositoryInfo", obj1, obj2);
@@ -127,7 +125,7 @@ public class ConverterTest extends TestC
acl1.setPermissionMappingData(pmd);
obj1.setAclCapabilities(acl1);
- obj2 = Converter.convert(Converter.convert(obj1));
+ obj2 = WSConverter.convert(WSConverter.convert(obj1, CmisVersion.CMIS_1_1));
assertDataObjectsEquals("RepositoryInfo", obj1, obj2);
}
@@ -135,7 +133,7 @@ public class ConverterTest extends TestC
public void testTypeDefinition() throws Exception {
// dry run
DocumentTypeDefinitionImpl obj1 = new DocumentTypeDefinitionImpl();
- TypeDefinition obj2 = Converter.convert(Converter.convert(obj1));
+ TypeDefinition obj2 = WSConverter.convert(WSConverter.convert(obj1));
assertDataObjectsEquals("TypeDefinition", obj1, obj2);
@@ -158,7 +156,7 @@ public class ConverterTest extends TestC
obj1.setParentTypeId("parentId");
obj1.setQueryName("queryName");
- obj2 = Converter.convert(Converter.convert(obj1));
+ obj2 = WSConverter.convert(WSConverter.convert(obj1));
assertDataObjectsEquals("TypeDefinition", obj1, obj2);
}
@@ -166,7 +164,7 @@ public class ConverterTest extends TestC
public void testObject() throws Exception {
// dry run
ObjectDataImpl obj1 = new ObjectDataImpl();
- ObjectData obj2 = Converter.convert(Converter.convert(obj1));
+ ObjectData obj2 = WSConverter.convert(WSConverter.convert(obj1, CmisVersion.CMIS_1_1));
assertDataObjectsEquals("Object", obj1, obj2);
}
@@ -215,8 +213,8 @@ public class ConverterTest extends TestC
for (Map.Entry<?, ?> entry : expectedMap.entrySet()) {
assertTrue(actualMap.containsKey(entry.getKey()));
- assertDataObjectsEquals(name + "[" + entry.getKey() + "]", entry.getValue(), actualMap.get(entry
- .getKey()));
+ assertDataObjectsEquals(name + "[" + entry.getKey() + "]", entry.getValue(),
+ actualMap.get(entry.getKey()));
}
return;
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/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/atompub/PolicyService.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/PolicyService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/PolicyService.java Mon Apr 15 15:21:57 2013
@@ -18,7 +18,6 @@
*/
package org.apache.chemistry.opencmis.server.impl.atompub;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.RESOURCE_POLICIES;
import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.compileBaseUrl;
import static org.apache.chemistry.opencmis.server.impl.atompub.AtomPubUtils.compileUrlBuilder;
@@ -35,7 +34,6 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
import org.apache.chemistry.opencmis.commons.impl.Constants;
import org.apache.chemistry.opencmis.commons.impl.UrlBuilder;
-import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisObjectType;
import org.apache.chemistry.opencmis.commons.server.CallContext;
import org.apache.chemistry.opencmis.commons.server.CmisService;
import org.apache.chemistry.opencmis.commons.server.ObjectInfo;
@@ -170,11 +168,6 @@ public final class PolicyService {
*/
private static void writePolicyEntry(CmisService service, AtomEntry entry, String objectId, ObjectData policy,
String repositoryId, UrlBuilder baseUrl, CmisVersion cmisVersion) throws Exception {
- CmisObjectType resultJaxb = convert(policy);
- if (resultJaxb == null) {
- return;
- }
-
ObjectInfo info = service.getObjectInfo(repositoryId, policy.getId());
if (info == null) {
throw new CmisRuntimeException("Object Info not found!");
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AbstractService.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/webservices/AbstractService.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AbstractService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AbstractService.java Mon Apr 15 15:21:57 2013
@@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletRes
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.handler.MessageContext;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
import org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException;
import org.apache.chemistry.opencmis.commons.exceptions.CmisConstraintException;
import org.apache.chemistry.opencmis.commons.exceptions.CmisContentAlreadyExistsException;
@@ -145,6 +146,15 @@ public abstract class AbstractService {
}
/**
+ * Returns the CMIS version.
+ */
+ protected CmisVersion getCmisVersion(WebServiceContext wsContext) {
+ HttpServletRequest request = (HttpServletRequest) wsContext.getMessageContext().get(
+ MessageContext.SERVLET_REQUEST);
+ return (CmisVersion) request.getAttribute(CmisWebServicesServlet.CMIS_VERSION);
+ }
+
+ /**
* Returns the {@link CmisService} object.
*/
protected CmisService getService(WebServiceContext wsContext, String repositoryId) {
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AclService.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/webservices/AclService.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AclService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AclService.java Mon Apr 15 15:21:57 2013
@@ -18,7 +18,7 @@
*/
package org.apache.chemistry.opencmis.server.impl.webservices;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convert;
import javax.annotation.Resource;
import javax.jws.WebService;
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/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/webservices/DiscoveryService.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/DiscoveryService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/DiscoveryService.java Mon Apr 15 15:21:57 2013
@@ -18,9 +18,9 @@
*/
package org.apache.chemistry.opencmis.server.impl.webservices;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convertHolder;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.setHolderValue;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convert;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convertHolder;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.setHolderValue;
import java.math.BigInteger;
@@ -31,6 +31,7 @@ import javax.xml.ws.WebServiceContext;
import javax.xml.ws.soap.MTOM;
import org.apache.chemistry.opencmis.commons.data.ObjectList;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisExtensionType;
@@ -52,8 +53,10 @@ public class DiscoveryService extends Ab
String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems,
CmisExtensionType extension, Holder<CmisObjectListType> objects) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
org.apache.chemistry.opencmis.commons.spi.Holder<String> changeLogTokenHolder = convertHolder(changeLogToken);
@@ -61,7 +64,7 @@ public class DiscoveryService extends Ab
filter, includePolicyIds, includeAcl, maxItems, convert(extension));
if (objects != null) {
- objects.value = convert(changesList);
+ objects.value = convert(changesList, cmisVersion);
}
setHolderValue(changeLogTokenHolder, changeLogToken);
@@ -76,12 +79,14 @@ public class DiscoveryService extends Ab
Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
return convert(service.query(repositoryId, statement, searchAllVersions, includeAllowableActions,
convert(IncludeRelationships.class, includeRelationships), renditionFilter, maxItems, skipCount,
- convert(extension)));
+ convert(extension)), cmisVersion);
} catch (Exception e) {
throw convertException(e);
} finally {
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/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/webservices/MultiFilingService.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/MultiFilingService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/MultiFilingService.java Mon Apr 15 15:21:57 2013
@@ -18,8 +18,8 @@
*/
package org.apache.chemistry.opencmis.server.impl.webservices;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convertExtensionHolder;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.setExtensionValues;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convertExtensionHolder;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.setExtensionValues;
import javax.annotation.Resource;
import javax.jws.WebService;
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/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/webservices/NavigationService.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/NavigationService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/NavigationService.java Mon Apr 15 15:21:57 2013
@@ -18,7 +18,7 @@
*/
package org.apache.chemistry.opencmis.server.impl.webservices;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convert;
import java.math.BigInteger;
import java.util.ArrayList;
@@ -31,6 +31,7 @@ import javax.xml.ws.soap.MTOM;
import org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer;
import org.apache.chemistry.opencmis.commons.data.ObjectParentData;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisExtensionType;
@@ -56,12 +57,14 @@ public class NavigationService extends A
Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
return convert(service.getCheckedOutDocs(repositoryId, folderId, filter, orderBy, includeAllowableActions,
convert(IncludeRelationships.class, includeRelationships), renditionFilter, maxItems, skipCount,
- convert(extension)));
+ convert(extension)), cmisVersion);
} catch (Exception e) {
throw convertException(e);
} finally {
@@ -74,12 +77,14 @@ public class NavigationService extends A
Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension)
throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
return convert(service.getChildren(repositoryId, folderId, filter, orderBy, includeAllowableActions,
convert(IncludeRelationships.class, includeRelationships), renditionFilter, includePathSegment,
- maxItems, skipCount, convert(extension)));
+ maxItems, skipCount, convert(extension)), cmisVersion);
} catch (Exception e) {
throw convertException(e);
} finally {
@@ -91,8 +96,10 @@ public class NavigationService extends A
String filter, Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships,
String renditionFilter, Boolean includePathSegment, CmisExtensionType extension) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
List<CmisObjectInFolderContainerType> result = new ArrayList<CmisObjectInFolderContainerType>();
@@ -102,7 +109,7 @@ public class NavigationService extends A
if (serviceResult != null) {
for (ObjectInFolderContainer container : serviceResult) {
- result.add(convert(container));
+ result.add(convert(container, cmisVersion));
}
}
@@ -117,10 +124,12 @@ public class NavigationService extends A
public CmisObjectType getFolderParent(String repositoryId, String folderId, String filter,
CmisExtensionType extension) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
- return convert(service.getFolderParent(repositoryId, folderId, filter, convert(extension)));
+ return convert(service.getFolderParent(repositoryId, folderId, filter, convert(extension)), cmisVersion);
} catch (Exception e) {
throw convertException(e);
} finally {
@@ -132,8 +141,10 @@ public class NavigationService extends A
String filter, Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships,
String renditionFilter, Boolean includePathSegment, CmisExtensionType extension) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
List<CmisObjectInFolderContainerType> result = new ArrayList<CmisObjectInFolderContainerType>();
@@ -143,7 +154,7 @@ public class NavigationService extends A
if (serviceResult != null) {
for (ObjectInFolderContainer container : serviceResult) {
- result.add(convert(container));
+ result.add(convert(container, cmisVersion));
}
}
@@ -159,8 +170,10 @@ public class NavigationService extends A
Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
Boolean includeRelativePathSegment, CmisExtensionType extension) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
List<CmisObjectParentsType> result = new ArrayList<CmisObjectParentsType>();
@@ -170,7 +183,7 @@ public class NavigationService extends A
if (serviceResult != null) {
for (ObjectParentData parent : serviceResult) {
- result.add(convert(parent));
+ result.add(convert(parent, cmisVersion));
}
}
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/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/webservices/ObjectService.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectService.java Mon Apr 15 15:21:57 2013
@@ -18,11 +18,11 @@
*/
package org.apache.chemistry.opencmis.server.impl.webservices;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convertExtensionHolder;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convertHolder;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.setExtensionValues;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.setHolderValue;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convert;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convertExtensionHolder;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convertHolder;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.setExtensionValues;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.setHolderValue;
import java.math.BigInteger;
import java.util.ArrayList;
@@ -36,6 +36,7 @@ import javax.xml.ws.soap.MTOM;
import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
import org.apache.chemistry.opencmis.commons.data.RenditionData;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
import org.apache.chemistry.opencmis.commons.enums.VersioningState;
@@ -264,10 +265,12 @@ public class ObjectService extends Abstr
public CmisAllowableActionsType getAllowableActions(String repositoryId, String objectId,
CmisExtensionType extension) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
- return convert(service.getAllowableActions(repositoryId, objectId, convert(extension)));
+ return convert(service.getAllowableActions(repositoryId, objectId, convert(extension)), cmisVersion);
} catch (Exception e) {
throw convertException(e);
} finally {
@@ -295,12 +298,14 @@ public class ObjectService extends Abstr
Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
Boolean includePolicyIds, Boolean includeAcl, CmisExtensionType extension) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
return convert(service.getObject(repositoryId, objectId, filter, includeAllowableActions,
convert(IncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds,
- includeAcl, convert(extension)));
+ includeAcl, convert(extension)), cmisVersion);
} catch (Exception e) {
throw convertException(e);
} finally {
@@ -312,12 +317,14 @@ public class ObjectService extends Abstr
Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
Boolean includePolicyIds, Boolean includeAcl, CmisExtensionType extension) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
return convert(service.getObjectByPath(repositoryId, path, filter, includeAllowableActions,
convert(IncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds,
- includeAcl, convert(extension)));
+ includeAcl, convert(extension)), cmisVersion);
} catch (Exception e) {
throw convertException(e);
} finally {
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/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/webservices/PolicyService.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/PolicyService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/PolicyService.java Mon Apr 15 15:21:57 2013
@@ -18,9 +18,9 @@
*/
package org.apache.chemistry.opencmis.server.impl.webservices;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convertExtensionHolder;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.setExtensionValues;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convert;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convertExtensionHolder;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.setExtensionValues;
import java.util.ArrayList;
import java.util.List;
@@ -33,6 +33,7 @@ import javax.xml.ws.soap.MTOM;
import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
import org.apache.chemistry.opencmis.commons.data.ObjectData;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisExtensionType;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisObjectType;
@@ -69,8 +70,10 @@ public class PolicyService extends Abstr
public List<CmisObjectType> getAppliedPolicies(String repositoryId, String objectId, String filter,
CmisExtensionType extension) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
List<ObjectData> policies = service.getAppliedPolicies(repositoryId, objectId, filter, convert(extension));
@@ -80,7 +83,7 @@ public class PolicyService extends Abstr
List<CmisObjectType> result = new ArrayList<CmisObjectType>();
for (ObjectData object : policies) {
- result.add(convert(object));
+ result.add(convert(object, cmisVersion));
}
return result;
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/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/webservices/RelationshipService.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RelationshipService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RelationshipService.java Mon Apr 15 15:21:57 2013
@@ -18,7 +18,7 @@
*/
package org.apache.chemistry.opencmis.server.impl.webservices;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convert;
import java.math.BigInteger;
@@ -27,6 +27,7 @@ import javax.jws.WebService;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.soap.MTOM;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisExtensionType;
@@ -49,12 +50,14 @@ public class RelationshipService extends
String filter, Boolean includeAllowableActions, BigInteger maxItems, BigInteger skipCount,
CmisExtensionType extension) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
return convert(service.getObjectRelationships(repositoryId, objectId, includeSubRelationshipTypes,
convert(RelationshipDirection.class, relationshipDirection), typeId, filter,
- includeAllowableActions, maxItems, skipCount, convert(extension)));
+ includeAllowableActions, maxItems, skipCount, convert(extension)), cmisVersion);
} catch (Exception e) {
throw convertException(e);
} finally {
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryService.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/webservices/RepositoryService.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryService.java Mon Apr 15 15:21:57 2013
@@ -18,8 +18,8 @@
*/
package org.apache.chemistry.opencmis.server.impl.webservices;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convertTypeContainerList;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convert;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convertTypeContainerList;
import java.math.BigInteger;
import java.util.ArrayList;
@@ -32,6 +32,7 @@ import javax.xml.ws.WebServiceContext;
import javax.xml.ws.soap.MTOM;
import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisExtensionType;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisFaultType;
@@ -84,10 +85,12 @@ public class RepositoryService extends A
public CmisRepositoryInfoType getRepositoryInfo(String repositoryId, CmisExtensionType extension)
throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
- return convert(service.getRepositoryInfo(repositoryId, convert(extension)));
+ return convert(service.getRepositoryInfo(repositoryId, convert(extension)), cmisVersion);
} catch (Exception e) {
throw convertException(e);
} finally {
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/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/webservices/VersioningService.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/VersioningService.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/VersioningService.java Mon Apr 15 15:21:57 2013
@@ -18,11 +18,11 @@
*/
package org.apache.chemistry.opencmis.server.impl.webservices;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convertExtensionHolder;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.convertHolder;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.setExtensionValues;
-import static org.apache.chemistry.opencmis.commons.impl.Converter.setHolderValue;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convert;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convertExtensionHolder;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.convertHolder;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.setExtensionValues;
+import static org.apache.chemistry.opencmis.commons.impl.WSConverter.setHolderValue;
import java.util.ArrayList;
import java.util.List;
@@ -35,6 +35,7 @@ import javax.xml.ws.soap.MTOM;
import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
import org.apache.chemistry.opencmis.commons.data.ObjectData;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisAccessControlListType;
import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisContentStreamType;
@@ -127,8 +128,10 @@ public class VersioningService extends A
public List<CmisObjectType> getAllVersions(String repositoryId, String versionSeriesId, String filter,
Boolean includeAllowableActions, CmisExtensionType extension) throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
List<ObjectData> versions = service.getAllVersions(repositoryId, null, versionSeriesId, filter,
includeAllowableActions, convert(extension));
@@ -139,7 +142,7 @@ public class VersioningService extends A
List<CmisObjectType> result = new ArrayList<CmisObjectType>();
for (ObjectData object : versions) {
- result.add(convert(object));
+ result.add(convert(object, cmisVersion));
}
return result;
@@ -155,12 +158,14 @@ public class VersioningService extends A
String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, CmisExtensionType extension)
throws CmisException {
CmisService service = null;
+ CmisVersion cmisVersion = null;
try {
service = getService(wsContext, repositoryId);
+ cmisVersion = getCmisVersion(wsContext);
return convert(service.getObjectOfLatestVersion(repositoryId, null, versionSeriesId, major, filter,
includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
- renditionFilter, includePolicyIds, includeAcl, convert(extension)));
+ renditionFilter, includePolicyIds, includeAcl, convert(extension)), cmisVersion);
} catch (Exception e) {
throw convertException(e);
} finally {
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/TypeManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/TypeManager.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/TypeManager.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/TypeManager.java Mon Apr 15 15:21:57 2013
@@ -36,7 +36,7 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.enums.Updatability;
import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
import org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException;
-import org.apache.chemistry.opencmis.commons.impl.Converter;
+import org.apache.chemistry.opencmis.commons.impl.WSConverter;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractPropertyDefinition;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractTypeDefinition;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.DocumentTypeDefinitionImpl;
@@ -608,6 +608,6 @@ public class TypeManager {
}
private static TypeDefinition copyTypeDefintion(TypeDefinition type) {
- return Converter.convert(Converter.convert(type));
+ return WSConverter.convert(WSConverter.convert(type));
}
}
Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java?rev=1468114&r1=1468113&r2=1468114&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-jcr/src/main/java/org/apache/chemistry/opencmis/jcr/JcrTypeManager.java Mon Apr 15 15:21:57 2013
@@ -29,7 +29,7 @@ import org.apache.chemistry.opencmis.com
import org.apache.chemistry.opencmis.commons.enums.PropertyType;
import org.apache.chemistry.opencmis.commons.enums.Updatability;
import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
-import org.apache.chemistry.opencmis.commons.impl.Converter;
+import org.apache.chemistry.opencmis.commons.impl.WSConverter;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractPropertyDefinition;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractTypeDefinition;
import org.apache.chemistry.opencmis.commons.impl.dataobjects.DocumentTypeDefinitionImpl;
@@ -138,7 +138,7 @@ public class JcrTypeManager implements T
}
public static TypeDefinition copyTypeDefinition(TypeDefinition type) {
- return Converter.convert(Converter.convert(type));
+ return WSConverter.convert(WSConverter.convert(type));
}
/**
Added: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/WebServices11TckIT.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/WebServices11TckIT.java?rev=1468114&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/WebServices11TckIT.java (added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/WebServices11TckIT.java Mon Apr 15 15:21:57 2013
@@ -0,0 +1,63 @@
+/*
+ * 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.fit.tck;
+
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.apache.chemistry.opencmis.commons.enums.BindingType;
+import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
+import org.junit.Ignore;
+
+@Ignore
+public class WebServices11TckIT extends AbstractTckIT {
+
+ public static final String WEBSERVICES_PATH = "/opencmis/services11/";
+
+ @Override
+ public Map<String, String> getSessionParameters() {
+ Map<String, String> parameters = getBaseSessionParameters();
+
+ String url = "http://" + HOST + ":" + PORT + WEBSERVICES_PATH;
+
+ parameters.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());
+ parameters.put(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE, url + "RepositoryService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE, url + "NavigationService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_OBJECT_SERVICE, url + "ObjectService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_VERSIONING_SERVICE, url + "VersioningService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE, url + "DiscoveryService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE, url + "RelationshipService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE, url + "MultiFilingService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_POLICY_SERVICE, url + "PolicyService?wsdl");
+ parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, url + "ACLService?wsdl");
+
+ return parameters;
+ }
+
+ @Override
+ public BindingType getBindingType() {
+ return BindingType.WEBSERVICES;
+ }
+
+ @Override
+ public CmisVersion getCmisVersion() {
+ return CmisVersion.CMIS_1_1;
+ }
+
+}
Propchange: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-fit/src/test/java/org/apache/chemistry/opencmis/fit/tck/WebServices11TckIT.java
------------------------------------------------------------------------------
svn:eol-style = native