Improve DocBook support.
[gpl/argeo-suite.git] / publishing / org.argeo.publishing.ui / src / org / argeo / docbook / ui / DocumentTextEditor.java
index 9dc7e1002dea7e68d91f6f4eb1a28532b5a05f75..aeafcd3466557014c529d84fd8a6494c51cdf1e8 100644 (file)
@@ -7,14 +7,15 @@ import javax.jcr.RepositoryException;
 import org.argeo.cms.text.TextSection;
 import org.argeo.cms.ui.CmsEditable;
 import org.argeo.cms.ui.util.CmsUiUtils;
+import org.argeo.jcr.Jcr;
+import org.argeo.jcr.JcrxType;
 import org.eclipse.swt.widgets.Composite;
 
 /** Text editor where sections and subsections can be managed by the user. */
 public class DocumentTextEditor extends AbstractDbkViewer {
        private static final long serialVersionUID = 6049661610883342325L;
 
-       public DocumentTextEditor(Composite parent, int style, Node textNode, CmsEditable cmsEditable)
-                       throws RepositoryException {
+       public DocumentTextEditor(Composite parent, int style, Node textNode, CmsEditable cmsEditable) {
                super(new TextSection(parent, style, textNode), style, cmsEditable);
                refresh();
                getMainSection().setLayoutData(CmsUiUtils.fillWidth());
@@ -23,9 +24,8 @@ public class DocumentTextEditor extends AbstractDbkViewer {
        @Override
        protected void initModel(Node textNode) throws RepositoryException {
                if (isFlat()) {
-                       textNode.addNode(DocBookNames.DBK_PARA, DocBookTypes.PARA)
-                                       .addNode(DocBookNames.JCR_XMLTEXT, DocBookTypes.XMLTEXT)
-                                       .setProperty(DocBookNames.JCR_XMLCHARACTERS, "Hello World!");
+                       textNode.addNode(DocBookNames.DBK_PARA, DocBookTypes.PARA).addNode(Jcr.JCR_XMLTEXT, JcrxType.JCRX_XMLTEXT)
+                                       .setProperty(Jcr.JCR_XMLCHARACTERS, "");
                }
 //             else
 //                     textNode.setProperty(DocBookNames.DBK_TITLE, textNode.getName());