1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  package org.apache.chemistry.opencmis.server.impl.webservices;
20  
21  import org.apache.chemistry.opencmis.commons.enums.RelationshipDirection;
22  import static org.apache.chemistry.opencmis.commons.impl.Converter.convert;
23  import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
24  import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisExtensionType;
25  import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisObjectListType;
26  import org.apache.chemistry.opencmis.commons.impl.jaxb.EnumRelationshipDirection;
27  import org.apache.chemistry.opencmis.commons.impl.jaxb.RelationshipServicePort;
28  import org.apache.chemistry.opencmis.commons.server.CmisService;
29  
30  import java.math.BigInteger;
31  
32  import javax.annotation.Resource;
33  
34  import javax.jws.WebService;
35  
36  import javax.xml.ws.WebServiceContext;
37  import javax.xml.ws.soap.MTOM;
38  
39  
40  
41  
42  
43  @MTOM
44  @WebService( endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.RelationshipServicePort" )
45  public class RelationshipService extends AbstractService implements RelationshipServicePort
46  {
47      @Resource
48      public WebServiceContext wsContext;
49  
50      public CmisObjectListType getObjectRelationships( String repositoryId, String objectId,
51          Boolean includeSubRelationshipTypes, EnumRelationshipDirection relationshipDirection, String typeId,
52          String filter, Boolean includeAllowableActions, BigInteger maxItems, BigInteger skipCount,
53          CmisExtensionType extension ) throws CmisException
54      {
55          CmisService service = null;
56  
57          try
58          {
59              service = getService( wsContext, repositoryId );
60  
61              return convert( service.getObjectRelationships( repositoryId, objectId, includeSubRelationshipTypes,
62                      convert( RelationshipDirection.class, relationshipDirection ), typeId, filter,
63                      includeAllowableActions, maxItems, skipCount, convert( extension ) ) );
64          }
65          catch ( Exception e )
66          {
67              throw convertException( e );
68          }
69          finally
70          {
71              closeService( service );
72          }
73      }
74  }