use of org.bimserver.database.actions.GetSubProjectByNameDatabaseAction in project BIMserver by opensourceBIM.
the class ServiceImpl method getSubProjectByName.
@Override
public SProject getSubProjectByName(Long parentProjectId, String name) throws UserException, ServerException {
requireRealUserAuthentication();
DatabaseSession session = getBimServer().getDatabase().createSession();
try {
BimDatabaseAction<Project> action = new GetSubProjectByNameDatabaseAction(session, getInternalAccessMethod(), parentProjectId, name, getAuthorization());
return getBimServer().getSConverter().convertToSObject(session.executeAndCommitAction(action));
} catch (Exception e) {
return handleException(e);
} finally {
session.close();
}
}
Aggregations