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.data.ExtensionsData;
22 import static org.apache.chemistry.opencmis.commons.impl.Converter.convertExtensionHolder;
23 import static org.apache.chemistry.opencmis.commons.impl.Converter.setExtensionValues;
24 import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisException;
25 import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisExtensionType;
26 import org.apache.chemistry.opencmis.commons.impl.jaxb.MultiFilingServicePort;
27 import org.apache.chemistry.opencmis.commons.server.CmisService;
28
29 import javax.annotation.Resource;
30
31 import javax.jws.WebService;
32
33 import javax.xml.ws.Holder;
34 import javax.xml.ws.WebServiceContext;
35 import javax.xml.ws.soap.MTOM;
36
37
38
39
40
41 @MTOM
42 @WebService( endpointInterface = "org.apache.chemistry.opencmis.commons.impl.jaxb.MultiFilingServicePort" )
43 public class MultiFilingService extends AbstractService implements MultiFilingServicePort
44 {
45 @Resource
46 public WebServiceContext wsContext;
47
48 public void addObjectToFolder( String repositoryId, String objectId, String folderId, Boolean allVersions,
49 Holder<CmisExtensionType> extension ) throws CmisException
50 {
51 CmisService service = null;
52
53 try
54 {
55 service = getService( wsContext, repositoryId );
56
57 ExtensionsData extData = convertExtensionHolder( extension );
58
59 service.addObjectToFolder( repositoryId, objectId, folderId, allVersions, extData );
60
61 setExtensionValues( extData, extension );
62 }
63 catch ( Exception e )
64 {
65 throw convertException( e );
66 }
67 finally
68 {
69 closeService( service );
70 }
71 }
72
73 public void removeObjectFromFolder( String repositoryId, String objectId, String folderId,
74 Holder<CmisExtensionType> extension ) throws CmisException
75 {
76 CmisService service = null;
77
78 try
79 {
80 service = getService( wsContext, repositoryId );
81
82 ExtensionsData extData = convertExtensionHolder( extension );
83
84 service.removeObjectFromFolder( repositoryId, objectId, folderId, extData );
85
86 setExtensionValues( extData, extension );
87 }
88 catch ( Exception e )
89 {
90 throw convertException( e );
91 }
92 finally
93 {
94 closeService( service );
95 }
96 }
97 }