use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class WorkspaceRoleEntityController method findWorkspaceRoleEntityByDataSourceAndIdentifier.
public WorkspaceRoleEntity findWorkspaceRoleEntityByDataSourceAndIdentifier(String dataSource, String identifier) {
SchoolDataSource schoolDataSource = schoolDataSourceDAO.findByIdentifier(dataSource);
if (schoolDataSource == null) {
logger.severe("Could not find datasource " + dataSource);
return null;
}
RoleSchoolDataIdentifier roleIdentifier = roleSchoolDataIdentifierDAO.findByDataSourceAndIdentifier(schoolDataSource, identifier);
if (roleIdentifier != null) {
RoleEntity roleEntity = roleIdentifier.getRoleEntity();
if (roleEntity != null && roleEntity.getType() == UserRoleType.WORKSPACE) {
return (WorkspaceRoleEntity) roleEntity;
}
}
return null;
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class WorkspaceRoleEntityController method createWorkspaceRoleEntity.
public WorkspaceRoleEntity createWorkspaceRoleEntity(String dataSource, String identifier, WorkspaceRoleArchetype archetype, String name) {
SchoolDataSource schoolDataSource = schoolDataSourceDAO.findByIdentifier(dataSource);
if (schoolDataSource == null) {
logger.severe("Could not find datasource " + dataSource);
return null;
}
WorkspaceRoleEntity workspaceRoleEntity = workspaceRoleEntityDAO.create(archetype, name);
roleSchoolDataIdentifierDAO.create(schoolDataSource, identifier, workspaceRoleEntity);
return workspaceRoleEntity;
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class CourseIdentifierEntityController method findCourseIdentifierEntityBySchoolDataSourceAndIdentifier.
public CourseIdentifierEntity findCourseIdentifierEntityBySchoolDataSourceAndIdentifier(String dataSource, String identifier) {
SchoolDataSource schoolDataSource = schoolDataSourceDAO.findByIdentifier(dataSource);
if (dataSource == null) {
logger.severe("Could not find datasource " + dataSource);
return null;
}
CourseIdentifierSchoolDataIdentifier schoolDataIdentifier = courseIdentifierSchoolDataIdentifierDAO.findByDataSourceAndIdentifier(schoolDataSource, identifier);
if (schoolDataIdentifier != null) {
return schoolDataIdentifier.getCourseIdentifierEntity();
}
return null;
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class EnvironmentRoleEntityController method findEnvironmentRoleEntity.
public EnvironmentRoleEntity findEnvironmentRoleEntity(String dataSource, String identifier) {
SchoolDataSource schoolDataSource = schoolDataSourceDAO.findByIdentifier(dataSource);
if (schoolDataSource == null) {
logger.severe("Could not find datasource " + dataSource);
return null;
}
RoleSchoolDataIdentifier roleIdentifier = roleSchoolDataIdentifierDAO.findByDataSourceAndIdentifier(schoolDataSource, identifier);
if (roleIdentifier != null) {
RoleEntity roleEntity = roleIdentifier.getRoleEntity();
if (roleEntity != null && roleEntity.getType() == UserRoleType.ENVIRONMENT) {
return (EnvironmentRoleEntity) roleEntity;
}
}
return null;
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class GradingSchoolDataController method listAssessmentRequestsByStudent.
public List<WorkspaceAssessmentRequest> listAssessmentRequestsByStudent(String schoolDataSource, String studentIdentifier) {
SchoolDataSource dataSource = schoolDataSourceDAO.findByIdentifier(schoolDataSource);
GradingSchoolDataBridge schoolDataBridge = getGradingBridge(dataSource);
if (schoolDataBridge != null) {
return schoolDataBridge.listAssessmentRequestsByStudent(studentIdentifier);
} else {
logger.log(Level.SEVERE, "School Data Bridge could not be found for data source: " + dataSource.getIdentifier());
}
return null;
}
Aggregations