X-Git-Url: https://git.argeo.org/?p=gpl%2Fargeo-suite.git;a=blobdiff_plain;f=knowledge%2Forg.argeo.support.odk%2Fsrc%2Forg%2Fargeo%2Fsupport%2Fodk%2FOdkUtils.java;h=585b897a5197a8a161b60e124d37d5acbeb40096;hp=887d655d516cbb58061d3a0c21fa984f8889d120;hb=df5fdbc43d45908a7aa713bb3c5762cb8dc284c7;hpb=dc577c6d2be1fe28e5c2720ae3cea3d329ec690b diff --git a/knowledge/org.argeo.support.odk/src/org/argeo/support/odk/OdkUtils.java b/knowledge/org.argeo.support.odk/src/org/argeo/support/odk/OdkUtils.java index 887d655..585b897 100644 --- a/knowledge/org.argeo.support.odk/src/org/argeo/support/odk/OdkUtils.java +++ b/knowledge/org.argeo.support.odk/src/org/argeo/support/odk/OdkUtils.java @@ -70,9 +70,12 @@ public class OdkUtils { String path = instanceUri.getPath(); if (!path.endsWith(".xml")) throw new IllegalArgumentException("File uri " + instanceUri + " must end with .xml"); - path = path.substring(0, path.length() - ".xml".length()); + // Work around bug in ODK Collect not supporting paths + // path = path.substring(0, path.length() - ".xml".length()); + // Node target = file.getSession().getNode(path); + String uuid = path.substring(1, path.length() - ".xml".length()); + Node target = file.getSession().getNodeByIdentifier(uuid); // FIXME hard code terms path in order to test ODK Collect bug - Node target = file.getSession().getNode("/example/terms"+path); if (target.isNodeType(NodeType.MIX_REFERENCEABLE)) { file.setProperty(Property.JCR_ID, target); if (file.hasProperty(Property.JCR_PATH))