/* * (non-Javadoc) * @see com.stratelia.webactiv.util.document.model.jcr.impl.JcrDocumentService# getUpdatedDocument * (com.stratelia.webactiv.util.document.model.DocumentVersion, java.lang.String) */ public void getUpdatedDocument(DocumentVersion document) { Session session = null; try { session = BasicDaoFactory.getSystemSession(); jcrDocumentDao.updateDocument(session, document); session.save(); } catch (RepositoryException ex) { SilverTrace.error("document", "JcrDocumentServiceImpl", "document.jcr.create.exception", ex); throw new VersioningRuntimeException( "JcrDocumentServiceImpl", SilverpeasRuntimeException.ERROR, "document.jcr.create.exception", ex); } catch (IOException ex) { SilverTrace.error("document", "JcrDocumentServiceImpl", "document.jcr.create.exception", ex); throw new VersioningRuntimeException( "JcrDocumentServiceImpl", SilverpeasRuntimeException.ERROR, "document.jcr.create.exception", ex); } finally { if (session != null) { session.logout(); } } }
/** * Indicate if the node for the specified attachment is currently locked (for example by Office in * the case of a webdav online edition). * * @param attachment the attachment. * @param language the language to obtain the file. * @return true if the node is locked - false otherwise. * @throws RepositoryException */ public boolean isNodeLocked(DocumentVersion document) { Session session = null; try { session = BasicDaoFactory.getSystemSession(); return jcrDocumentDao.isNodeLocked(session, document); } catch (RepositoryException ex) { SilverTrace.error( "document", "JcrDocumentServiceImpl", "document.jcr.isLocked.exception", ex); throw new VersioningRuntimeException( "JcrDocumentServiceImpl", SilverpeasRuntimeException.ERROR, "document.jcr.isLocked.exception", ex); } finally { if (session != null) { session.logout(); } } }