geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r998934 - in /geronimo/server/branches/2.2/plugins: console/console-portal-driver/src/main/i18n-resources/ console/console-portal-driver/src/main/java/org/apache/geronimo/console/navigation/ console/console-portal-driver/src/main/webapp/WEB...
Date Mon, 20 Sep 2010 14:01:28 GMT
Author: genspring
Date: Mon Sep 20 14:01:28 2010
New Revision: 998934

URL: http://svn.apache.org/viewvc?rev=998934&view=rev
Log:
GERONIMO-5516 Add isAdvanced properties to AdminConsoleExtensionGBean

Added:
    geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/js/navigation.js
Modified:
    geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/i18n-resources/portaldriver_en.properties
    geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/i18n-resources/portaldriver_zh.properties
    geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/java/org/apache/geronimo/console/navigation/NavigationJsonGenerator.java
    geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp
    geronimo/server/branches/2.2/plugins/console/console-tomcat/src/main/plan/plan.xml
    geronimo/server/branches/2.2/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/AdminConsoleExtensionGBean.java
    geronimo/server/branches/2.2/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/impl/PageConfig.java

Modified: geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/i18n-resources/portaldriver_en.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/i18n-resources/portaldriver_en.properties?rev=998934&r1=998933&r2=998934&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/i18n-resources/portaldriver_en.properties
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/i18n-resources/portaldriver_en.properties
Mon Sep 20 14:01:28 2010
@@ -30,3 +30,5 @@ console.login.welcome                   
 console.login_error.invalid               = Invalid User Name and/or Password!
 console.login_success.loginSuccessful     = Login Successful
 console.login_success.returnToPortalTests = Click here to return to the portal tests.
+console.mode.basic                        =Basic
+console.mode.advanced                     =Advanced

Modified: geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/i18n-resources/portaldriver_zh.properties
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/i18n-resources/portaldriver_zh.properties?rev=998934&r1=998933&r2=998934&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/i18n-resources/portaldriver_zh.properties
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/i18n-resources/portaldriver_zh.properties
Mon Sep 20 14:01:28 2010
@@ -30,3 +30,5 @@ console.login.welcome                   
 console.login_error.invalid               = 无效的用户名或密码!
 console.login_success.loginSuccessful     = 登录成功
 console.login_success.returnToPortalTests = 点击这里返回到portal测试页面。
+console.mode.basic                        =普通
+console.mode.advanced                     =高级 

Modified: geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/java/org/apache/geronimo/console/navigation/NavigationJsonGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/java/org/apache/geronimo/console/navigation/NavigationJsonGenerator.java?rev=998934&r1=998933&r2=998934&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/java/org/apache/geronimo/console/navigation/NavigationJsonGenerator.java
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/java/org/apache/geronimo/console/navigation/NavigationJsonGenerator.java
Mon Sep 20 14:01:28 2010
@@ -92,7 +92,39 @@ public class NavigationJsonGenerator {
         sb.append("\n]");
         return sb.toString();
     }
