geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shiv...@apache.org
Subject svn commit: r669860 - in /geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main: java/org/apache/geronimo/console/configcreator/configData/ webapp/ webapp/WEB-INF/ webapp/WEB-INF/view/configcreator/ webapp/images/ webapp/js/
Date Fri, 20 Jun 2008 11:28:15 GMT
Author: shivahr
Date: Fri Jun 20 04:28:14 2008
New Revision: 669860

URL: http://svn.apache.org/viewvc?rev=669860&view=rev
Log:
GERONIMO-4133 Handle dependencies in EAR PlanCreator. Thanks to Shrey Banga for the patch.

Added:
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/enterpriseApp.css
  (with props)
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/images/
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/images/help.gif
  (with props)
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/js/
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/js/enterpriseApp.js
  (with props)
Modified:
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/configData/EARHelper.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/view/configcreator/enterpriseApp.jsp
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/web.xml

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/configData/EARHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/configData/EARHelper.java?rev=669860&r1=669859&r2=669860&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/configData/EARHelper.java
(original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/configData/EARHelper.java
Fri Jun 20 04:28:14 2008
@@ -19,6 +19,7 @@
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 
@@ -346,7 +347,48 @@
     }
 
     @DataTransferObject
-    public static class DependenciesJsonTree extends TreeJson implements Serializable {
+    public static class DependencyItem implements Serializable {
+        String name;
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+        }
+
+    }
+
+    @DataTransferObject
+    public static class DependenciesJsonTree implements Serializable {
+        String identifier = "name";
+        String label = "name";
+        List<DependencyItem> items = new ArrayList<DependencyItem>();
+
+        public String getIdentifier() {
+            return identifier;
+        }
+
+        public void setIdentifier(String identifier) {
+            this.identifier = identifier;
+        }
+
+        public String getLabel() {
+            return label;
+        }
+
+        public void setLabel(String label) {
+            this.label = label;
+        }
+
+        public List<DependencyItem> getItems() {
+            return items;
+        }
+
+        public void setItems(List<DependencyItem> items) {
+            this.items = items;
+        }
 
         public DependenciesJsonTree() {
         }
@@ -355,12 +397,18 @@
             Iterator<String> iter = environmentConfig.getDependenciesSet().iterator();
             while (iter.hasNext()) {
                 String depString = iter.next();
-                items.add(new TreeNode(depString, depString));
+                DependencyItem item = new DependencyItem();
+                item.setName(depString);
+                items.add(item);
             }
         }
 
-        public void save(EnvironmentType environment) {
-            ;
+        public void save(HashSet<String> dependenciesSet) {
+            dependenciesSet.clear();
+            for (int i = 0; i < items.size(); i++) {
+                String depString = items.get(i).getName();
+                dependenciesSet.add(depString);
+            }
         }
     }
 
