chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r934896 [6/12] - 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 Fri, 16 Apr 2010 14:14:02 GMT
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=934896&r1=934895&r2=934896&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 Fri Apr 16 14:14:00 2010
@@ -66,369 +66,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 fContext;
+	@Resource
+	WebServiceContext fContext;
 
-  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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisObjectService service = factory.getObjectService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisObjectService service = factory.getObjectService();
+			CallContext context = createContext(fContext);
+
+			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=934896&r1=934895&r2=934896&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 Fri Apr 16 14:14:00 2010
@@ -48,69 +48,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 fContext;
+	@Resource
+	WebServiceContext fContext;
 
-  public void applyPolicy(String repositoryId, String policyId, String objectId,
-      Holder<CmisExtensionType> extension) throws CmisException {
-    try {
-      AbstractServicesFactory factory = getServicesFactory(fContext);
-      CmisPolicyService service = factory.getPolicyService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisPolicyService service = factory.getPolicyService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisPolicyService service = factory.getPolicyService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
+			CmisPolicyService service = factory.getPolicyService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisPolicyService service = factory.getPolicyService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisPolicyService service = factory.getPolicyService();
+			CallContext context = createContext(fContext);
+
+			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=934896&r1=934895&r2=934896&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 Fri Apr 16 14:14:00 2010
@@ -44,25 +44,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 fContext;
+	@Resource
+	WebServiceContext fContext;
 
-  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(fContext);
-      CmisRelationshipService service = factory.getRelationshipService();
-      CallContext context = createContext(fContext);
+	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(fContext);
+			CmisRelationshipService service = factory.getRelationshipService();
+			CallContext context = createContext(fContext);
 
-      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=934896&r1=934895&r2=934896&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 Fri Apr 16 14:14:00 2010
@@ -50,100 +50,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 fContext;
+	@Resource
+	WebServiceContext fContext;
 
-  public List<CmisRepositoryEntryType> getRepositories(CmisExtensionType extension)
-      throws CmisException {
-    try {
-      AbstractServicesFactory factory = getServicesFactory(fContext);
-      CmisRepositoryService service = factory.getRepositoryService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisRepositoryService service = factory.getRepositoryService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisRepositoryService service = factory.getRepositoryService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisRepositoryService service = factory.getRepositoryService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
-      CmisRepositoryService service = factory.getRepositoryService();
-      CallContext context = createContext(fContext);
-
-      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(fContext);
+			CmisRepositoryService service = factory.getRepositoryService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisRepositoryService service = factory.getRepositoryService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisRepositoryService service = factory.getRepositoryService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisRepositoryService service = factory.getRepositoryService();
+			CallContext context = createContext(fContext);
+
+			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(fContext);
+			CmisRepositoryService service = factory.getRepositoryService();
+			CallContext context = createContext(fContext);
+
+			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);
+		}
+	}
 
 }

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/VersioningService.java?rev=934896&r1=934895&r2=934896&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/VersioningService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/webservices/VersioningService.java Fri Apr 16 14:14:00 2010
@@ -55,138 +55,126 @@ import org.apache.chemistry.opencmis.ser
  */
 @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.VersioningServicePort")
 public class VersioningService extends AbstractService implements VersioningServicePort {
-  @Resource
-  WebServiceContext fContext;
+	@Resource
+	WebServiceContext fContext;
 
-  public void cancelCheckOut(String repositoryId, String objectId,
-      Holder<CmisExtensionType> extension) throws CmisException {
-    try {
-      AbstractServicesFactory factory = getServicesFactory(fContext);
-      CmisVersioningService service = factory.getVersioningService();
-      CallContext context = createContext(fContext);
-
-      ExtensionsData extData = convertExtensionHolder(extension);
-
-      service.cancelCheckOut(context, repositoryId, objectId, extData);
-
-      setExtensionValues(extData, extension);
-    }
-    catch (Exception e) {
-      throw convertException(e);
-    }
-  }
-
-  public void checkIn(String repositoryId, Holder<String> objectId, Boolean major,
-      CmisPropertiesType properties, CmisContentStreamType contentStream, String checkinComment,
-      List<String> policies, CmisAccessControlListType addAces,
-      CmisAccessControlListType removeAces, Holder<CmisExtensionType> extension)
-      throws CmisException {
-    try {
-      AbstractServicesFactory factory = getServicesFactory(fContext);
-      CmisVersioningService service = factory.getVersioningService();
-      CallContext context = createContext(fContext);
-
-      org.apache.chemistry.opencmis.commons.api.Holder<String> objectIdHolder = convertHolder(objectId);
-      ExtensionsData extData = convertExtensionHolder(extension);
-
-      service.checkIn(context, repositoryId, objectIdHolder, major, convert(properties),
-          convert(contentStream), checkinComment, policies, convert(addAces, null), convert(
-              removeAces, null), extData, null);
-
-      setHolderValue(objectIdHolder, objectId);
-      setExtensionValues(extData, extension);
-    }
-    catch (Exception e) {
-      throw convertException(e);
-    }
-  }
-
-  public void checkOut(String repositoryId, Holder<String> objectId,
-      Holder<CmisExtensionType> extension, Holder<Boolean> contentCopied) throws CmisException {
-    try {
-      AbstractServicesFactory factory = getServicesFactory(fContext);
-      CmisVersioningService service = factory.getVersioningService();
-      CallContext context = createContext(fContext);
-
-      org.apache.chemistry.opencmis.commons.api.Holder<String> objectIdHolder = convertHolder(objectId);
-      org.apache.chemistry.opencmis.commons.api.Holder<Boolean> contentCopiedHolder = new org.apache.chemistry.opencmis.commons.api.Holder<Boolean>();
-      ExtensionsData extData = convertExtensionHolder(extension);
-
-      service.checkOut(context, repositoryId, objectIdHolder, extData, contentCopiedHolder, null);
-
-      if (contentCopied != null) {
-        contentCopied.value = contentCopiedHolder.getValue();
-      }
-
-      setHolderValue(objectIdHolder, objectId);
-      setExtensionValues(extData, extension);
-    }
-    catch (Exception e) {
-      throw convertException(e);
-    }
-  }
-
-  public List<CmisObjectType> getAllVersions(String repositoryId, String versionSeriesId,
-      String filter, Boolean includeAllowableActions, CmisExtensionType extension)
-      throws CmisException {
-    try {
-      AbstractServicesFactory factory = getServicesFactory(fContext);
-      CmisVersioningService service = factory.getVersioningService();
-      CallContext context = createContext(fContext);
-
-      List<ObjectData> versions = service.getAllVersions(context, repositoryId, versionSeriesId,
-          filter, includeAllowableActions, convert(extension), null);
-
-      if (versions == null) {
-        return null;
-      }
-
-      List<CmisObjectType> result = new ArrayList<CmisObjectType>();
-      for (ObjectData object : versions) {
-        result.add(convert(object));
-      }
-
-      return result;
-    }
-    catch (Exception e) {
-      throw convertException(e);
-    }
-  }
-
-  public CmisObjectType getObjectOfLatestVersion(String repositoryId, String versionSeriesId,
-      Boolean major, String filter, Boolean includeAllowableActions,
-      EnumIncludeRelationships includeRelationships, String renditionFilter,
-      Boolean includePolicyIds, Boolean includeAcl, CmisExtensionType extension)
-      throws CmisException {
-    try {
-      AbstractServicesFactory factory = getServicesFactory(fContext);
-      CmisVersioningService service = factory.getVersioningService();
-      CallContext context = createContext(fContext);
-
-      return convert(service.getObjectOfLatestVersion(context, repositoryId, versionSeriesId,
-          major, filter, includeAllowableActions, convert(IncludeRelationships.class,
-              includeRelationships), renditionFilter, includePolicyIds, includeAcl,
-          convert(extension), null));
-    }
-    catch (Exception e) {
-      throw convertException(e);
-    }
-  }
-
-  public CmisPropertiesType getPropertiesOfLatestVersion(String repositoryId,
-      String versionSeriesId, Boolean major, String filter, CmisExtensionType extension)
-      throws CmisException {
-    try {
-      AbstractServicesFactory factory = getServicesFactory(fContext);
-      CmisVersioningService service = factory.getVersioningService();
-      CallContext context = createContext(fContext);
-
-      return convert(service.getPropertiesOfLatestVersion(context, repositoryId, versionSeriesId,
-          major, filter, convert(extension)));
-    }
-    catch (Exception e) {
-      throw convertException(e);
-    }
-  }
+	public void cancelCheckOut(String repositoryId, String objectId, Holder<CmisExtensionType> extension)
+			throws CmisException {
+		try {
+			AbstractServicesFactory factory = getServicesFactory(fContext);
+			CmisVersioningService service = factory.getVersioningService();
+			CallContext context = createContext(fContext);
+
+			ExtensionsData extData = convertExtensionHolder(extension);
+
+			service.cancelCheckOut(context, repositoryId, objectId, extData);
+
+			setExtensionValues(extData, extension);
+		} catch (Exception e) {
+			throw convertException(e);
+		}
+	}
+
+	public void checkIn(String repositoryId, Holder<String> objectId, Boolean major, CmisPropertiesType properties,
+			CmisContentStreamType contentStream, String checkinComment, List<String> policies,
+			CmisAccessControlListType addAces, CmisAccessControlListType removeAces, Holder<CmisExtensionType> extension)
+			throws CmisException {
+		try {
+			AbstractServicesFactory factory = getServicesFactory(fContext);
+			CmisVersioningService service = factory.getVersioningService();
+			CallContext context = createContext(fContext);
+
+			org.apache.chemistry.opencmis.commons.api.Holder<String> objectIdHolder = convertHolder(objectId);
+			ExtensionsData extData = convertExtensionHolder(extension);
+
+			service.checkIn(context, repositoryId, objectIdHolder, major, convert(properties), convert(contentStream),
+					checkinComment, policies, convert(addAces, null), convert(removeAces, null), extData, null);
+
+			setHolderValue(objectIdHolder, objectId);
+			setExtensionValues(extData, extension);
+		} catch (Exception e) {
+			throw convertException(e);
+		}
+	}
+
+	public void checkOut(String repositoryId, Holder<String> objectId, Holder<CmisExtensionType> extension,
+			Holder<Boolean> contentCopied) throws CmisException {
+		try {
+			AbstractServicesFactory factory = getServicesFactory(fContext);
+			CmisVersioningService service = factory.getVersioningService();
+			CallContext context = createContext(fContext);
+
+			org.apache.chemistry.opencmis.commons.api.Holder<String> objectIdHolder = convertHolder(objectId);
+			org.apache.chemistry.opencmis.commons.api.Holder<Boolean> contentCopiedHolder = new org.apache.chemistry.opencmis.commons.api.Holder<Boolean>();
+			ExtensionsData extData = convertExtensionHolder(extension);
+
+			service.checkOut(context, repositoryId, objectIdHolder, extData, contentCopiedHolder, null);
+
+			if (contentCopied != null) {
+				contentCopied.value = contentCopiedHolder.getValue();
+			}
+
+			setHolderValue(objectIdHolder, objectId);
+			setExtensionValues(extData, extension);
+		} catch (Exception e) {
+			throw convertException(e);
+		}
+	}
+
+	public List<CmisObjectType> getAllVersions(String repositoryId, String versionSeriesId, String filter,
+			Boolean includeAllowableActions, CmisExtensionType extension) throws CmisException {
+		try {
+			AbstractServicesFactory factory = getServicesFactory(fContext);
+			CmisVersioningService service = factory.getVersioningService();
+			CallContext context = createContext(fContext);
+
+			List<ObjectData> versions = service.getAllVersions(context, repositoryId, versionSeriesId, filter,
+					includeAllowableActions, convert(extension), null);
+
+			if (versions == null) {
+				return null;
+			}
+
+			List<CmisObjectType> result = new ArrayList<CmisObjectType>();
+			for (ObjectData object : versions) {
+				result.add(convert(object));
+			}
+
+			return result;
+		} catch (Exception e) {
+			throw convertException(e);
+		}
+	}
+
+	public CmisObjectType getObjectOfLatestVersion(String repositoryId, String versionSeriesId, Boolean major,
+			String filter, Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships,
+			String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, CmisExtensionType extension)
+			throws CmisException {
+		try {
+			AbstractServicesFactory factory = getServicesFactory(fContext);
+			CmisVersioningService service = factory.getVersioningService();
+			CallContext context = createContext(fContext);
+
+			return convert(service.getObjectOfLatestVersion(context, repositoryId, versionSeriesId, major, filter,
+					includeAllowableActions, convert(IncludeRelationships.class, includeRelationships),
+					renditionFilter, includePolicyIds, includeAcl, convert(extension), null));
+		} catch (Exception e) {
+			throw convertException(e);
+		}
+	}
+
+	public CmisPropertiesType getPropertiesOfLatestVersion(String repositoryId, String versionSeriesId, Boolean major,
+			String filter, CmisExtensionType extension) throws CmisException {
+		try {
+			AbstractServicesFactory factory = getServicesFactory(fContext);
+			CmisVersioningService service = factory.getVersioningService();
+			CallContext context = createContext(fContext);
+
+			return convert(service.getPropertiesOfLatestVersion(context, repositoryId, versionSeriesId, major, filter,
+					convert(extension)));
+		} catch (Exception e) {
+			throw convertException(e);
+		}
+	}
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/AtomEntryParserTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/AtomEntryParserTest.java?rev=934896&r1=934895&r2=934896&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/AtomEntryParserTest.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/test/java/org/apache/chemistry/opencmis/server/impl/AtomEntryParserTest.java Fri Apr 16 14:14:00 2010
@@ -40,221 +40,166 @@ import org.junit.Test;
  */
 public class AtomEntryParserTest {
 
-  private static final String CMIS_ENTRY_CONTENT = "This is my content!";
-  private static final String CMIS_ENTRY = "<?xml version='1.0' encoding='utf-8'?>"
-      + "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\">"
-      + "<atom:author><atom:name>test</atom:name></atom:author>"
-      + "<atom:id>http://test/id</atom:id>"
-      + "<atom:published>2009-12-31T12:53:37Z</atom:published>"
-      + "<atom:title>test.txt</atom:title>"
-      + "<atom:updated>2010-01-01T00:00:00Z</atom:updated>"
-      + "<cmisra:object xmlns:ns3=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\">"
-      + "  <cmis:properties>"
-      + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectId\">"
-      + "      <cmis:value>id</cmis:value>"
-      + "    </cmis:propertyId>"
-      + "    <cmis:propertyString propertyDefinitionId=\"cmis:name\">"
-      + "      <cmis:value>test.txt</cmis:value>"
-      + "    </cmis:propertyString>"
-      + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\">"
-      + "      <cmis:value>cmis:document</cmis:value>" + "    </cmis:propertyId>"
-      + "  </cmis:properties>" + "</cmisra:object>"
-      + "<cmisra:content>"
-      + "  <cmisra:mediatype>text/plain</cmisra:mediatype>"
-      + "  <cmisra:base64>"
-      + Base64.encodeBase64String(CMIS_ENTRY_CONTENT.getBytes())
-      + "</cmisra:base64>"
-      + "</cmisra:content>" + "</atom:entry>";
-
-  private static final String ATOM_ENTRY_TEXT_CONTENT = "This is plain text!";
-  private static final String ATOM_ENTRY_TEXT = "<?xml version='1.0' encoding='utf-8'?>"
-      + "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\">"
-      + "<atom:author><atom:name>test</atom:name></atom:author>"
-      + "<atom:id>http://test/id</atom:id>"
-      + "<atom:published>2009-12-31T12:53:37Z</atom:published>"
-      + "<atom:title>test.txt</atom:title>"
-      + "<atom:updated>2010-01-01T00:00:00Z</atom:updated>"
-      + "<cmisra:object xmlns:ns3=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\">"
-      + "  <cmis:properties>"
-      + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectId\">"
-      + "      <cmis:value>id</cmis:value>"
-      + "    </cmis:propertyId>"
-      + "    <cmis:propertyString propertyDefinitionId=\"cmis:name\">"
-      + "      <cmis:value>test.txt</cmis:value>"
-      + "    </cmis:propertyString>"
-      + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\">"
-      + "      <cmis:value>cmis:document</cmis:value>"
-      + "    </cmis:propertyId>"
-      + "  </cmis:properties>"
-      + "</cmisra:object>"
-      + "<atom:content type=\"text\">"
-      + ATOM_ENTRY_TEXT_CONTENT
-      + "</atom:content>"
-      + "</atom:entry>";
-
-  private static final String ATOM_ENTRY_XML_CONTENT = "<first xmlns=\"http://test/1\"><second myattr=\"Cool, a value!\">hey, this is text</second><myns:third xmlns:myns=\"http://test/2\">guess what's here ... more text</myns:third></first>";
-  private static final String ATOM_ENTRY_XML = "<?xml version='1.0' encoding='utf-8'?>"
-      + "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\">"
-      + "<atom:author><atom:name>test</atom:name></atom:author>"
-      + "<atom:id>http://test/id</atom:id>"
-      + "<atom:published>2009-12-31T12:53:37Z</atom:published>"
-      + "<atom:title>test.txt</atom:title>"
-      + "<atom:updated>2010-01-01T00:00:00Z</atom:updated>"
-      + "<cmisra:object xmlns:ns3=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\">"
-      + "  <cmis:properties>"
-      + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectId\">"
-      + "      <cmis:value>id</cmis:value>"
-      + "    </cmis:propertyId>"
-      + "    <cmis:propertyString propertyDefinitionId=\"cmis:name\">"
-      + "      <cmis:value>test.txt</cmis:value>"
-      + "    </cmis:propertyString>"
-      + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\">"
-      + "      <cmis:value>cmis:document</cmis:value>"
-      + "    </cmis:propertyId>"
-      + "  </cmis:properties>" + "</cmisra:object>"
-      + "<atom:content type=\"text/xml\">"
-      + ATOM_ENTRY_XML_CONTENT
-      + "</atom:content>"
-      + "</atom:entry>";
-
-  private static final String ATOM_ENTRY_XHTML_CONTENT = "<div xmlns=\"http://www.w3.org/1999/xhtml\">This is <b>XHTML</b> content.</div>";
-  private static final String ATOM_ENTRY_XHTML = "<?xml version='1.0' encoding='utf-8'?>"
-      + "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\">"
-      + "<atom:author><atom:name>test</atom:name></atom:author>"
-      + "<atom:id>http://test/id</atom:id>"
-      + "<atom:published>2009-12-31T12:53:37Z</atom:published>"
-      + "<atom:title>test.txt</atom:title>"
-      + "<atom:updated>2010-01-01T00:00:00Z</atom:updated>"
-      + "<cmisra:object xmlns:ns3=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\">"
-      + "  <cmis:properties>"
-      + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectId\">"
-      + "      <cmis:value>id</cmis:value>"
-      + "    </cmis:propertyId>"
-      + "    <cmis:propertyString propertyDefinitionId=\"cmis:name\">"
-      + "      <cmis:value>test.txt</cmis:value>"
-      + "    </cmis:propertyString>"
-      + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\">"
-      + "      <cmis:value>cmis:document</cmis:value>"
-      + "    </cmis:propertyId>"
-      + "  </cmis:properties>"
-      + "</cmisra:object>"
-      + "<atom:content type=\"xhtml\">"
-      + ATOM_ENTRY_XHTML_CONTENT
-      + "</atom:content>"
-      + "</atom:entry>";
-
-  private static final String ATOM_ENTRY_BASE64_CONTENT = "This is another content!";
-  private static final String ATOM_ENTRY_BASE64 = "<?xml version='1.0' encoding='utf-8'?>"
-      + "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\">"
-      + "<atom:author><atom:name>test</atom:name></atom:author>"
-      + "<atom:id>http://test/id</atom:id>"
-      + "<atom:published>2009-12-31T12:53:37Z</atom:published>"
-      + "<atom:title>test.txt</atom:title>"
-      + "<atom:updated>2010-01-01T00:00:00Z</atom:updated>"
-      + "<cmisra:object xmlns:ns3=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\">"
-      + "  <cmis:properties>"
-      + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectId\">"
-      + "      <cmis:value>id</cmis:value>"
-      + "    </cmis:propertyId>"
-      + "    <cmis:propertyString propertyDefinitionId=\"cmis:name\">"
-      + "      <cmis:value>test.txt</cmis:value>"
-      + "    </cmis:propertyString>"
-      + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\">"
-      + "      <cmis:value>cmis:document</cmis:value>"
-      + "    </cmis:propertyId>"
-      + "  </cmis:properties>"
-      + "</cmisra:object>"
-      + "<atom:content type=\"application/something\">"
-      + Base64.encodeBase64String(ATOM_ENTRY_BASE64_CONTENT.getBytes())
-      + "</atom:content>"
-      + "</atom:entry>";
-
-  private static final String ATOM_ENTRY_NAME = "<?xml version='1.0' encoding='utf-8'?>"
-      + "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\">"
-      + "<atom:author><atom:name>test</atom:name></atom:author>"
-      + "<atom:id>http://test/id</atom:id>"
-      + "<atom:published>2009-12-31T12:53:37Z</atom:published>"
-      + "<atom:title>atom.title</atom:title>"
-      + "<atom:updated>2010-01-01T00:00:00Z</atom:updated>"
-      + "<cmisra:object xmlns:ns3=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\">"
-      + "  <cmis:properties>"
-      + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectId\">"
-      + "      <cmis:value>id</cmis:value>"
-      + "    </cmis:propertyId>"
-      + "    <cmis:propertyString propertyDefinitionId=\"cmis:name\">"
-      + "      <cmis:value>cmis.name</cmis:value>"
-      + "    </cmis:propertyString>"
-      + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\">"
-      + "      <cmis:value>cmis:document</cmis:value>"
-      + "    </cmis:propertyId>"
-      + "  </cmis:properties>" + "</cmisra:object>"
-      + "</atom:entry>";
-
-  @Test
-  public void testCmisContent() throws Exception {
-    byte[] content = parse(CMIS_ENTRY.getBytes());
-    assertEquals(CMIS_ENTRY_CONTENT, new String(content));
-  }
-
-  @Test
-  public void testAtomContentText() throws Exception {
-    byte[] content = parse(ATOM_ENTRY_TEXT.getBytes());
-    assertEquals(ATOM_ENTRY_TEXT_CONTENT, new String(content));
-  }
-
-  @Test
-  public void testAtomContentXml() throws Exception {
-    byte[] content = parse(ATOM_ENTRY_XML.getBytes());
-    String xmlContent = new String(content);
-    assertTrue(xmlContent.indexOf('>') > -1);
-    assertEquals(ATOM_ENTRY_XML_CONTENT, xmlContent.substring(xmlContent.indexOf('>') + 1));
-  }
-
-  @Test
-  public void testAtomContentXHtml() throws Exception {
-    byte[] content = parse(ATOM_ENTRY_XHTML.getBytes());
-    String xmlContent = new String(content);
-    assertTrue(xmlContent.indexOf('>') > -1);
-    assertEquals(ATOM_ENTRY_XHTML_CONTENT, xmlContent.substring(xmlContent.indexOf('>') + 1));
-  }
-
-  @Test
-  public void testAtomContentBase64() throws Exception {
-    byte[] content = parse(ATOM_ENTRY_BASE64.getBytes());
-    assertEquals(ATOM_ENTRY_BASE64_CONTENT, new String(content));
-  }
-
-  @Test
-  public void testAtomTitle() throws Exception {
-    AtomEntryParser aep = new AtomEntryParser(new ByteArrayInputStream(ATOM_ENTRY_NAME.getBytes()));
-
-    assertNotNull(aep.getObject());
-    assertNotNull(aep.getObject().getProperties());
-    assertNotNull(aep.getObject().getProperties().getProperties());
-    assertNotNull(aep.getObject().getProperties().getProperties().get(PropertyIds.NAME) instanceof PropertyString);
-
-    PropertyString nameProperty = (PropertyString) aep.getObject().getProperties()
-        .getProperties().get(PropertyIds.NAME);
-
-    assertEquals("atom.title", nameProperty.getFirstValue());
-  }
-
-  private byte[] parse(byte[] entry) throws Exception {
-    AtomEntryParser aep = new AtomEntryParser(new ByteArrayInputStream(entry));
-    ContentStream contentStream = aep.getContentStream();
-
-    assertNotNull(contentStream);
-    assertNotNull(contentStream.getStream());
-
-    ByteArrayOutputStream baos = new ByteArrayOutputStream();
-
-    byte[] buffer = new byte[4096];
-    int b;
-
-    while ((b = contentStream.getStream().read(buffer)) > -1) {
-      baos.write(buffer, 0, b);
-    }
+	private static final String CMIS_ENTRY_CONTENT = "This is my content!";
+	private static final String CMIS_ENTRY = "<?xml version='1.0' encoding='utf-8'?>"
+			+ "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\">"
+			+ "<atom:author><atom:name>test</atom:name></atom:author>" + "<atom:id>http://test/id</atom:id>"
+			+ "<atom:published>2009-12-31T12:53:37Z</atom:published>" + "<atom:title>test.txt</atom:title>"
+			+ "<atom:updated>2010-01-01T00:00:00Z</atom:updated>"
+			+ "<cmisra:object xmlns:ns3=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\">"
+			+ "  <cmis:properties>" + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectId\">"
+			+ "      <cmis:value>id</cmis:value>" + "    </cmis:propertyId>"
+			+ "    <cmis:propertyString propertyDefinitionId=\"cmis:name\">"
+			+ "      <cmis:value>test.txt</cmis:value>" + "    </cmis:propertyString>"
+			+ "    <cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\">"
+			+ "      <cmis:value>cmis:document</cmis:value>" + "    </cmis:propertyId>" + "  </cmis:properties>"
+			+ "</cmisra:object>" + "<cmisra:content>" + "  <cmisra:mediatype>text/plain</cmisra:mediatype>"
+			+ "  <cmisra:base64>" + Base64.encodeBase64String(CMIS_ENTRY_CONTENT.getBytes()) + "</cmisra:base64>"
+			+ "</cmisra:content>" + "</atom:entry>";
+
+	private static final String ATOM_ENTRY_TEXT_CONTENT = "This is plain text!";
+	private static final String ATOM_ENTRY_TEXT = "<?xml version='1.0' encoding='utf-8'?>"
+			+ "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\">"
+			+ "<atom:author><atom:name>test</atom:name></atom:author>" + "<atom:id>http://test/id</atom:id>"
+			+ "<atom:published>2009-12-31T12:53:37Z</atom:published>" + "<atom:title>test.txt</atom:title>"
+			+ "<atom:updated>2010-01-01T00:00:00Z</atom:updated>"
+			+ "<cmisra:object xmlns:ns3=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\">"
+			+ "  <cmis:properties>" + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectId\">"
+			+ "      <cmis:value>id</cmis:value>" + "    </cmis:propertyId>"
+			+ "    <cmis:propertyString propertyDefinitionId=\"cmis:name\">"
+			+ "      <cmis:value>test.txt</cmis:value>" + "    </cmis:propertyString>"
+			+ "    <cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\">"
+			+ "      <cmis:value>cmis:document</cmis:value>" + "    </cmis:propertyId>" + "  </cmis:properties>"
+			+ "</cmisra:object>" + "<atom:content type=\"text\">" + ATOM_ENTRY_TEXT_CONTENT + "</atom:content>"
+			+ "</atom:entry>";
+
+	private static final String ATOM_ENTRY_XML_CONTENT = "<first xmlns=\"http://test/1\"><second myattr=\"Cool, a value!\">hey, this is text</second><myns:third xmlns:myns=\"http://test/2\">guess what's here ... more text</myns:third></first>";
+	private static final String ATOM_ENTRY_XML = "<?xml version='1.0' encoding='utf-8'?>"
+			+ "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\">"
+			+ "<atom:author><atom:name>test</atom:name></atom:author>" + "<atom:id>http://test/id</atom:id>"
+			+ "<atom:published>2009-12-31T12:53:37Z</atom:published>" + "<atom:title>test.txt</atom:title>"
+			+ "<atom:updated>2010-01-01T00:00:00Z</atom:updated>"
+			+ "<cmisra:object xmlns:ns3=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\">"
+			+ "  <cmis:properties>" + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectId\">"
+			+ "      <cmis:value>id</cmis:value>" + "    </cmis:propertyId>"
+			+ "    <cmis:propertyString propertyDefinitionId=\"cmis:name\">"
+			+ "      <cmis:value>test.txt</cmis:value>" + "    </cmis:propertyString>"
+			+ "    <cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\">"
+			+ "      <cmis:value>cmis:document</cmis:value>" + "    </cmis:propertyId>" + "  </cmis:properties>"
+			+ "</cmisra:object>" + "<atom:content type=\"text/xml\">" + ATOM_ENTRY_XML_CONTENT + "</atom:content>"
+			+ "</atom:entry>";
+
+	private static final String ATOM_ENTRY_XHTML_CONTENT = "<div xmlns=\"http://www.w3.org/1999/xhtml\">This is <b>XHTML</b> content.</div>";
+	private static final String ATOM_ENTRY_XHTML = "<?xml version='1.0' encoding='utf-8'?>"
+			+ "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\">"
+			+ "<atom:author><atom:name>test</atom:name></atom:author>" + "<atom:id>http://test/id</atom:id>"
+			+ "<atom:published>2009-12-31T12:53:37Z</atom:published>" + "<atom:title>test.txt</atom:title>"
+			+ "<atom:updated>2010-01-01T00:00:00Z</atom:updated>"
+			+ "<cmisra:object xmlns:ns3=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\">"
+			+ "  <cmis:properties>" + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectId\">"
+			+ "      <cmis:value>id</cmis:value>" + "    </cmis:propertyId>"
+			+ "    <cmis:propertyString propertyDefinitionId=\"cmis:name\">"
+			+ "      <cmis:value>test.txt</cmis:value>" + "    </cmis:propertyString>"
+			+ "    <cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\">"
+			+ "      <cmis:value>cmis:document</cmis:value>" + "    </cmis:propertyId>" + "  </cmis:properties>"
+			+ "</cmisra:object>" + "<atom:content type=\"xhtml\">" + ATOM_ENTRY_XHTML_CONTENT + "</atom:content>"
+			+ "</atom:entry>";
+
+	private static final String ATOM_ENTRY_BASE64_CONTENT = "This is another content!";
+	private static final String ATOM_ENTRY_BASE64 = "<?xml version='1.0' encoding='utf-8'?>"
+			+ "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\">"
+			+ "<atom:author><atom:name>test</atom:name></atom:author>" + "<atom:id>http://test/id</atom:id>"
+			+ "<atom:published>2009-12-31T12:53:37Z</atom:published>" + "<atom:title>test.txt</atom:title>"
+			+ "<atom:updated>2010-01-01T00:00:00Z</atom:updated>"
+			+ "<cmisra:object xmlns:ns3=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\">"
+			+ "  <cmis:properties>" + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectId\">"
+			+ "      <cmis:value>id</cmis:value>" + "    </cmis:propertyId>"
+			+ "    <cmis:propertyString propertyDefinitionId=\"cmis:name\">"
+			+ "      <cmis:value>test.txt</cmis:value>" + "    </cmis:propertyString>"
+			+ "    <cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\">"
+			+ "      <cmis:value>cmis:document</cmis:value>" + "    </cmis:propertyId>" + "  </cmis:properties>"
+			+ "</cmisra:object>" + "<atom:content type=\"application/something\">"
+			+ Base64.encodeBase64String(ATOM_ENTRY_BASE64_CONTENT.getBytes()) + "</atom:content>" + "</atom:entry>";
+
+	private static final String ATOM_ENTRY_NAME = "<?xml version='1.0' encoding='utf-8'?>"
+			+ "<atom:entry xmlns:atom=\"http://www.w3.org/2005/Atom\" xmlns:cmis=\"http://docs.oasis-open.org/ns/cmis/core/200908/\" xmlns:cmisra=\"http://docs.oasis-open.org/ns/cmis/restatom/200908/\">"
+			+ "<atom:author><atom:name>test</atom:name></atom:author>" + "<atom:id>http://test/id</atom:id>"
+			+ "<atom:published>2009-12-31T12:53:37Z</atom:published>" + "<atom:title>atom.title</atom:title>"
+			+ "<atom:updated>2010-01-01T00:00:00Z</atom:updated>"
+			+ "<cmisra:object xmlns:ns3=\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\">"
+			+ "  <cmis:properties>" + "    <cmis:propertyId propertyDefinitionId=\"cmis:objectId\">"
+			+ "      <cmis:value>id</cmis:value>" + "    </cmis:propertyId>"
+			+ "    <cmis:propertyString propertyDefinitionId=\"cmis:name\">"
+			+ "      <cmis:value>cmis.name</cmis:value>" + "    </cmis:propertyString>"
+			+ "    <cmis:propertyId propertyDefinitionId=\"cmis:objectTypeId\">"
+			+ "      <cmis:value>cmis:document</cmis:value>" + "    </cmis:propertyId>" + "  </cmis:properties>"
+			+ "</cmisra:object>" + "</atom:entry>";
+
+	@Test
+	public void testCmisContent() throws Exception {
+		byte[] content = parse(CMIS_ENTRY.getBytes());
+		assertEquals(CMIS_ENTRY_CONTENT, new String(content));
+	}
+
+	@Test
+	public void testAtomContentText() throws Exception {
+		byte[] content = parse(ATOM_ENTRY_TEXT.getBytes());
+		assertEquals(ATOM_ENTRY_TEXT_CONTENT, new String(content));
+	}
+
+	@Test
+	public void testAtomContentXml() throws Exception {
+		byte[] content = parse(ATOM_ENTRY_XML.getBytes());
+		String xmlContent = new String(content);
+		assertTrue(xmlContent.indexOf('>') > -1);
+		assertEquals(ATOM_ENTRY_XML_CONTENT, xmlContent.substring(xmlContent.indexOf('>') + 1));
+	}
+
+	@Test
+	public void testAtomContentXHtml() throws Exception {
+		byte[] content = parse(ATOM_ENTRY_XHTML.getBytes());
+		String xmlContent = new String(content);
+		assertTrue(xmlContent.indexOf('>') > -1);
+		assertEquals(ATOM_ENTRY_XHTML_CONTENT, xmlContent.substring(xmlContent.indexOf('>') + 1));
+	}
+
+	@Test
+	public void testAtomContentBase64() throws Exception {
+		byte[] content = parse(ATOM_ENTRY_BASE64.getBytes());
+		assertEquals(ATOM_ENTRY_BASE64_CONTENT, new String(content));
+	}
+
+	@Test
+	public void testAtomTitle() throws Exception {
+		AtomEntryParser aep = new AtomEntryParser(new ByteArrayInputStream(ATOM_ENTRY_NAME.getBytes()));
+
+		assertNotNull(aep.getObject());
+		assertNotNull(aep.getObject().getProperties());
+		assertNotNull(aep.getObject().getProperties().getProperties());
+		assertNotNull(aep.getObject().getProperties().getProperties().get(PropertyIds.NAME) instanceof PropertyString);
+
+		PropertyString nameProperty = (PropertyString) aep.getObject().getProperties().getProperties().get(
+				PropertyIds.NAME);
+
+		assertEquals("atom.title", nameProperty.getFirstValue());
+	}
+
+	private byte[] parse(byte[] entry) throws Exception {
+		AtomEntryParser aep = new AtomEntryParser(new ByteArrayInputStream(entry));
+		ContentStream contentStream = aep.getContentStream();
+
+		assertNotNull(contentStream);
+		assertNotNull(contentStream.getStream());
+
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+		byte[] buffer = new byte[4096];
+		int b;
+
+		while ((b = contentStream.getStream().read(buffer)) > -1) {
+			baos.write(buffer, 0, b);
+		}
 
-    return baos.toByteArray();
-  }
+		return baos.toByteArray();
+	}
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/AclService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/AclService.java?rev=934896&r1=934895&r2=934896&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/AclService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/AclService.java Fri Apr 16 14:14:00 2010
@@ -33,57 +33,57 @@ import org.apache.chemistry.opencmis.ser
  */
 public class AclService implements CmisAclService {
 
-  private RepositoryMap fRepositoryMap;
+	private RepositoryMap fRepositoryMap;
 
-  /**
-   * Constructor.
-   */
-  public AclService(RepositoryMap repositoryMap) {
-    fRepositoryMap = repositoryMap;
-  }
+	/**
+	 * Constructor.
+	 */
+	public AclService(RepositoryMap repositoryMap) {
+		fRepositoryMap = repositoryMap;
+	}
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see
-   * org.apache.opencmis.server.spi.CmisAclService#applyAcl(org.apache.opencmis.server.spi.CallContext
-   * , java.lang.String, java.lang.String, org.apache.opencmis.commons.provider.AccessControlList,
-   * org.apache.opencmis.commons.enums.AclPropagation)
-   */
-  public Acl applyAcl(CallContext context, String repositoryId, String objectId,
-      Acl aces, AclPropagation aclPropagation) {
-    fRepositoryMap.getAuthenticatedRepository(context, repositoryId);
-    throw new CmisNotSupportedException("applyAcl not supported!");
-  }
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.apache.opencmis.server.spi.CmisAclService#applyAcl(org.apache.opencmis
+	 * .server.spi.CallContext , java.lang.String, java.lang.String,
+	 * org.apache.opencmis.commons.provider.AccessControlList,
+	 * org.apache.opencmis.commons.enums.AclPropagation)
+	 */
+	public Acl applyAcl(CallContext context, String repositoryId, String objectId, Acl aces,
+			AclPropagation aclPropagation) {
+		fRepositoryMap.getAuthenticatedRepository(context, repositoryId);
+		throw new CmisNotSupportedException("applyAcl not supported!");
+	}
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see
-   * org.apache.opencmis.server.spi.CmisAclService#applyAcl(org.apache.opencmis.server.spi.CallContext
-   * , java.lang.String, java.lang.String, org.apache.opencmis.commons.provider.AccessControlList,
-   * org.apache.opencmis.commons.provider.AccessControlList,
-   * org.apache.opencmis.commons.enums.AclPropagation,
-   * org.apache.opencmis.commons.api.ExtensionsData)
-   */
-  public Acl applyAcl(CallContext context, String repositoryId, String objectId,
-      Acl addAces, Acl removeAces, AclPropagation aclPropagation,
-      ExtensionsData extension) {
-    fRepositoryMap.getAuthenticatedRepository(context, repositoryId);
-    throw new CmisNotSupportedException("applyAcl not supported!");
-  }
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.apache.opencmis.server.spi.CmisAclService#applyAcl(org.apache.opencmis
+	 * .server.spi.CallContext , java.lang.String, java.lang.String,
+	 * org.apache.opencmis.commons.provider.AccessControlList,
+	 * org.apache.opencmis.commons.provider.AccessControlList,
+	 * org.apache.opencmis.commons.enums.AclPropagation,
+	 * org.apache.opencmis.commons.api.ExtensionsData)
+	 */
+	public Acl applyAcl(CallContext context, String repositoryId, String objectId, Acl addAces, Acl removeAces,
+			AclPropagation aclPropagation, ExtensionsData extension) {
+		fRepositoryMap.getAuthenticatedRepository(context, repositoryId);
+		throw new CmisNotSupportedException("applyAcl not supported!");
+	}
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see
-   * org.apache.opencmis.server.spi.CmisAclService#getAcl(org.apache.opencmis.server.spi.CallContext
-   * , java.lang.String, java.lang.String, java.lang.Boolean,
-   * org.apache.opencmis.commons.api.ExtensionsData)
-   */
-  public Acl getAcl(CallContext context, String repositoryId, String objectId,
-      Boolean onlyBasicPermissions, ExtensionsData extension) {
-    return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getAcl(context,
-        objectId, objectId);
-  }
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.apache.opencmis.server.spi.CmisAclService#getAcl(org.apache.opencmis
+	 * .server.spi.CallContext , java.lang.String, java.lang.String,
+	 * java.lang.Boolean, org.apache.opencmis.commons.api.ExtensionsData)
+	 */
+	public Acl getAcl(CallContext context, String repositoryId, String objectId, Boolean onlyBasicPermissions,
+			ExtensionsData extension) {
+		return fRepositoryMap.getAuthenticatedRepository(context, repositoryId).getAcl(context, objectId, objectId);
+	}
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/DocumentInfo.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/DocumentInfo.java?rev=934896&r1=934895&r2=934896&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/DocumentInfo.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/DocumentInfo.java Fri Apr 16 14:14:00 2010
@@ -23,22 +23,22 @@ import org.apache.chemistry.opencmis.ser
 
 public class DocumentInfo extends ObjectInfoImpl {
 
-  public DocumentInfo() {
-    setBaseType(BaseTypeId.CMIS_DOCUMENT);
-    setHasAcl(true);
-    setHasContent(true);
-    setHasParent(true);
-    setVersionSeriesId(null);
-    setIsCurrentVersion(true);
-    setRelationshipSourceIds(null);
-    setRelationshipTargetIds(null);
-    setRenditionInfos(null);
-    setSupportsDescendants(false);
-    setSupportsFolderTree(false);
-    setSupportsPolicies(false);
-    setSupportsRelationships(false);
-    setWorkingCopyId(null);
-    setWorkingCopyOriginalId(null);
-  }
+	public DocumentInfo() {
+		setBaseType(BaseTypeId.CMIS_DOCUMENT);
+		setHasAcl(true);
+		setHasContent(true);
+		setHasParent(true);
+		setVersionSeriesId(null);
+		setIsCurrentVersion(true);
+		setRelationshipSourceIds(null);
+		setRelationshipTargetIds(null);
+		setRenditionInfos(null);
+		setSupportsDescendants(false);
+		setSupportsFolderTree(false);
+		setSupportsPolicies(false);
+		setSupportsRelationships(false);
+		setWorkingCopyId(null);
+		setWorkingCopyOriginalId(null);
+	}
 
 }



Mime
View raw message