This project has retired. For details please refer to its
Attic page.
AclService xref
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 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
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 }