chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcaru...@apache.org
Subject svn commit: r936938 [6/29] - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-server: chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/ chemistry-opencmis-server-bindings/src/main/java/org/apache/chemi...
Date Thu, 22 Apr 2010 16:28:00 GMT
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AuthHandler.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AuthHandler.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AuthHandler.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/AuthHandler.java Thu Apr 22 16:27:57 2010
@@ -42,56 +42,56 @@ import org.apache.chemistry.opencmis.com
  */
 public class AuthHandler implements SOAPHandler<SOAPMessageContext> {
 
-	private static final String WSSE_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
-	private static final QName WSSE_SECURITY = new QName(WSSE_NS, "Security");
-	private static final QName WSSE_USERNAME_TOKEN = new QName(WSSE_NS, "UsernameToken");
-	private static final QName WSSE_USERNAME = new QName(WSSE_NS, "Username");
-	private static final QName WSSE_PASSWORD = new QName(WSSE_NS, "Password");
-
-	private static final Set<QName> HEADERS = new HashSet<QName>();
-	static {
-		HEADERS.add(WSSE_SECURITY);
-	}
-
-	public Set<QName> getHeaders() {
-		return HEADERS;
-	}
-
-	public void close(MessageContext context) {
-	}
-
-	public boolean handleFault(SOAPMessageContext context) {
-		return true;
-	}
-
-	public boolean handleMessage(SOAPMessageContext context) {
-		Boolean outboundProperty = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
-		if (outboundProperty.booleanValue()) {
-			// we are only looking at inbound messages
-			return true;
-		}
-
-		try {
-			// read the header
-			SOAPMessage msg = context.getMessage();
-			SOAPHeader sh = msg.getSOAPHeader();
-			SOAPElement securityElement = (SOAPElement) sh.getChildElements(WSSE_SECURITY).next();
-			SOAPElement tokenElement = (SOAPElement) securityElement.getChildElements(WSSE_USERNAME_TOKEN).next();
-			SOAPElement userElement = (SOAPElement) tokenElement.getChildElements(WSSE_USERNAME).next();
-			SOAPElement passwordElement = (SOAPElement) tokenElement.getChildElements(WSSE_PASSWORD).next();
-
-			// add user and password to context
-			Map<String, String> callContextMap = new HashMap<String, String>();
-			callContextMap.put(CallContext.USERNAME, userElement.getValue());
-			callContextMap.put(CallContext.PASSWORD, passwordElement.getValue());
-
-			context.put(AbstractService.CALL_CONTEXT_MAP, callContextMap);
-			context.setScope(AbstractService.CALL_CONTEXT_MAP, Scope.APPLICATION);
-		} catch (Exception e) {
-			// something went wrong, e.g. a part of the SOAP header wasn't set
-			throw new RuntimeException("UsernameToken not set!", e);
-		}
+    private static final String WSSE_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
+    private static final QName WSSE_SECURITY = new QName(WSSE_NS, "Security");
+    private static final QName WSSE_USERNAME_TOKEN = new QName(WSSE_NS, "UsernameToken");
+    private static final QName WSSE_USERNAME = new QName(WSSE_NS, "Username");
+    private static final QName WSSE_PASSWORD = new QName(WSSE_NS, "Password");
+
+    private static final Set<QName> HEADERS = new HashSet<QName>();
+    static {
+        HEADERS.add(WSSE_SECURITY);
+    }
+
+    public Set<QName> getHeaders() {
+        return HEADERS;
+    }
+
+    public void close(MessageContext context) {
+    }
+
+    public boolean handleFault(SOAPMessageContext context) {
+        return true;
+    }
+
+    public boolean handleMessage(SOAPMessageContext context) {
+        Boolean outboundProperty = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+        if (outboundProperty.booleanValue()) {
+            // we are only looking at inbound messages
+            return true;
+        }
+
+        try {
+            // read the header
+            SOAPMessage msg = context.getMessage();
+            SOAPHeader sh = msg.getSOAPHeader();
+            SOAPElement securityElement = (SOAPElement) sh.getChildElements(WSSE_SECURITY).next();
+            SOAPElement tokenElement = (SOAPElement) securityElement.getChildElements(WSSE_USERNAME_TOKEN).next();
+            SOAPElement userElement = (SOAPElement) tokenElement.getChildElements(WSSE_USERNAME).next();
+            SOAPElement passwordElement = (SOAPElement) tokenElement.getChildElements(WSSE_PASSWORD).next();
+
+            // add user and password to context
+            Map<String, String> callContextMap = new HashMap<String, String>();
+            callContextMap.put(CallContext.USERNAME, userElement.getValue());
+            callContextMap.put(CallContext.PASSWORD, passwordElement.getValue());
+
+            context.put(AbstractService.CALL_CONTEXT_MAP, callContextMap);
+            context.setScope(AbstractService.CALL_CONTEXT_MAP, Scope.APPLICATION);
+        } catch (Exception e) {
+            // something went wrong, e.g. a part of the SOAP header wasn't set
+            throw new RuntimeException("UsernameToken not set!", e);
+        }
 
-		return true;
-	}
+        return true;
+    }
 }

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/DiscoveryService.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/DiscoveryService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/DiscoveryService.java Thu Apr 22 16:27:57 2010
@@ -45,46 +45,46 @@ import org.apache.chemistry.opencmis.ser
  */
 @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.DiscoveryServicePort")
 public class DiscoveryService extends AbstractService implements DiscoveryServicePort {
-	@Resource
-	WebServiceContext wsContext;
+    @Resource
+    WebServiceContext wsContext;
 
-	public void getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
-			String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems,
-			CmisExtensionType extension, Holder<CmisObjectListType> objects) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisDiscoveryService service = factory.getDiscoveryService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			org.apache.chemistry.opencmis.commons.api.Holder<String> changeLogTokenHolder = convertHolder(changeLogToken);
-
-			ObjectList changesList = service.getContentChanges(context, repositoryId, changeLogTokenHolder,
-					includeProperties, filter, includePolicyIds, includeAcl, maxItems, convert(extension), null);
-
-			if (objects != null) {
-				objects.value = convert(changesList);
-			}
-
-			setHolderValue(changeLogTokenHolder, changeLogToken);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public CmisObjectListType query(String repositoryId, String statement, Boolean searchAllVersions,
-			Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
-			BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisDiscoveryService service = factory.getDiscoveryService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.query(context, repositoryId, statement, searchAllVersions, includeAllowableActions,
-					convert(IncludeRelationships.class, includeRelationships), renditionFilter, maxItems, skipCount,
-					convert(extension)));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
+    public void getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
+            String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems,
+            CmisExtensionType extension, Holder<CmisObjectListType> objects) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisDiscoveryService service = factory.getDiscoveryService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            org.apache.chemistry.opencmis.commons.api.Holder<String> changeLogTokenHolder = convertHolder(changeLogToken);
+
+            ObjectList changesList = service.getContentChanges(context, repositoryId, changeLogTokenHolder,
+                    includeProperties, filter, includePolicyIds, includeAcl, maxItems, convert(extension), null);
+
+            if (objects != null) {
+                objects.value = convert(changesList);
+            }
+
+            setHolderValue(changeLogTokenHolder, changeLogToken);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public CmisObjectListType query(String repositoryId, String statement, Boolean searchAllVersions,
+            Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
+            BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisDiscoveryService service = factory.getDiscoveryService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.query(context, repositoryId, statement, searchAllVersions, includeAllowableActions,
+                    convert(IncludeRelationships.class, includeRelationships), renditionFilter, maxItems, skipCount,
+                    convert(extension)));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
 
 }

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/MultiFilingService.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/MultiFilingService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/MultiFilingService.java Thu Apr 22 16:27:57 2010
@@ -39,41 +39,41 @@ import org.apache.chemistry.opencmis.ser
  */
 @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.MultiFilingServicePort")
 public class MultiFilingService extends AbstractService implements MultiFilingServicePort {
-	@Resource
-	WebServiceContext wsContext;
+    @Resource
+    WebServiceContext wsContext;
 
-	public void addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions,
-			Holder<CmisExtensionType> extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisMultiFilingService service = factory.getMultiFilingService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			service.addObjectToFolder(context, repositoryId, objectId, folderId, allVersions, extData, null);
-
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public void removeObjectFromFolder(String repositoryId, String objectId, String folderId,
-			Holder<CmisExtensionType> extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisMultiFilingService service = factory.getMultiFilingService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			service.removeObjectFromFolder(context, repositoryId, objectId, folderId, extData, null);
-
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
+    public void addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions,
+            Holder<CmisExtensionType> extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisMultiFilingService service = factory.getMultiFilingService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            service.addObjectToFolder(context, repositoryId, objectId, folderId, allVersions, extData, null);
+
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public void removeObjectFromFolder(String repositoryId, String objectId, String folderId,
+            Holder<CmisExtensionType> extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisMultiFilingService service = factory.getMultiFilingService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            service.removeObjectFromFolder(context, repositoryId, objectId, folderId, extData, null);
+
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
 
 }

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/NavigationService.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/NavigationService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/NavigationService.java Thu Apr 22 16:27:57 2010
@@ -49,130 +49,130 @@ import org.apache.chemistry.opencmis.ser
  */
 @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.NavigationServicePort")
 public class NavigationService extends AbstractService implements NavigationServicePort {
-	@Resource
-	WebServiceContext wsContext;
+    @Resource
+    WebServiceContext wsContext;
 
-	public CmisObjectListType getCheckedOutDocs(String repositoryId, String folderId, String filter, String orderBy,
-			Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
-			BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisNavigationService service = factory.getNavigationService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.getCheckedOutDocs(context, repositoryId, folderId, filter, orderBy,
-					includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
-					renditionFilter, maxItems, skipCount, convert(extension), null));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public CmisObjectInFolderListType getChildren(String repositoryId, String folderId, String filter, String orderBy,
-			Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
-			Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension)
-			throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisNavigationService service = factory.getNavigationService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.getChildren(context, repositoryId, folderId, filter, orderBy,
-					includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
-					renditionFilter, includePathSegment, maxItems, skipCount, convert(extension), null));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public List<CmisObjectInFolderContainerType> getDescendants(String repositoryId, String folderId, BigInteger depth,
-			String filter, Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships,
-			String renditionFilter, Boolean includePathSegment, CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisNavigationService service = factory.getNavigationService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			List<CmisObjectInFolderContainerType> result = new ArrayList<CmisObjectInFolderContainerType>();
-
-			List<ObjectInFolderContainer> serviceResult = service.getDescendants(context, repositoryId, folderId,
-					depth, filter, includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
-					renditionFilter, includePathSegment, convert(extension), null);
-
-			if (serviceResult != null) {
-				for (ObjectInFolderContainer container : serviceResult) {
-					result.add(convert(container));
-				}
-			}
-
-			return result;
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public CmisObjectType getFolderParent(String repositoryId, String folderId, String filter,
-			CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisNavigationService service = factory.getNavigationService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.getFolderParent(context, repositoryId, folderId, filter, convert(extension), null));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public List<CmisObjectInFolderContainerType> getFolderTree(String repositoryId, String folderId, BigInteger depth,
-			String filter, Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships,
-			String renditionFilter, Boolean includePathSegment, CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisNavigationService service = factory.getNavigationService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			List<CmisObjectInFolderContainerType> result = new ArrayList<CmisObjectInFolderContainerType>();
-
-			List<ObjectInFolderContainer> serviceResult = service.getFolderTree(context, repositoryId, folderId, depth,
-					filter, includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
-					renditionFilter, includePathSegment, convert(extension), null);
-
-			if (serviceResult != null) {
-				for (ObjectInFolderContainer container : serviceResult) {
-					result.add(convert(container));
-				}
-			}
-
-			return result;
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public List<CmisObjectParentsType> getObjectParents(String repositoryId, String objectId, String filter,
-			Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
-			Boolean includeRelativePathSegment, CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisNavigationService service = factory.getNavigationService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			List<CmisObjectParentsType> result = new ArrayList<CmisObjectParentsType>();
-
-			List<ObjectParentData> serviceResult = service.getObjectParents(context, repositoryId, objectId, filter,
-					includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
-					renditionFilter, includeRelativePathSegment, convert(extension), null);
-
-			if (serviceResult != null) {
-				for (ObjectParentData parent : serviceResult) {
-					result.add(convert(parent));
-				}
-			}
-
-			return result;
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
+    public CmisObjectListType getCheckedOutDocs(String repositoryId, String folderId, String filter, String orderBy,
+            Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
+            BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisNavigationService service = factory.getNavigationService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.getCheckedOutDocs(context, repositoryId, folderId, filter, orderBy,
+                    includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
+                    renditionFilter, maxItems, skipCount, convert(extension), null));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public CmisObjectInFolderListType getChildren(String repositoryId, String folderId, String filter, String orderBy,
+            Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
+            Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension)
+            throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisNavigationService service = factory.getNavigationService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.getChildren(context, repositoryId, folderId, filter, orderBy,
+                    includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
+                    renditionFilter, includePathSegment, maxItems, skipCount, convert(extension), null));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public List<CmisObjectInFolderContainerType> getDescendants(String repositoryId, String folderId, BigInteger depth,
+            String filter, Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships,
+            String renditionFilter, Boolean includePathSegment, CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisNavigationService service = factory.getNavigationService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            List<CmisObjectInFolderContainerType> result = new ArrayList<CmisObjectInFolderContainerType>();
+
+            List<ObjectInFolderContainer> serviceResult = service.getDescendants(context, repositoryId, folderId,
+                    depth, filter, includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
+                    renditionFilter, includePathSegment, convert(extension), null);
+
+            if (serviceResult != null) {
+                for (ObjectInFolderContainer container : serviceResult) {
+                    result.add(convert(container));
+                }
+            }
+
+            return result;
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public CmisObjectType getFolderParent(String repositoryId, String folderId, String filter,
+            CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisNavigationService service = factory.getNavigationService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.getFolderParent(context, repositoryId, folderId, filter, convert(extension), null));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public List<CmisObjectInFolderContainerType> getFolderTree(String repositoryId, String folderId, BigInteger depth,
+            String filter, Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships,
+            String renditionFilter, Boolean includePathSegment, CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisNavigationService service = factory.getNavigationService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            List<CmisObjectInFolderContainerType> result = new ArrayList<CmisObjectInFolderContainerType>();
+
+            List<ObjectInFolderContainer> serviceResult = service.getFolderTree(context, repositoryId, folderId, depth,
+                    filter, includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
+                    renditionFilter, includePathSegment, convert(extension), null);
+
+            if (serviceResult != null) {
+                for (ObjectInFolderContainer container : serviceResult) {
+                    result.add(convert(container));
+                }
+            }
+
+            return result;
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public List<CmisObjectParentsType> getObjectParents(String repositoryId, String objectId, String filter,
+            Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
+            Boolean includeRelativePathSegment, CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisNavigationService service = factory.getNavigationService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            List<CmisObjectParentsType> result = new ArrayList<CmisObjectParentsType>();
+
+            List<ObjectParentData> serviceResult = service.getObjectParents(context, repositoryId, objectId, filter,
+                    includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
+                    renditionFilter, includeRelativePathSegment, convert(extension), null);
+
+            if (serviceResult != null) {
+                for (ObjectParentData parent : serviceResult) {
+                    result.add(convert(parent));
+                }
+            }
+
+            return result;
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
 }

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectService.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/ObjectService.java Thu Apr 22 16:27:57 2010
@@ -63,338 +63,338 @@ import com.sun.xml.ws.developer.Streamin
 @StreamingAttachment(parseEagerly = true, memoryThreshold = 4 * 1024 * 1204)
 @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.ObjectServicePort")
 public class ObjectService extends AbstractService implements ObjectServicePort {
-	@Resource
-	WebServiceContext wsContext;
+    @Resource
+    WebServiceContext wsContext;
 
-	public void createDocument(String repositoryId, CmisPropertiesType properties, String folderId,
-			CmisContentStreamType contentStream, EnumVersioningState versioningState, List<String> policies,
-			CmisAccessControlListType addAces, CmisAccessControlListType removeAces,
-			Holder<CmisExtensionType> extension, Holder<String> objectId) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			String id = service.createDocument(context, repositoryId, convert(properties), folderId,
-					convert(contentStream), convert(VersioningState.class, versioningState), policies, convert(addAces,
-							null), convert(removeAces, null), extData);
-
-			if (objectId != null) {
-				objectId.value = id;
-			}
-
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public void createDocumentFromSource(String repositoryId, String sourceId, CmisPropertiesType properties,
-			String folderId, EnumVersioningState versioningState, List<String> policies,
-			CmisAccessControlListType addAces, CmisAccessControlListType removeAces,
-			Holder<CmisExtensionType> extension, Holder<String> objectId) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			String id = service.createDocumentFromSource(context, repositoryId, sourceId, convert(properties),
-					folderId, convert(VersioningState.class, versioningState), policies, convert(addAces, null),
-					convert(removeAces, null), extData);
-
-			if (objectId != null) {
-				objectId.value = id;
-			}
-
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public void createFolder(String repositoryId, CmisPropertiesType properties, String folderId,
-			List<String> policies, CmisAccessControlListType addAces, CmisAccessControlListType removeAces,
-			Holder<CmisExtensionType> extension, Holder<String> objectId) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			String id = service.createFolder(context, repositoryId, convert(properties), folderId, policies, convert(
-					addAces, null), convert(removeAces, null), extData);
-
-			if (objectId != null) {
-				objectId.value = id;
-			}
-
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public void createPolicy(String repositoryId, CmisPropertiesType properties, String folderId,
-			List<String> policies, CmisAccessControlListType addAces, CmisAccessControlListType removeAces,
-			Holder<CmisExtensionType> extension, Holder<String> objectId) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			String id = service.createPolicy(context, repositoryId, convert(properties), folderId, policies, convert(
-					addAces, null), convert(removeAces, null), extData);
-
-			if (objectId != null) {
-				objectId.value = id;
-			}
-
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public void createRelationship(String repositoryId, CmisPropertiesType properties, List<String> policies,
-			CmisAccessControlListType addAces, CmisAccessControlListType removeAces,
-			Holder<CmisExtensionType> extension, Holder<String> objectId) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			String id = service.createRelationship(context, repositoryId, convert(properties), policies, convert(
-					addAces, null), convert(removeAces, null), extData);
-
-			if (objectId != null) {
-				objectId.value = id;
-			}
-
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public void deleteContentStream(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
-			Holder<CmisExtensionType> extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			org.apache.chemistry.opencmis.commons.api.Holder<String> objectIdHolder = convertHolder(objectId);
-			org.apache.chemistry.opencmis.commons.api.Holder<String> changeTokenHolder = convertHolder(changeToken);
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			service.deleteContentStream(context, repositoryId, objectIdHolder, changeTokenHolder, extData);
-
-			setHolderValue(objectIdHolder, objectId);
-			setHolderValue(changeTokenHolder, changeToken);
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public void deleteObject(String repositoryId, String objectId, Boolean allVersions,
-			Holder<CmisExtensionType> extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			service.deleteObjectOrCancelCheckOut(context, repositoryId, objectId, allVersions, extData);
-
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public FailedToDelete deleteTree(String repositoryId, String folderId, Boolean allVersions,
-			EnumUnfileObject unfileObjects, Boolean continueOnFailure, CmisExtensionType extension)
-			throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.deleteTree(context, repositoryId, folderId, allVersions, convert(UnfileObject.class,
-					unfileObjects), continueOnFailure, convert(extension)));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public CmisAllowableActionsType getAllowableActions(String repositoryId, String objectId,
-			CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.getAllowableActions(context, repositoryId, objectId, convert(extension)));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public CmisContentStreamType getContentStream(String repositoryId, String objectId, String streamId,
-			BigInteger offset, BigInteger length, CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.getContentStream(context, repositoryId, objectId, streamId, offset, length,
-					convert(extension)));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public CmisObjectType getObject(String repositoryId, String objectId, String filter,
-			Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
-			Boolean includePolicyIds, Boolean includeAcl, CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.getObject(context, repositoryId, objectId, filter, includeAllowableActions, convert(
-					IncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds, includeAcl,
-					convert(extension), null));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public CmisObjectType getObjectByPath(String repositoryId, String path, String filter,
-			Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
-			Boolean includePolicyIds, Boolean includeAcl, CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.getObjectByPath(context, repositoryId, path, filter, includeAllowableActions,
-					convert(IncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds,
-					includeAcl, convert(extension), null));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public CmisPropertiesType getProperties(String repositoryId, String objectId, String filter,
-			CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.getProperties(context, repositoryId, objectId, filter, convert(extension)));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public List<CmisRenditionType> getRenditions(String repositoryId, String objectId, String renditionFilter,
-			BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			List<CmisRenditionType> result = new ArrayList<CmisRenditionType>();
-
-			List<RenditionData> renditionList = service.getRenditions(context, repositoryId, objectId, renditionFilter,
-					maxItems, skipCount, convert(extension));
-
-			if (renditionList != null) {
-				for (RenditionData rendition : renditionList) {
-					result.add(convert(rendition));
-				}
-			}
-
-			return result;
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
-			Holder<CmisExtensionType> extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			org.apache.chemistry.opencmis.commons.api.Holder<String> objectIdHolder = convertHolder(objectId);
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			service.moveObject(context, repositoryId, objectIdHolder, targetFolderId, sourceFolderId, extData, null);
-
-			setHolderValue(objectIdHolder, objectId);
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
-			Holder<String> changeToken, CmisContentStreamType contentStream, Holder<CmisExtensionType> extension)
-			throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			org.apache.chemistry.opencmis.commons.api.Holder<String> objectIdHolder = convertHolder(objectId);
-			org.apache.chemistry.opencmis.commons.api.Holder<String> changeTokenHolder = convertHolder(changeToken);
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			service.setContentStream(context, repositoryId, objectIdHolder, overwriteFlag, changeTokenHolder,
-					convert(contentStream), extData);
-
-			setHolderValue(objectIdHolder, objectId);
-			setHolderValue(changeTokenHolder, changeToken);
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
-			CmisPropertiesType properties, Holder<CmisExtensionType> extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisObjectService service = factory.getObjectService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			org.apache.chemistry.opencmis.commons.api.Holder<String> objectIdHolder = convertHolder(objectId);
-			org.apache.chemistry.opencmis.commons.api.Holder<String> changeTokenHolder = convertHolder(changeToken);
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			service.updateProperties(context, repositoryId, objectIdHolder, changeTokenHolder, convert(properties),
-					null, extData, null);
-
-			setHolderValue(objectIdHolder, objectId);
-			setHolderValue(changeTokenHolder, changeToken);
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
+    public void createDocument(String repositoryId, CmisPropertiesType properties, String folderId,
+            CmisContentStreamType contentStream, EnumVersioningState versioningState, List<String> policies,
+            CmisAccessControlListType addAces, CmisAccessControlListType removeAces,
+            Holder<CmisExtensionType> extension, Holder<String> objectId) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            String id = service.createDocument(context, repositoryId, convert(properties), folderId,
+                    convert(contentStream), convert(VersioningState.class, versioningState), policies, convert(addAces,
+                            null), convert(removeAces, null), extData);
+
+            if (objectId != null) {
+                objectId.value = id;
+            }
+
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public void createDocumentFromSource(String repositoryId, String sourceId, CmisPropertiesType properties,
+            String folderId, EnumVersioningState versioningState, List<String> policies,
+            CmisAccessControlListType addAces, CmisAccessControlListType removeAces,
+            Holder<CmisExtensionType> extension, Holder<String> objectId) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            String id = service.createDocumentFromSource(context, repositoryId, sourceId, convert(properties),
+                    folderId, convert(VersioningState.class, versioningState), policies, convert(addAces, null),
+                    convert(removeAces, null), extData);
+
+            if (objectId != null) {
+                objectId.value = id;
+            }
+
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public void createFolder(String repositoryId, CmisPropertiesType properties, String folderId,
+            List<String> policies, CmisAccessControlListType addAces, CmisAccessControlListType removeAces,
+            Holder<CmisExtensionType> extension, Holder<String> objectId) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            String id = service.createFolder(context, repositoryId, convert(properties), folderId, policies, convert(
+                    addAces, null), convert(removeAces, null), extData);
+
+            if (objectId != null) {
+                objectId.value = id;
+            }
+
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public void createPolicy(String repositoryId, CmisPropertiesType properties, String folderId,
+            List<String> policies, CmisAccessControlListType addAces, CmisAccessControlListType removeAces,
+            Holder<CmisExtensionType> extension, Holder<String> objectId) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            String id = service.createPolicy(context, repositoryId, convert(properties), folderId, policies, convert(
+                    addAces, null), convert(removeAces, null), extData);
+
+            if (objectId != null) {
+                objectId.value = id;
+            }
+
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public void createRelationship(String repositoryId, CmisPropertiesType properties, List<String> policies,
+            CmisAccessControlListType addAces, CmisAccessControlListType removeAces,
+            Holder<CmisExtensionType> extension, Holder<String> objectId) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            String id = service.createRelationship(context, repositoryId, convert(properties), policies, convert(
+                    addAces, null), convert(removeAces, null), extData);
+
+            if (objectId != null) {
+                objectId.value = id;
+            }
+
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public void deleteContentStream(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
+            Holder<CmisExtensionType> extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            org.apache.chemistry.opencmis.commons.api.Holder<String> objectIdHolder = convertHolder(objectId);
+            org.apache.chemistry.opencmis.commons.api.Holder<String> changeTokenHolder = convertHolder(changeToken);
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            service.deleteContentStream(context, repositoryId, objectIdHolder, changeTokenHolder, extData);
+
+            setHolderValue(objectIdHolder, objectId);
+            setHolderValue(changeTokenHolder, changeToken);
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public void deleteObject(String repositoryId, String objectId, Boolean allVersions,
+            Holder<CmisExtensionType> extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            service.deleteObjectOrCancelCheckOut(context, repositoryId, objectId, allVersions, extData);
+
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public FailedToDelete deleteTree(String repositoryId, String folderId, Boolean allVersions,
+            EnumUnfileObject unfileObjects, Boolean continueOnFailure, CmisExtensionType extension)
+            throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.deleteTree(context, repositoryId, folderId, allVersions, convert(UnfileObject.class,
+                    unfileObjects), continueOnFailure, convert(extension)));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public CmisAllowableActionsType getAllowableActions(String repositoryId, String objectId,
+            CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.getAllowableActions(context, repositoryId, objectId, convert(extension)));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public CmisContentStreamType getContentStream(String repositoryId, String objectId, String streamId,
+            BigInteger offset, BigInteger length, CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.getContentStream(context, repositoryId, objectId, streamId, offset, length,
+                    convert(extension)));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public CmisObjectType getObject(String repositoryId, String objectId, String filter,
+            Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
+            Boolean includePolicyIds, Boolean includeAcl, CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.getObject(context, repositoryId, objectId, filter, includeAllowableActions, convert(
+                    IncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds, includeAcl,
+                    convert(extension), null));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public CmisObjectType getObjectByPath(String repositoryId, String path, String filter,
+            Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
+            Boolean includePolicyIds, Boolean includeAcl, CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.getObjectByPath(context, repositoryId, path, filter, includeAllowableActions,
+                    convert(IncludeRelationships.class, includeRelationships), renditionFilter, includePolicyIds,
+                    includeAcl, convert(extension), null));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public CmisPropertiesType getProperties(String repositoryId, String objectId, String filter,
+            CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.getProperties(context, repositoryId, objectId, filter, convert(extension)));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public List<CmisRenditionType> getRenditions(String repositoryId, String objectId, String renditionFilter,
+            BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            List<CmisRenditionType> result = new ArrayList<CmisRenditionType>();
+
+            List<RenditionData> renditionList = service.getRenditions(context, repositoryId, objectId, renditionFilter,
+                    maxItems, skipCount, convert(extension));
+
+            if (renditionList != null) {
+                for (RenditionData rendition : renditionList) {
+                    result.add(convert(rendition));
+                }
+            }
+
+            return result;
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
+            Holder<CmisExtensionType> extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            org.apache.chemistry.opencmis.commons.api.Holder<String> objectIdHolder = convertHolder(objectId);
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            service.moveObject(context, repositoryId, objectIdHolder, targetFolderId, sourceFolderId, extData, null);
+
+            setHolderValue(objectIdHolder, objectId);
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
+            Holder<String> changeToken, CmisContentStreamType contentStream, Holder<CmisExtensionType> extension)
+            throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            org.apache.chemistry.opencmis.commons.api.Holder<String> objectIdHolder = convertHolder(objectId);
+            org.apache.chemistry.opencmis.commons.api.Holder<String> changeTokenHolder = convertHolder(changeToken);
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            service.setContentStream(context, repositoryId, objectIdHolder, overwriteFlag, changeTokenHolder,
+                    convert(contentStream), extData);
+
+            setHolderValue(objectIdHolder, objectId);
+            setHolderValue(changeTokenHolder, changeToken);
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
+            CmisPropertiesType properties, Holder<CmisExtensionType> extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisObjectService service = factory.getObjectService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            org.apache.chemistry.opencmis.commons.api.Holder<String> objectIdHolder = convertHolder(objectId);
+            org.apache.chemistry.opencmis.commons.api.Holder<String> changeTokenHolder = convertHolder(changeToken);
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            service.updateProperties(context, repositoryId, objectIdHolder, changeTokenHolder, convert(properties),
+                    null, extData, null);
+
+            setHolderValue(objectIdHolder, objectId);
+            setHolderValue(changeTokenHolder, changeToken);
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
 }

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/PolicyService.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/PolicyService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/PolicyService.java Thu Apr 22 16:27:57 2010
@@ -45,66 +45,66 @@ import org.apache.chemistry.opencmis.ser
  */
 @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.PolicyServicePort")
 public class PolicyService extends AbstractService implements PolicyServicePort {
-	@Resource
-	WebServiceContext wsContext;
+    @Resource
+    WebServiceContext wsContext;
 
-	public void applyPolicy(String repositoryId, String policyId, String objectId, Holder<CmisExtensionType> extension)
-			throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisPolicyService service = factory.getPolicyService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			service.applyPolicy(context, repositoryId, policyId, objectId, extData, null);
-
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public List<CmisObjectType> getAppliedPolicies(String repositoryId, String objectId, String filter,
-			CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisPolicyService service = factory.getPolicyService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			List<ObjectData> policies = service.getAppliedPolicies(context, repositoryId, objectId, filter,
-					convert(extension), null);
-
-			if (policies == null) {
-				return null;
-			}
-
-			List<CmisObjectType> result = new ArrayList<CmisObjectType>();
-			for (ObjectData object : policies) {
-				result.add(convert(object));
-			}
-
-			return result;
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public void removePolicy(String repositoryId, String policyId, String objectId, Holder<CmisExtensionType> extension)
-			throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisPolicyService service = factory.getPolicyService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			ExtensionsData extData = convertExtensionHolder(extension);
-
-			service.removePolicy(context, repositoryId, policyId, objectId, extData);
-
-			setExtensionValues(extData, extension);
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
+    public void applyPolicy(String repositoryId, String policyId, String objectId, Holder<CmisExtensionType> extension)
+            throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisPolicyService service = factory.getPolicyService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            service.applyPolicy(context, repositoryId, policyId, objectId, extData, null);
+
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public List<CmisObjectType> getAppliedPolicies(String repositoryId, String objectId, String filter,
+            CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisPolicyService service = factory.getPolicyService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            List<ObjectData> policies = service.getAppliedPolicies(context, repositoryId, objectId, filter,
+                    convert(extension), null);
+
+            if (policies == null) {
+                return null;
+            }
+
+            List<CmisObjectType> result = new ArrayList<CmisObjectType>();
+            for (ObjectData object : policies) {
+                result.add(convert(object));
+            }
+
+            return result;
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public void removePolicy(String repositoryId, String policyId, String objectId, Holder<CmisExtensionType> extension)
+            throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisPolicyService service = factory.getPolicyService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            ExtensionsData extData = convertExtensionHolder(extension);
+
+            service.removePolicy(context, repositoryId, policyId, objectId, extData);
+
+            setExtensionValues(extData, extension);
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
 
 }

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RelationshipService.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RelationshipService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RelationshipService.java Thu Apr 22 16:27:57 2010
@@ -41,24 +41,24 @@ import org.apache.chemistry.opencmis.ser
  */
 @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.RelationshipServicePort")
 public class RelationshipService extends AbstractService implements RelationshipServicePort {
-	@Resource
-	WebServiceContext wsContext;
+    @Resource
+    WebServiceContext wsContext;
 
-	public CmisObjectListType getObjectRelationships(String repositoryId, String objectId,
-			Boolean includeSubRelationshipTypes, EnumRelationshipDirection relationshipDirection, String typeId,
-			String filter, Boolean includeAllowableActions, BigInteger maxItems, BigInteger skipCount,
-			CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisRelationshipService service = factory.getRelationshipService();
-			CallContext context = createContext(wsContext, repositoryId);
+    public CmisObjectListType getObjectRelationships(String repositoryId, String objectId,
+            Boolean includeSubRelationshipTypes, EnumRelationshipDirection relationshipDirection, String typeId,
+            String filter, Boolean includeAllowableActions, BigInteger maxItems, BigInteger skipCount,
+            CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisRelationshipService service = factory.getRelationshipService();
+            CallContext context = createContext(wsContext, repositoryId);
 
-			return convert(service.getObjectRelationships(context, repositoryId, objectId, includeSubRelationshipTypes,
-					convert(RelationshipDirection.class, relationshipDirection), typeId, filter,
-					includeAllowableActions, maxItems, skipCount, convert(extension), null));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
+            return convert(service.getObjectRelationships(context, repositoryId, objectId, includeSubRelationshipTypes,
+                    convert(RelationshipDirection.class, relationshipDirection), typeId, filter,
+                    includeAllowableActions, maxItems, skipCount, convert(extension), null));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
 
 }

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryService.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/RepositoryService.java Thu Apr 22 16:27:57 2010
@@ -47,92 +47,92 @@ import org.apache.chemistry.opencmis.ser
  */
 @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.RepositoryServicePort")
 public class RepositoryService extends AbstractService implements RepositoryServicePort {
-	@Resource
-	WebServiceContext wsContext;
+    @Resource
+    WebServiceContext wsContext;
 
-	public List<CmisRepositoryEntryType> getRepositories(CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisRepositoryService service = factory.getRepositoryService();
-			CallContext context = createContext(wsContext, null);
-
-			List<RepositoryInfo> infoDataList = service.getRepositoryInfos(context, convert(extension));
-
-			if (infoDataList == null) {
-				return null;
-			}
-
-			List<CmisRepositoryEntryType> result = new ArrayList<CmisRepositoryEntryType>();
-			for (RepositoryInfo infoData : infoDataList) {
-				CmisRepositoryEntryType entry = new CmisRepositoryEntryType();
-				entry.setRepositoryId(infoData.getId());
-				entry.setRepositoryName(infoData.getName());
-
-				result.add(entry);
-			}
-
-			return result;
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public CmisRepositoryInfoType getRepositoryInfo(String repositoryId, CmisExtensionType extension)
-			throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisRepositoryService service = factory.getRepositoryService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.getRepositoryInfo(context, repositoryId, convert(extension)));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public CmisTypeDefinitionListType getTypeChildren(String repositoryId, String typeId,
-			Boolean includePropertyDefinitions, BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension)
-			throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisRepositoryService service = factory.getRepositoryService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.getTypeChildren(context, repositoryId, typeId, includePropertyDefinitions, maxItems,
-					skipCount, convert(extension)));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public CmisTypeDefinitionType getTypeDefinition(String repositoryId, String typeId, CmisExtensionType extension)
-			throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisRepositoryService service = factory.getRepositoryService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			return convert(service.getTypeDefinition(context, repositoryId, typeId, convert(extension)));
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
-
-	public List<CmisTypeContainer> getTypeDescendants(String repositoryId, String typeId, BigInteger depth,
-			Boolean includePropertyDefinitions, CmisExtensionType extension) throws CmisException {
-		try {
-			AbstractServicesFactory factory = getServicesFactory(wsContext);
-			CmisRepositoryService service = factory.getRepositoryService();
-			CallContext context = createContext(wsContext, repositoryId);
-
-			List<CmisTypeContainer> result = new ArrayList<CmisTypeContainer>();
-			convertTypeContainerList(service.getTypeDescendants(context, repositoryId, typeId, depth,
-					includePropertyDefinitions, convert(extension)), result);
-
-			return result;
-		} catch (Exception e) {
-			throw convertException(e);
-		}
-	}
+    public List<CmisRepositoryEntryType> getRepositories(CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisRepositoryService service = factory.getRepositoryService();
+            CallContext context = createContext(wsContext, null);
+
+            List<RepositoryInfo> infoDataList = service.getRepositoryInfos(context, convert(extension));
+
+            if (infoDataList == null) {
+                return null;
+            }
+
+            List<CmisRepositoryEntryType> result = new ArrayList<CmisRepositoryEntryType>();
+            for (RepositoryInfo infoData : infoDataList) {
+                CmisRepositoryEntryType entry = new CmisRepositoryEntryType();
+                entry.setRepositoryId(infoData.getId());
+                entry.setRepositoryName(infoData.getName());
+
+                result.add(entry);
+            }
+
+            return result;
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public CmisRepositoryInfoType getRepositoryInfo(String repositoryId, CmisExtensionType extension)
+            throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisRepositoryService service = factory.getRepositoryService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.getRepositoryInfo(context, repositoryId, convert(extension)));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public CmisTypeDefinitionListType getTypeChildren(String repositoryId, String typeId,
+            Boolean includePropertyDefinitions, BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension)
+            throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisRepositoryService service = factory.getRepositoryService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.getTypeChildren(context, repositoryId, typeId, includePropertyDefinitions, maxItems,
+                    skipCount, convert(extension)));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public CmisTypeDefinitionType getTypeDefinition(String repositoryId, String typeId, CmisExtensionType extension)
+            throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisRepositoryService service = factory.getRepositoryService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            return convert(service.getTypeDefinition(context, repositoryId, typeId, convert(extension)));
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
+
+    public List<CmisTypeContainer> getTypeDescendants(String repositoryId, String typeId, BigInteger depth,
+            Boolean includePropertyDefinitions, CmisExtensionType extension) throws CmisException {
+        try {
+            AbstractServicesFactory factory = getServicesFactory(wsContext);
+            CmisRepositoryService service = factory.getRepositoryService();
+            CallContext context = createContext(wsContext, repositoryId);
+
+            List<CmisTypeContainer> result = new ArrayList<CmisTypeContainer>();
+            convertTypeContainerList(service.getTypeDescendants(context, repositoryId, typeId, depth,
+                    includePropertyDefinitions, convert(extension)), result);
+
+            return result;
+        } catch (Exception e) {
+            throw convertException(e);
+        }
+    }
 
 }



Mime
View raw message