1

following works fine:

XMLDocumentManager docMgr = client.newXMLDocumentManager();

JAXBContext context = JAXBContext.newInstance(Document.class);
JAXBHandle jaxbHandle = new JAXBHandle(context);
docMgr.read(
  "/masters/1337-12/t/1439-1074_2013_2_toc.xml",
  jaxbHandle);

Assert.assertNotNull(jaxbHandle);

Document document = (Document) jaxbHandle.get();

But what I can do if I don't know the document URI and I have to do a search like following:

StructuredQueryBuilder qb = new StructuredQueryBuilder(
  "OPTIONS_NAME");
StructuredQueryDefinition querydef = qb.valueConstraint("tocId",
  tocId);
// contains RAW data - 
StringHandle resultsHandle = queryMgr.search(querydef, new StringHandle());

How can I transform this result with JAXB?

2
  • well..because JAVA API is quite slow (tested now) Ill switch to XCC.. Commented Jul 8, 2013 at 10:17
  • I’d be curious to better understand where the performance of the Java API didn’t meet your expectations. Can you provide more details? Commented Jul 9, 2013 at 23:59

1 Answer 1

2

For a POJO interface to search results, use the built-in SearchHandle class.

JAXB is easiest to use when roundtripping tree data structures from Java objects to XML and back (and thus useful for your own content).

Regarding performance, XCC is faster than the Java API for direct operations on documents. That's why MLCP uses XCC for ingestion. The performance difference is not significant for most applications that interact with the database (especially those that need the value-add services exposed by the REST API).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.