The Assembler
serializes content items, including any Workbench content, as XML in the
Workbench (or on a file system in a production environment). This XML is
deserialized during an
assemble()
call when retrieving a content item to pass it
to its cartridge handler.
You can also use the included classes to serialize the Assembler response to a format that is more convenient for use in your front end application. For example:
// Invoke the Assembler on myContentItem ContentItem responseContentItem = assembler.assemble(myContentItem); // Serialize the Assembler response to JSON response.setCharacterEncoding("UTF-8"); JsonSerializer serializer = new JsonSerializer(response.getWriter()); serializer.write(responseContentItem);
When Assembler is deployed as a service, the Assembler service web application needs to specify a serializer that will be used for the response.
Note
The Assembler includes default implementations of a
JSONResponseWriter
and an
XMLResponseWriter
. You can provide your own
implementation if you need to output the Assembler response to a different
format (such as a different XML representation).
For detailed information, refer to the documentation for the
com.endeca.infront.serialization
package in the
Assembler Core API Reference (Javadoc).