Return-Path: X-Original-To: apmail-chemistry-commits-archive@www.apache.org Delivered-To: apmail-chemistry-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC90E9F8D for ; Tue, 3 Apr 2012 05:08:58 +0000 (UTC) Received: (qmail 17228 invoked by uid 500); 3 Apr 2012 05:08:58 -0000 Delivered-To: apmail-chemistry-commits-archive@chemistry.apache.org Received: (qmail 17040 invoked by uid 500); 3 Apr 2012 05:08:57 -0000 Mailing-List: contact commits-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list commits@chemistry.apache.org Received: (qmail 16837 invoked by uid 99); 3 Apr 2012 05:08:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2012 05:08:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2012 05:08:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DC35C2388CA6 for ; Tue, 3 Apr 2012 05:07:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r811232 [20/23] - in /websites/staging/chemistry/trunk/content: ./ java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/ java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/css/ java/0.7.0/... Date: Tue, 03 Apr 2012 05:07:17 -0000 To: commits@chemistry.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120403050722.DC35C2388CA6@eris.apache.org> Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/AbstractUsernameTokenAuthHandler.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/AbstractUsernameTokenAuthHandler.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/AbstractUsernameTokenAuthHandler.html Tue Apr 3 05:07:13 2012 @@ -0,0 +1,278 @@ + + + + +AbstractUsernameTokenAuthHandler xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.server.impl.webservices;
+20  
+21  import java.util.ArrayList;
+22  import java.util.HashMap;
+23  import java.util.HashSet;
+24  import java.util.List;
+25  import java.util.Map;
+26  import java.util.Set;
+27  
+28  import javax.xml.bind.JAXBContext;
+29  import javax.xml.bind.JAXBElement;
+30  import javax.xml.bind.JAXBException;
+31  import javax.xml.bind.annotation.XmlAccessType;
+32  import javax.xml.bind.annotation.XmlAccessorType;
+33  import javax.xml.bind.annotation.XmlAnyAttribute;
+34  import javax.xml.bind.annotation.XmlAnyElement;
+35  import javax.xml.bind.annotation.XmlAttribute;
+36  import javax.xml.bind.annotation.XmlElement;
+37  import javax.xml.bind.annotation.XmlElementDecl;
+38  import javax.xml.bind.annotation.XmlID;
+39  import javax.xml.bind.annotation.XmlRegistry;
+40  import javax.xml.bind.annotation.XmlSchemaType;
+41  import javax.xml.bind.annotation.XmlSeeAlso;
+42  import javax.xml.bind.annotation.XmlType;
+43  import javax.xml.bind.annotation.XmlValue;
+44  import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+45  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+46  import javax.xml.namespace.QName;
+47  
+48  import org.apache.chemistry.opencmis.commons.server.CallContext;
+49  
+50  public class AbstractUsernameTokenAuthHandler {
+51  
+52      protected static final JAXBContext WSSE_CONTEXT;
+53      static {
+54          JAXBContext jc = null;
+55          try {
+56              jc = JAXBContext.newInstance(ObjectFactory.class);
+57          } catch (JAXBException e) {
+58              e.printStackTrace();
+59          }
+60          WSSE_CONTEXT = jc;
+61      }
+62  
+63      protected static final String WSSE_NS = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
+64      protected static final QName WSSE_SECURITY = new QName(WSSE_NS, "Security");
+65      protected static final QName WSSE_USERNAME_TOKEN = new QName(WSSE_NS, "UsernameToken");
+66      protected static final QName WSSE_PASSWORD = new QName(WSSE_NS, "Password");
+67  
+68      protected static final Set<QName> HEADERS = new HashSet<QName>();
+69      static {
+70          HEADERS.add(WSSE_SECURITY);
+71      }
+72  
+73      @SuppressWarnings("unchecked")
+74      protected Map<String, String> extractUsernamePassword(JAXBElement<SecurityHeaderType> sht) {
+75          String username = null;
+76          String password = null;
+77  
+78          for (Object uno : sht.getValue().getAny()) {
+79              if ((uno instanceof JAXBElement) && ((JAXBElement<?>) uno).getValue() instanceof UsernameTokenType) {
+80                  UsernameTokenType utt = ((JAXBElement<UsernameTokenType>) uno).getValue();
+81                  username = utt.getUsername().getValue();
+82  
+83                  for (Object po : utt.getAny()) {
+84                      if ((po instanceof JAXBElement) && ((JAXBElement<?>) po).getValue() instanceof PasswordString) {
+85                          password = ((JAXBElement<PasswordString>) po).getValue().getValue();
+86                          break;
+87                      }
+88                  }
+89  
+90                  break;
+91              }
+92          }
+93  
+94          Map<String, String> result = null;
+95  
+96          if (username != null) {
+97              result = new HashMap<String, String>();
+98              result.put(CallContext.USERNAME, username);
+99              result.put(CallContext.PASSWORD, password);
+100         }
+101 
+102         return result;
+103     }
+104 
+105     // --- JAXB classes ---
+106 
+107     @XmlRegistry
+108     public static class ObjectFactory {
+109 
+110         public ObjectFactory() {
+111         }
+112 
+113         public SecurityHeaderType createSecurityHeaderType() {
+114             return new SecurityHeaderType();
+115         }
+116 
+117         public UsernameTokenType createUsernameTokenType() {
+118             return new UsernameTokenType();
+119         }
+120 
+121         public PasswordString createPasswordString() {
+122             return new PasswordString();
+123         }
+124 
+125         public AttributedString createAttributedString() {
+126             return new AttributedString();
+127         }
+128 
+129         @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "Security")
+130         public JAXBElement<SecurityHeaderType> createSecurity(SecurityHeaderType value) {
+131             return new JAXBElement<SecurityHeaderType>(WSSE_SECURITY, SecurityHeaderType.class, null, value);
+132         }
+133 
+134         @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "UsernameToken")
+135         public JAXBElement<UsernameTokenType> createUsernameToken(UsernameTokenType value) {
+136             return new JAXBElement<UsernameTokenType>(WSSE_USERNAME_TOKEN, UsernameTokenType.class, null, value);
+137         }
+138 
+139         @XmlElementDecl(namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", name = "Password")
+140         public JAXBElement<PasswordString> createPassword(PasswordString value) {
+141             return new JAXBElement<PasswordString>(WSSE_PASSWORD, PasswordString.class, null, value);
+142         }
+143 
+144     }
+145 
+146     @XmlAccessorType(XmlAccessType.FIELD)
+147     @XmlType(name = "SecurityHeaderType", propOrder = { "any" })
+148     public static class SecurityHeaderType {
+149 
+150         @XmlAnyElement(lax = true)
+151         protected List<Object> any;
+152         @XmlAnyAttribute
+153         private final Map<QName, String> otherAttributes = new HashMap<QName, String>();
+154 
+155         public List<Object> getAny() {
+156             if (any == null) {
+157                 any = new ArrayList<Object>();
+158             }
+159             return this.any;
+160         }
+161 
+162         public Map<QName, String> getOtherAttributes() {
+163             return otherAttributes;
+164         }
+165 
+166     }
+167 
+168     @XmlAccessorType(XmlAccessType.FIELD)
+169     @XmlType(name = "UsernameTokenType", propOrder = { "username", "any" })
+170     public static class UsernameTokenType {
+171 
+172         @XmlElement(name = "Username", namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", required = true)
+173         protected AttributedString username;
+174         @XmlAnyElement(lax = true)
+175         protected List<Object> any;
+176         @XmlAttribute(name = "Id", namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")
+177         @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+178         @XmlID
+179         @XmlSchemaType(name = "ID")
+180         protected String id;
+181         @XmlAnyAttribute
+182         private final Map<QName, String> otherAttributes = new HashMap<QName, String>();
+183 
+184         public AttributedString getUsername() {
+185             return username;
+186         }
+187 
+188         public void setUsername(AttributedString value) {
+189             this.username = value;
+190         }
+191 
+192         public List<Object> getAny() {
+193             if (any == null) {
+194                 any = new ArrayList<Object>();
+195             }
+196             return this.any;
+197         }
+198 
+199         public String getId() {
+200             return id;
+201         }
+202 
+203         public void setId(String value) {
+204             this.id = value;
+205         }
+206 
+207         public Map<QName, String> getOtherAttributes() {
+208             return otherAttributes;
+209         }
+210     }
+211 
+212     @XmlAccessorType(XmlAccessType.FIELD)
+213     @XmlType(name = "PasswordString")
+214     public static class PasswordString extends AttributedString {
+215 
+216         @XmlAttribute(name = "Type")
+217         @XmlSchemaType(name = "anyURI")
+218         protected String type;
+219 
+220         public String getType() {
+221             return type;
+222         }
+223 
+224         public void setType(String value) {
+225             this.type = value;
+226         }
+227     }
+228 
+229     @XmlAccessorType(XmlAccessType.FIELD)
+230     @XmlType(name = "AttributedString", propOrder = { "value" })
+231     @XmlSeeAlso({ PasswordString.class })
+232     public static class AttributedString {
+233 
+234         @XmlValue
+235         protected String value;
+236         @XmlAttribute(name = "Id", namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd")
+237         @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+238         @XmlID
+239         @XmlSchemaType(name = "ID")
+240         protected String id;
+241         @XmlAnyAttribute
+242         private final Map<QName, String> otherAttributes = new HashMap<QName, String>();
+243 
+244         public String getValue() {
+245             return value;
+246         }
+247 
+248         public void setValue(String value) {
+249             this.value = value;
+250         }
+251 
+252         public String getId() {
+253             return id;
+254         }
+255 
+256         public void setId(String value) {
+257             this.id = value;
+258         }
+259 
+260         public Map<QName, String> getOtherAttributes() {
+261             return otherAttributes;
+262         }
+263     }
+264 }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/AclService.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/AclService.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/AclService.html Tue Apr 3 05:07:13 2012 @@ -0,0 +1,109 @@ + + + + +AclService xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.server.impl.webservices;
+20  
+21  import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
+22  
+23  import javax.annotation.Resource;
+24  import javax.jws.WebService;
+25  import javax.xml.ws.WebServiceContext;
+26  import javax.xml.ws.soap.MTOM;
+27  
+28  import org.apache.chemistry.opencmis.commons.data.Acl;
+29  import org.apache.chemistry.opencmis.commons.enums.AclPropagation;
+30  import org.apache.chemistry.opencmis.commons.impl.jaxb.ACLServicePort;
+31  import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisACLType;
+32  import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisAccessControlListType;
+33  import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
+34  import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisExtensionType;
+35  import org.apache.chemistry.opencmis.commons.impl.jaxb.EnumACLPropagation;
+36  import org.apache.chemistry.opencmis.commons.server.CmisService;
+37  
+38  /**
+39   * CMIS ACL Service.
+40   */
+41  @MTOM
+42  @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.ACLServicePort")
+43  public class AclService extends AbstractService implements ACLServicePort {
+44      @Resource
+45      public WebServiceContext wsContext;
+46  
+47      public CmisACLType applyACL(String repositoryId, String objectId, CmisAccessControlListType addAces,
+48              CmisAccessControlListType removeAces, EnumACLPropagation aclPropagation, CmisExtensionType extension)
+49              throws CmisException {
+50          CmisService service = null;
+51          try {
+52              service = getService(wsContext, repositoryId);
+53  
+54              Acl acl = service.applyAcl(repositoryId, objectId, convert(addAces, null), convert(removeAces, null),
+55                      convert(AclPropagation.class, aclPropagation), convert(extension));
+56  
+57              if (acl == null) {
+58                  return null;
+59              }
+60  
+61              CmisACLType result = new CmisACLType();
+62              result.setACL(convert(acl));
+63              result.setExact(acl.isExact());
+64  
+65              return result;
+66          } catch (Exception e) {
+67              throw convertException(e);
+68          } finally {
+69              closeService(service);
+70          }
+71      }
+72  
+73      public CmisACLType getACL(String repositoryId, String objectId, Boolean onlyBasicPermissions,
+74              CmisExtensionType extension) throws CmisException {
+75          CmisService service = null;
+76          try {
+77              service = getService(wsContext, repositoryId);
+78  
+79              Acl acl = service.getAcl(repositoryId, objectId, onlyBasicPermissions, convert(extension));
+80              if (acl == null) {
+81                  return null;
+82              }
+83  
+84              CmisACLType result = new CmisACLType();
+85              result.setACL(convert(acl));
+86              result.setExact(acl.isExact());
+87  
+88              return result;
+89          } catch (Exception e) {
+90              throw convertException(e);
+91          } finally {
+92              closeService(service);
+93          }
+94      }
+95  }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/AuthHandler.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/AuthHandler.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/AuthHandler.html Tue Apr 3 05:07:13 2012 @@ -0,0 +1,98 @@ + + + + +AuthHandler xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.server.impl.webservices;
+20  
+21  import java.util.HashMap;
+22  import java.util.Map;
+23  import java.util.Set;
+24  
+25  import javax.xml.bind.JAXBElement;
+26  import javax.xml.namespace.QName;
+27  import javax.xml.ws.handler.MessageContext;
+28  import javax.xml.ws.handler.MessageContext.Scope;
+29  
+30  import com.sun.xml.ws.api.handler.MessageHandler;
+31  import com.sun.xml.ws.api.handler.MessageHandlerContext;
+32  import com.sun.xml.ws.api.message.Header;
+33  import com.sun.xml.ws.api.message.HeaderList;
+34  import com.sun.xml.ws.api.message.Message;
+35  
+36  /**
+37   * This class tries to extract a user name and a password from a UsernameToken.
+38   */
+39  public class AuthHandler extends AbstractUsernameTokenAuthHandler implements MessageHandler<MessageHandlerContext> {
+40  
+41      public Set<QName> getHeaders() {
+42          return HEADERS;
+43      }
+44  
+45      public void close(MessageContext context) {
+46      }
+47  
+48      public boolean handleFault(MessageHandlerContext context) {
+49          return true;
+50      }
+51  
+52      public boolean handleMessage(MessageHandlerContext context) {
+53          Boolean outboundProperty = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+54          if (outboundProperty.booleanValue()) {
+55              // we are only looking at inbound messages
+56              return true;
+57          }
+58  
+59          Map<String, String> callContextMap = null;
+60  
+61          try {
+62              // read the header
+63              Message msg = context.getMessage();
+64              HeaderList hl = msg.getHeaders();
+65              Header securityHeader = hl.get(WSSE_SECURITY, true);
+66  
+67              JAXBElement<SecurityHeaderType> sht = securityHeader.readAsJAXB(WSSE_CONTEXT.createUnmarshaller());
+68  
+69              callContextMap = extractUsernamePassword(sht);
+70          } catch (Exception e) {
+71              // something went wrong, e.g. a part of the SOAP header wasn't set
+72          }
+73  
+74          // add user and password to context
+75          if (callContextMap == null) {
+76              callContextMap = new HashMap<String, String>();
+77          }
+78  
+79          context.put(AbstractService.CALL_CONTEXT_MAP, callContextMap);
+80          context.setScope(AbstractService.CALL_CONTEXT_MAP, Scope.APPLICATION);
+81  
+82          return true;
+83      }
+84  }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/CmisWebServicesServlet.html Tue Apr 3 05:07:13 2012 @@ -0,0 +1,75 @@ + + + + +CmisWebServicesServlet xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.server.impl.webservices;
+20  
+21  import javax.servlet.ServletConfig;
+22  import javax.xml.ws.WebServiceFeature;
+23  
+24  import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory;
+25  import org.apache.chemistry.opencmis.server.impl.CmisRepositoryContextListener;
+26  
+27  import com.sun.xml.ws.api.WSFeatureList;
+28  import com.sun.xml.ws.developer.StreamingAttachmentFeature;
+29  import com.sun.xml.ws.transport.http.servlet.ServletAdapter;
+30  import com.sun.xml.ws.transport.http.servlet.WSServlet;
+31  import com.sun.xml.ws.transport.http.servlet.WSServletDelegate;
+32  
+33  public class CmisWebServicesServlet extends WSServlet {
+34      private static final long serialVersionUID = 1L;
+35  
+36      @Override
+37      protected WSServletDelegate getDelegate(ServletConfig servletConfig) {
+38          WSServletDelegate delegate = super.getDelegate(servletConfig);
+39  
+40          // set temp directory and the threshold for all services with a
+41          // StreamingAttachment annotation
+42          if (delegate.adapters != null) {
+43              // get the CmisService factory
+44              CmisServiceFactory factory = (CmisServiceFactory) getServletContext().getAttribute(
+45                      CmisRepositoryContextListener.SERVICES_FACTORY);
+46  
+47              // iterate of all adapters
+48              for (ServletAdapter adapter : delegate.adapters) {
+49                  WSFeatureList wsfl = adapter.getEndpoint().getBinding().getFeatures();
+50                  for (WebServiceFeature ft : wsfl) {
+51                      if (ft instanceof StreamingAttachmentFeature) {
+52                          ((StreamingAttachmentFeature) ft).setDir(factory.getTempDirectory().getAbsolutePath());
+53                          ((StreamingAttachmentFeature) ft).setMemoryThreshold(factory.getMemoryThreshold());
+54                      }
+55                  }
+56              }
+57          }
+58  
+59          return delegate;
+60      }
+61  }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/DiscoveryService.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/DiscoveryService.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/DiscoveryService.html Tue Apr 3 05:07:13 2012 @@ -0,0 +1,105 @@ + + + + +DiscoveryService xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.server.impl.webservices;
+20  
+21  import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
+22  import static org.apache.chemistry.opencmis.commons.impl.Converter.convertHolder;
+23  import static org.apache.chemistry.opencmis.commons.impl.Converter.setHolderValue;
+24  
+25  import java.math.BigInteger;
+26  
+27  import javax.annotation.Resource;
+28  import javax.jws.WebService;
+29  import javax.xml.ws.Holder;
+30  import javax.xml.ws.WebServiceContext;
+31  import javax.xml.ws.soap.MTOM;
+32  
+33  import org.apache.chemistry.opencmis.commons.data.ObjectList;
+34  import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+35  import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
+36  import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisExtensionType;
+37  import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisObjectListType;
+38  import org.apache.chemistry.opencmis.commons.impl.jaxb.DiscoveryServicePort;
+39  import org.apache.chemistry.opencmis.commons.impl.jaxb.EnumIncludeRelationships;
+40  import org.apache.chemistry.opencmis.commons.server.CmisService;
+41  
+42  /**
+43   * CMIS Discovery Service.
+44   */
+45  @MTOM
+46  @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.DiscoveryServicePort")
+47  public class DiscoveryService extends AbstractService implements DiscoveryServicePort {
+48      @Resource
+49      public WebServiceContext wsContext;
+50  
+51      public void getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
+52              String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems,
+53              CmisExtensionType extension, Holder<CmisObjectListType> objects) throws CmisException {
+54          CmisService service = null;
+55          try {
+56              service = getService(wsContext, repositoryId);
+57  
+58              org.apache.chemistry.opencmis.commons.spi.Holder<String> changeLogTokenHolder = convertHolder(changeLogToken);
+59  
+60              ObjectList changesList = service.getContentChanges(repositoryId, changeLogTokenHolder, includeProperties,
+61                      filter, includePolicyIds, includeAcl, maxItems, convert(extension));
+62  
+63              if (objects != null) {
+64                  objects.value = convert(changesList);
+65              }
+66  
+67              setHolderValue(changeLogTokenHolder, changeLogToken);
+68          } catch (Exception e) {
+69              throw convertException(e);
+70          } finally {
+71              closeService(service);
+72          }
+73      }
+74  
+75      public CmisObjectListType query(String repositoryId, String statement, Boolean searchAllVersions,
+76              Boolean includeAllowableActions, EnumIncludeRelationships includeRelationships, String renditionFilter,
+77              BigInteger maxItems, BigInteger skipCount, CmisExtensionType extension) throws CmisException {
+78          CmisService service = null;
+79          try {
+80              service = getService(wsContext, repositoryId);
+81  
+82              return convert(service.query(repositoryId, statement, searchAllVersions, includeAllowableActions,
+83                      convert(IncludeRelationships.class, includeRelationships), renditionFilter, maxItems, skipCount,
+84                      convert(extension)));
+85          } catch (Exception e) {
+86              throw convertException(e);
+87          } finally {
+88              closeService(service);
+89          }
+90      }
+91  }
+
+
+ + Added: websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/MultiFilingService.html ============================================================================== --- websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/MultiFilingService.html (added) +++ websites/staging/chemistry/trunk/content/java/0.7.0/maven/chemistry-opencmis-server/chemistry-opencmis-server-bindings/xref/org/apache/chemistry/opencmis/server/impl/webservices/MultiFilingService.html Tue Apr 3 05:07:13 2012 @@ -0,0 +1,94 @@ + + + + +MultiFilingService xref + + + +
+
+1   /*
+2    * Licensed to the Apache Software Foundation (ASF) under one
+3    * or more contributor license agreements.  See the NOTICE file
+4    * distributed with this work for additional information
+5    * regarding copyright ownership.  The ASF licenses this file
+6    * to you under the Apache License, Version 2.0 (the
+7    * "License"); you may not use this file except in compliance
+8    * with the License.  You may obtain a copy of the License at
+9    *
+10   * http://www.apache.org/licenses/LICENSE-2.0
+11   *
+12   * Unless required by applicable law or agreed to in writing,
+13   * software distributed under the License is distributed on an
+14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+15   * KIND, either express or implied.  See the License for the
+16   * specific language governing permissions and limitations
+17   * under the License.
+18   */
+19  package org.apache.chemistry.opencmis.server.impl.webservices;
+20  
+21  import static org.apache.chemistry.opencmis.commons.impl.Converter.convertExtensionHolder;
+22  import static org.apache.chemistry.opencmis.commons.impl.Converter.setExtensionValues;
+23  
+24  import javax.annotation.Resource;
+25  import javax.jws.WebService;
+26  import javax.xml.ws.Holder;
+27  import javax.xml.ws.WebServiceContext;
+28  import javax.xml.ws.soap.MTOM;
+29  
+30  import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
+31  import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
+32  import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisExtensionType;
+33  import org.apache.chemistry.opencmis.commons.impl.jaxb.MultiFilingServicePort;
+34  import org.apache.chemistry.opencmis.commons.server.CmisService;
+35  
+36  /**
+37   * CMIS MultiFiling Service.
+38   */
+39  @MTOM
+40  @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.MultiFilingServicePort")
+41  public class MultiFilingService extends AbstractService implements MultiFilingServicePort {
+42      @Resource
+43      public WebServiceContext wsContext;
+44  
+45      public void addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions,
+46              Holder<CmisExtensionType> extension) throws CmisException {
+47          CmisService service = null;
+48          try {
+49              service = getService(wsContext, repositoryId);
+50  
+51              ExtensionsData extData = convertExtensionHolder(extension);
+52  
+53              service.addObjectToFolder(repositoryId, objectId, folderId, allVersions, extData);
+54  
+55              setExtensionValues(extData, extension);
+56          } catch (Exception e) {
+57              throw convertException(e);
+58          } finally {
+59              closeService(service);
+60          }
+61      }
+62  
+63      public void removeObjectFromFolder(String repositoryId, String objectId, String folderId,
+64              Holder<CmisExtensionType> extension) throws CmisException {
+65          CmisService service = null;
+66          try {
+67              service = getService(wsContext, repositoryId);
+68  
+69              ExtensionsData extData = convertExtensionHolder(extension);
+70  
+71              service.removeObjectFromFolder(repositoryId, objectId, folderId, extData);
+72  
+73              setExtensionValues(extData, extension);
+74          } catch (Exception e) {
+75              throw convertException(e);
+76          } finally {
+77              closeService(service);
+78          }
+79      }
+80  }
+
+
+ +