.. java:import:: java.io IOException .. java:import:: java.io OutputStream .. java:import:: java.io Writer .. java:import:: org.caosdb.server CaosDBServer .. java:import:: org.caosdb.server ServerProperties .. java:import:: org.jdom2 Document .. java:import:: org.jdom2 Element .. java:import:: org.jdom2 ProcessingInstruction .. java:import:: org.jdom2.output Format .. java:import:: org.jdom2.output XMLOutputter .. java:import:: org.restlet.data MediaType .. java:import:: org.restlet.data Reference .. java:import:: org.restlet.representation WriterRepresentation JdomRepresentation ================== .. java:package:: org.caosdb.server.resource :noindex: .. java:type:: public class JdomRepresentation extends WriterRepresentation The Restlet Extension (restlet.ext) packages support two implementations of the xml API DOM and SAX - w3c.DOM and oracle's JAXP. Both of them are implementations of API which are not primarily designed for java implementation and thus are a bit awkward to handle. This class provides support for JDOM - an genuine java xml processor (http://www.jdom.org/). It extends restlet.representation.WriterRepresentation and overrides its write(Writer writer) method. This method is called by the Restlet API. It commits a Writer to which the generated \ ``Document document``\ is written by the jdom.outputter.output(document writer) The JdomRepresentation may be implemented as \ ``@Get, @Put, @Delete ...``\ methods in a ServerResource class, which have to return an xml document. :author: Timm Fitschen Constructors ------------ JdomRepresentation ^^^^^^^^^^^^^^^^^^ .. java:constructor:: public JdomRepresentation(Document document, String indent, String xslPath) :outertype: JdomRepresentation Constructor. :param document: A JDOM Document parsed from elsewhere. :param indent: Usually a number of whitespaces for better human readbility. :param xslPath: A String containing a meaningful path to a xslt file. Methods ------- addStyleSheet ^^^^^^^^^^^^^ .. java:method:: protected final void addStyleSheet(Document document, String xslPath) :outertype: JdomRepresentation adds the xslt processing instruction to the document. getWebUIRef ^^^^^^^^^^^ .. java:method:: public static final String getWebUIRef(Reference reference) :outertype: JdomRepresentation write ^^^^^ .. java:method:: @Override public void write(Writer writer) throws IOException :outertype: JdomRepresentation write ^^^^^ .. java:method:: @Override public void write(OutputStream out) throws IOException :outertype: JdomRepresentation