chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcaru...@apache.org
Subject svn commit: r910572 [9/36] - in /incubator/chemistry/trunk/opencmis: ./ _dev/ opencmis-client/ opencmis-client/opencmis-client-api/ opencmis-client/opencmis-client-api/src/ opencmis-client/opencmis-client-api/src/main/ opencmis-client/opencmis-client-a...
Date Tue, 16 Feb 2010 16:04:07 GMT
Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/MultiFilingServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/MultiFilingServiceImpl.java?rev=910572&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/MultiFilingServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/MultiFilingServiceImpl.java Tue Feb 16 16:03:38 2010
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.client.provider.spi.webservices;
+
+import static org.apache.opencmis.commons.impl.Converter.convertExtensionHolder;
+import static org.apache.opencmis.commons.impl.Converter.setExtensionValues;
+
+import org.apache.opencmis.client.provider.spi.Session;
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.opencmis.commons.impl.jaxb.CmisException;
+import org.apache.opencmis.commons.impl.jaxb.CmisExtensionType;
+import org.apache.opencmis.commons.impl.jaxb.MultiFilingServicePort;
+import org.apache.opencmis.commons.provider.MultiFilingService;
+
+/**
+ * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
+ * 
+ */
+public class MultiFilingServiceImpl extends AbstractWebServicesService implements
+    MultiFilingService {
+
+  private PortProvider fPortProvider;
+
+  /**
+   * Constructor.
+   */
+  public MultiFilingServiceImpl(Session session, PortProvider portProvider) {
+    setSession(session);
+    fPortProvider = portProvider;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.MultiFilingService#addObjectToFolder(java.lang.String,
+   * java.lang.String, java.lang.String, java.lang.Boolean,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public void addObjectToFolder(String repositoryId, String objectId, String folderId,
+      Boolean allVersions, ExtensionsData extension) {
+    MultiFilingServicePort port = fPortProvider.getMultiFilingServicePort();
+
+    try {
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.addObjectToFolder(repositoryId, objectId, folderId, allVersions, portExtension);
+
+      setExtensionValues(portExtension, extension);
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.MultiFilingService#removeObjectFromFolder(java.lang.String,
+   * java.lang.String, java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public void removeObjectFromFolder(String repositoryId, String objectId, String folderId,
+      ExtensionsData extension) {
+    MultiFilingServicePort port = fPortProvider.getMultiFilingServicePort();
+
+    try {
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.removeObjectFromFolder(repositoryId, objectId, folderId, portExtension);
+
+      setExtensionValues(portExtension, extension);
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/MultiFilingServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/NavigationServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/NavigationServiceImpl.java?rev=910572&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/NavigationServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/NavigationServiceImpl.java Tue Feb 16 16:03:38 2010
@@ -0,0 +1,252 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.client.provider.spi.webservices;
+
+import static org.apache.opencmis.commons.impl.Converter.convert;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.opencmis.client.provider.spi.Session;
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.enums.IncludeRelationships;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.opencmis.commons.impl.jaxb.CmisException;
+import org.apache.opencmis.commons.impl.jaxb.CmisObjectInFolderContainerType;
+import org.apache.opencmis.commons.impl.jaxb.CmisObjectParentsType;
+import org.apache.opencmis.commons.impl.jaxb.EnumIncludeRelationships;
+import org.apache.opencmis.commons.impl.jaxb.NavigationServicePort;
+import org.apache.opencmis.commons.provider.NavigationService;
+import org.apache.opencmis.commons.provider.ObjectData;
+import org.apache.opencmis.commons.provider.ObjectInFolderContainer;
+import org.apache.opencmis.commons.provider.ObjectInFolderList;
+import org.apache.opencmis.commons.provider.ObjectList;
+import org.apache.opencmis.commons.provider.ObjectParentData;
+
+/**
+ * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
+ * 
+ */
+public class NavigationServiceImpl extends AbstractWebServicesService implements NavigationService {
+
+  private PortProvider fPortProvider;
+
+  /**
+   * Constructor.
+   */
+  public NavigationServiceImpl(Session session, PortProvider portProvider) {
+    setSession(session);
+    fPortProvider = portProvider;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.NavigationService#getChildren(java.lang.String,
+   * java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean,
+   * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String, java.lang.Boolean,
+   * java.math.BigInteger, java.math.BigInteger, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public ObjectInFolderList getChildren(String repositoryId, String folderId, String filter,
+      String orderBy, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+      String renditionFilter, Boolean includePathSegment, BigInteger maxItems,
+      BigInteger skipCount, ExtensionsData extension) {
+    NavigationServicePort port = fPortProvider.getNavigationServicePort();
+
+    try {
+      return convert(port.getChildren(repositoryId, folderId, filter, orderBy,
+          includeAllowableActions, convert(EnumIncludeRelationships.class, includeRelationships),
+          renditionFilter, includePathSegment, maxItems, skipCount, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.NavigationService#getDescendants(java.lang.String,
+   * java.lang.String, java.math.BigInteger, java.lang.String, java.lang.Boolean,
+   * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String, java.lang.Boolean,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId,
+      BigInteger depth, String filter, Boolean includeAllowableActions,
+      IncludeRelationships includeRelationships, String renditionFilter,
+      Boolean includePathSegment, ExtensionsData extension) {
+    NavigationServicePort port = fPortProvider.getNavigationServicePort();
+
+    try {
+      List<CmisObjectInFolderContainerType> containerList = port.getDescendants(repositoryId,
+          folderId, depth, filter, includeAllowableActions, convert(EnumIncludeRelationships.class,
+              includeRelationships), renditionFilter, includePathSegment, convert(extension));
+
+      // no list?
+      if ((containerList == null) || (containerList.isEmpty())) {
+        return null;
+      }
+
+      // convert list
+      List<ObjectInFolderContainer> result = new ArrayList<ObjectInFolderContainer>();
+      for (CmisObjectInFolderContainerType container : containerList) {
+        result.add(convert(container));
+      }
+
+      return result;
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.NavigationService#getFolderParent(java.lang.String,
+   * java.lang.String, java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public ObjectData getFolderParent(String repositoryId, String folderId, String filter,
+      ExtensionsData extension) {
+    NavigationServicePort port = fPortProvider.getNavigationServicePort();
+
+    try {
+      return convert(port.getFolderParent(repositoryId, folderId, filter, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.NavigationService#getFolderTree(java.lang.String,
+   * java.lang.String, java.math.BigInteger, java.lang.String, java.lang.Boolean,
+   * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String, java.lang.Boolean,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId,
+      BigInteger depth, String filter, Boolean includeAllowableActions,
+      IncludeRelationships includeRelationships, String renditionFilter,
+      Boolean includePathSegment, ExtensionsData extension) {
+    NavigationServicePort port = fPortProvider.getNavigationServicePort();
+
+    try {
+      List<CmisObjectInFolderContainerType> containerList = port.getFolderTree(repositoryId,
+          folderId, depth, filter, includeAllowableActions, convert(EnumIncludeRelationships.class,
+              includeRelationships), renditionFilter, includePathSegment, convert(extension));
+
+      // no list?
+      if ((containerList == null) || (containerList.isEmpty())) {
+        return null;
+      }
+
+      // convert list
+      List<ObjectInFolderContainer> result = new ArrayList<ObjectInFolderContainer>();
+      for (CmisObjectInFolderContainerType container : containerList) {
+        result.add(convert(container));
+      }
+
+      return result;
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.NavigationService#getObjectParents(java.lang.String,
+   * java.lang.String, java.lang.String, java.lang.Boolean,
+   * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String, java.lang.Boolean,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public List<ObjectParentData> getObjectParents(String repositoryId, String objectId,
+      String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+      String renditionFilter, Boolean includeRelativePathSegment, ExtensionsData extension) {
+    NavigationServicePort port = fPortProvider.getNavigationServicePort();
+
+    try {
+      List<CmisObjectParentsType> parentsList = port.getObjectParents(repositoryId, objectId,
+          filter, includeAllowableActions, convert(EnumIncludeRelationships.class,
+              includeRelationships), renditionFilter, includeRelativePathSegment,
+          convert(extension));
+
+      // no list?
+      if ((parentsList == null) || (parentsList.isEmpty())) {
+        return null;
+      }
+
+      // convert list
+      List<ObjectParentData> result = new ArrayList<ObjectParentData>();
+      for (CmisObjectParentsType parent : parentsList) {
+        result.add(convert(parent));
+      }
+
+      return result;
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.NavigationService#getCheckedOutDocs(java.lang.String,
+   * java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean,
+   * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String, java.math.BigInteger,
+   * java.math.BigInteger, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public ObjectList getCheckedOutDocs(String repositoryId, String folderId, String filter,
+      String orderBy, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+      String renditionFilter, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+    NavigationServicePort port = fPortProvider.getNavigationServicePort();
+
+    try {
+      return convert(port.getCheckedOutDocs(repositoryId, folderId, filter, orderBy,
+          includeAllowableActions, convert(EnumIncludeRelationships.class, includeRelationships),
+          renditionFilter, maxItems, skipCount, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/NavigationServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/ObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/ObjectServiceImpl.java?rev=910572&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/ObjectServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/ObjectServiceImpl.java Tue Feb 16 16:03:38 2010
@@ -0,0 +1,555 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.client.provider.spi.webservices;
+
+import static org.apache.opencmis.commons.impl.Converter.convert;
+import static org.apache.opencmis.commons.impl.Converter.convertExtensionHolder;
+import static org.apache.opencmis.commons.impl.Converter.convertHolder;
+import static org.apache.opencmis.commons.impl.Converter.setExtensionValues;
+import static org.apache.opencmis.commons.impl.Converter.setHolderValue;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.opencmis.client.provider.spi.Session;
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.enums.IncludeRelationships;
+import org.apache.opencmis.commons.enums.UnfileObjects;
+import org.apache.opencmis.commons.enums.VersioningState;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.opencmis.commons.impl.jaxb.CmisException;
+import org.apache.opencmis.commons.impl.jaxb.CmisExtensionType;
+import org.apache.opencmis.commons.impl.jaxb.CmisRenditionType;
+import org.apache.opencmis.commons.impl.jaxb.EnumIncludeRelationships;
+import org.apache.opencmis.commons.impl.jaxb.EnumUnfileObject;
+import org.apache.opencmis.commons.impl.jaxb.EnumVersioningState;
+import org.apache.opencmis.commons.impl.jaxb.ObjectServicePort;
+import org.apache.opencmis.commons.provider.AccessControlList;
+import org.apache.opencmis.commons.provider.AllowableActionsData;
+import org.apache.opencmis.commons.provider.ContentStreamData;
+import org.apache.opencmis.commons.provider.FailedToDeleteData;
+import org.apache.opencmis.commons.provider.Holder;
+import org.apache.opencmis.commons.provider.ObjectData;
+import org.apache.opencmis.commons.provider.ObjectService;
+import org.apache.opencmis.commons.provider.PropertiesData;
+import org.apache.opencmis.commons.provider.RenditionData;
+
+/**
+ * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
+ * 
+ */
+public class ObjectServiceImpl extends AbstractWebServicesService implements ObjectService {
+
+  private PortProvider fPortProvider;
+
+  /**
+   * Constructor.
+   */
+  public ObjectServiceImpl(Session session, PortProvider portProvider) {
+    setSession(session);
+    fPortProvider = portProvider;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#createDocument(java.lang.String,
+   * org.apache.opencmis.client.provider.PropertiesData, java.lang.String,
+   * org.apache.opencmis.client.provider.ContentStreamData, org.apache.opencmis.commons.enums.VersioningState,
+   * java.util.List, org.apache.opencmis.client.provider.AccessControlList,
+   * org.apache.opencmis.client.provider.AccessControlList, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public String createDocument(String repositoryId, PropertiesData properties, String folderId,
+      ContentStreamData contentStream, VersioningState versioningState, List<String> policies,
+      AccessControlList addACEs, AccessControlList removeACEs, ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      javax.xml.ws.Holder<String> objectId = new javax.xml.ws.Holder<String>();
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.createDocument(repositoryId, convert(properties), folderId, convert(contentStream),
+          convert(EnumVersioningState.class, versioningState), policies, convert(addACEs),
+          convert(removeACEs), portExtension, objectId);
+
+      setExtensionValues(portExtension, extension);
+
+      return objectId.value;
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#createDocumentFromSource(java.lang.String,
+   * java.lang.String, org.apache.opencmis.client.provider.PropertiesData, java.lang.String,
+   * org.apache.opencmis.commons.enums.VersioningState, java.util.List,
+   * org.apache.opencmis.client.provider.AccessControlList, org.apache.opencmis.client.provider.AccessControlList,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public String createDocumentFromSource(String repositoryId, String sourceId,
+      PropertiesData properties, String folderId, VersioningState versioningState,
+      List<String> policies, AccessControlList addACEs, AccessControlList removeACEs,
+      ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      javax.xml.ws.Holder<String> objectId = new javax.xml.ws.Holder<String>();
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.createDocumentFromSource(repositoryId, sourceId, convert(properties), folderId, convert(
+          EnumVersioningState.class, versioningState), policies, convert(addACEs),
+          convert(removeACEs), portExtension, objectId);
+
+      setExtensionValues(portExtension, extension);
+
+      return objectId.value;
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#createFolder(java.lang.String,
+   * org.apache.opencmis.client.provider.PropertiesData, java.lang.String, java.util.List,
+   * org.apache.opencmis.client.provider.AccessControlList, org.apache.opencmis.client.provider.AccessControlList,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public String createFolder(String repositoryId, PropertiesData properties, String folderId,
+      List<String> policies, AccessControlList addACEs, AccessControlList removeACEs,
+      ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      javax.xml.ws.Holder<String> objectId = new javax.xml.ws.Holder<String>();
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.createFolder(repositoryId, convert(properties), folderId, policies, convert(addACEs),
+          convert(removeACEs), portExtension, objectId);
+
+      setExtensionValues(portExtension, extension);
+
+      return objectId.value;
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#createPolicy(java.lang.String,
+   * org.apache.opencmis.client.provider.PropertiesData, java.lang.String, java.util.List,
+   * org.apache.opencmis.client.provider.AccessControlList, org.apache.opencmis.client.provider.AccessControlList,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public String createPolicy(String repositoryId, PropertiesData properties, String folderId,
+      List<String> policies, AccessControlList addACEs, AccessControlList removeACEs,
+      ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      javax.xml.ws.Holder<String> objectId = new javax.xml.ws.Holder<String>();
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.createPolicy(repositoryId, convert(properties), folderId, policies, convert(addACEs),
+          convert(removeACEs), portExtension, objectId);
+
+      setExtensionValues(portExtension, extension);
+
+      return objectId.value;
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#createRelationship(java.lang.String,
+   * org.apache.opencmis.client.provider.PropertiesData, java.util.List,
+   * org.apache.opencmis.client.provider.AccessControlList, org.apache.opencmis.client.provider.AccessControlList,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public String createRelationship(String repositoryId, PropertiesData properties,
+      List<String> policies, AccessControlList addACEs, AccessControlList removeACEs,
+      ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      javax.xml.ws.Holder<String> objectId = new javax.xml.ws.Holder<String>();
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.createRelationship(repositoryId, convert(properties), policies, convert(addACEs),
+          convert(removeACEs), portExtension, objectId);
+
+      setExtensionValues(portExtension, extension);
+
+      return objectId.value;
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#updateProperties(java.lang.String,
+   * org.apache.opencmis.client.provider.Holder, org.apache.opencmis.client.provider.Holder,
+   * org.apache.opencmis.client.provider.PropertiesData, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public void updateProperties(String repositoryId, Holder<String> objectId,
+      Holder<String> changeToken, PropertiesData properties, ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      javax.xml.ws.Holder<String> portObjectId = convertHolder(objectId);
+      javax.xml.ws.Holder<String> portChangeToken = convertHolder(changeToken);
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.updateProperties(repositoryId, portObjectId, portChangeToken, convert(properties),
+          portExtension);
+
+      setHolderValue(portObjectId, objectId);
+      setHolderValue(portChangeToken, changeToken);
+      setExtensionValues(portExtension, extension);
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#deleteObject(java.lang.String,
+   * java.lang.String, java.lang.Boolean, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public void deleteObject(String repositoryId, String objectId, Boolean allVersions,
+      ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.deleteObject(repositoryId, objectId, allVersions, portExtension);
+
+      setExtensionValues(portExtension, extension);
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#deleteTree(java.lang.String, java.lang.String,
+   * java.lang.Boolean, org.apache.opencmis.commons.enums.UnfileObject, java.lang.Boolean,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions,
+      UnfileObjects unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      return convert(port.deleteTree(repositoryId, folderId, allVersions, convert(
+          EnumUnfileObject.class, unfileObjects), continueOnFailure, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#getAllowableActions(java.lang.String,
+   * java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public AllowableActionsData getAllowableActions(String repositoryId, String objectId,
+      ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      return convert(port.getAllowableActions(repositoryId, objectId, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#getContentStream(java.lang.String,
+   * java.lang.String, java.lang.String, java.math.BigInteger, java.math.BigInteger,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public ContentStreamData getContentStream(String repositoryId, String objectId, String streamId,
+      BigInteger offset, BigInteger length, ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      return convert(port.getContentStream(repositoryId, objectId, streamId, offset, length,
+          convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#getObject(java.lang.String, java.lang.String,
+   * java.lang.String, java.lang.Boolean, org.apache.opencmis.commons.enums.IncludeRelationships,
+   * java.lang.String, java.lang.Boolean, java.lang.Boolean,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public ObjectData getObject(String repositoryId, String objectId, String filter,
+      Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+      String renditionFilter, Boolean includePolicyIds, Boolean includeACL, ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      return convert(port.getObject(repositoryId, objectId, filter, includeAllowableActions,
+          convert(EnumIncludeRelationships.class, includeRelationships), renditionFilter,
+          includePolicyIds, includeACL, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#getObjectByPath(java.lang.String,
+   * java.lang.String, java.lang.String, java.lang.Boolean,
+   * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String, java.lang.Boolean,
+   * java.lang.Boolean, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public ObjectData getObjectByPath(String repositoryId, String path, String filter,
+      Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+      String renditionFilter, Boolean includePolicyIds, Boolean includeACL, ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      return convert(port.getObjectByPath(repositoryId, path, filter, includeAllowableActions,
+          convert(EnumIncludeRelationships.class, includeRelationships), renditionFilter,
+          includePolicyIds, includeACL, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#getProperties(java.lang.String,
+   * java.lang.String, java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public PropertiesData getProperties(String repositoryId, String objectId, String filter,
+      ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      return convert(port.getProperties(repositoryId, objectId, filter, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#getRenditions(java.lang.String,
+   * java.lang.String, java.lang.String, java.math.BigInteger, java.math.BigInteger,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public List<RenditionData> getRenditions(String repositoryId, String objectId,
+      String renditionFilter, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      List<CmisRenditionType> renditionList = port.getRenditions(repositoryId, objectId,
+          renditionFilter, maxItems, skipCount, convert(extension));
+
+      // no list?
+      if ((renditionList == null) || (renditionList.isEmpty())) {
+        return null;
+      }
+
+      // convert list
+      List<RenditionData> result = new ArrayList<RenditionData>();
+      for (CmisRenditionType rendition : renditionList) {
+        result.add(convert(rendition));
+      }
+
+      return result;
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#moveObject(java.lang.String,
+   * org.apache.opencmis.client.provider.Holder, java.lang.String, java.lang.String,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId,
+      String sourceFolderId, ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      javax.xml.ws.Holder<String> portObjectId = convertHolder(objectId);
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.moveObject(repositoryId, portObjectId, targetFolderId, sourceFolderId, portExtension);
+
+      setHolderValue(portObjectId, objectId);
+      setExtensionValues(portExtension, extension);
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#setContentStream(java.lang.String,
+   * org.apache.opencmis.client.provider.Holder, java.lang.Boolean, org.apache.opencmis.client.provider.Holder,
+   * org.apache.opencmis.client.provider.ContentStreamData, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
+      Holder<String> changeToken, ContentStreamData contentStream, ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      javax.xml.ws.Holder<String> portObjectId = convertHolder(objectId);
+      javax.xml.ws.Holder<String> portChangeToken = convertHolder(changeToken);
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.setContentStream(repositoryId, portObjectId, overwriteFlag, portChangeToken,
+          convert(contentStream), portExtension);
+
+      setHolderValue(portObjectId, objectId);
+      setHolderValue(portChangeToken, changeToken);
+      setExtensionValues(portExtension, extension);
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.ObjectService#deleteContentStream(java.lang.String,
+   * org.apache.opencmis.client.provider.Holder, org.apache.opencmis.client.provider.Holder,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public void deleteContentStream(String repositoryId, Holder<String> objectId,
+      Holder<String> changeToken, ExtensionsData extension) {
+    ObjectServicePort port = fPortProvider.getObjectServicePort();
+
+    try {
+      javax.xml.ws.Holder<String> portObjectId = convertHolder(objectId);
+      javax.xml.ws.Holder<String> portChangeToken = convertHolder(changeToken);
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.deleteContentStream(repositoryId, portObjectId, portChangeToken, portExtension);
+
+      setHolderValue(portObjectId, objectId);
+      setHolderValue(portChangeToken, changeToken);
+      setExtensionValues(portExtension, extension);
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/ObjectServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/PolicyServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/PolicyServiceImpl.java?rev=910572&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/PolicyServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/PolicyServiceImpl.java Tue Feb 16 16:03:38 2010
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.client.provider.spi.webservices;
+
+import static org.apache.opencmis.commons.impl.Converter.convert;
+import static org.apache.opencmis.commons.impl.Converter.convertExtensionHolder;
+import static org.apache.opencmis.commons.impl.Converter.setExtensionValues;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.opencmis.client.provider.spi.Session;
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.opencmis.commons.impl.jaxb.CmisException;
+import org.apache.opencmis.commons.impl.jaxb.CmisExtensionType;
+import org.apache.opencmis.commons.impl.jaxb.CmisObjectType;
+import org.apache.opencmis.commons.impl.jaxb.PolicyServicePort;
+import org.apache.opencmis.commons.provider.ObjectData;
+import org.apache.opencmis.commons.provider.PolicyService;
+
+/**
+ * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
+ * 
+ */
+public class PolicyServiceImpl extends AbstractWebServicesService implements PolicyService {
+
+  private PortProvider fPortProvider;
+
+  /**
+   * Constructor.
+   */
+  public PolicyServiceImpl(Session session, PortProvider portProvider) {
+    setSession(session);
+    fPortProvider = portProvider;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.PolicyService#applyPolicy(java.lang.String, java.lang.String,
+   * java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public void applyPolicy(String repositoryId, String policyId, String objectId,
+      ExtensionsData extension) {
+    PolicyServicePort port = fPortProvider.getPolicyServicePort();
+
+    try {
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.applyPolicy(repositoryId, policyId, objectId, portExtension);
+
+      setExtensionValues(portExtension, extension);
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.PolicyService#removePolicy(java.lang.String,
+   * java.lang.String, java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public void removePolicy(String repositoryId, String policyId, String objectId,
+      ExtensionsData extension) {
+    PolicyServicePort port = fPortProvider.getPolicyServicePort();
+
+    try {
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.removePolicy(repositoryId, policyId, objectId, portExtension);
+
+      setExtensionValues(portExtension, extension);
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.PolicyService#getAppliedPolicies(java.lang.String,
+   * java.lang.String, java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public List<ObjectData> getAppliedPolicies(String repositoryId, String objectId, String filter,
+      ExtensionsData extension) {
+    PolicyServicePort port = fPortProvider.getPolicyServicePort();
+
+    try {
+      List<CmisObjectType> policyList = port.getAppliedPolicies(repositoryId, objectId, filter,
+          convert(extension));
+
+      // no list?
+      if ((policyList == null) || (policyList.isEmpty())) {
+        return null;
+      }
+
+      // convert list
+      List<ObjectData> result = new ArrayList<ObjectData>();
+      for (CmisObjectType policy : policyList) {
+        result.add(convert(policy));
+      }
+
+      return result;
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/PolicyServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/PortProvider.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/PortProvider.java?rev=910572&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/PortProvider.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/PortProvider.java Tue Feb 16 16:03:38 2010
@@ -0,0 +1,282 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.client.provider.spi.webservices;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.soap.MTOMFeature;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.opencmis.client.provider.impl.CmisProviderHelper;
+import org.apache.opencmis.client.provider.spi.AbstractAuthenticationProvider;
+import org.apache.opencmis.client.provider.spi.Session;
+import org.apache.opencmis.commons.SessionParameter;
+import org.apache.opencmis.commons.exceptions.CmisBaseException;
+import org.apache.opencmis.commons.exceptions.CmisConnectionException;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.opencmis.commons.impl.jaxb.ACLService;
+import org.apache.opencmis.commons.impl.jaxb.ACLServicePort;
+import org.apache.opencmis.commons.impl.jaxb.DiscoveryService;
+import org.apache.opencmis.commons.impl.jaxb.DiscoveryServicePort;
+import org.apache.opencmis.commons.impl.jaxb.MultiFilingService;
+import org.apache.opencmis.commons.impl.jaxb.MultiFilingServicePort;
+import org.apache.opencmis.commons.impl.jaxb.NavigationService;
+import org.apache.opencmis.commons.impl.jaxb.NavigationServicePort;
+import org.apache.opencmis.commons.impl.jaxb.ObjectService;
+import org.apache.opencmis.commons.impl.jaxb.ObjectServicePort;
+import org.apache.opencmis.commons.impl.jaxb.PolicyService;
+import org.apache.opencmis.commons.impl.jaxb.PolicyServicePort;
+import org.apache.opencmis.commons.impl.jaxb.RelationshipService;
+import org.apache.opencmis.commons.impl.jaxb.RelationshipServicePort;
+import org.apache.opencmis.commons.impl.jaxb.RepositoryService;
+import org.apache.opencmis.commons.impl.jaxb.RepositoryServicePort;
+import org.apache.opencmis.commons.impl.jaxb.VersioningService;
+import org.apache.opencmis.commons.impl.jaxb.VersioningServicePort;
+import org.w3c.dom.Element;
+
+import com.sun.xml.ws.api.message.Headers;
+import com.sun.xml.ws.developer.JAXWSProperties;
+import com.sun.xml.ws.developer.StreamingAttachmentFeature;
+import com.sun.xml.ws.developer.WSBindingProvider;
+
+/**
+ * Provides CMIS Web Services port objects. Handles authentication headers.
+ * 
+ * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
+ * 
+ */
+public class PortProvider {
+
+  private static Log log = LogFactory.getLog(PortProvider.class);
+
+  public static final String CMIS_NAMESPACE = "http://docs.oasis-open.org/ns/cmis/ws/200908/";
+
+  public static final String REPOSITORY_SERVICE = "RepositoryService";
+  public static final String OBJECT_SERVICE = "ObjectService";
+  public static final String DISCOVERY_SERVICE = "DiscoveryService";
+  public static final String NAVIGATION_SERVICE = "NavigationService";
+  public static final String MULTIFILING_SERVICE = "MulifilingService";
+  public static final String VERSIONING_SERVICE = "VersioningService";
+  public static final String RELATIONSHIP_SERVICE = "RelationshipService";
+  public static final String POLICY_SERVICE = "PolicyService";
+  public static final String ACL_SERVICE = "ACLService";
+
+  private static final int CHUNK_SIZE = 64 * 1024;
+
+  private Session fSession;
+
+  /**
+   * Constructor.
+   */
+  public PortProvider(Session session) {
+    fSession = session;
+  }
+
+  /**
+   * Return the Repository Service port object.
+   */
+  public RepositoryServicePort getRepositoryServicePort() {
+    return (RepositoryServicePort) getPortObject(SessionParameter.WEBSERVICES_REPOSITORY_SERVICE);
+  }
+
+  /**
+   * Return the Navigation Service port object.
+   */
+  public NavigationServicePort getNavigationServicePort() {
+    return (NavigationServicePort) getPortObject(SessionParameter.WEBSERVICES_NAVIGATION_SERVICE);
+  }
+
+  /**
+   * Return the Object Service port object.
+   */
+  public ObjectServicePort getObjectServicePort() {
+    return (ObjectServicePort) getPortObject(SessionParameter.WEBSERVICES_OBJECT_SERVICE);
+  }
+
+  /**
+   * Return the Versioning Service port object.
+   */
+  public VersioningServicePort getVersioningServicePort() {
+    return (VersioningServicePort) getPortObject(SessionParameter.WEBSERVICES_VERSIONING_SERVICE);
+  }
+
+  /**
+   * Return the Discovery Service port object.
+   */
+  public DiscoveryServicePort getDiscoveryServicePort() {
+    return (DiscoveryServicePort) getPortObject(SessionParameter.WEBSERVICES_DISCOVERY_SERVICE);
+  }
+
+  /**
+   * Return the MultiFiling Service port object.
+   */
+  public MultiFilingServicePort getMultiFilingServicePort() {
+    return (MultiFilingServicePort) getPortObject(SessionParameter.WEBSERVICES_MULTIFILING_SERVICE);
+  }
+
+  /**
+   * Return the Relationship Service port object.
+   */
+  public RelationshipServicePort getRelationshipServicePort() {
+    return (RelationshipServicePort) getPortObject(SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE);
+  }
+
+  /**
+   * Return the Policy Service port object.
+   */
+  public PolicyServicePort getPolicyServicePort() {
+    return (PolicyServicePort) getPortObject(SessionParameter.WEBSERVICES_POLICY_SERVICE);
+  }
+
+  /**
+   * Return the ACL Service port object.
+   */
+  public ACLServicePort getACLServicePort() {
+    return (ACLServicePort) getPortObject(SessionParameter.WEBSERVICES_ACL_SERVICE);
+  }
+
+  // ---- internal ----
+
+  /**
+   * Gets a port object from the session or (re-)initializes the port objects.
+   */
+  @SuppressWarnings("unchecked")
+  private Object getPortObject(String portKey) {
+    Map<String, Object> portMap = (Map<String, Object>) fSession.get(SpiSessionParameter.PORTS);
+
+    // does the port map exist?
+    if (portMap == null) {
+      // create and store map
+      portMap = new HashMap<String, Object>();
+      fSession.put(SpiSessionParameter.PORTS, portMap, true);
+    }
+
+    // is the port in the port map?
+    if (!portMap.containsKey(portKey)) {
+      // create and add port object
+      portMap.put(portKey, initPortObject(portKey));
+    }
+
+    return portMap.get(portKey);
+  }
+
+  /**
+   * Creates a port object.
+   */
+  private Object initPortObject(String portKey) {
+    Object portObject = null;
+
+    if (log.isDebugEnabled()) {
+      log.debug("Initializing Web Service " + portKey + "...");
+    }
+
+    try {
+      // get WSDL URL
+      URL wsdlUrl = new URL((String) fSession.get(portKey));
+
+      // build the requested port object
+      if (SessionParameter.WEBSERVICES_REPOSITORY_SERVICE.equals(portKey)) {
+        RepositoryService service = new RepositoryService(wsdlUrl, new QName(CMIS_NAMESPACE,
+            REPOSITORY_SERVICE));
+        portObject = service.getRepositoryServicePort(new MTOMFeature());
+      }
+      else if (SessionParameter.WEBSERVICES_NAVIGATION_SERVICE.equals(portKey)) {
+        NavigationService service = new NavigationService(wsdlUrl, new QName(CMIS_NAMESPACE,
+            NAVIGATION_SERVICE));
+        portObject = service.getNavigationServicePort(new MTOMFeature());
+      }
+      else if (SessionParameter.WEBSERVICES_OBJECT_SERVICE.equals(portKey)) {
+        ObjectService service = new ObjectService(wsdlUrl,
+            new QName(CMIS_NAMESPACE, OBJECT_SERVICE));
+        portObject = service.getObjectServicePort(new MTOMFeature(),
+            new StreamingAttachmentFeature(null, true, 4 * 1024 * 1024));
+        ((BindingProvider) portObject).getRequestContext().put(
+            JAXWSProperties.HTTP_CLIENT_STREAMING_CHUNK_SIZE, CHUNK_SIZE);
+      }
+      else if (SessionParameter.WEBSERVICES_VERSIONING_SERVICE.equals(portKey)) {
+        VersioningService service = new VersioningService(wsdlUrl, new QName(CMIS_NAMESPACE,
+            VERSIONING_SERVICE));
+        portObject = service.getVersioningServicePort(new MTOMFeature());
+      }
+      else if (SessionParameter.WEBSERVICES_DISCOVERY_SERVICE.equals(portKey)) {
+        DiscoveryService service = new DiscoveryService(wsdlUrl, new QName(CMIS_NAMESPACE,
+            DISCOVERY_SERVICE));
+        portObject = service.getDiscoveryServicePort(new MTOMFeature());
+      }
+      else if (SessionParameter.WEBSERVICES_MULTIFILING_SERVICE.equals(portKey)) {
+        MultiFilingService service = new MultiFilingService(wsdlUrl, new QName(CMIS_NAMESPACE,
+            MULTIFILING_SERVICE));
+        portObject = service.getMultiFilingServicePort(new MTOMFeature());
+      }
+      else if (SessionParameter.WEBSERVICES_RELATIONSHIP_SERVICE.equals(portKey)) {
+        RelationshipService service = new RelationshipService(wsdlUrl, new QName(CMIS_NAMESPACE,
+            RELATIONSHIP_SERVICE));
+        portObject = service.getRelationshipServicePort(new MTOMFeature());
+      }
+      else if (SessionParameter.WEBSERVICES_POLICY_SERVICE.equals(portKey)) {
+        PolicyService service = new PolicyService(wsdlUrl,
+            new QName(CMIS_NAMESPACE, POLICY_SERVICE));
+        portObject = service.getPolicyServicePort(new MTOMFeature());
+      }
+      else if (SessionParameter.WEBSERVICES_ACL_SERVICE.equals(portKey)) {
+        ACLService service = new ACLService(wsdlUrl, new QName(CMIS_NAMESPACE, ACL_SERVICE));
+        portObject = service.getACLServicePort(new MTOMFeature());
+      }
+
+      // add SOAP and HTTP authentication headers
+      AbstractAuthenticationProvider authProvider = CmisProviderHelper
+          .getAuthenticationProvider(fSession);
+      if (authProvider != null) {
+        // SOAP header
+        Element soapHeader = authProvider.getSOAPHeaders(portObject);
+        if (soapHeader != null) {
+          ((WSBindingProvider) portObject).setOutboundHeaders(Headers.create(soapHeader));
+        }
+
+        // HTTP header
+        Map<String, List<String>> httpHeaders = authProvider.getHTTPHeaders(wsdlUrl.toString());
+        if (httpHeaders != null) {
+          ((BindingProvider) portObject).getRequestContext().put(
+              MessageContext.HTTP_REQUEST_HEADERS, httpHeaders);
+        }
+      }
+    }
+    catch (CmisBaseException ce) {
+      throw ce;
+    }
+    catch (Exception e) {
+      throw new CmisConnectionException("Cannot initalize Web Services port object [" + portKey
+          + "]: " + e.getMessage(), e);
+    }
+
+    // we have no object ... strange ...
+    if (portObject == null) {
+      throw new CmisRuntimeException("Cannot find Web Services port object [" + portKey + "]!");
+    }
+
+    return portObject;
+  }
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/PortProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/RelationshipServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/RelationshipServiceImpl.java?rev=910572&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/RelationshipServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/RelationshipServiceImpl.java Tue Feb 16 16:03:38 2010
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.client.provider.spi.webservices;
+
+import static org.apache.opencmis.commons.impl.Converter.convert;
+
+import java.math.BigInteger;
+
+import org.apache.opencmis.client.provider.spi.Session;
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.enums.RelationshipDirection;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.opencmis.commons.impl.jaxb.CmisException;
+import org.apache.opencmis.commons.impl.jaxb.EnumRelationshipDirection;
+import org.apache.opencmis.commons.impl.jaxb.RelationshipServicePort;
+import org.apache.opencmis.commons.provider.ObjectList;
+import org.apache.opencmis.commons.provider.RelationshipService;
+
+/**
+ * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
+ * 
+ */
+public class RelationshipServiceImpl extends AbstractWebServicesService implements
+    RelationshipService {
+
+  private PortProvider fPortProvider;
+
+  /**
+   * Constructor.
+   */
+  public RelationshipServiceImpl(Session session, PortProvider portProvider) {
+    setSession(session);
+    fPortProvider = portProvider;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.RelationshipService#getObjectRelationships(java.lang.String,
+   * java.lang.String, java.lang.Boolean, org.apache.opencmis.commons.enums.RelationshipDirection,
+   * java.lang.String, java.lang.String, java.lang.Boolean, java.math.BigInteger,
+   * java.math.BigInteger, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public ObjectList getObjectRelationships(String repositoryId, String objectId,
+      Boolean includeSubRelationshipTypes, RelationshipDirection relationshipDirection,
+      String typeId, String filter, Boolean includeAllowableActions, BigInteger maxItems,
+      BigInteger skipCount, ExtensionsData extension) {
+    RelationshipServicePort port = fPortProvider.getRelationshipServicePort();
+
+    try {
+      return convert(port.getObjectRelationships(repositoryId, objectId,
+          includeSubRelationshipTypes, convert(EnumRelationshipDirection.class,
+              relationshipDirection), typeId, filter, includeAllowableActions, maxItems, skipCount,
+          convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/RelationshipServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/RepositoryServiceImpl.java?rev=910572&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/RepositoryServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/RepositoryServiceImpl.java Tue Feb 16 16:03:38 2010
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.client.provider.spi.webservices;
+
+import static org.apache.opencmis.commons.impl.Converter.convert;
+import static org.apache.opencmis.commons.impl.Converter.convertTypeContainerList;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.opencmis.client.provider.spi.Session;
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.api.TypeDefinitionContainer;
+import org.apache.opencmis.commons.api.TypeDefinition;
+import org.apache.opencmis.commons.api.TypeDefinitionList;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.opencmis.commons.impl.jaxb.CmisException;
+import org.apache.opencmis.commons.impl.jaxb.CmisRepositoryEntryType;
+import org.apache.opencmis.commons.impl.jaxb.CmisRepositoryInfoType;
+import org.apache.opencmis.commons.impl.jaxb.RepositoryServicePort;
+import org.apache.opencmis.commons.provider.RepositoryInfoData;
+import org.apache.opencmis.commons.provider.RepositoryService;
+
+/**
+ * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
+ * 
+ */
+public class RepositoryServiceImpl extends AbstractWebServicesService implements RepositoryService {
+
+  private PortProvider fPortProvider;
+
+  /**
+   * Constructor.
+   */
+  public RepositoryServiceImpl(Session session, PortProvider portProvider) {
+    setSession(session);
+    fPortProvider = portProvider;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see
+   * org.apache.opencmis.client.provider.RepositoryService#getRepositoryInfos(org.apache.opencmis.client.provider
+   * .ExtensionsData)
+   */
+  public List<RepositoryInfoData> getRepositoryInfos(ExtensionsData extension) {
+    RepositoryServicePort port = fPortProvider.getRepositoryServicePort();
+
+    List<RepositoryInfoData> infos = null;
+    try {
+      // get the list of repositories
+      List<CmisRepositoryEntryType> entries = port.getRepositories(convert(extension));
+
+      if (entries != null) {
+        infos = new ArrayList<RepositoryInfoData>();
+
+        // iterate through the list and fetch repository infos
+        for (CmisRepositoryEntryType entry : entries) {
+          CmisRepositoryInfoType info = port.getRepositoryInfo(entry.getRepositoryId(), null);
+          infos.add(convert(info));
+        }
+      }
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+
+    return infos;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.RepositoryService#getRepositoryInfo(java.lang.String,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public RepositoryInfoData getRepositoryInfo(String repositoryId, ExtensionsData extension) {
+    RepositoryServicePort port = fPortProvider.getRepositoryServicePort();
+
+    try {
+      return convert(port.getRepositoryInfo(repositoryId, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.RepositoryService#getTypeDefinition(java.lang.String,
+   * java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public TypeDefinition getTypeDefinition(String repositoryId, String typeId,
+      ExtensionsData extension) {
+    RepositoryServicePort port = fPortProvider.getRepositoryServicePort();
+
+    try {
+      return convert(port.getTypeDefinition(repositoryId, typeId, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.RepositoryService#getTypeChildren(java.lang.String,
+   * java.lang.String, java.lang.Boolean, java.math.BigInteger, java.math.BigInteger,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public TypeDefinitionList getTypeChildren(String repositoryId, String typeId,
+      Boolean includePropertyDefinitions, BigInteger maxItems, BigInteger skipCount,
+      ExtensionsData extension) {
+    RepositoryServicePort port = fPortProvider.getRepositoryServicePort();
+
+    try {
+      return convert(port.getTypeChildren(repositoryId, typeId, includePropertyDefinitions,
+          maxItems, skipCount, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.RepositoryService#getTypeDescendants(java.lang.String,
+   * java.lang.String, java.math.BigInteger, java.lang.Boolean,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public List<TypeDefinitionContainer> getTypeDescendants(String repositoryId, String typeId,
+      BigInteger depth, Boolean includePropertyDefinitions, ExtensionsData extension) {
+    RepositoryServicePort port = fPortProvider.getRepositoryServicePort();
+
+    try {
+      return convertTypeContainerList(port.getTypeDescendants(repositoryId, typeId, depth,
+          includePropertyDefinitions, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/RepositoryServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/SpiSessionParameter.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/SpiSessionParameter.java?rev=910572&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/SpiSessionParameter.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/SpiSessionParameter.java Tue Feb 16 16:03:38 2010
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.client.provider.spi.webservices;
+
+/**
+ * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
+ * 
+ */
+public final class SpiSessionParameter {
+
+  public static final String PORTS = "org.apache.opencmis.provider.webservices.ports";
+
+  private SpiSessionParameter() {
+  }
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/SpiSessionParameter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/VersioningServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/VersioningServiceImpl.java?rev=910572&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/VersioningServiceImpl.java (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/VersioningServiceImpl.java Tue Feb 16 16:03:38 2010
@@ -0,0 +1,235 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.opencmis.client.provider.spi.webservices;
+
+import static org.apache.opencmis.commons.impl.Converter.convert;
+import static org.apache.opencmis.commons.impl.Converter.convertExtensionHolder;
+import static org.apache.opencmis.commons.impl.Converter.convertHolder;
+import static org.apache.opencmis.commons.impl.Converter.setExtensionValues;
+import static org.apache.opencmis.commons.impl.Converter.setHolderValue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.opencmis.client.provider.spi.Session;
+import org.apache.opencmis.commons.api.ExtensionsData;
+import org.apache.opencmis.commons.enums.IncludeRelationships;
+import org.apache.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.opencmis.commons.impl.jaxb.CmisException;
+import org.apache.opencmis.commons.impl.jaxb.CmisExtensionType;
+import org.apache.opencmis.commons.impl.jaxb.CmisObjectType;
+import org.apache.opencmis.commons.impl.jaxb.EnumIncludeRelationships;
+import org.apache.opencmis.commons.impl.jaxb.VersioningServicePort;
+import org.apache.opencmis.commons.provider.AccessControlList;
+import org.apache.opencmis.commons.provider.ContentStreamData;
+import org.apache.opencmis.commons.provider.Holder;
+import org.apache.opencmis.commons.provider.ObjectData;
+import org.apache.opencmis.commons.provider.PropertiesData;
+import org.apache.opencmis.commons.provider.VersioningService;
+
+/**
+ * @author <a href="mailto:fmueller@opentext.com">Florian M&uuml;ller</a>
+ * 
+ */
+public class VersioningServiceImpl extends AbstractWebServicesService implements VersioningService {
+
+  private PortProvider fPortProvider;
+
+  /**
+   * Constructor.
+   */
+  public VersioningServiceImpl(Session session, PortProvider portProvider) {
+    setSession(session);
+    fPortProvider = portProvider;
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.VersioningService#checkOut(java.lang.String,
+   * org.apache.opencmis.client.provider.Holder, org.apache.opencmis.client.provider.ExtensionsData,
+   * org.apache.opencmis.client.provider.Holder)
+   */
+  public void checkOut(String repositoryId, Holder<String> objectId, ExtensionsData extension,
+      Holder<Boolean> contentCopied) {
+    VersioningServicePort port = fPortProvider.getVersioningServicePort();
+
+    try {
+      javax.xml.ws.Holder<String> portObjectId = convertHolder(objectId);
+      javax.xml.ws.Holder<Boolean> portContentCopied = new javax.xml.ws.Holder<Boolean>();
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.checkOut(repositoryId, portObjectId, portExtension, portContentCopied);
+
+      setHolderValue(portObjectId, objectId);
+      setHolderValue(portContentCopied, contentCopied);
+      setExtensionValues(portExtension, extension);
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.VersioningService#cancelCheckOut(java.lang.String,
+   * java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public void cancelCheckOut(String repositoryId, String objectId, ExtensionsData extension) {
+    VersioningServicePort port = fPortProvider.getVersioningServicePort();
+
+    try {
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.cancelCheckOut(repositoryId, objectId, portExtension);
+
+      setExtensionValues(portExtension, extension);
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.VersioningService#checkIn(java.lang.String,
+   * org.apache.opencmis.client.provider.Holder, java.lang.Boolean,
+   * org.apache.opencmis.client.provider.PropertiesData, org.apache.opencmis.client.provider.ContentStreamData,
+   * java.lang.String, java.util.List, org.apache.opencmis.client.provider.AccessControlList,
+   * org.apache.opencmis.client.provider.AccessControlList, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public void checkIn(String repositoryId, Holder<String> objectId, Boolean major,
+      PropertiesData properties, ContentStreamData contentStream, String checkinComment,
+      List<String> policies, AccessControlList addACEs, AccessControlList removeACEs,
+      ExtensionsData extension) {
+    VersioningServicePort port = fPortProvider.getVersioningServicePort();
+
+    try {
+      javax.xml.ws.Holder<String> portObjectId = convertHolder(objectId);
+      javax.xml.ws.Holder<CmisExtensionType> portExtension = convertExtensionHolder(extension);
+
+      port.checkIn(repositoryId, portObjectId, major, convert(properties), convert(contentStream),
+          checkinComment, policies, convert(addACEs), convert(removeACEs), portExtension);
+
+      setHolderValue(portObjectId, objectId);
+      setExtensionValues(portExtension, extension);
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.VersioningService#getAllVersions(java.lang.String,
+   * java.lang.String, java.lang.String, java.lang.Boolean,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public List<ObjectData> getAllVersions(String repositoryId, String versionSeriesId,
+      String filter, Boolean includeAllowableActions, ExtensionsData extension) {
+    VersioningServicePort port = fPortProvider.getVersioningServicePort();
+
+    try {
+      List<CmisObjectType> versionList = port.getAllVersions(repositoryId, versionSeriesId, filter,
+          includeAllowableActions, convert(extension));
+
+      // no list?
+      if ((versionList == null) || (versionList.isEmpty())) {
+        return null;
+      }
+
+      // convert list
+      List<ObjectData> result = new ArrayList<ObjectData>();
+      for (CmisObjectType version : versionList) {
+        result.add(convert(version));
+      }
+
+      return result;
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see org.apache.opencmis.client.provider.VersioningService#getObjectOfLatestVersion(java.lang.String,
+   * java.lang.String, java.lang.Boolean, java.lang.String, java.lang.Boolean,
+   * org.apache.opencmis.commons.enums.IncludeRelationships, java.lang.String, java.lang.Boolean,
+   * java.lang.Boolean, org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public ObjectData getObjectOfLatestVersion(String repositoryId, String versionSeriesId,
+      Boolean major, String filter, Boolean includeAllowableActions,
+      IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+      Boolean includeACL, ExtensionsData extension) {
+    VersioningServicePort port = fPortProvider.getVersioningServicePort();
+
+    try {
+      return convert(port.getObjectOfLatestVersion(repositoryId, versionSeriesId, major, filter,
+          includeAllowableActions, convert(EnumIncludeRelationships.class, includeRelationships),
+          renditionFilter, includePolicyIds, includeACL, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+
+  /*
+   * (non-Javadoc)
+   * 
+   * @see
+   * org.apache.opencmis.client.provider.VersioningService#getPropertiesOfLatestVersion(java.lang.String,
+   * java.lang.String, java.lang.Boolean, java.lang.String,
+   * org.apache.opencmis.client.provider.ExtensionsData)
+   */
+  public PropertiesData getPropertiesOfLatestVersion(String repositoryId, String VersionSeriesId,
+      Boolean major, String filter, ExtensionsData extension) {
+    VersioningServicePort port = fPortProvider.getVersioningServicePort();
+
+    try {
+      return convert(port.getPropertiesOfLatestVersion(repositoryId, VersionSeriesId, major,
+          filter, convert(extension)));
+    }
+    catch (CmisException e) {
+      throw convertException(e);
+    }
+    catch (Exception e) {
+      throw new CmisRuntimeException("Error: " + e.getMessage(), e);
+    }
+  }
+}

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/main/java/org/apache/opencmis/client/provider/spi/webservices/VersioningServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/site/apt/index.apt?rev=910572&view=auto
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/site/apt/index.apt (added)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/site/apt/index.apt Tue Feb 16 16:03:38 2010
@@ -0,0 +1,30 @@
+  -----
+  OpenCMIS Provider Layer
+  -----
+
+JUnit Test Parameters
+
+  The provider implementation tests that require a real CMIS repository can be 
+  configured via system properties. These are the properties:
+ 
+*-------------------------------------+-------------------------------------------+-------------------------------------------------------------------------------+
+|| Property                           || Description                              || Default                                                                      |
+*-------------------------------------+-------------------------------------------+-------------------------------------------------------------------------------+
+| opencmis.test                       | Must be set to true to run tests          | false                                                                         |
+*-------------------------------------+-------------------------------------------+-------------------------------------------------------------------------------+
+| opencmis.test.username              | User name                                 | test                                                                          |
+*-------------------------------------+-------------------------------------------+-------------------------------------------------------------------------------+
+| opencmis.test.password              | Password                                  | test                                                                          |
+*-------------------------------------+-------------------------------------------+-------------------------------------------------------------------------------+
+| opencmis.test.repository            | Repository id of the test repository      | [If not set the first repository returned by getRepositoryInfo will be used.] |
+*-------------------------------------+-------------------------------------------+-------------------------------------------------------------------------------+
+| opencmis.test.testfolder            | Root folder for all tests                 | [If not set the the root folder of the test repository will be used.]         |
+*-------------------------------------+-------------------------------------------+-------------------------------------------------------------------------------+
+| opencmis.test.documenttype          | Default test document type                | cmis:document                                                                 |
+*-------------------------------------+-------------------------------------------+-------------------------------------------------------------------------------+
+| opencmis.test.foldertype            | Default test folder type                  | cmis:folder                                                                   |
+*-------------------------------------+-------------------------------------------+-------------------------------------------------------------------------------+
+| opencmis.test.atompub.url           | URL of the CMIS AtomPub service document  | http://localhost:8080/cmis/atom                                               |
+*-------------------------------------+-------------------------------------------+-------------------------------------------------------------------------------+
+| opencmis.test.webservices.url       | URL prefix of the CMIS Web Services WSDLs | http://localhost:8080/cmis/services/                                          |
+*-------------------------------------+-------------------------------------------+-------------------------------------------------------------------------------+

Propchange: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-provider-impl/src/site/apt/index.apt
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message