]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - server/org.argeo.slc.ria/src/argeo-ria-lib/jcr/class/org/argeo/jcr/ria/views/XmlNodeEditor.js
First draft for Jcr nodes data model.
[gpl/argeo-slc.git] / server / org.argeo.slc.ria / src / argeo-ria-lib / jcr / class / org / argeo / jcr / ria / views / XmlNodeEditor.js
diff --git a/server/org.argeo.slc.ria/src/argeo-ria-lib/jcr/class/org/argeo/jcr/ria/views/XmlNodeEditor.js b/server/org.argeo.slc.ria/src/argeo-ria-lib/jcr/class/org/argeo/jcr/ria/views/XmlNodeEditor.js
new file mode 100644 (file)
index 0000000..2493edd
--- /dev/null
@@ -0,0 +1,72 @@
+qx.Class.define("org.argeo.jcr.ria.views.XmlNodeEditor", {\r
+       extend : qx.ui.embed.Html,\r
+       implement : [org.argeo.ria.components.IView], \r
+\r
+       properties : {\r
+               /**\r
+                * The commands definition Map that will be automatically added and wired to the menubar and toolbar.\r
+                * See {@link org.argeo.ria.event.CommandsManager#definitions} for the keys to use for defining commands.\r
+                */\r
+               commands : {\r
+                       init : {}\r
+               },\r
+               viewSelection : {\r
+                       nullable:false, \r
+                       check:"org.argeo.ria.components.ViewSelection"\r
+               },\r
+               instanceId : {\r
+                       init:"XmlEditor",\r
+                       event : "changeInstanceId"\r
+               },\r
+               instanceLabel : {\r
+                       init:"Xml Editor",\r
+                       event : "changeInstanceLabel"\r
+               }\r
+       },\r
+       \r
+       construct : function(){\r
+               this.base(arguments);\r
+       },\r
+       \r
+       members : {\r
+               /**\r
+                * The implementation should contain the GUI initialisation.\r
+                * This is the role of the manager to actually add the graphical component to the pane, \r
+                * so it's not necessary to do it here. \r
+                * @param viewPane {org.argeo.ria.components.ViewPane} The pane manager\r
+                * @param data {Mixed} Any object or data passed by the initiator of the view\r
+                * @return {Boolean}\r
+                */\r
+               init : function(viewPane, data){\r
+                       this.setViewSelection(new org.argeo.ria.components.ViewSelection(viewPane.getViewId()));          \r
+                       this.setHtml("Hello!");\r
+               },\r
+               /**\r
+                * The implementation should contain the real data loading (i.o. query...)\r
+                * @return {Boolean}\r
+                */\r
+               load : function(rootNode){\r
+                       rootNode.load();\r
+                       rootNode.addListener("changeLoadState", function(){\r
+                               var xmlString = rootNode.toXmlString(true);\r
+                               this.setHtml(qx.xml.String.escape(xmlString));\r
+                       }, this);\r
+               },\r
+               /**\r
+                * Whether this component is already contained in a scroller (return false) or not (return true).\r
+                * @return {Boolean}\r
+                */\r
+               addScroll : function(){\r
+                       return true;\r
+               },\r
+               /**\r
+                * Called at destruction time\r
+                * Perform all the clean operations (stopping polling queries, etc.) \r
+                */\r
+               close : function(){\r
+                       \r
+               }               \r
+       }\r
+       \r
+       \r
+});
\ No newline at end of file