use of org.bimserver.webservices.SProjectComparator 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();
}
}
use of org.bimserver.webservices.SProjectComparator in project BIMserver by opensourceBIM.
the class ServiceImpl method getSubProjects.
@Override
public List<SProject> getSubProjects(Long poid) throws ServerException, UserException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
BimDatabaseAction<Set<Project>> action = new GetSubProjectsDatabaseAction(session, getInternalAccessMethod(), getAuthorization(), poid);
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