]> 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
48191b259bf422ed0798467c4143deb640aa6ceb
[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 = {slc:"http://argeo.org/projects/slc/schemas"};
16 },
17
18 statics : {
19 LABEL : "JCR Browser",
20 ICON : "org.argeo.slc.ria/utilities-terminal.png"
21 //ROLES_RESTRICTION : ["ROLE_ADMIN"]
22 },
23
24 members : {
25 _splitPane : null,
26
27 initViewPanes : function(viewsManager){
28
29 this._tBar = new org.argeo.ria.components.ViewPane("toolbar", "");
30 this._tBar.header.setVisibility("excluded");
31 viewsManager.getViewPanesContainer().add(this._tBar);
32
33 this._splitPane = new qx.ui.splitpane.Pane("horizontal");
34 var leftPane = new org.argeo.ria.components.ViewPane("treeview", "Tree View");
35 this._splitPane.add(leftPane, 1);
36 var mainPane = new org.argeo.ria.components.ViewPane("fulltree", "Editor View");
37 this._splitPane.add(mainPane, 2);
38 viewsManager.registerViewPane(this._tBar);
39 viewsManager.registerViewPane(mainPane);
40 viewsManager.registerViewPane(leftPane);
41 viewsManager.getViewPanesContainer().add(this._splitPane, {flex:1});
42
43 },
44
45 initViews : function(viewsManager){
46 var nodeProvider = new org.argeo.jcr.ria.provider.XmlNodeProvider();
47 nodeProvider.initProvider({
48 xmlSrc : "/org.argeo.slc.webapp/getJcrItem.jcr?",
49 dynamic : true,
50 pathParameter:"path"
51 });
52 var rootNode = new org.argeo.jcr.ria.model.Node("Root", nodeProvider, true);
53 rootNode.setPath('/slc');
54 var dataModel = new org.argeo.jcr.ria.model.DataModel(rootNode);
55
56 var inputView = viewsManager.initIViewClass(org.argeo.jcr.ria.views.ContextNodeInputView, "toolbar", dataModel);
57 inputView.load();
58
59 var testView = viewsManager.initIViewClass(org.argeo.jcr.ria.views.PlainXmlViewer, "fulltree", dataModel);
60 testView.load();
61
62 var treeView = viewsManager.initIViewClass(org.argeo.jcr.ria.views.TreeView, "treeview", dataModel);
63 treeView.load();
64 },
65
66 remove : function(viewsManager){
67 viewsManager.getViewPanesContainer().remove(this._splitPane);
68 viewsManager.getViewPanesContainer().remove(this._tBar);
69 }
70
71 }
72
73 });