public DocumentAccessor call() throws Exception { return docMgr.removeDocument(uri, context); } });
} else if (command.equals(cmd_remove_document)) { String uri = getDocumentUri(params); result = getDocumentManagement().removeDocument(uri, props); } else if (command.equals(cmd_remove_cln_documents)) { String pattern = (String) params.get("pattern");
public boolean removeDocument(String uri) { try { xRepo.getDocumentManagement().removeDocument(uri, null); return true; } catch (BagriException ex) { return false; } }
@Override public void deleteDocument(String uri) throws BagriException { xRepo.getDocumentManagement().removeDocument(uri, null); }
@DELETE @Path("/{uri}") @Produces(MediaType.APPLICATION_JSON) @ApiOperation(value = "deleteDocument: deletes Document by its uri") public Response deleteDocument(@PathParam("uri") String uri) { DocumentManagement docMgr = getDocManager(); try { docMgr.removeDocument(uri, null); return Response.ok(uri).build(); } catch (Exception ex) { logger.error("deleteDocument.error", ex); throw new WebApplicationException(ex, Status.INTERNAL_SERVER_ERROR); //return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(ex.getMessage()).build(); } }
public void removeDocumentTest(String uri) throws Exception { Properties props = getDocumentProperties(); getDocManagement().removeDocument(uri, props); }
@ManagedOperation(description="Remove Document") @ManagedOperationParameters({ @ManagedOperationParameter(name = "uri", description = "Document identifier"), @ManagedOperationParameter(name = "properties", description = "A list of properties in key=value form separated by semicolon")}) public boolean removeDocument(String uri, String properties) { try { docManager.removeDocument(uri, propsFromString(properties)); return true; } catch (Exception ex) { logger.error("removeDocument.error: {}", ex.getMessage(), ex); throw new RuntimeException(ex.getMessage()); } }
@Override public DocumentAccessor call() throws Exception { checkPermission(Permission.Value.modify); TransactionIsolation tiLevel = ((SchemaRepositoryImpl) repo).getTransactionLevel(context); if (tiLevel == null) { return docMgr.removeDocument(uri, context); } txMgr.callInTransaction(txId, false, tiLevel, new Callable<DocumentAccessor>() { public DocumentAccessor call() throws Exception { return docMgr.removeDocument(uri, context); } }); return null; }
@Override public Sequence call(XPathContext context, Sequence[] arguments) throws XPathException { String uri = arguments[0].head().getStringValue(); Properties props = null; if (arguments.length > 1) { props = sequence2Properties(arguments[1]); } try { xdm.removeDocument(uri, props); return new AnyURIValue(uri); } catch (BagriException ex) { throw new XPathException(ex); } } };
XQItemAccessor item = getBoundItem(params, "uri"); String uri = item.getAtomicValue(); dMgr.removeDocument(uri, null); return Collections.emptyIterator(); } else {
protected void removeDocumentsTest() throws Exception { if (getTxManagement().isInTransaction()) { getTxManagement().finishCurrentTransaction(true); } long txId = getTxManagement().beginTransaction(); Properties props = getDocumentProperties(); for (String uri: uris) { getDocManagement().removeDocument(uri, props); } uris.clear(); getTxManagement().commitTransaction(txId); }