@Override public boolean deleteSEP(String rdfId) { boolean success = sesameStorage.deleteSEP(rdfId); initializeSEPStorage(); return success; }
@Path("/{id}") @DELETE @Produces(MediaType.APPLICATION_JSON) public Response deleteElement(@PathParam("username") String username, @PathParam("id") String elementId) { UserService userService = getUserService(); IPipelineElementDescriptionStorage requestor = getPipelineElementRdfStorage(); try { if (requestor.getSEPAById(elementId) != null) { requestor.deleteSEPA(requestor.getSEPAById(elementId)); userService.deleteOwnSepa(username, elementId); } else if (requestor.getSEPById(elementId) != null) { requestor.deleteSEP(requestor.getSEPById(elementId)); userService.deleteOwnSource(username, elementId); } else if (requestor.getSECById(elementId) != null) { requestor.deleteSEC(requestor.getSECById(elementId)); userService.deleteOwnAction(username, elementId); } else { return constructErrorMessage(new Notification(NotificationType.STORAGE_ERROR.title(), NotificationType.STORAGE_ERROR.description())); } } catch (URISyntaxException e) { return constructErrorMessage(new Notification(NotificationType.STORAGE_ERROR.title(), NotificationType.STORAGE_ERROR.description())); } return constructSuccessMessage(NotificationType.STORAGE_SUCCESS.uiNotification()); }
@Override public boolean deleteSEP(DataSourceDescription sep) { boolean success = sesameStorage.deleteSEP(sep); initializeSEPStorage(); return success; }
@Override public boolean deleteSEPA(String rdfId) { boolean success = sesameStorage.deleteSEP(rdfId); initializeSEPAStorage(); return success; }
@Override public boolean deleteSEP(DataSourceDescription sep) { boolean success = sesameStorage.deleteSEP(sep); initializeSEPStorage(); return success; }
@Override public boolean deleteSEP(String rdfId) { boolean success = sesameStorage.deleteSEP(rdfId); initializeSEPStorage(); return success; }
@Override public boolean deleteSEPA(String rdfId) { boolean success = sesameStorage.deleteSEP(rdfId); initializeSEPAStorage(); return success; }
@Path("/delete") @POST @Produces(MediaType.APPLICATION_JSON) public Response deleteElement(@PathParam("username") String username, @FormParam("uri") String uri) { // URI myUri = uri.getBaseUri(); // String id = myUri.toString() + "v2/adapter/all/" + elementId; UserService userService = getUserService(); IPipelineElementDescriptionStorage requestor = getPipelineElementRdfStorage(); logger.info("User " + username + " deletes element with URI: " + uri + " from triplestore"); try { if (requestor.getSEPById(uri) != null) { requestor.deleteSEP(requestor.getSEPById(uri)); userService.deleteOwnSource(username, uri); } else return constructErrorMessage(new Notification(NotificationType.STORAGE_ERROR.title(), NotificationType.STORAGE_ERROR.description())); } catch (URISyntaxException e) { return constructErrorMessage(new Notification(NotificationType.STORAGE_ERROR.title(), NotificationType.STORAGE_ERROR.description())); } return constructSuccessMessage(NotificationType.STORAGE_SUCCESS.uiNotification()); }