|
I'm working on some custom data importing that will use EntityImport if
I can get past a hurdle.
I've tried to simplify this to the bare minimum to reproduce the problem.
The EntityImport XML file contains the following trivial data:
---start---
<TestRoot></TestRoot>
---end---
The EntityImport Freemarker template contains:
---start---
<entity-engine-xml>
<#recurse doc>
</entity-engine-xml>
<#macro @element>
</#macro>
---end---
Obviously, this doesn't actually DO anything, however, it still ought to
visit the TestRoot node. Instead, the log raises an exception:
2017-11-12 23:27:49,140 |jsse-nio-8443-exec-4 |FreeMarkerWorker |E|null
freemarker.core.NonNodeException: For "#recurse" node: Expected a node,
but this has evaluated to an extended_hash+string
(org.apache.xerces.dom.DeferredDocumentImpl wrapped into
f.e.b.StringModel): ==> doc [in template
"file:/home/sysadmin/ofbiz/local/freemarker/RecurseTest.ftl"at line 4,
column 11]
So it's finding "doc", but it doesn't like the type and isn't recursing
to visit the first and only child - TestRoot.
Stepping through the entityImport code, the XML is parsed and added the
to fmcontext hashmap (with key "doc"), and is then passed to the
FreeMarkerWorker.renderTemplate. For some reason my debug setup won't
let me step into the
renderTemplate code to see what's happeningbeyond this.
Can anyone pin-point my problem? It seems like I'm supposed to "unwrap"
the object that "doc" references, but it's not immediately obvious to me
how to do that.
I'm using the latest version of the codebase (well a day or 2 old at most).
|