use of org.bimserver.database.actions.GetProjectByPoidDatabaseAction in project BIMserver by opensourceBIM.
the class ServiceImpl method getProjectSmallByPoid.
@Override
public SProjectSmall getProjectSmallByPoid(Long poid) throws ServerException, UserException {
requireAuthenticationAndRunningServer();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
GetProjectByPoidDatabaseAction action = new GetProjectByPoidDatabaseAction(session, getInternalAccessMethod(), poid, getAuthorization());
Project project = session.executeAndCommitAction(action);
User user = session.get(getAuthorization().getUoid(), OldQuery.getDefault());
return GetAllProjectsSmallDatabaseAction.createSmallProject(getAuthorization(), getBimServer(), project, user);
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
use of org.bimserver.database.actions.GetProjectByPoidDatabaseAction in project BIMserver by opensourceBIM.
the class ServiceImpl method getProjectByPoid.
@Override
public SProject getProjectByPoid(Long poid) throws ServerException, UserException {
requireAuthenticationAndRunningServer();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
GetProjectByPoidDatabaseAction action = new GetProjectByPoidDatabaseAction(session, getInternalAccessMethod(), poid, getAuthorization());
SProject result = getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(action));
return result;
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations