use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class WorkspaceEntityController method findWorkspaceEntityIdsByIdentifiers.
public Set<Long> findWorkspaceEntityIdsByIdentifiers(Collection<SchoolDataIdentifier> identifiers) {
Set<Long> result = new HashSet<>();
Map<String, Set<String>> groupedIdentifiers = new HashMap<>();
for (SchoolDataIdentifier identifier : identifiers) {
Set<String> groupIdentifiers = groupedIdentifiers.get(identifier.getDataSource());
if (groupIdentifiers == null) {
groupIdentifiers = new HashSet<>();
groupedIdentifiers.put(identifier.getDataSource(), groupIdentifiers);
}
groupIdentifiers.add(identifier.getIdentifier());
}
for (String dataSource : groupedIdentifiers.keySet()) {
Set<String> groupIdentifiers = groupedIdentifiers.get(dataSource);
SchoolDataSource schoolDataSource = schoolDataSourceDAO.findByIdentifier(dataSource);
if (schoolDataSource != null) {
result.addAll(workspaceEntityDAO.listIdsByDataSourceAndIdentifiers(schoolDataSource, groupIdentifiers));
} else {
logger.severe("Could not find school data source: " + dataSource);
}
}
return result;
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class WorkspaceSchoolDataController method findWorkspaceEntity.
/* Workspace Entities */
public WorkspaceEntity findWorkspaceEntity(Workspace workspace) {
SchoolDataSource schoolDataSource = schoolDataSourceDAO.findByIdentifier(workspace.getSchoolDataSource());
WorkspaceEntity workspaceEntity = workspaceEntityDAO.findByDataSourceAndIdentifier(schoolDataSource, workspace.getIdentifier());
return workspaceEntity;
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class WorkspaceSchoolDataController method createWorkspace.
/* Workspaces */
public Workspace createWorkspace(String schoolDataSourceIdentifier, String name, String description, WorkspaceType type, String courseIdentifierIdentifier) {
SchoolDataSource schoolDataSource = schoolDataSourceDAO.findByIdentifier(schoolDataSourceIdentifier);
WorkspaceSchoolDataBridge workspaceBridge = getWorkspaceBridge(schoolDataSource);
if (workspaceBridge != null) {
return workspaceBridge.createWorkspace(name, description, type, courseIdentifierIdentifier);
} else {
logger.log(Level.SEVERE, "School Data Bridge not found: " + schoolDataSource);
}
return null;
}
use of fi.otavanopisto.muikku.model.base.SchoolDataSource in project muikku by otavanopisto.
the class GradingSchoolDataController method listWorkspaceAssessmentRequests.
public List<WorkspaceAssessmentRequest> listWorkspaceAssessmentRequests(String schoolDataSource, String workspaceIdentifier, String studentIdentifier) {
SchoolDataSource dataSource = schoolDataSourceDAO.findByIdentifier(schoolDataSource);
GradingSchoolDataBridge schoolDataBridge = getGradingBridge(dataSource);
if (schoolDataBridge != null) {
return schoolDataBridge.listWorkspaceAssessmentRequests(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 GradingSchoolDataController method updateWorkspaceAssessmentRequest.
public WorkspaceAssessmentRequest updateWorkspaceAssessmentRequest(String schoolDataSource, String identifier, String workspaceUserIdentifier, String workspaceUserSchoolDataSource, String workspaceIdentifier, String studentIdentifier, String requestText, Date date, Boolean archived, Boolean handled) {
SchoolDataSource dataSource = schoolDataSourceDAO.findByIdentifier(schoolDataSource);
GradingSchoolDataBridge schoolDataBridge = getGradingBridge(dataSource);
if (schoolDataBridge != null) {
return schoolDataBridge.updateWorkspaceAssessmentRequest(identifier, workspaceUserIdentifier, workspaceUserSchoolDataSource, workspaceIdentifier, studentIdentifier, requestText, date, archived, handled);
} else {
logger.log(Level.SEVERE, "School Data Bridge could not be found for data source: " + dataSource.getIdentifier());
}
return null;
}
Aggregations