Improve content edition and validation
[lgpl/argeo-commons.git] / jcr / org.argeo.cms.jcr / src / org / argeo / cms / jcr / acr / JcrContentUtils.java
index b8d9e70dec1b6734fedc766a925156d4fc4a8b45..c85e3644190bb50d73d4e4b704cda3084a0d0af4 100644 (file)
@@ -92,7 +92,21 @@ public class JcrContentUtils {
                }
        }
 
-       private static Source toSource(Node node) {
+       private static Source toSource(Node node) throws RepositoryException {
+
+//             try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+//                     node.getSession().exportDocumentView(node.getPath(), out, true, false);
+//                     DocumentBuilder documentBuilder = DocumentBuilderFactory.newNSInstance().newDocumentBuilder();
+//                     Document document;
+//                     try (ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray())) {
+//                             document = documentBuilder.parse(in);
+//                     }
+//                     cleanJcrDom(document);
+//                     return new DOMSource(document);
+//             } catch (IOException | SAXException | ParserConfigurationException e) {
+//                     throw new RuntimeException(e);
+//             }
+
                try (PipedInputStream in = new PipedInputStream();) {
 
                        CompletableFuture<Document> toDo = CompletableFuture.supplyAsync(() -> {