use of com.remswork.project.alice.resource.links.ProjectResultResourceLinks in project classify-system by anverliedoit.
the class ProjectResultResource method deleteProjectResult.
@DELETE
public Response deleteProjectResult(@PathParam("projectId") long projectId) {
try {
ProjectResultResourceLinks resultResourceLinks = new ProjectResultResourceLinks(uriInfo);
ProjectResult result = projectService.deleteProjectResultByProjectAndStudentId(projectId, studentId);
result.addLink(resultResourceLinks.self(result.getId()));
return Response.status(Response.Status.OK).entity(result).build();
} catch (GradingFactorException e) {
e.printStackTrace();
Message message = new Message(400, "Bad Request", e.getMessage());
return Response.status(Response.Status.BAD_REQUEST).entity(message).build();
}
}
use of com.remswork.project.alice.resource.links.ProjectResultResourceLinks in project classify-system by anverliedoit.
the class ProjectResultResource method addProjectResult.
@POST
public Response addProjectResult(@QueryParam("score") int score, @PathParam("projectId") long projectId) {
try {
ProjectResultResourceLinks resultResourceLinks = new ProjectResultResourceLinks(uriInfo);
ProjectResult result = projectService.addProjectResult(score, projectId, studentId);
result.addLink(resultResourceLinks.self(result.getId()));
return Response.status(Response.Status.OK).entity(result).build();
} catch (GradingFactorException e) {
e.printStackTrace();
Message message = new Message(404, "Not Found", e.getMessage());
return Response.status(Response.Status.NOT_FOUND).entity(message).build();
}
}
use of com.remswork.project.alice.resource.links.ProjectResultResourceLinks in project classify-system by anverliedoit.
the class ProjectResultResource method updateProjectResult.
@PUT
public Response updateProjectResult(@PathParam("projectId") long projectId, @QueryParam("score") int score) {
try {
ProjectResultResourceLinks resultResourceLinks = new ProjectResultResourceLinks(uriInfo);
ProjectResult result = projectService.updateProjectResultByProjectAndStudentId(score, projectId, studentId);
result.addLink(resultResourceLinks.self(result.getId()));
return Response.status(Response.Status.OK).entity(result).build();
} catch (GradingFactorException e) {
e.printStackTrace();
Message message = new Message(400, "Bad Request", e.getMessage());
return Response.status(Response.Status.NOT_FOUND).entity(message).build();
}
}
use of com.remswork.project.alice.resource.links.ProjectResultResourceLinks in project classify-system by anverliedoit.
the class ProjectResultResource method getProjectResult.
@GET
public Response getProjectResult(@PathParam("projectId") long projectId) {
try {
ProjectResultResourceLinks resultResourceLinks = new ProjectResultResourceLinks(uriInfo);
ProjectResult result = projectService.getProjectResultByProjectAndStudentId(projectId, studentId);
result.addLink(resultResourceLinks.self(result.getId()));
return Response.status(Response.Status.OK).entity(result).build();
} catch (GradingFactorException e) {
e.printStackTrace();
Message message = new Message(404, "Not Found", e.getMessage());
return Response.status(Response.Status.NOT_FOUND).entity(message).build();
}
}
Aggregations