This project has retired. For details please refer to its Attic page.
RelationshipService 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 java.math.BigInteger;
24  
25  import javax.annotation.Resource;
26  import javax.jws.WebService;
27  import javax.xml.ws.WebServiceContext;
28  import javax.xml.ws.soap.MTOM;
29  
30  import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
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.CmisObjectListType;
34  import org.apache.chemistry.opencmis.commons.impl.jaxb.EnumRelationshipDirection;
35  import org.apache.chemistry.opencmis.commons.impl.jaxb.RelationshipServicePort;
36  import org.apache.chemistry.opencmis.commons.server.CmisService;
37  
38  /**
39   * CMIS Relationship Service.
40   */
41  @MTOM
42  @WebService(endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.RelationshipServicePort")
43  public class RelationshipService extends AbstractService implements RelationshipServicePort {
44      @Resource
45      public WebServiceContext wsContext;
46  
47      public CmisObjectListType getObjectRelationships(String repositoryId, String objectId,
48              Boolean includeSubRelationshipTypes, EnumRelationshipDirection relationshipDirection, String typeId,
49              String filter, Boolean includeAllowableActions, BigInteger maxItems, BigInteger skipCount,
50              CmisExtensionType extension) throws CmisException {
51          CmisService service = null;
52          try {
53              service = getService(wsContext, repositoryId);
54  
55              return convert(service.getObjectRelationships(repositoryId, objectId, includeSubRelationshipTypes,
56                      convert(RelationshipDirection.class, relationshipDirection), typeId, filter,
57                      includeAllowableActions, maxItems, skipCount, convert(extension)));
58          } catch (Exception e) {
59              throw convertException(e);
60          } finally {
61              closeService(service);
62          }
63      }
64  }