-    
+    public String generateTreeJSON(List<PageConfig> pageConfigList, String contextPath,
String DefaultIcon,String mode) {
+        
+        Map<String, TreeNode> navigationTree = new TreeMap<String, TreeNode>();
+        
+        for (PageConfig pc : pageConfigList) {
+        	if(pc.getMode()!=null&&mode.equals(pc.getMode())){
+	            try {
+	                new TreeNode(pc).populateTree(navigationTree);
+	            } catch (Exception e) {
+	                log.error(e.getMessage(),e);
+	                continue;
+	            }
+        	}
+        }
+
+        StringBuffer sb = new StringBuffer(10);
+        sb.append("[");
+        
+        
+        for (TreeNode node : navigationTree.values()) {
+
+            if (node.isTopNode()) {
+                sb.append("\n");
+                appendNodeToTreeJSON(sb, node, contextPath, DefaultIcon);
+            }
+
+        }
+        //remove the extra ','
+        sb.deleteCharAt(sb.length()-1);
+
+        sb.append("\n]");
+        return sb.toString();
+    }
     private void appendNodeToTreeJSON(StringBuffer sb, TreeNode node, String contextPath,
String DefaultIcon) {
 
         sb.append("{");
@@ -158,6 +190,37 @@ public class NavigationJsonGenerator {
         return sb.toString();
     }
 
+    public String generateQuickLauncherJSON(List<PageConfig> pageConfigList, String
contextPath, String DefaultIcon,String mode) {
+        
+        Map<String, TreeNode> navigationTree = new TreeMap<String, TreeNode>();
+        
+        for (PageConfig pc : pageConfigList) {
+        	if(pc.getMode()!=null&&mode.equals(pc.getMode())){
+	            try {
+	                new TreeNode(pc).populateTree(navigationTree);
+	            } catch (Exception e) {
+	                log.error(e.getMessage(),e);
+	                continue;
+	            }
+        	}
+        }
+
+        StringBuffer sb = new StringBuffer(10);
+        sb.append("[\n");
+        
+        for (TreeNode node : navigationTree.values()) {
+
+            if (node.isTopNode()) {
+                appendNodeToQuickLauncherJSON(sb, node, contextPath, DefaultIcon);
+            }
+
+        }
+        //remove the extra ','
+        sb.deleteCharAt(sb.length()-1);
+
+        sb.append("\n]");
+        return sb.toString();
+    }
     private void appendNodeToQuickLauncherJSON(StringBuffer sb, TreeNode node, String contextPath,
String DefaultIcon) {
 
         if (node.isLeafNode()) {

Modified: geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp?rev=998934&r1=998933&r2=998934&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp
(original)
+++ geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/themes/navigation.jsp
Mon Sep 20 14:01:28 2010
@@ -40,35 +40,43 @@ limitations under the License.
 <%
     NavigationJsonGenerator generator = new NavigationJsonGenerator(request.getLocale());
     String treeJson = generator.generateTreeJSON(pageConfigList, request.getContextPath(),
"/images/ico_doc_16x16.gif");
+    String treeJsonBasic = generator.generateTreeJSON(pageConfigList, request.getContextPath(),
"/images/ico_doc_16x16.gif","basic");
     String listJson = generator.generateQuickLauncherJSON(pageConfigList, request.getContextPath(),
"/images/ico_doc_16x16.gif");
+    String listJsonBasic = generator.generateQuickLauncherJSON(pageConfigList, request.getContextPath(),
"/images/ico_doc_16x16.gif","basic");
 %>
 
 <table class="tundra" width="200px" border="0" cellpadding="0" cellspacing="0">
     <tr>
-        <td CLASS="ReallyDarkBackground"><strong>&nbsp;<fmt:message  
 key="Console Navigation" /></strong></td>
+        <td CLASS="ReallyDarkBackground"><strong>&nbsp;<fmt:message  
 key="Console Navigation"/></strong></td>
     </tr>
     <tr>
-        <td>&nbsp;</td>
+        <td>&nbsp;<input type="radio" name="mode" id ="mode" checked="checked"
onclick="changeMode()"/><fmt:bundle basename="portaldriver"><fmt:message key="console.mode.basic"/></fmt:bundle>
+                  <input type="radio"  name="mode" id ="mode" onclick="changeMode()"/><fmt:bundle
basename="portaldriver"><fmt:message key="console.mode.advanced"/></fmt:bundle>
+        </td>
     </tr>
-    <tr>
+    <tr><td>&nbsp;&nbsp;</td></tr>
+    <tr id="tquickLauncher" style="display:none;">
         <td>&nbsp;&nbsp;<input id="quickLauncher"></td>
     </tr>
     <tr>
-        <td>&nbsp;&nbsp;<div id="navigationTree"></div>
+        <td>&nbsp;&nbsp;<div id="navigationTreeBasic"></div><div
id="navigationTreeAdvanced"></div>
         </td>
     </tr>
 </table>
-
-<script type="text/javascript">
-
-<%-- scripts to create the navigation tree--%>
-
+<script language="Javascript" src="<%=request.getContextPath()%>/js/navigation.js"
type="text/javascript"></script>
+<script language="Javascript">
    dojo.require("dojo.data.ItemFileReadStore");
    dojo.require("dijit.form.FilteringSelect");
    dojo.require("dijit.Tree");
-
    var treeData = <%=treeJson%>;
+   var treeDataBasic =<%=treeJsonBasic%>;
    var listData = <%=listJson%>;
+   var listDataBasic = <%=listJsonBasic%>;
+   var treeModel="";
+   var navigationTreeBasic="";
+   var navigationTreeAdvanced="";
+   var filterSelect="";
+   
    var treeStore = new dojo.data.ItemFileReadStore
     ({
          data: {
@@ -77,6 +85,14 @@ limitations under the License.
              items: treeData
              }
      });
+   var treeStoreBasic = new dojo.data.ItemFileReadStore
+    ({
+         data: {
+             identifier: 'id',
+             label: 'label',
+             items: treeDataBasic
+             }
+     });
     var listStore = new dojo.data.ItemFileReadStore({
        data: {
            identifier: 'name',
@@ -84,169 +100,12 @@ limitations under the License.
            items: listData
            }
     });
-function load() {
-      
-   var treeModel = new dijit.tree.ForestStoreModel({
-       store: treeStore
-   });
-       
-   var navigationTree = new dijit.Tree
-           (
-         {  model: treeModel,
-            showRoot: false,
-            openOnClick: true,
-            onClick: function(treeNodeItem,treeNode) {
-            
-            var anchorNode=treeNode.labelNode.childNodes[2];
-
-             if(anchorNode)
-                {
-                 displayPortlets(anchorNode.href);
-                }                     
-            },
-            _createTreeNode: function(args) {
-                    var tnode = new dijit._TreeNode(args);
-                    tnode.labelNode.innerHTML = args.label;
-                    return tnode;
-                }
-         },
-         dojo.byId("navigationTree")
-       );
-
-
-   var filterSelect = new dijit.form.FilteringSelect
-       (
-          {
-           id: "quickLauncher",
-           store: listStore,
-           searchAttr: "name",
-           name: "quickLauncher",
-           promptMessage: "type and press enter to quick launch",
-           labelAttr: "label",
-           labelType: "html",
-           onKeyPress: function(event){        
-               if(event.charCode!=dojo.keys.ENTER) return;
-                   quickLaunchPortlets(this.value);      
-           },
-           onChange: function(event){
-               quickLaunchPortlets(this.value);
-           }
-         },
-         dojo.byId("quickLauncher")
-         );
-  }
-
-    function quickLaunchPortlets(portalPageName){
-        listStore.fetchItemByIdentity({identity:portalPageName,
-            onItem:function(item){
-                var iframeHref = listStore.getValue(item,"href");
-                displayPortlets(iframeHref);
+    var listStoreBasic = new dojo.data.ItemFileReadStore({
+        data: {
+            identifier: 'name',
+            label: 'label',
+            items: listDataBasic
             }
-        });
-        if(dijit.byId("navigationTree")){
-            findAndSelect(portalPageName,dijit.byId("navigationTree").rootNode);
-        }
-    }
-
-    function displayPortlets(iframeHref){
-    
-        //var iframeHref = anchor.href;
-
-        if(document.location.href.indexOf(iframeHref)==0){      
-            iframeHref=document.location.href.substring(0,document.location.href.indexOf("?"));
-        }
-        
-        dojo.io.iframe.setSrc(document.getElementById("portletsFrame"), iframeHref+"?formId="+formID,
true);
-               
-         try {
-            objToResize=getIframeObjectToResize();
-            <%-- reset the height of iframe page each time the new portlet is loaded--%>
-            objToResize.height = 400;
-              }
-          catch(err){
-            window.status = err.message;
-          }
-          
-        setTimeout('returnToTop()', 30);      
-     }
-     
-    function returnToTop(){
-        window.scrollTo(0,0);
-        return false;
-     }
-     
-       
-
-    dojo.addOnLoad(load);
-   
-
-<%-- scripts to expand  and select tree node automatically when open menu item from quick
launcher --%>
-
-   
-function findAndSelect(key, rootNode)
-    {
-        
-        var pathToExpandItems = [];
-
-        if(findRecur(rootNode.item.children, key, pathToExpandItems))
-        {
-            select(pathToExpandItems);
-        } 
-    }
-
-
-function findRecur(items, key, pathToExpandItems) 
-    {
-        for (var child = 0; child < items.length; child++) {
-
-            pathToExpandItems.push(items[child]);
-            var label = treeStore.getLabel(items[child]);
-            if (label && label.indexOf(key) != -1)
-                return true;
-
-            if (items[child].children && findRecur(items[child].children, key, pathToExpandItems))
-                return true;
-            pathToExpandItems.pop();
-        }
-        return false;
-    }
-    
-function select(pathToExpandItems)
-    {
-    
-    var navigationTree=dijit.byId("navigationTree");
-        var i;
-        function expandParent(node)
-        {
-            if(node && !node.isExpanded)
-            {
-                expandParent(node.getParent());
-                navigationTree._expandNode(node);
-            }
-        }
-        //make sure the ancestor node expanded before
-         var firstNode = getTreeNode(navigationTree,pathToExpandItems[0],treeStore);    

-         expandParent(firstNode.getParent());
-        
-        for (i = 0;;i++) {
-            node  = getTreeNode(navigationTree,pathToExpandItems[i],treeStore);
-            if(i < pathToExpandItems.length-1)
-                navigationTree._expandNode(node);
-            else 
-            {
-                navigationTree.focusNode(node);
-                return node;
-            }
-        }
-    }
-    
-   function getTreeNode(tree,item,treeStore){
-   
-        var wrapperNode =tree._itemNodesMap[treeStore.getIdentity(item)];
-        return wrapperNode[0];
-   } 
- 
-        
+     });
+    dojo.addOnLoad(function() { createNavigationTree(treeStoreBasic,listStoreBasic,"basic");
});
 </script>
-
-

Added: geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/js/navigation.js
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/js/navigation.js?rev=998934&view=auto
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/js/navigation.js
(added)
+++ geronimo/server/branches/2.2/plugins/console/console-portal-driver/src/main/webapp/js/navigation.js
Mon Sep 20 14:01:28 2010
@@ -0,0 +1,218 @@
+//======================================================================
+//   Licensed to the Apache Software Foundation (ASF) under one or more
+//   contributor license agreements.  See the NOTICE file distributed with
+//   this work for additional information regarding copyright ownership.
+//   The ASF licenses this file to You under the Apache License, Version 2.0
+//   (the "License"); you may not use this file except in compliance with
+//   the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+//======================================================================
+
+// $Rev: 753156 $ $Date: 2009-03-13 16:21:04 +0800 (Fri, 13 Mar 2009) $
+  function createNavigationTree(treeStore1,listStore1,showMode) {
+	 	treeModel = new dijit.tree.ForestStoreModel({
+	 	     store: treeStore1
+	 	 });  
+	 	if(showMode=="basic"){
+	 		  dojo.byId("navigationTreeAdvanced").style.display="none"; 
+	 		  dojo.byId("navigationTreeBasic").style.display="block"; 
+	 		  if(dijit.byId("navigationTreeBasic")==null){
+	 	        navigationTreeBasic = new dijit.Tree(
+	 	         {  model: treeModel,
+	 	            showRoot: false,
+	 	            openOnClick: true,
+	 	            autoExpand: true,
+	 	            onClick: function(treeNodeItem,treeNode) {
+	 	            
+	 	            var anchorNode=treeNode.labelNode.childNodes[2];
+	
+	 	             if(anchorNode)
+	 	                {
+	 	                 displayPortlets(anchorNode.href,"navigationTreeBasic");
+	 	                }                     
+	 	            },
+	 	            _createTreeNode: function(args) {
+	 	                    var tnode = new dijit._TreeNode(args);
+	 	                    tnode.labelNode.innerHTML = args.label;
+	 	                    return tnode;
+	 	                }
+	 	          },
+	 	          dojo.byId("navigationTreeBasic")
+	 	        );
+	 		  }
+          }else{
+ 	 		   dojo.byId("navigationTreeBasic").style.display="none"; 
+ 	 		   dojo.byId("navigationTreeAdvanced").style.display="block"; 
+        	   if(dijit.byId("navigationTreeAdvanced")==null){
+        	   navigationTreeAdvanced = new dijit.Tree(
+	           {  model: treeModel,
+	              showRoot: false,
+	              openOnClick: true,
+	              autoExpand: false,
+	              onClick: function(treeNodeItem,treeNode) {
+	              var anchorNode=treeNode.labelNode.childNodes[2];
+	              if(anchorNode){
+	                 displayPortlets(anchorNode.href,"navigationTreeAdvanced");
+	              }                     
+	            },
+	            _createTreeNode: function(args) {
+	                    var tnode = new dijit._TreeNode(args);
+	                    tnode.labelNode.innerHTML = args.label;
+	                    return tnode;
+	                }
+	            },
+	            dojo.byId("navigationTreeAdvanced")
+	          );
+            }
+          }
+	      if(showMode=="basic"){
+	          dojo.byId("tquickLauncher").style.display="none"; 
+	    	  return;
+		  }else{
+			  dojo.byId("tquickLauncher").style.display="block"; 
+		  }
+ 	      if(dijit.byId("quickLauncher")!=null){
+ 		     dijit.byId("quickLauncher").store=listStore1;
+           }else{
+	 	       filterSelect = new dijit.form.FilteringSelect
+	 	       (
+	 	          {
+	 	           store: listStore1,
+	 	           searchAttr: "name",
+	 	           promptMessage: "type and press enter to quick launch",
+	 	           labelAttr: "label",
+	 	           labelType: "html",
+	 	           onKeyPress: function(event){        
+	 	               if(event.charCode!=dojo.keys.ENTER) return;
+	 	                   quickLaunchPortlets(this.value);      
+	 	           },
+	 	           onChange: function(event){
+	 	               quickLaunchPortlets(this.value);
+	 	           }
+	 	         },
+	 	         dojo.byId("quickLauncher")
+	 	         );
+	 	   }
+ 	}
+
+    function quickLaunchPortlets(portalPageName,navigationTree){
+        listStore.fetchItemByIdentity({identity:portalPageName,
+            onItem:function(item){
+                var iframeHref = listStore.getValue(item,"href");
+                displayPortlets(iframeHref);
+            }
+        });
+        if(dijit.byId(navigationTree)){
+            findAndSelect(portalPageName,navigationTree);
+        }
+    }
+
+    function displayPortlets(iframeHref){
+    
+        //var iframeHref = anchor.href;
+
+        if(document.location.href.indexOf(iframeHref)==0){      
+            iframeHref=document.location.href.substring(0,document.location.href.indexOf("?"));
+        }
+        
+        dojo.io.iframe.setSrc(document.getElementById("portletsFrame"), iframeHref+"?formId="+formID,
true);
+               
+         try {
+            objToResize=getIframeObjectToResize();
+             //reset the height of iframe page each time the new portlet is loaded
+            objToResize.height = 400;
+              }
+          catch(err){
+            window.status = err.message;
+          }
+          
+        setTimeout('returnToTop()', 30);      
+     }
+     
+    function returnToTop(){
+        window.scrollTo(0,0);
+        return false;
+     }
+    function changeMode(){
+    	var rmode=document.getElementsByName("mode");
+    	if(rmode[0].checked){
+    	   createNavigationTree(treeStoreBasic,listStoreBasic,"basic");
+    	   return;
+    	}else{
+    		 createNavigationTree(treeStore,listStore,"advanced");
+    		 return;
+        }
+          
+    }
+   //scripts to expand  and select tree node automatically when open menu item from quick
launcher
+
+   
+function findAndSelect(key,navigationTree)
+    {
+	    rootNode=dijit.byId(navigationTree).rootNode
+        var pathToExpandItems = [];
+
+        if(findRecur(rootNode.item.children, key, pathToExpandItems))
+        {
+            select(pathToExpandItems,navigationTree);
+        } 
+    }
+
+
+function findRecur(items, key, pathToExpandItems) 
+    {
+        for (var child = 0; child < items.length; child++) {
+
+            pathToExpandItems.push(items[child]);
+            var label = treeStore.getLabel(items[child]);
+            if (label && label.indexOf(key) != -1)
+                return true;
+
+            if (items[child].children && findRecur(items[child].children, key, pathToExpandItems))
+                return true;
+            pathToExpandItems.pop();
+        }
+        return false;
+    }
+    
+function select(pathToExpandItems,navigationTree)
+    {
+    
+    var navigationTree=dijit.byId(navigationTree);
+        var i;
+        function expandParent(node)
+        {
+            if(node && !node.isExpanded)
+            {
+                expandParent(node.getParent());
+                navigationTree._expandNode(node);
+            }
+        }
+        //make sure the ancestor node expanded before
+         var firstNode = getTreeNode(navigationTree,pathToExpandItems[0],treeStore);    

+         expandParent(firstNode.getParent());
+        
+        for (i = 0;;i++) {
+            node  = getTreeNode(navigationTree,pathToExpandItems[i],treeStore);
+            if(i < pathToExpandItems.length-1)
+                navigationTree._expandNode(node);
+            else 
+            {
+                navigationTree.focusNode(node);
+                return node;
+            }
+        }
+    }
+    
+   function getTreeNode(tree,item,treeStore){
+   
+        var wrapperNode =tree._itemNodesMap[treeStore.getIdentity(item)];
+        return wrapperNode[0];
+   } 

Modified: geronimo/server/branches/2.2/plugins/console/console-tomcat/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/console/console-tomcat/src/main/plan/plan.xml?rev=998934&r1=998933&r2=998934&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/console/console-tomcat/src/main/plan/plan.xml (original)
+++ geronimo/server/branches/2.2/plugins/console/console-tomcat/src/main/plan/plan.xml Mon
Sep 20 14:01:28 2010
@@ -71,6 +71,7 @@
                 <reference name="PortalContainerServices">
                     <name>PlutoPortalServices</name>
                 </reference>
+                 <attribute name="mode">basic</attribute>
             </gbean>
             <gbean name="ServerInfo" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
                 <attribute name="pageTitle">1-1/Server/Information</attribute>
@@ -80,6 +81,7 @@
                 <reference name="PortalContainerServices">
                     <name>PlutoPortalServices</name>
                 </reference>
+                <attribute name="mode">basic</attribute>
             </gbean>
             <gbean name="JavaSysInfo" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
                 <attribute name="pageTitle">1-2/Server/Java System Info</attribute>
@@ -89,6 +91,7 @@
                 <reference name="PortalContainerServices">
                     <name>PlutoPortalServices</name>
                 </reference>
+                <attribute name="mode">advance</attribute>
             </gbean>
             <gbean name="Logs" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
                 <attribute name="pageTitle">1-3/Server/Server Logs</attribute>
@@ -98,6 +101,7 @@
                 <reference name="PortalContainerServices">
                     <name>PlutoPortalServices</name>
                 </reference>
+                 <attribute name="mode">advance</attribute>
             </gbean>
             <gbean name="Shutdown" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
                 <attribute name="pageTitle">1-4/Server/Shutdown</attribute>
@@ -161,6 +165,7 @@
                 <reference name="PortalContainerServices">
                     <name>PlutoPortalServices</name>
                 </reference>
+                <attribute name="mode">basic</attribute>
             </gbean>
             <gbean name="SystemModules" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
                 <attribute name="pageTitle">3-2/Applications/System Modules</attribute>

Modified: geronimo/server/branches/2.2/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/AdminConsoleExtensionGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/AdminConsoleExtensionGBean.java?rev=998934&r1=998933&r2=998934&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/AdminConsoleExtensionGBean.java
(original)
+++ geronimo/server/branches/2.2/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/AdminConsoleExtensionGBean.java
Mon Sep 20 14:01:28 2010
@@ -18,7 +18,9 @@ package org.apache.geronimo.pluto;
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -48,19 +50,29 @@ public class AdminConsoleExtensionGBean 
     private final ArrayList<String> portletList;
     private final String icon;
     private final PortalContainerServices portletContainerServices;
-
-    /* Constructor for GBean */
-    public AdminConsoleExtensionGBean(String pageTitle, String portletContext, ArrayList<String>
portletList, PortalContainerServices portalContainerServices) {
-        this(pageTitle, portletContext, portletList, null, portalContainerServices);
+    private final String mode;
+    private final static Set modes=new HashSet();
+    static{
+    	modes.add("advanced");
+    	modes.add("basic");
     }
-
-    public AdminConsoleExtensionGBean(String pageTitle, String portletContext, ArrayList<String>
portletList, String icon, PortalContainerServices portalContainerServices) {
+    /* Constructor for GBean */
+    public AdminConsoleExtensionGBean(String pageTitle, String portletContext, ArrayList<String>
portletList, String icon, PortalContainerServices portalContainerServices,String mode) {
         super();
         this.pageTitle = pageTitle;
         this.portletContext = portletContext;
         this.portletList = portletList;
         this.icon = icon;
         this.portletContainerServices = portalContainerServices;
+        if(mode==null){
+        	log.debug("you did not specifiy a mode for GBean "+pageTitle+",  the system will
use advanced as the default mode ");
+        	this.mode="advanced";
+        }else if(modes.contains(mode)){
+        	this.mode=mode;
+        }else{
+        	log.warn("when create GBean "+pageTitle+" error :your mode " + mode +" is illegal,
the system will use advanced as the default mode ");
+        	this.mode="advanced";
+        }
     }
 
     /*
@@ -145,6 +157,7 @@ public class AdminConsoleExtensionGBean 
         pageConfig.setName(pageTitle);
         pageConfig.setUri("/WEB-INF/themes/default-theme.jsp");
         pageConfig.setIcon(icon);
+        pageConfig.setMode(mode);
         return pageConfig;
     }
 
@@ -254,13 +267,14 @@ public class AdminConsoleExtensionGBean 
         infoFactory.addAttribute("portletContext", String.class, true, true);
         infoFactory.addAttribute("portletList", ArrayList.class, true, true);
         infoFactory.addAttribute("icon", String.class, true, true);
+        infoFactory.addAttribute("mode", String.class, true, true);
         infoFactory.addReference("PortalContainerServices", PortalContainerServices.class,
"GBean");
         infoFactory.setConstructor(new String[]{
                 "pageTitle",
                 "portletContext",
                 "portletList",
                 "icon", 
-                "PortalContainerServices"});
+                "PortalContainerServices","mode"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 

Modified: geronimo/server/branches/2.2/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/impl/PageConfig.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/impl/PageConfig.java?rev=998934&r1=998933&r2=998934&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/impl/PageConfig.java
(original)
+++ geronimo/server/branches/2.2/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/impl/PageConfig.java
Mon Sep 20 14:01:28 2010
@@ -1,37 +1,48 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-package org.apache.geronimo.pluto.impl;
-
-/**
- * @version $Rev$ $Date$
- */
-public class PageConfig extends org.apache.pluto.driver.services.portal.PageConfig {
-
-    private String icon;
-
-    public String getIcon() {
-        return icon;
-    }
-
-    public void setIcon(String icon) {
-        this.icon = icon;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.pluto.impl;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class PageConfig extends org.apache.pluto.driver.services.portal.PageConfig {
+
+    private String icon;
+
+    private String mode;
+    public String getIcon() {
+        return icon;
+    }
+
+    public void setIcon(String icon) {
+        this.icon = icon;
+    }
+
+	public String getMode() {
+		return mode;
+	}
+
+	public void setMode(String mode) {
+		this.mode = mode;
+	}
+    
+    
+}



Mime
View raw message