2 * This document is a part of the source code and related artifacts
3 * for CollectionSpace, an open source collections management system
4 * for museums and related institutions:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright 2009 University of California at Berkeley
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
16 * https://source.collectionspace.org/collection-space/LICENSE.txt
18 package org.collectionspace.services.nuxeo.client.java;
20 import java.util.UUID;
21 import java.util.List;
23 import org.collectionspace.services.common.context.ServiceContext;
24 import org.collectionspace.services.common.document.BadRequestException;
25 import org.collectionspace.services.common.document.DocumentException;
26 import org.collectionspace.services.common.document.DocumentFilter;
27 import org.collectionspace.services.common.document.DocumentHandler;
28 import org.collectionspace.services.common.document.DocumentNotFoundException;
29 import org.collectionspace.services.common.repository.RepositoryClient;
30 import org.collectionspace.services.common.document.DocumentHandler.Action;
31 import org.collectionspace.services.common.document.DocumentWrapper;
32 import org.collectionspace.services.common.document.DocumentWrapperImpl;
33 import org.collectionspace.services.nuxeo.util.NuxeoUtils;
34 import org.nuxeo.common.utils.IdUtils;
35 import org.nuxeo.ecm.core.api.ClientException;
36 import org.nuxeo.ecm.core.api.DocumentModel;
37 import org.nuxeo.ecm.core.api.DocumentModelList;
38 import org.nuxeo.ecm.core.api.impl.DocumentModelListImpl;
39 import org.nuxeo.ecm.core.api.DocumentRef;
40 import org.nuxeo.ecm.core.api.IdRef;
41 import org.nuxeo.ecm.core.api.PathRef;
42 import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
43 import org.nuxeo.ecm.core.client.NuxeoClient;
44 import org.slf4j.Logger;
45 import org.slf4j.LoggerFactory;
48 * RepositoryJavaClient is used to perform CRUD operations on documents in Nuxeo
49 * repository using Remote Java APIs. It uses @see DocumentHandler as IOHandler
52 * $LastChangedRevision: $ $LastChangedDate: $
54 public class RepositoryJavaClientImpl implements RepositoryClient {
56 private final Logger logger = LoggerFactory.getLogger(RepositoryJavaClientImpl.class);
58 public RepositoryJavaClientImpl() {
62 * create document in the Nuxeo repository
64 * @param ctx service context under which this method is invoked
66 * of the document created
68 * should be used by the caller to provide and transform the
70 * @return id in repository of the newly created document
71 * @throws DocumentException
74 public String create(ServiceContext ctx,
75 DocumentHandler handler) throws BadRequestException,
78 if (ctx.getDocumentType() == null) {
79 throw new IllegalArgumentException(
80 "RepositoryJavaClient.create: docType is missing");
82 if (handler == null) {
83 throw new IllegalArgumentException(
84 "RepositoryJavaClient.create: handler is missing");
86 String nuxeoWspaceId = ctx.getRepositoryWorkspaceId();
87 if (nuxeoWspaceId == null) {
88 throw new DocumentNotFoundException(
89 "Unable to find workspace for service " + ctx.getServiceName()
90 + " check if the workspace exists in the Nuxeo repository");
92 RepositoryInstance repoSession = null;
94 handler.prepare(Action.CREATE);
95 repoSession = getRepositorySession();
96 DocumentRef nuxeoWspace = new IdRef(nuxeoWspaceId);
97 DocumentModel wspaceDoc = repoSession.getDocument(nuxeoWspace);
98 String wspacePath = wspaceDoc.getPathAsString();
99 //give our own ID so PathRef could be constructed later on
100 String id = IdUtils.generateId(UUID.randomUUID().toString());
101 // create document model
102 DocumentModel doc = repoSession.createDocumentModel(wspacePath, id,
103 ctx.getDocumentType());
104 ((DocumentModelHandler) handler).setRepositorySession(repoSession);
105 DocumentWrapper<DocumentModel> wrapDoc = new DocumentWrapperImpl<DocumentModel>(doc);
106 handler.handle(Action.CREATE, wrapDoc);
107 // create document with documentmodel
108 doc = repoSession.createDocument(doc);
110 handler.complete(Action.CREATE, wrapDoc);
112 } catch (BadRequestException bre) {
114 } catch (Exception e) {
115 if (logger.isDebugEnabled()) {
116 logger.debug("Caught exception ", e);
118 throw new DocumentException(e);
120 if (repoSession != null) {
121 releaseRepositorySession(repoSession);
128 * get document from the Nuxeo repository
129 * @param ctx service context under which this method is invoked
131 * of the document to retrieve
133 * should be used by the caller to provide and transform the
135 * @throws DocumentException
138 public void get(ServiceContext ctx, String id, DocumentHandler handler)
139 throws DocumentNotFoundException, DocumentException {
141 if (handler == null) {
142 throw new IllegalArgumentException(
143 "RepositoryJavaClient.get: handler is missing");
145 RepositoryInstance repoSession = null;
148 handler.prepare(Action.GET);
149 repoSession = getRepositorySession();
150 DocumentRef docRef = NuxeoUtils.createPathRef(ctx, id);
151 DocumentModel doc = null;
153 doc = repoSession.getDocument(docRef);
154 } catch (ClientException ce) {
155 String msg = "could not find document with id=" + id;
156 logger.error(msg, ce);
157 throw new DocumentNotFoundException(msg, ce);
159 //set reposession to handle the document
160 ((DocumentModelHandler) handler).setRepositorySession(repoSession);
161 DocumentWrapper<DocumentModel> wrapDoc = new DocumentWrapperImpl<DocumentModel>(doc);
162 handler.handle(Action.GET, wrapDoc);
163 handler.complete(Action.GET, wrapDoc);
164 } catch (IllegalArgumentException iae) {
166 } catch (DocumentException de) {
168 } catch (Exception e) {
169 if (logger.isDebugEnabled()) {
170 logger.debug("Caught exception ", e);
172 throw new DocumentException(e);
174 if (repoSession != null) {
175 releaseRepositorySession(repoSession);
181 * get document from the Nuxeo repository, using the docFilter params.
182 * @param ctx service context under which this method is invoked
184 * should be used by the caller to provide and transform the
185 * document. Handler must have a docFilter set to return a single item.
186 * @throws DocumentException
189 public void get(ServiceContext ctx, DocumentHandler handler)
190 throws DocumentNotFoundException, DocumentException {
192 if (handler == null) {
193 throw new IllegalArgumentException(
194 "RepositoryJavaClient.get: handler is missing");
196 DocumentFilter docFilter = handler.getDocumentFilter();
197 if (docFilter == null) {
198 throw new IllegalArgumentException(
199 "RepositoryJavaClient.get: handler has no Filter specified");
201 if(docFilter.getPageSize()!= 1) {
202 logger.warn("RepositoryJavaClient.get: forcing docFilter pagesize to 1.");
204 String docType = ctx.getDocumentType();
205 if (docType == null) {
206 throw new DocumentNotFoundException(
207 "Unable to find DocumentType for service " + ctx.getServiceName());
209 String domain = ctx.getRepositoryDomainName();
210 if (domain == null) {
211 throw new DocumentNotFoundException(
212 "Unable to find Domain for service " + ctx.getServiceName());
214 RepositoryInstance repoSession = null;
217 handler.prepare(Action.GET);
218 repoSession = getRepositorySession();
220 DocumentModelList docList = null;
221 // force limit to 1, and ignore totalSize
222 String query = buildNXQLQuery(docType, docFilter.getWhereClause(), domain );
223 docList = repoSession.query( query, null, 1, 0, false);
224 if(docList.size()!=1) {
225 throw new DocumentNotFoundException("No document found matching filter params.");
227 DocumentModel doc = docList.get(0);
229 if (logger.isDebugEnabled()) {
230 logger.debug("Executed NXQL query: " + query);
233 //set reposession to handle the document
234 ((DocumentModelHandler) handler).setRepositorySession(repoSession);
235 DocumentWrapper<DocumentModel> wrapDoc = new DocumentWrapperImpl<DocumentModel>(doc);
236 handler.handle(Action.GET, wrapDoc);
237 handler.complete(Action.GET, wrapDoc);
238 } catch (IllegalArgumentException iae) {
240 } catch (DocumentException de) {
242 } catch (Exception e) {
243 if (logger.isDebugEnabled()) {
244 logger.debug("Caught exception ", e);
246 throw new DocumentException(e);
248 if (repoSession != null) {
249 releaseRepositorySession(repoSession);
255 * get wrapped documentModel from the Nuxeo repository
256 * @param ctx service context under which this method is invoked
258 * of the document to retrieve
259 * @throws DocumentException
262 public DocumentWrapper<DocumentModel> getDoc(
263 ServiceContext ctx, String id)
264 throws DocumentNotFoundException, DocumentException {
265 RepositoryInstance repoSession = null;
266 DocumentWrapper<DocumentModel> wrapDoc = null;
269 repoSession = getRepositorySession();
270 DocumentRef docRef = NuxeoUtils.createPathRef(ctx, id);
271 DocumentModel doc = null;
273 doc = repoSession.getDocument(docRef);
274 } catch (ClientException ce) {
275 String msg = "could not find document with id=" + id;
276 logger.error(msg, ce);
277 throw new DocumentNotFoundException(msg, ce);
279 wrapDoc = new DocumentWrapperImpl<DocumentModel>(doc);
280 } catch (IllegalArgumentException iae) {
282 } catch (DocumentException de) {
284 } catch (Exception e) {
285 if (logger.isDebugEnabled()) {
286 logger.debug("Caught exception ", e);
288 throw new DocumentException(e);
290 if (repoSession != null) {
291 releaseRepositorySession(repoSession);
298 * find wrapped documentModel from the Nuxeo repository
299 * @param ctx service context under which this method is invoked
300 * @param where NXQL where clause to get the document
301 * @throws DocumentException
304 public DocumentWrapper<DocumentModel> findDoc(
305 ServiceContext ctx, String where)
306 throws DocumentNotFoundException, DocumentException {
307 RepositoryInstance repoSession = null;
308 DocumentWrapper<DocumentModel> wrapDoc = null;
311 String docType = ctx.getDocumentType();
312 if (docType == null) {
313 throw new DocumentNotFoundException(
314 "Unable to find DocumentType for service " + ctx.getServiceName());
316 String domain = ctx.getRepositoryDomainName();
317 if (domain == null) {
318 throw new DocumentNotFoundException(
319 "Unable to find Domain for service " + ctx.getServiceName());
321 repoSession = getRepositorySession();
322 DocumentModelList docList = null;
323 // force limit to 1, and ignore totalSize
324 String query = buildNXQLQuery(docType, where, domain );
325 docList = repoSession.query( query, null, 1, 0, false);
326 if(docList.size()!=1) {
327 if (logger.isDebugEnabled()) {
328 logger.debug("findDoc: Query found: "+docList.size()+" items.");
329 logger.debug(" Query: " + query);
331 throw new DocumentNotFoundException("No document found matching filter params.");
333 DocumentModel doc = docList.get(0);
334 wrapDoc = new DocumentWrapperImpl<DocumentModel>(doc);
335 } catch (IllegalArgumentException iae) {
337 } catch (DocumentException de) {
339 } catch (Exception e) {
340 if (logger.isDebugEnabled()) {
341 logger.debug("Caught exception ", e);
343 throw new DocumentException(e);
345 if (repoSession != null) {
346 releaseRepositorySession(repoSession);
353 * find doc and return CSID from the Nuxeo repository
354 * @param ctx service context under which this method is invoked
355 * @param where NXQL where clause to get the document
356 * @throws DocumentException
358 public String findDocCSID(
359 ServiceContext ctx, String where)
360 throws DocumentNotFoundException, DocumentException {
363 DocumentWrapper<DocumentModel> wrapDoc = findDoc(ctx, where);
364 DocumentModel docModel = wrapDoc.getWrappedObject();
365 csid = NuxeoUtils.extractId(docModel.getPathAsString());
366 } catch (DocumentNotFoundException dnfe) {
368 } catch (IllegalArgumentException iae) {
370 } catch (DocumentException de) {
372 } catch (Exception e) {
373 if (logger.isDebugEnabled()) {
374 logger.debug("Caught exception ", e);
376 throw new DocumentException(e);
382 * Find a list of documentModels from the Nuxeo repository
383 * @param docTypes a list of DocType names to match
384 * @param where the clause to qualify on
385 * @param domain the domain for the associated services
389 public DocumentWrapper<DocumentModelList> findDocs(
390 List<String> docTypes, String where, String domain,
391 int pageSize, int pageNum, boolean computeTotal )
392 throws DocumentNotFoundException, DocumentException {
393 RepositoryInstance repoSession = null;
394 DocumentWrapper<DocumentModelList> wrapDoc = null;
397 if (docTypes == null || docTypes.size()<1) {
398 throw new DocumentNotFoundException(
399 "findDocs must specify at least one DocumentType.");
401 if (domain == null) {
402 throw new DocumentNotFoundException("findDocs must specify Domain.");
404 repoSession = getRepositorySession();
405 DocumentModelList docList = null;
406 // force limit to 1, and ignore totalSize
407 String query = buildNXQLQuery(docTypes, where, domain );
408 docList = repoSession.query( query, null, pageSize, pageNum, computeTotal);
409 wrapDoc = new DocumentWrapperImpl<DocumentModelList>(docList);
410 } catch (IllegalArgumentException iae) {
412 } catch (DocumentException de) {
414 } catch (Exception e) {
415 if (logger.isDebugEnabled()) {
416 logger.debug("Caught exception ", e);
418 throw new DocumentException(e);
420 if (repoSession != null) {
421 releaseRepositorySession(repoSession);
429 public void get(ServiceContext ctx, List<String> csidList, DocumentHandler handler)
430 throws DocumentNotFoundException, DocumentException {
431 if (handler == null) {
432 throw new IllegalArgumentException(
433 "RepositoryJavaClient.getAll: handler is missing");
436 RepositoryInstance repoSession = null;
439 handler.prepare(Action.GET_ALL);
440 repoSession = getRepositorySession();
441 DocumentModelList docModelList = new DocumentModelListImpl();
442 //FIXME: Should be using NuxeoUtils.createPathRef for security reasons
443 for (String csid : csidList) {
444 DocumentRef docRef = NuxeoUtils.createPathRef(ctx, csid);
445 DocumentModel docModel = repoSession.getDocument(docRef);
446 docModelList.add(docModel);
449 //set reposession to handle the document
450 ((DocumentModelHandler) handler).setRepositorySession(repoSession);
451 DocumentWrapper<DocumentModelList> wrapDoc = new DocumentWrapperImpl<DocumentModelList>(docModelList);
452 handler.handle(Action.GET_ALL, wrapDoc);
453 handler.complete(Action.GET_ALL, wrapDoc);
454 } catch (DocumentException de) {
456 } catch (Exception e) {
457 if (logger.isDebugEnabled()) {
458 logger.debug("Caught exception ", e);
460 throw new DocumentException(e);
462 if (repoSession != null) {
463 releaseRepositorySession(repoSession);
469 * getAll get all documents for an entity entity service from the Nuxeo
472 * @param ctx service context under which this method is invoked
474 * should be used by the caller to provide and transform the
476 * @throws DocumentException
479 public void getAll(ServiceContext ctx, DocumentHandler handler)
480 throws DocumentNotFoundException, DocumentException {
481 if (handler == null) {
482 throw new IllegalArgumentException(
483 "RepositoryJavaClient.getAll: handler is missing");
485 String nuxeoWspaceId = ctx.getRepositoryWorkspaceId();
486 if (nuxeoWspaceId == null) {
487 throw new DocumentNotFoundException(
488 "Unable to find workspace for service "
489 + ctx.getServiceName()
490 + " check if the workspace exists in the Nuxeo repository");
492 RepositoryInstance repoSession = null;
495 handler.prepare(Action.GET_ALL);
496 repoSession = getRepositorySession();
497 DocumentRef wsDocRef = new IdRef(nuxeoWspaceId);
498 DocumentModelList docList = repoSession.getChildren(wsDocRef);
499 //set reposession to handle the document
500 ((DocumentModelHandler) handler).setRepositorySession(repoSession);
501 DocumentWrapper<DocumentModelList> wrapDoc = new DocumentWrapperImpl<DocumentModelList>(docList);
502 handler.handle(Action.GET_ALL, wrapDoc);
503 handler.complete(Action.GET_ALL, wrapDoc);
504 } catch (DocumentException de) {
506 } catch (Exception e) {
507 if (logger.isDebugEnabled()) {
508 logger.debug("Caught exception ", e);
510 throw new DocumentException(e);
512 if (repoSession != null) {
513 releaseRepositorySession(repoSession);
519 * getFiltered get all documents for an entity service from the Document repository,
520 * given filter parameters specified by the handler.
521 * @param ctx service context under which this method is invoked
522 * @param handler should be used by the caller to provide and transform the document
523 * @throws DocumentNotFoundException if workspace not found
524 * @throws DocumentException
526 public void getFiltered(ServiceContext ctx, DocumentHandler handler)
527 throws DocumentNotFoundException, DocumentException {
528 if (handler == null) {
529 throw new IllegalArgumentException(
530 "RepositoryJavaClient.getFiltered: handler is missing");
532 DocumentFilter docFilter = handler.getDocumentFilter();
533 if (docFilter == null) {
534 throw new IllegalArgumentException(
535 "RepositoryJavaClient.getFiltered: handler has no Filter specified");
537 String docType = ctx.getDocumentType();
538 if (docType == null) {
539 throw new DocumentNotFoundException(
540 "Unable to find DocumentType for service " + ctx.getServiceName());
542 String domain = ctx.getRepositoryDomainName();
543 if (domain == null) {
544 throw new DocumentNotFoundException(
545 "Unable to find Domain for service " + ctx.getServiceName());
547 RepositoryInstance repoSession = null;
549 handler.prepare(Action.GET_ALL);
550 repoSession = getRepositorySession();
551 DocumentModelList docList = null;
552 String query = buildNXQLQuery(docType, docFilter.getWhereClause(), domain );
554 // If we have limit and/or offset, then pass true to get totalSize
555 // in returned DocumentModelList.
556 if ((docFilter.getOffset() > 0) || (docFilter.getPageSize() > 0)) {
557 docList = repoSession.query(query, null,
558 docFilter.getPageSize(), docFilter.getOffset(), true);
560 docList = repoSession.query(query);
563 if (logger.isDebugEnabled()) {
564 logger.debug("Executed NXQL query: " + query.toString());
567 //set repoSession to handle the document
568 ((DocumentModelHandler) handler).setRepositorySession(repoSession);
569 DocumentWrapper<DocumentModelList> wrapDoc = new DocumentWrapperImpl<DocumentModelList>(docList);
570 handler.handle(Action.GET_ALL, wrapDoc);
571 handler.complete(Action.GET_ALL, wrapDoc);
572 } catch (DocumentException de) {
574 } catch (Exception e) {
575 if (logger.isDebugEnabled()) {
576 logger.debug("Caught exception ", e);
578 throw new DocumentException(e);
580 if (repoSession != null) {
581 releaseRepositorySession(repoSession);
587 * update given document in the Nuxeo repository
589 * @param ctx service context under which this method is invoked
593 * should be used by the caller to provide and transform the
595 * @throws DocumentException
598 public void update(ServiceContext ctx, String id, DocumentHandler handler)
599 throws BadRequestException, DocumentNotFoundException,
601 if (handler == null) {
602 throw new IllegalArgumentException(
603 "RepositoryJavaClient.update: handler is missing");
605 RepositoryInstance repoSession = null;
607 handler.prepare(Action.UPDATE);
608 repoSession = getRepositorySession();
609 DocumentRef docRef = NuxeoUtils.createPathRef(ctx, id);
610 DocumentModel doc = null;
612 doc = repoSession.getDocument(docRef);
613 } catch (ClientException ce) {
614 String msg = "Could not find document to update with id=" + id;
615 logger.error(msg, ce);
616 throw new DocumentNotFoundException(msg, ce);
618 //set reposession to handle the document
619 ((DocumentModelHandler) handler).setRepositorySession(repoSession);
620 DocumentWrapper<DocumentModel> wrapDoc = new DocumentWrapperImpl<DocumentModel>(doc);
621 handler.handle(Action.UPDATE, wrapDoc);
622 repoSession.saveDocument(doc);
624 handler.complete(Action.UPDATE, wrapDoc);
625 } catch (BadRequestException bre) {
627 } catch (DocumentException de) {
629 } catch (Exception e) {
630 if (logger.isDebugEnabled()) {
631 logger.debug("Caught exception ", e);
633 throw new DocumentException(e);
635 if (repoSession != null) {
636 releaseRepositorySession(repoSession);
642 * delete a document from the Nuxeo repository
643 * @param ctx service context under which this method is invoked
646 * @throws DocumentException
649 public void delete(ServiceContext ctx, String id) throws DocumentNotFoundException,
652 if (logger.isDebugEnabled()) {
653 logger.debug("deleting document with id=" + id);
655 RepositoryInstance repoSession = null;
657 repoSession = getRepositorySession();
658 DocumentRef docRef = NuxeoUtils.createPathRef(ctx, id);
660 repoSession.removeDocument(docRef);
661 } catch (ClientException ce) {
662 String msg = "could not find document to delete with id=" + id;
663 logger.error(msg, ce);
664 throw new DocumentNotFoundException(msg, ce);
667 } catch (DocumentException de) {
669 } catch (Exception e) {
670 if (logger.isDebugEnabled()) {
671 logger.debug("Caught exception ", e);
673 throw new DocumentException(e);
675 if (repoSession != null) {
676 releaseRepositorySession(repoSession);
682 public String createWorkspace(String tenantDomain, String workspaceName) throws Exception {
683 RepositoryInstance repoSession = null;
684 String workspaceId = null;
686 repoSession = getRepositorySession();
687 DocumentRef docRef = new PathRef(
689 + "/" + "workspaces");
690 DocumentModel parent = repoSession.getDocument(docRef);
691 DocumentModel doc = repoSession.createDocumentModel(parent.getPathAsString(),
692 workspaceName, "Workspace");
693 doc.setPropertyValue("dc:title", workspaceName);
694 doc.setPropertyValue("dc:description", "A CollectionSpace workspace for "
696 doc = repoSession.createDocument(doc);
697 workspaceId = doc.getId();
699 if (logger.isDebugEnabled()) {
700 logger.debug("created workspace name=" + workspaceName
701 + " id=" + workspaceId);
703 } catch (Exception e) {
704 if (logger.isDebugEnabled()) {
705 logger.debug("createWorkspace caught exception ", e);
709 if (repoSession != null) {
710 releaseRepositorySession(repoSession);
717 public String getWorkspaceId(String tenantDomain, String workspaceName) throws Exception {
718 String workspaceId = null;
719 RepositoryInstance repoSession = null;
721 repoSession = getRepositorySession();
722 DocumentRef docRef = new PathRef(
725 + "/" + workspaceName);
726 DocumentModel workspace = repoSession.getDocument(docRef);
727 workspaceId = workspace.getId();
728 } catch (DocumentException de) {
730 } catch (Exception e) {
731 if (logger.isDebugEnabled()) {
732 logger.debug("Caught exception ", e);
734 throw new DocumentException(e);
736 if (repoSession != null) {
737 releaseRepositorySession(repoSession);
743 private final void appendNXQLWhere(StringBuilder query, String where, String domain ) {
744 // TODO This is a slow method for tenant-filter
745 // We should make this a property that is indexed.
746 query.append(" WHERE ecm:path STARTSWITH '/" + domain + "'");
747 if ((null != where) && (where.length() > 0)) {
748 // Due to an apparent bug/issue in how Nuxeo translates the NXQL query string
749 // into SQL, we need to parenthesize our 'where' clause
750 query.append(" AND " + "(" + where +")" + "AND ecm:isProxy = 0");
754 private final String buildNXQLQuery(String docType, String where, String domain ) {
755 StringBuilder query = new StringBuilder("SELECT * FROM ");
756 query.append(docType);
757 appendNXQLWhere(query, where, domain );
758 return query.toString();
761 private final String buildNXQLQuery(List<String> docTypes, String where, String domain ) {
762 StringBuilder query = new StringBuilder("SELECT * FROM ");
763 boolean fFirst = true;
764 for(String docType:docTypes) {
769 query.append(docType);
771 appendNXQLWhere(query, where, domain );
772 return query.toString();
775 private RepositoryInstance getRepositorySession() throws Exception {
776 // FIXME: is it possible to reuse repository session?
777 // Authentication failures happen while trying to reuse the session
778 NuxeoClient client = NuxeoConnector.getInstance().getClient();
779 RepositoryInstance repoSession = client.openRepository();
780 if (logger.isDebugEnabled()) {
781 logger.debug("getRepository() repository root: " + repoSession.getRootDocument());
786 private void releaseRepositorySession(RepositoryInstance repoSession) {
788 NuxeoClient client = NuxeoConnector.getInstance().getClient();
790 client.releaseRepository(repoSession);
791 } catch (Exception e) {
792 logger.error("Could not close the repository session", e);
793 // no need to throw this service specific exception