Following the example the in the xPlore_1.0_Development_Guide.pdf, I have been able to create a TBO and inject custom data:
@Override
protected void customExportForIndexing(IDfFtExportContext context) throws DfException {
super.customExportForIndexing(context);
Document document = context.getDocument();
NodeList nodes = document.getElementsByTagName(DfFtXmlElementNames.ROOT);
Element rootElem = nodes.getLength() > 0 ? (Element) nodes.item(0) : null;
if (rootElem == null) {
rootElem = document.createElement(DfFtXmlElementNames.ROOT);
document.appendChild(rootElem);
}
nodes = rootElem.getElementsByTagName(DfFtXmlElementNames.CUSTOM);
Element dmftcustom = nodes.getLength() > 0 ? (Element) nodes.item(0) : null;
if (dmftcustom == null) {
dmftcustom = document.createElement(DfFtXmlElementNames.CUSTOM);
rootElem.appendChild(dmftcustom);
}
Element testElement = document.createElement("bnxcustom");
testElement.setTextContent("bnxtext");
dmftcustom.appendChild(testElement);
}
I can verify the data has made it into the XML content using the Documentum xPlore Administrator application:
<dmftcustom summary_tokens="dmftsummarytokens_dmftcustom_9">
<bnxcustom>bnxtext</bnxcustom>
</dmftcustom>
According to the documentation, it appears as though we need to also create a custom index to make this data searchable. However, the example in the document is pretty weak for a beginner. Does anyone out there know how we can create a custom index for this data, so that we might find it using an XQuery similar to this?
for $i score $s in /dmftdoc[. ftcontains 'bnxtest'] order by $s descending return <d> {$i/dmftmetadata//r_object_id} { $i/dmftmetadata//object_name } { $i/dmftmetadata//r_modifier } </d>Thanks,
Brad