]> git.argeo.org Git - gpl/argeo-slc.git/blob - server/org.argeo.slc.ria/src/argeo-ria-lib/jcr/class/org/argeo/jcr/ria/JcrBrowser.js
5f1e07217b11f8bfa2f257168e9d32d4d9e1bc4d
[gpl/argeo-slc.git] / server / org.argeo.slc.ria / src / argeo-ria-lib / jcr / class / org / argeo / jcr / ria / JcrBrowser.js
1 /**
2 * IPerspective Implementation : Horizontal split pane defining two panes, "list" and "applet".
3 */
4
5 /* ************************************************************************
6
7 ************************************************************************ */
8 qx.Class.define("org.argeo.jcr.ria.JcrBrowser",
9 {
10 extend : qx.core.Object,
11 implement : [org.argeo.ria.components.IPerspective],
12
13 construct : function(){
14 this.base(arguments);
15 org.argeo.ria.util.Element.DEFAULT_NAMESPACE_MAP =
16 {
17 slc:"http://argeo.org/projects/slc/schemas",
18 fn:"http://www.w3.org/2005/xpath-functions",
19 fn_old:"http://www.w3.org/2004/10/xpath-functions",
20 xs:"http://www.w3.org/2001/XMLSchema" ,
21 jcr:"http://www.jcp.org/jcr/1.0" ,
22 mix:"http://www.jcp.org/jcr/mix/1.0",
23 sv:"http://www.jcp.org/jcr/sv/1.0" ,
24 rep:"internal" ,
25 nt:"http://www.jcp.org/jcr/nt/1.0"
26 };
27 },
28
29 statics : {
30 LABEL : "JCR Browser (Tech Preview)",
31 ICON : "org.argeo.slc.ria/utilities-terminal.png"/*,
32 ACCESS : "!ROLE_ANONYMOUS"*/
33 },
34
35 members : {
36 _splitPane : null,
37
38 initViewPanes : function(viewsManager){
39
40 this._tBar = new org.argeo.ria.components.ViewPane("toolbar", "");
41 this._tBar.header.setVisibility("excluded");
42 viewsManager.getViewPanesContainer().add(this._tBar);
43
44 this._splitPane = new qx.ui.splitpane.Pane("horizontal");
45 var leftPane = new org.argeo.ria.components.TabbedViewPane("treeview", "Tree View");
46 this._splitPane.add(leftPane, 1);
47 var mainPane = new org.argeo.ria.components.TabbedViewPane("editor", "Editor View", true);
48 this._splitPane.add(mainPane, 2);
49 viewsManager.registerViewPane(this._tBar);
50 viewsManager.registerViewPane(mainPane);
51 viewsManager.registerViewPane(leftPane);
52 viewsManager.getViewPanesContainer().add(this._splitPane, {flex:1});
53
54 },
55
56 initViews : function(viewsManager){
57 var nodeProvider = new org.argeo.jcr.ria.provider.XmlNodeProvider();
58 nodeProvider.initProvider({
59 xmlSrc : "/org.argeo.slc.webapp/getJcrItem.jcr?",
60 dynamic : true,
61 pathParameter:"path"
62 });
63 var rootNode = new org.argeo.jcr.ria.model.Node("Root", nodeProvider, true);
64 rootNode.setPath('/slc');
65 var dataModel = new org.argeo.jcr.ria.model.DataModel(rootNode);
66
67 var inputView = viewsManager.initIViewClass(org.argeo.jcr.ria.views.ContextNodeInputView, "toolbar", dataModel);
68 inputView.load();
69
70 /*
71 var testView = viewsManager.initIViewClass(org.argeo.jcr.ria.views.PlainXmlViewer, "fulltree", dataModel);
72 testView.load();
73 */
74 var listView = viewsManager.initIViewClass(org.argeo.jcr.ria.views.ListView, "editor", dataModel);
75 listView.load();
76
77 var treeView = viewsManager.initIViewClass(org.argeo.jcr.ria.views.TreeView, "treeview", dataModel);
78 treeView.load();
79
80 dataModel.requireContextChange();
81 },
82
83 remove : function(viewsManager){
84 viewsManager.getViewPanesContainer().remove(this._splitPane);
85 viewsManager.getViewPanesContainer().remove(this._tBar);
86 }
87
88 }
89
90 });