18 package org.turro.jpa.serializer;
20 import java.io.IOException;
21 import java.io.StringReader;
22 import java.io.StringWriter;
23 import org.jdom.Document;
24 import org.jdom.JDOMException;
25 import org.jdom.input.SAXBuilder;
26 import org.jdom.output.Format;
27 import org.jdom.output.XMLOutputter;
28 import org.turro.jpa.entity.XMLSerializer;
29 import org.turro.json.JsonSearch;
30 import org.turro.log.WebLoggers;
31 import org.turro.zkoss.dialog.Windows;
32 import org.turro.zkoss.label.PreLabel;
33 import org.zkoss.zk.ui.Page;
41 private Object entity;
52 public void show(Page page) {
54 data = entity ==
null ? data :
new XMLSerializer(entity).serialize();
56 if(data.startsWith(
"<")) {
57 SAXBuilder builder =
new SAXBuilder();
58 Document doc = builder.build(
new StringReader(data.replaceAll(
"&(?![a-z]+;)",
"&")));
59 StringWriter sw =
new StringWriter();
60 Format fm = Format.getPrettyFormat();
61 XMLOutputter xo =
new XMLOutputter(fm);
72 }
else if(data.startsWith(
"{")) {
82 }
catch (Exception ex) {
92 }
catch(Exception ex) {
SerializerMessage(Object entity)
SerializerMessage(String data)
static WebLoggers severe(Object entity)
WebLoggers exception(Throwable throwable)
static Windows title(String title)
Windows addComponent(HtmlBasedComponent component)
Windows width(String width)
Windows height(String height)