use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class GradingSchoolDataController method findLatestWorkspaceAssessmentByStudent.
public WorkspaceAssessment findLatestWorkspaceAssessmentByStudent(String schoolDataSource, String studentIdentifier) {
SchoolDataSource dataSource = schoolDataSourceDAO.findByIdentifier(schoolDataSource);
GradingSchoolDataBridge schoolDataBridge = getGradingBridge(dataSource);
if (schoolDataBridge != null) {
return schoolDataBridge.findLatestWorkspaceAssessmentByStudent(studentIdentifier);
} else {
logger.log(Level.SEVERE, "School Data Bridge could not be found for data source: " + dataSource.getIdentifier());
}
return null;
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class GradingSchoolDataController method findWorkspaceAssessmentRequest.
public WorkspaceAssessmentRequest findWorkspaceAssessmentRequest(String schoolDataSource, String identifier, String workspaceIdentifier, String studentIdentifier) {
SchoolDataSource dataSource = schoolDataSourceDAO.findByIdentifier(schoolDataSource);
GradingSchoolDataBridge schoolDataBridge = getGradingBridge(dataSource);
if (schoolDataBridge != null) {
return schoolDataBridge.findWorkspaceAssessmentRequest(identifier, workspaceIdentifier, studentIdentifier);
} else {
logger.log(Level.SEVERE, "School Data Bridge could not be found for data source: " + dataSource.getIdentifier());
}
return null;
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class RoleController method findRoleByDataSourceAndRoleEntity.
public Role findRoleByDataSourceAndRoleEntity(String schoolDataSource, RoleEntity roleEntity) {
SchoolDataSource dataSource = schoolDataSourceDAO.findByIdentifier(schoolDataSource);
if (dataSource == null) {
logger.severe("Could not find school data source " + schoolDataSource);
return null;
}
RoleSchoolDataIdentifier schoolDataIdentifier = roleSchoolDataIdentifierDAO.findByDataSourceAndRoleEntity(dataSource, roleEntity);
if (schoolDataIdentifier != null) {
return findRole(dataSource, schoolDataIdentifier.getIdentifier());
}
return null;
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class GradingSchoolDataController method countStudentWorkspaceAssessments.
public Long countStudentWorkspaceAssessments(String schoolDataSource, String studentIdentifier, Date fromDate, Date toDate, boolean onlyPassingGrades) {
SchoolDataSource dataSource = schoolDataSourceDAO.findByIdentifier(schoolDataSource);
GradingSchoolDataBridge schoolDataBridge = getGradingBridge(dataSource);
if (schoolDataBridge != null) {
return schoolDataBridge.countStudentWorkspaceAssessments(studentIdentifier, fromDate, toDate, onlyPassingGrades);
} else {
logger.log(Level.SEVERE, "School Data Bridge could not be found for data source: " + dataSource.getIdentifier());
}
return null;
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class SchoolDataSourceDAO method findByIdentifier.
public SchoolDataSource findByIdentifier(String identifier) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<SchoolDataSource> criteria = criteriaBuilder.createQuery(SchoolDataSource.class);
Root<SchoolDataSource> root = criteria.from(SchoolDataSource.class);
criteria.select(root);
criteria.where(criteriaBuilder.equal(root.get(SchoolDataSource_.identifier), identifier));
return getSingleResult(entityManager.createQuery(criteria));
}
Aggregations