From 1c8303618e6865a4b3a8715ee217ed557736d9ae Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Wed, 5 Oct 2011 15:09:08 +0000 Subject: [PATCH] Improve JCR git-svn-id: https://svn.argeo.org/commons/trunk@4801 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../src/main/java/org/argeo/jcr/JcrUtils.java | 7 +++++-- .../org/argeo/jcr/tabular/JcrTabularRowIterator.java | 11 +++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/JcrUtils.java b/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/JcrUtils.java index 08f8d55c3..eeaff3a92 100644 --- a/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/JcrUtils.java +++ b/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/JcrUtils.java @@ -39,6 +39,7 @@ import javax.jcr.Node; import javax.jcr.NodeIterator; import javax.jcr.Property; import javax.jcr.PropertyIterator; +import javax.jcr.PropertyType; import javax.jcr.Repository; import javax.jcr.RepositoryException; import javax.jcr.RepositoryFactory; @@ -379,15 +380,17 @@ public class JcrUtils implements ArgeoJcrConstants { NodeIterator it = node.getNodes(); while (it.hasNext()) { Node childNode = it.nextNode(); - debug(childNode); + debug(childNode, log); } // Then output the properties PropertyIterator properties = node.getProperties(); // log.debug("Property are : "); - while (properties.hasNext()) { + properties: while (properties.hasNext()) { Property property = properties.nextProperty(); + if (property.getType() == PropertyType.BINARY) + continue properties;// skip if (property.getDefinition().isMultiple()) { // A multi-valued property, print all values Value[] values = property.getValues(); diff --git a/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/tabular/JcrTabularRowIterator.java b/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/tabular/JcrTabularRowIterator.java index 8223e1d48..47578f61b 100644 --- a/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/tabular/JcrTabularRowIterator.java +++ b/server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/tabular/JcrTabularRowIterator.java @@ -39,7 +39,6 @@ public class JcrTabularRowIterator implements TabularRowIterator { public JcrTabularRowIterator(Node tableNode) { try { - Node contentNode = tableNode.getNode(Property.JCR_CONTENT); for (NodeIterator it = tableNode.getNodes(); it.hasNext();) { Node node = it.nextNode(); if (node.isNodeType(ArgeoTypes.ARGEO_COLUMN)) { @@ -48,13 +47,9 @@ public class JcrTabularRowIterator implements TabularRowIterator { TabularColumn tc = new TabularColumn(node.getProperty( Property.JCR_TITLE).getString(), type); header.add(tc); - // } else if (node.getName().equals(Property.JCR_CONTENT)) { - // contentNode = node; } } - // should not happen since content is mandatory - assert contentNode != null; - + Node contentNode = tableNode.getNode(Property.JCR_CONTENT); if (contentNode.isNodeType(ArgeoTypes.ARGEO_CSV)) { textLines = new ArrayBlockingQueue>(1000); csvParser = new CsvParser() { @@ -168,4 +163,8 @@ public class JcrTabularRowIterator implements TabularRowIterator { return currentRowNumber; } + public List getHeader() { + return header; + } + } -- 2.39.2