import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.Value;
+import javax.jcr.nodetype.NodeType;
import javax.jcr.query.Query;
import javax.jcr.query.QueryResult;
else
currentNode = currentNode.addNode(part);
if (versioning)
- currentNode.addMixin(ArgeoJcrConstants.MIX_VERSIONABLE);
+ currentNode.addMixin(NodeType.MIX_VERSIONABLE);
if (log.isTraceEnabled())
log.debug("Added folder " + part + " as " + current);
} else {
// First output the node path
log.debug(node.getPath());
// Skip the virtual (and large!) jcr:system subtree
- if (node.getName().equals(ArgeoJcrConstants.JCR_SYSTEM)) {
+ if (node.getName().equals("jcr:system")) {
return;
}
try {
Iterator<String> pit = properties.iterator();
- while (pit.hasNext()) {
+ props: while (pit.hasNext()) {
String name = pit.next();
- if (!observed.hasProperty(name)) {
+ if (!reference.hasProperty(name)) {
+ if (!observed.hasProperty(name))
+ continue props;
+ Value val = observed.getProperty(name).getValue();
+ try {
+ // empty String but not null
+ if ("".equals(val.getString()))
+ continue props;
+ } catch (Exception e) {
+ // not parseable as String, silent
+ }
+ PropertyDiff pDiff = new PropertyDiff(PropertyDiff.ADDED,
+ name, null, val);
+ diffs.put(name, pDiff);
+ } else if (!observed.hasProperty(name)) {
PropertyDiff pDiff = new PropertyDiff(PropertyDiff.REMOVED,
name, reference.getProperty(name).getValue(), null);
diffs.put(name, pDiff);
- } else if (!reference.hasProperty(name)) {
- PropertyDiff pDiff = new PropertyDiff(PropertyDiff.ADDED,
- name, null, observed.getProperty(name).getValue());
- diffs.put(name, pDiff);
} else {
Value referenceValue = reference.getProperty(name)
.getValue();