@@ -371,7 +419,7 @@
 
     @RemoteMethod
     public void saveDependenciesJsonTree(HttpServletRequest request, DependenciesJsonTree
dependenciesJsonTree){
-        dependenciesJsonTree.save(getEarConfigData(request).getEnvironmentConfig().getEnvironment());
+        dependenciesJsonTree.save(getEarConfigData(request).getEnvironmentConfig().getDependenciesSet());
     }
 
     @RemoteMethod

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/view/configcreator/enterpriseApp.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/view/configcreator/enterpriseApp.jsp?rev=669860&r1=669859&r2=669860&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/view/configcreator/enterpriseApp.jsp
(original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/view/configcreator/enterpriseApp.jsp
Fri Jun 20 04:28:14 2008
@@ -23,9 +23,15 @@
 
 <style type="text/css">
   @import "/dojo/dijit/themes/tundra/tundra.css";
-  @import "/dojo/dojo/resources/dojo.css"
+  @import "/dojo/dojo/resources/dojo.css";
+  @import "<%=request.getContextPath()%>/enterpriseApp.css";  
 </style>
 
+<% String dwrForwarderServlet = "/console/dwr5"; %>
+<script type='text/javascript' src='<%= dwrForwarderServlet %>/interface/EARHelper.js'></script>
+<script type='text/javascript' src='<%= dwrForwarderServlet %>/engine.js'></script>
+<script type='text/javascript' src='<%= dwrForwarderServlet %>/util.js'></script>
+
 <script type="text/javascript" src="/dojo/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
 <script type="text/javascript">
   dojo.require("dojo.parser");
@@ -33,6 +39,7 @@
   dojo.require("dijit.layout.ContentPane");
   dojo.require("dijit.layout.SplitContainer");
   dojo.require("dojo.data.ItemFileReadStore");
+  dojo.require("dojo.data.ItemFileWriteStore");
   dojo.require("dijit.Tree");
   dojo.require("dijit.form.Form");
   dojo.require("dijit.form.ValidationTextBox");
@@ -44,73 +51,28 @@
   dojo.require("dijit.form.NumberSpinner");
   dojo.require("dijit.form.Slider");
   dojo.require("dijit.form.Textarea");
+  dojo.require("dijit.form.TextBox");
   dojo.require("dijit.form.Button");
   dojo.require("dijit.Editor");
   dojo.require("dijit.TitlePane");
+  dojo.require("dijit.Dialog");
 </script>
 
-<% String dwrForwarderServlet = "/console/dwr5"; %>
-<script type='text/javascript' src='<%= dwrForwarderServlet %>/interface/EARHelper.js'></script>
-<script type='text/javascript' src='<%= dwrForwarderServlet %>/engine.js'></script>
-<script type='text/javascript' src='<%= dwrForwarderServlet %>/util.js'></script>
-
-<script type="text/javascript" charset="utf-8">
-  function updateEarTreeStore(earTree) {
-    //alert("earTree received from server: " + dojo.toJson(earTree));
-    var earTreeStore = new dojo.data.ItemFileReadStore({data: earTree});
-    new dijit.Tree({id: 'referencesTree', store: earTreeStore, label: 'EAR'}, dojo.byId("referencesTreeHolder"));
-    new dijit.Tree({id: 'securityTree', store: earTreeStore, label: 'EAR'}, dojo.byId("securityTreeHolder"));
-  }
-
-  function updateDependenciesTree(dependenciesJson) {
-    var dependenciesStore = new dojo.data.ItemFileReadStore({data: dependenciesJson});
-    var placeHolder = dojo.byId("dependenciesTree");
-    <ul dojoType="dijit.Menu" id="tree_menu" style="display: none;">
-      <li dojoType="dijit.MenuItem" onClick="alert('Hello world');">Delete</li>
-    </ul>
-    new dijit.Tree({id: 'dependenciesTree', store: dependenciesStore, label: 'Dependencies'},
placeHolder);
-  }
-
-  function populateEnvironment(envJson) {
-    var envForm = dijit.byId("environmentForm");
-    envForm.setValues(envJson);
-  }
-
-  function saveEnvironment(envJson) {
-    EARHelper.saveEnvironmentJson(envJson, saveEnvironmentCallBack);
-  }
-
-  function saveEnvironmentCallBack() {
-    EARHelper.getGeneratedPlan(function(plan) {
-      alert(plan);
-    });
-  }
-
-  function addNewDependency(value) {
-    alert("Dependency to be added: " + value);
-  }
-
-  dojo.addOnLoad(function(){
-    EARHelper.getEnvironmentJson(populateEnvironment);
-    EARHelper.getDependenciesJsonTree(updateDependenciesTree);
-    EARHelper.getEarTree(updateEarTreeStore);
-  });
-</script>
+<script type='text/javascript' src='<%=request.getContextPath()%>/js/enterpriseApp.js'></script>
 
-<div class="tundra"> 
-<div id="mainTabContainer" dojoType="dijit.layout.TabContainer" 
-    style="width:750px;height:1000px">
+<body class="tundra"> 
+<div id="mainTabContainer" dojoType="dijit.layout.TabContainer" style="width:750px; height:800px">
   <div id="environment" dojoType="dijit.layout.ContentPane" title="Environment">
     <form dojoType="dijit.form.Form" id="environmentForm" 
-      execute=" alert('Execute form w/values:\n'+dojo.toJson(arguments[0],true)); 
-      saveEnvironment(arguments[0]);">
+      execute="saveEnvironment(arguments[0]); saveDependencies()"
+      onsubmit="return false;">
 
     <!-- ENTRY FIELD: Module Id -->
-    <div dojoType="dijit.TitlePane" title="Module Id" open="true" style="width:500px;
margin:0; padding:0;">
+    <div dojoType="dijit.TitlePane" title="Module Id" open="true" style="width:100%; margin:0;
padding:0;">
       <table border="0">
         <tr>
           <th colspan="2" align="center"> Module Id:</th>
-          <td id="moduleIdHelp">?</td>
+          <td id="moduleIdHelp"><a class="helpIcon">&nbsp;</a></td>
           <div dojoType="dijit.Tooltip" connectId="moduleIdHelp" 
             label="Every module in Geronimo is uniquely identified by it's ModuleID which
consists of four 
               components: groupId/artifactId/version/type. 
@@ -121,9 +83,9 @@
           <th><div align="right">Group Id:</div></th>
           <td>
             <input type="text" id="groupId" name="groupId"
-              dojoType="dijit.form.ValidationTextBox" required="true" trim="true"/>
+              dojoType="dijit.form.ValidationTextBox" required="false" trim="true"/>
           </td>
-          <td id="groupIdHelp">?</td>
+          <td id="groupIdHelp"><a class="helpIcon">&nbsp;</a></td>
           <div dojoType="dijit.Tooltip" connectId="groupIdHelp" 
             label="A name identifying a group of related modules. This may be a project name,
a company name, etc. 
               The important thing is that each artifactID should be unique within the group.">
@@ -135,7 +97,7 @@
             <input type="text" id="artifactId" name="artifactId"
               dojoType="dijit.form.ValidationTextBox" required="true" trim="true"/>
           </td>
-          <td id="artifactIdHelp">?</td>
+          <td id="artifactIdHelp"><a class="helpIcon">&nbsp;</a></td>
           <div dojoType="dijit.Tooltip" connectId="artifactIdHelp" 
             label="A name identifying the specific module within the group.">
           </div>
@@ -144,9 +106,9 @@
           <th><div align="right">Version:</div></th>
           <td>
             <input type="text" id="version" name="version"
-              dojoType="dijit.form.ValidationTextBox" required="true" trim="true"/>
+              dojoType="dijit.form.ValidationTextBox" required="false" trim="true"/>
           </td>
-          <td id="versionHelp">?</td>
+          <td id="versionHelp"><a class="helpIcon">&nbsp;</a></td>
           <div dojoType="dijit.Tooltip" connectId="versionHelp" 
             label="Version number for the module.">
           </div>
@@ -155,7 +117,7 @@
           <th><div align="right">Type:</div></th>
           <td>
             <select dojoType="dijit.form.ComboBox" id="type" name="type" 
-                value="" autocomplete="true" hasDownArrow="false">
+                value="" autocomplete="false" hasDownArrow="false">
               <option></option>
               <option>CAR</option>
               <option>EAR</option>
@@ -163,7 +125,7 @@
               <option>JAR</option>
             </select>
           </td>
-          <td id="typeHelp">?</td>
+          <td id="typeHelp"><a class="helpIcon">&nbsp;</a></td>
           <div dojoType="dijit.Tooltip" connectId="typeHelp" 
             label="A module's type is normally either CAR (for a system module) or the file
extension for an 
               application module (ear,war,jar,etc).">
@@ -174,7 +136,7 @@
 
     <!-- ENTRY FIELD: Hidden Classes, Non Overridable Classes and Inverse Class Loading
-->
     <div dojoType="dijit.TitlePane" title="Class Path Settings" open="false" 
-        style="width:500px; margin:0; padding:0;">
+        style="width:100%; margin:0; padding:0;">
       <table border="0">
         <tr>
           <th colspan="2" align="center"> Classpath Settings:</th>
@@ -186,7 +148,7 @@
             <input type="text" id="hiddenClasses" name="hiddenClasses"
               dojoType="dijit.form.ValidationTextBox" trim="true"/>
           </td>
-          <td id="hiddenClassesHelp">?</td>
+          <td id="hiddenClassesHelp"><a class="helpIcon">&nbsp;</a></td>
           <div dojoType="dijit.Tooltip" connectId="hiddenClassesHelp" 
             label="List packages or classes that may be in a parent class loader, but should
not be exposed 
               from there to the Web application. This is typically used when the Web application
wants to use a 
@@ -200,7 +162,7 @@
             <input type="text" id="nonOverridableClasses" name="nonOverridableClasses"

               dojoType="dijit.form.ValidationTextBox" trim="true"/>
           </td>
-          <td id="nonOverridableClassesHelp">?</td>
+          <td id="nonOverridableClassesHelp"><a class="helpIcon">&nbsp;</a></td>
           <div dojoType="dijit.Tooltip" connectId="nonOverridableClassesHelp" 
             label="List packages or classes that the Web application should always load from
a parent class 
               loader, and never load from WEB-INF/lib or WEB-INF/classes. This might be used
to force a Web 
@@ -214,7 +176,7 @@
             <input type="checkBox" name="inverseClassLoading" id="inverseClassLoading"
value="true" 
               dojoType="dijit.form.CheckBox" />
           </td>
-          <td id="inverseClassLoadingHelp">?</td>
+          <td id="inverseClassLoadingHelp"><a class="helpIcon">&nbsp;</a></td>
           <div dojoType="dijit.Tooltip" connectId="inverseClassLoadingHelp" 
             label="Normally (if this element is not checked), the module's class loader will
work normally - 
               classes will be loaded from the parent class loader if available before checking
the current class 
@@ -228,36 +190,34 @@
 
     <!-- Dependencies -->
     <div dojoType="dijit.TitlePane" title="Dependencies" open="false" 
-        style="width:500px; margin:0; padding:0;">
-      <table border="0">
+        style="width:100%; margin:0; padding:0;">
+      <table border="0" width="100%">
         <tr>
-          <th colspan="2" align="center"> Dependencies: <i id="dependenciesHelp">?</i></th>
+          <th>Dependencies:</th><th><a id="dependenciesHelp" class="helpIcon">&nbsp;</a>
           <div dojoType="dijit.Tooltip" connectId="dependenciesHelp"
             label="All the modules available in the server repository are shown below. Select
the ones on which 
             your web-application is dependent. Default selections should be sufficient in
most scenarios.">
           </div>
+          </th>
         </tr>
         <tr>
-          <td colspan="2">
-            <div id=dependenciesTree>Dependencies tree goes here</div>
+          <td valign="top">
+            <div id="dependenciesTree">Dependencies tree goes here</div>
           </td>
-          <td></td>
-        </tr>
-        <tr>
-          <td>Add Dependency:</td>
-          <td>
-            <select dojoType="dijit.form.FilteringSelect" autocomplete="true" value="
" 
-                onChange="addNewDependency">
-              <option value=" "> </option>
-              <c:forEach var="commonLib" items="${commonLibs}">
-                <option value="${commonLib}">${commonLib}</option>
-              </c:forEach>
-            </select>
+          <td align="right" valign="top">
+            <button dojoType="dijit.form.Button" id="btnAdd" onclick="doAddDependencies()">
+              <div style="width:58px">Add</div>
+            </button><br/>
+            <button dojoType="dijit.form.Button" onclick="doEditDependency()">
+              <div style="width:58px">Edit</div>
+            </button><br/>
+            <button dojoType="dijit.form.Button" onclick="doDeleteDependency()">
+              <div style="width:58px">Delete</div>
+            </button><br/>
           </td>
         </tr>
       </table>
     </div>
-
       <CENTER>
         <!-- Save button -->
         <button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave"
type="submit">
@@ -266,12 +226,11 @@
       </CENTER>
     </form>
   </div>
-
   <div id="references" dojoType="dijit.layout.ContentPane" title="References">
     <div dojoType="dijit.layout.SplitContainer" orientation="horizontal" sizerWidth="7"
         activeSizing="true" style="border: 1px solid #bfbfbf;">
       <div dojoType="dijit.layout.ContentPane" sizeMin="100" sizeShare="20">
-        <div id=referencesTreeHolder>EAR tree goes here</div>
+        <div id="referencesTreeHolder">EAR tree goes here</div>
       </div>
       <div dojoType="dijit.layout.ContentPane" sizeMin="200" sizeShare="80">
         Editors for references go here
@@ -282,7 +241,7 @@
     <div dojoType="dijit.layout.SplitContainer" orientation="horizontal" sizerWidth="7"
         activeSizing="true" style="border: 1px solid #bfbfbf;">
       <div dojoType="dijit.layout.ContentPane" sizeMin="100" sizeShare="20">
-        <div id=securityTreeHolder>EAR tree goes here</div>
+        <div id="securityTreeHolder">EAR tree goes here</div>
       </div>
       <div dojoType="dijit.layout.ContentPane" sizeMin="200" sizeShare="80">
         Editors for security go here
@@ -290,8 +249,59 @@
     </div>
   </div>
   <div id="generatedPlan" dojoType="dijit.layout.ContentPane" title="Generated Plan">
-    <textarea rows="30" cols="85" name="deploymentPlan">${data.deploymentPlan}</textarea>
-    <!-- <textarea id="generatedPlanDisplayer" dojoType="dijit.form.Textarea" style="width:600px">${data.deploymentPlan}</textarea>
-->
+    <textarea rows="30" cols="85" id="generatedPlanDisplayer" name="deploymentPlan">${data.deploymentPlan}</textarea>
+    <!--<textarea id="generatedPlanDisplayer" dojoType="dijit.form.Textarea" style="width:600px">${data.deploymentPlan}</textarea>-->
+  </div>
+</div>
+<div id="dependenciesDialog" dojotype="dijit.Dialog"
+    title="Select dependencies to add" execute="addDependencies(arguments[0])" extractContent="false">
+  <div style="height:400px; width:100%; overflow:auto">
+    <table width="640" cellspacing="0">
+      <c:forEach var="commonLib" items="${commonLibs}" varStatus="vs">
+        <tr>
+          <td>
+            <input dojotype="dijit.form.CheckBox" id="depChkBox_${vs.index}" name="dependencies"
value="${commonLib}" type="checkbox"/>
+          </td>
+          <td valign="middle" align="left">
+            <label for="dependencies">${commonLib}</label>
+          </td>
+        </tr>
+      </c:forEach>
+    </table>
   </div>
+  <center><button dojoType="dijit.form.Button" type="submit">OK</button></center>
 </div>
+<div id="editDependencyDialog" dojotype="dijit.Dialog" 
+    title="Edit dependency" execute="editDependencyTo(arguments[0])" extractContent="false">
+  <input type="hidden" name="prevName" id="depEditPrevName" value="none"/>
+  <table cellspacing="15">
+    <tr>
+      <td>Groupd Id:</td>
+      <td>
+        <input type="text" dojoType="dijit.form.TextBox" id="txtGroupId" size="20" name="groupId"
trim="true"/>
+      </td>
+    </tr>
+    <tr>
+      <td>Artifact Id:</td>
+      <td>
+        <input type="text" dojoType="dijit.form.TextBox" id="txtArtifactId" size="20"

+          name="artifactId" trim="true" onChange="checkDepEditFields()"/>
+      </td>
+    </tr>
+    <tr>
+      <td>Version:</td>
+      <td>
+        <input type="text" dojoType="dijit.form.TextBox" id="txtVersion" size="20" name="version"
trim="true"/>
+      </td>
+    </tr>
+    <tr>
+      <td>Type:</td>
+      <td>
+        <input type="text" dojoType="dijit.form.TextBox" id="txtType" size="20" name="type"
trim="true"/>
+      </td>
+    </tr>
+    <tr><td colspan="2"><div id="depEditStatus"></div></td></tr>
+  </table>
+  <center><button dojoType="dijit.form.Button" type="submit" id="btnDepEditOK">OK</button></center>
 </div>
+</body>

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/web.xml?rev=669860&r1=669859&r2=669860&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/web.xml
Fri Jun 20 04:28:14 2008
@@ -41,6 +41,7 @@
             org.apache.geronimo.console.configcreator.configData.EARHelper$TreeNode,
             org.apache.geronimo.console.configcreator.configData.EARHelper$TreeFolder,
             org.apache.geronimo.console.configcreator.configData.EARHelper$EnvironmentJson,
+            org.apache.geronimo.console.configcreator.configData.EARHelper$DependencyItem,
             org.apache.geronimo.console.configcreator.configData.EARHelper$DependenciesJsonTree
         </param-value>
       </init-param>

Added: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/enterpriseApp.css
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/enterpriseApp.css?rev=669860&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/enterpriseApp.css
(added)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/enterpriseApp.css
Fri Jun 20 04:28:14 2008
@@ -0,0 +1,35 @@
+/*======================================================================
+*   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.
+======================================================================*/
+
+label {
+    float: none;
+}
+
+div#dependenciesDialog td {
+    padding: 5px;
+}
+th {
+    text-align: center;
+    font-weight: bold;
+}
+a.helpIcon {
+    cursor: pointer;
+    background-image: url('images/help.gif');
+    display: block;
+    width: 16px;
+    height: 16px;
+}

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/enterpriseApp.css
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/enterpriseApp.css
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/enterpriseApp.css
------------------------------------------------------------------------------
    svn:mime-type = text/css

