public class DbkTextInterpreter implements TextInterpreter {
private DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+ private String linkCssClass = DbkType.link.name();
+
@Override
public void write(Item item, String content) {
try {
String href = child.getProperty(DbkAttr.XLINK_HREF).getString();
// TODO deal with other forbidden XML characters?
href = href.replace("&", "&");
- sb.append("<a href=\"").append(href).append("\">");
+ sb.append("<a class='" + linkCssClass + "' href='").append(href).append("'>");
readAsSimpleHtml(child, sb);
sb.append("</a>");
}
public String readSimpleHtml(Item item) {
try {
StringBuilder sb = new StringBuilder();
+// sb.append("<div style='text-align: justify;'>");
readAsSimpleHtml((Node) item, sb);
+// sb.append("</div>");
+// System.out.println(sb);
return sb.toString();
} catch (RepositoryException e) {
throw new JcrException("Cannot convert " + item + " to simple HTML", e);