use of org.bimserver.database.actions.GetAllProjectsDatabaseAction in project BIMserver by opensourceBIM.
the class ServiceImpl method getAllProjects.
@Override
public List<SProject> getAllProjects(Boolean onlyTopLevel, Boolean onlyActive) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
BimDatabaseAction<Set<Project>> action = new GetAllProjectsDatabaseAction(session, getInternalAccessMethod(), onlyTopLevel, onlyActive, getAuthorization());
List<SProject> convertToSListProject = getBimServer().getSConverter().convertToSListProject(session.executeAndCommitAction(action));
Collections.sort(convertToSListProject, new SProjectComparator());
return convertToSListProject;
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations