use of fi.otavanopisto.muikku.schooldata.events.SchoolDataWorkspaceDiscoveredEvent in project muikku by otavanopisto.
the class AcceptanceTestsRESTService method createWorkspace.
@POST
@Path("/workspaces")
@RESTPermit(handling = Handling.UNSECURED)
public Response createWorkspace(fi.otavanopisto.muikku.atests.Workspace payload) {
SchoolDataWorkspaceDiscoveredEvent event = new SchoolDataWorkspaceDiscoveredEvent(payload.getSchoolDataSource(), payload.getIdentifier(), payload.getName(), null);
schoolDataWorkspaceDiscoveredEvent.fire(event);
WorkspaceEntity workspaceEntity = workspaceEntityController.findWorkspaceEntityById(event.getDiscoveredWorkspaceEntityId());
if (payload.getPublished() != null) {
workspaceEntityController.updatePublished(workspaceEntity, payload.getPublished());
}
return Response.ok(createRestEntity(workspaceEntity, payload.getName())).build();
}
use of fi.otavanopisto.muikku.schooldata.events.SchoolDataWorkspaceDiscoveredEvent in project muikku by otavanopisto.
the class PyramusUpdater method fireWorkspaceDiscovered.
private void fireWorkspaceDiscovered(Course course) {
String identifier = identifierMapper.getWorkspaceIdentifier(course.getId());
Map<String, Object> extra = new HashMap<>();
extra.put("pyramusVariables", course.getVariables());
schoolDataWorkspaceDiscoveredEvent.fire(new SchoolDataWorkspaceDiscoveredEvent(SchoolDataPyramusPluginDescriptor.SCHOOL_DATA_SOURCE, identifier, course.getName(), extra));
}
Aggregations