This project has retired. For details please refer to its Attic page.
NavigationServiceImpl xref

1   /*
2    *
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   *
20   */
21  package org.apache.chemistry.opencmis.client.bindings.spi.local;
22  
23  import java.math.BigInteger;
24  import java.util.List;
25  
26  import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
27  import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
28  import org.apache.chemistry.opencmis.commons.data.ObjectData;
29  import org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer;
30  import org.apache.chemistry.opencmis.commons.data.ObjectInFolderList;
31  import org.apache.chemistry.opencmis.commons.data.ObjectList;
32  import org.apache.chemistry.opencmis.commons.data.ObjectParentData;
33  import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
34  import org.apache.chemistry.opencmis.commons.server.CmisService;
35  import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory;
36  import org.apache.chemistry.opencmis.commons.spi.NavigationService;
37  
38  public class NavigationServiceImpl extends AbstractLocalService implements NavigationService {
39  
40      /**
41       * Constructor.
42       */
43      public NavigationServiceImpl(BindingSession session, CmisServiceFactory factory) {
44          setSession(session);
45          setServiceFactory(factory);
46      }
47  
48      public ObjectList getCheckedOutDocs(String repositoryId, String folderId, String filter, String orderBy,
49              Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
50              BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
51          CmisService service = getService(repositoryId);
52  
53          try {
54              return service.getCheckedOutDocs(repositoryId, folderId, filter, orderBy, includeAllowableActions,
55                      includeRelationships, renditionFilter, maxItems, skipCount, extension);
56          } finally {
57              service.close();
58          }
59      }
60  
61      public ObjectInFolderList getChildren(String repositoryId, String folderId, String filter, String orderBy,
62              Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
63              Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
64          CmisService service = getService(repositoryId);
65  
66          try {
67              return service.getChildren(repositoryId, folderId, filter, orderBy, includeAllowableActions,
68                      includeRelationships, renditionFilter, includePathSegment, maxItems, skipCount, extension);
69          } finally {
70              service.close();
71          }
72      }
73  
74      public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId, BigInteger depth,
75              String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
76              String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
77          CmisService service = getService(repositoryId);
78  
79          try {
80              return service.getDescendants(repositoryId, folderId, depth, filter, includeAllowableActions,
81                      includeRelationships, renditionFilter, includePathSegment, extension);
82          } finally {
83              service.close();
84          }
85      }
86  
87      public ObjectData getFolderParent(String repositoryId, String folderId, String filter, ExtensionsData extension) {
88          CmisService service = getService(repositoryId);
89  
90          try {
91              return service.getFolderParent(repositoryId, folderId, filter, extension);
92          } finally {
93              service.close();
94          }
95      }
96  
97      public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId, BigInteger depth,
98              String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
99              String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
100         CmisService service = getService(repositoryId);
101 
102         try {
103             return service.getFolderTree(repositoryId, folderId, depth, filter, includeAllowableActions,
104                     includeRelationships, renditionFilter, includePathSegment, extension);
105         } finally {
106             service.close();
107         }
108     }
109 
110     public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter,
111             Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
112             Boolean includeRelativePathSegment, ExtensionsData extension) {
113         CmisService service = getService(repositoryId);
114 
115         try {
116             return service.getObjectParents(repositoryId, objectId, filter, includeAllowableActions,
117                     includeRelationships, renditionFilter, includeRelativePathSegment, extension);
118         } finally {
119             service.close();
120         }
121     }
122 }