@Override public List<SCheckout> getAllCheckoutsOfProject(Long poid) throws ServerException, UserException { requireRealUserAuthentication(); DatabaseSession session = getBimServer().getDatabase().createSession(); try { BimDatabaseAction<List<Checkout>> action = new GetAllCheckoutsOfProjectDatabaseAction(session, getInternalAccessMethod(), poid, false); List<Checkout> list = session.executeAndCommitAction(action); Collections.sort(list, new CheckoutComparator()); return getBimServer().getSConverter().convertToSListCheckout(list); } catch (Exception e) { return handleException(e); } finally { session.close(); } }
@Override public List<SCheckout> getAllCheckoutsByUser(Long uoid) throws ServerException, UserException { requireRealUserAuthentication(); DatabaseSession session = getBimServer().getDatabase().createSession(); try { BimDatabaseAction<List<Checkout>> action = new GetAllCheckoutsByUserDatabaseAction(session, getInternalAccessMethod(), uoid); List<Checkout> list = session.executeAndCommitAction(action); Collections.sort(list, new CheckoutComparator()); return getBimServer().getSConverter().convertToSListCheckout(list); } catch (Exception e) { return handleException(e); } finally { session.close(); } }
@Override public List<SCheckout> getAllCheckoutsOfProjectAndSubProjects(Long poid) throws ServerException, UserException { requireRealUserAuthentication(); DatabaseSession session = getBimServer().getDatabase().createSession(); try { BimDatabaseAction<List<Checkout>> action = new GetAllCheckoutsOfProjectDatabaseAction(session, getInternalAccessMethod(), poid, true); List<Checkout> list = session.executeAndCommitAction(action); Collections.sort(list, new CheckoutComparator()); return getBimServer().getSConverter().convertToSListCheckout(list); } catch (Exception e) { return handleException(e); } finally { session.close(); } }
@Override public List<SCheckout> getAllCheckoutsOfRevision(Long roid) throws ServerException, UserException { requireRealUserAuthentication(); DatabaseSession session = getBimServer().getDatabase().createSession(); try { BimDatabaseAction<List<Checkout>> action = new GetAllCheckoutsOfRevisionDatabaseAction(session, getInternalAccessMethod(), roid); List<Checkout> list = session.executeAndCommitAction(action); Collections.sort(list, new CheckoutComparator()); return getBimServer().getSConverter().convertToSListCheckout(list); } catch (Exception e) { return handleException(e); } finally { session.close(); } }