Added: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/images/help.gif
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/images/help.gif?rev=669860&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/images/help.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Added: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/js/enterpriseApp.js
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/js/enterpriseApp.js?rev=669860&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/js/enterpriseApp.js
(added)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/js/enterpriseApp.js
Fri Jun 20 04:28:14 2008
@@ -0,0 +1,235 @@
+//======================================================================
+//   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$ $Date$
+
+function updateEarTree(earTree) {
+    var earTreeStore = new dojo.data.ItemFileReadStore({data: earTree});
+    new dijit.Tree({id: 'referencesTree', store: earTreeStore, label: 'EAR'}, dojo.byId("referencesTreeHolder"));
+    new dijit.Tree({id: 'securityTree', store: earTreeStore, label: 'EAR'}, dojo.byId("securityTreeHolder"));
+}
+
+function updateDependenciesTree(dependenciesJson) {
+    var dependenciesStore = new dojo.data.ItemFileWriteStore({data: dependenciesJson});
+    new dijit.Tree(
+  	    {
+            id: 'dependenciesTree', 
+            store: dependenciesStore,
+            label: 'Dependencies',
+        }, dojo.byId("dependenciesTree"));
+        
+    var items = dependenciesJson.items;
+     
+    for(i = 0; i < items.length; i++) {
+        var chkBoxElement = dojo.query("input[value='"+items[i].name[0]+"']","dependenciesDialog")[0];
+        
+        if(chkBoxElement) {
+            var chkBoxWidget = dijit.byId(chkBoxElement.id);
+            chkBoxWidget.setChecked(true);
+            chkBoxWidget.setAttribute("disabled", true);
+        }
+    }
+}
+
+function populateEnvironment(envJson) {
+    var envForm = dijit.byId("environmentForm");
+    envForm.setValues(envJson);
+}
+
+function saveEnvironment(envJson) {
+    EARHelper.saveEnvironmentJson(envJson);
+}
+
+function refreshGeneratedPlan() {
+    EARHelper.getGeneratedPlan(function(plan) {
+        dojo.byId("generatedPlanDisplayer").value = plan;
+    });
+}
+  
+function saveDependencies() {
+    var treeItems = [];
+    dijit.byId("dependenciesTree").store.fetch({
+        query: {name: "*"},
+        scope: this,
+        onItem: function(item) { treeItems.push({name: item.name[0]}) },
+        onComplete: function() {
+            var depJson = new Object();
+            depJson.identifier = 'name';
+            depJson.label = 'name';
+            depJson.items = treeItems;
+            EARHelper.saveDependenciesJsonTree(depJson);
+        }
+    });
+}
+
+function addDependencyCallback(items, request) {
+    value = request.query.name;
+    
+    if(items == null || items.length == 0) {
+        var depTree = dijit.byId("dependenciesTree");
+        
+		depTree.store.save({scope: {'value': value, 'depTree': depTree}, onComplete: function()
{
+                depTree.store.newItem({name: value, attribute:'name'});
+                depTree._expandNode(depTree.rootNode);
+            }
+        });
+    }
+}
+  
+function addNewDependency(value) {
+    if(value != ' ') {
+        dijit.byId("dependenciesTree").store.fetch({query:{name:value}, onComplete: addDependencyCallback})
+    }
+}
+
+function addDependencies(arg) {
+    var deps = arg.dependencies;
+    for(i = 0; i < deps.length; i++) {
+        addNewDependency(deps[i]);
+    }
+    var checkedElements = dojo.query("input","dependenciesDialog").filter(
+        function(elem) { 
+            return elem.checked; 
+        }).forEach(
+            function(item) {
+                dijit.byId(item.id).setAttribute("disabled", true);
+            });
+}
+
+function doAddDependencies() {
+    dijit.byId('dependenciesDialog').show(); 
+}
+
+function deleteDependencyCallback(item) {
+    if(!item) return;
+    var name = item.name[0];
+    var chkBoxElement = dojo.query("input","dependenciesDialog").filter(
+        function(elem) {
+            return elem.value == name; 
+        }
+    )[0];
+
+    if(chkBoxElement) {
+        var chkBoxWidget = dijit.byId(chkBoxElement.id);
+        chkBoxWidget.setChecked(false);
+        chkBoxWidget.setAttribute("disabled", false);
+
+		var depTree = dijit.byId("dependenciesTree");
+
+		depTree.store.save({
+		    scope: item,
+		    onComplete: function() { dijit.byId("dependenciesTree").store.deleteItem(this) }
+		});
+    }
+}
+  
+function doDeleteDependency() {
+    depTree = dijit.byId("dependenciesTree");
+    if(depTree.lastFocused != null) {
+        if(depTree.lastFocused == depTree.rootNode) {
+            if(confirm("Delete all dependencies ?")) {
+                depTree.store.fetch({query: {name: "*"}, onItem: deleteDependencyCallback});
+            }
+        }
+        depTree.store.fetchItemByIdentity({
+            identity: depTree.lastFocused.label,
+            onItem: deleteDependencyCallback 
+        });
+    }
+}
+  
+function editDependencyTo(dialogInputs) {
+    var name = dojo.byId("depEditPrevName").value;
+    var newName = dialogInputs.groupId + "/" + dialogInputs.artifactId + "/" + dialogInputs.version
+ "/" + dialogInputs.type;
+    if(name == newName) return;
+
+    var chkBoxElement = dojo.query("input","dependenciesDialog").filter(
+        function(elem) {
+            return elem.value == name;
+        }
+    )[0];
+
+    if(chkBoxElement) {
+        dijit.byId(chkBoxElement.id).setValue(newName);
+        chkBoxLabel = dojo.query("label","dependenciesDialog").filter(
+            function(elem) {
+                return elem.innerHTML == name;
+            }
+        )[0];
+        chkBoxLabel.innerHTML = newName;
+        var depTree = dijit.byId("dependenciesTree");
+        depTree.store.fetchItemByIdentity({
+            identity: name, 
+            onItem: function(item) { 
+                dijit.byId("dependenciesTree").store.deleteItem(item)
+            }
+        });
+        depTree.store.newItem({name: newName, attribute: 'name'});
+    }
+}
+
+function editDependencyCallback(item) {
+    if(!item)
+        return;
+    var name = item.name[0];
+    var elems = name.split('/');
+    dijit.byId("txtGroupId").setValue(elems[0]);
+    dijit.byId("txtArtifactId").setValue(elems[1]);
+    dijit.byId("txtVersion").setValue(elems[2]);
+    dijit.byId("txtType").setValue(elems[3]);
+    dojo.byId("depEditPrevName").value = name;
+    dijit.byId("editDependencyDialog").show();
+}
+
+function doEditDependency() {
+    depTree = dijit.byId("dependenciesTree");
+    if(depTree.lastFocused != null) {
+        depTree.store.fetchItemByIdentity({
+            identity: depTree.lastFocused.label,
+            onItem: editDependencyCallback
+        });
+    }
+}
+
+function checkDepEditFields() {
+    if(dijit.byId("txtArtifactId").getValue() == "") {
+        dijit.byId("btnDepEditOK").setAttribute("disabled", true);
+        dojo.byId("depEditStatus").innerHTML = "<img src='/dojo/dijit/themes/tundra/images/warning.png'/>
Invalid artifact id";
+    } else {
+        dijit.byId("btnDepEditOK").setAttribute("disabled", false);
+        dojo.byId("depEditStatus").innerHTML = "";
+    }
+}
+
+dojo.addOnLoad(function(){
+    EARHelper.getEnvironmentJson(populateEnvironment);
+    EARHelper.getDependenciesJsonTree(updateDependenciesTree);
+    EARHelper.getEarTree(updateEarTree);
+
+    var dlgDep = dijit.byId("dependenciesDialog");
+    dlgDep._getFocusItems = function(node) {}
+    dlgDep._firstFocusItem = dojo.byId("depChkBox_1");
+    dlgDep._lastFocusItem = dojo.byId("btnAdd");
+    
+    var nodeCount = 0;
+    dojo.query("tr", "dependenciesDialog").filter(
+        function(row) {
+            return (nodeCount++) % 2 == 0;
+        }).style("backgroundColor","rgb(240,250,255)");
+
+    dojo.connect(dijit.byId('generatedPlan').controlButton, 'onClick', refreshGeneratedPlan);
+});

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/js/enterpriseApp.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/js/enterpriseApp.js
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/js/enterpriseApp.js
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message