@Path("/{elementUri}/jsonld") @GET @Produces(MediaType.TEXT_PLAIN) @Override public String getAsJsonLd(@PathParam("elementUri") String elementUri) { try { return toJsonLd(getPipelineElementRdfStorage().getSEPAById(elementUri)); } catch (URISyntaxException e) { return toJson(constructErrorMessage(Notifications.create(NotificationType.UNKNOWN_ERROR, e.getMessage()))); } }
@DELETE @Path("/own/{elementUri}") @RequiresAuthentication @Produces(MediaType.APPLICATION_JSON) @GsonWithIds @Override public Response removeOwn(@PathParam("username") String username, @PathParam("elementUri") String elementUri) { try { getUserService().deleteOwnSepa(username, elementUri); getPipelineElementRdfStorage().deleteSEPA(getPipelineElementRdfStorage().getSEPAById(elementUri)); } catch (URISyntaxException e) { return constructErrorMessage(Notifications.create(NotificationType.STORAGE_ERROR, e.getMessage())); } return constructSuccessMessage(NotificationType.STORAGE_SUCCESS.uiNotification()); }
@Path("{id}/jsonld") @GET @Produces(MediaType.TEXT_PLAIN) public Response getActionAsJsonLd(@PathParam("id") String elementId) { IPipelineElementDescriptionStorage requestor = getPipelineElementRdfStorage(); elementId = decode(elementId); try { if (requestor.getSEPAById(elementId) != null) { return ok(toJsonLd(requestor.getSEPAById(elementId))); } else if (requestor.getSEPById(elementId) != null) { return ok(toJsonLd(requestor.getSEPById(elementId))); } else if (requestor.getSECById(elementId) != null) { return ok(toJsonLd(requestor.getSECById(elementId))); } else { return ok(Notifications.create(NotificationType.UNKNOWN_ERROR)); } } catch (URISyntaxException e) { return constructErrorMessage(new Notification(NotificationType.UNKNOWN_ERROR.title(), NotificationType.UNKNOWN_ERROR.description(), e.getMessage())); } } }