use of org.bimserver.database.actions.GetSubProjectsDatabaseAction 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