geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsic...@apache.org
Subject svn commit: r565397 [3/3] - in /geronimo/server/trunk: applications/console/geronimo-console-framework/src/main/webapp/WEB-INF/data/ applications/console/geronimo-console-standard/ applications/console/geronimo-console-standard/src/main/java/org/apache...
Date Mon, 13 Aug 2007 16:21:46 GMT
Added: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/configcreator/security.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/configcreator/security.jsp?view=auto&rev=565397
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/configcreator/security.jsp (added)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/configcreator/security.jsp Mon Aug 13 09:21:44 2007
@@ -0,0 +1,437 @@
+<%--
+   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$ --%>
+
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<portlet:defineObjects />
+
+<script>
+function <portlet:namespace/>showElement(id) {
+  var element = document.getElementById("<portlet:namespace/>"+id);
+  if (element.style.display != 'inline') {
+    element.style.display = 'inline';
+  }
+}
+
+function <portlet:namespace/>hideElement(id) {
+  var element = document.getElementById("<portlet:namespace/>"+id);
+  if (element.style.display != 'none') {
+    element.style.display = 'none';
+  }
+}
+
+function <portlet:namespace/>handleAddClick(roleId, type) {
+  if (type == "principal") {
+    <portlet:namespace/>showElement(roleId + '.principal.ui');
+    <portlet:namespace/>hideElement(roleId + '.loginDomainPrincipal.ui');
+    <portlet:namespace/>hideElement(roleId + '.realmPrincipal.ui');
+    <portlet:namespace/>hideElement(roleId + '.distinguishedName.ui');
+  } else if (type == "loginDomainPrincipal") {
+    <portlet:namespace/>showElement(roleId + '.loginDomainPrincipal.ui');
+    <portlet:namespace/>hideElement(roleId + '.principal.ui');
+    <portlet:namespace/>hideElement(roleId + '.realmPrincipal.ui');
+    <portlet:namespace/>hideElement(roleId + '.distinguishedName.ui');
+  } else if (type == "realmPrincipal") {
+    <portlet:namespace/>showElement(roleId + '.realmPrincipal.ui');
+    <portlet:namespace/>hideElement(roleId + '.principal.ui');
+    <portlet:namespace/>hideElement(roleId + '.loginDomainPrincipal.ui');
+    <portlet:namespace/>hideElement(roleId + '.distinguishedName.ui');
+  } else if (type == "distinguishedName") {
+    <portlet:namespace/>showElement(roleId + '.distinguishedName.ui');
+    <portlet:namespace/>hideElement(roleId + '.principal.ui');
+    <portlet:namespace/>hideElement(roleId + '.loginDomainPrincipal.ui');
+    <portlet:namespace/>hideElement(roleId + '.realmPrincipal.ui');
+  } else {
+    <portlet:namespace/>hideElement(roleId + '.principal.ui');
+    <portlet:namespace/>hideElement(roleId + '.loginDomainPrincipal.ui');
+    <portlet:namespace/>hideElement(roleId + '.realmPrincipal.ui');
+    <portlet:namespace/>hideElement(roleId + '.distinguishedName.ui');
+  }
+}
+
+function <portlet:namespace/>addElement(roleId, type)
+{
+  var prefix = "<portlet:namespace/>" + roleId + "." + type;
+  if (document.getElementById(prefix + ".name").value == "") {
+    alert("Name field is empty!");
+    return;
+  }
+  if ((type == "loginDomainPrincipal" || type == "realmPrincipal") && 
+      document.getElementById(prefix + ".domainName").value == "") {
+    alert("Domain Name field is empty!");
+    return;
+  }
+
+  var tbody = document.getElementById(prefix + ".table.tbody");
+  if (tbody == null) {
+    var placeHolder = document.getElementById(prefix + ".placeHolder");
+    var table = document.createElement("table");
+    table.setAttribute("id", prefix + ".table");
+    table.setAttribute("border","0");
+    table.setAttribute("width","100%");
+
+    var numColumns = "2"; // default for type == "distinguishedName"
+    var heading = "Distinguished Names";
+    if (type == "principal") {
+      numColumns = "3";
+      heading = "Principals";
+    } else if (type == "loginDomainPrincipal") {
+      numColumns = "4";
+      heading = "Login Domain Principals";
+    } else if (type == "realmPrincipal") {
+      numColumns = "5";
+      heading = "Realm Principals";
+    }
+
+    var newTHead = document.createElement("thead");
+    var newTR = document.createElement("tr");
+    var newTD = document.createElement("td");
+    newTD.setAttribute("colSpan", numColumns);
+    newTD.setAttribute("style", "padding-top: 5px");
+    newTD.innerHTML = 
+      "<b>" + heading + 
+      " <input type=\"hidden\" id=\"" + roleId + "." + type + ".count\" value=\"0\" /> " + 
+      "</b>";
+    newTR.appendChild(newTD);
+    newTHead.appendChild(newTR);
+
+    newTR = document.createElement("tr");
+    var newTH = document.createElement("th");
+    newTH.setAttribute("class", "DarkBackground");
+    newTH.setAttribute("className", "DarkBackground");
+    newTH.innerHTML = "Name";
+    newTR.appendChild(newTH);
+    if (type != "distinguishedName") {
+      newTH = document.createElement("th");
+      newTH.setAttribute("class", "DarkBackground");
+     newTH.setAttribute("className", "DarkBackground");
+      newTH.innerHTML = "Class";
+      newTR.appendChild(newTH);
+      if (type != "principal") {
+        newTH = document.createElement("th");
+        newTH.setAttribute("class", "DarkBackground");
+        newTH.setAttribute("className", "DarkBackground");
+        newTH.innerHTML = "Domain Name";
+        newTR.appendChild(newTH);
+        if (type != "loginDomainPrincipal") {
+          newTH = document.createElement("th");
+          newTH.setAttribute("class", "DarkBackground");
+          newTH.setAttribute("className", "DarkBackground");
+          newTH.innerHTML = "Realm Name";
+          newTR.appendChild(newTH);
+        }
+      }
+    }
+    newTH = document.createElement("th");
+    newTH.setAttribute("class", "DarkBackground");
+    newTH.setAttribute("className", "DarkBackground");
+    newTH.innerHTML = "Actions";
+    newTR.appendChild(newTH);
+    newTHead.appendChild(newTR);
+
+    table.appendChild(newTHead);
+    var newTFoot = document.createElement("tfoot");
+    table.appendChild(newTFoot);
+    tbody = document.createElement("tbody");
+    tbody.setAttribute("id", prefix + ".table.tbody");
+    table.appendChild(tbody);
+    placeHolder.appendChild(table);
+  }
+
+  var lastIndex = document.getElementById(roleId + "." + type + ".lastIndex");
+  var elementId = roleId + "." + type + "." + lastIndex.value;
+  lastIndex.value = (lastIndex.value - 1) + 2;
+  //lastIndex.value is a string, and using lastIndex.value += 1 might imply string concat
+  var newTRId = "<portlet:namespace/>" + elementId + ".tr";
+  var newTR = document.createElement("tr");
+  newTR.setAttribute("id", newTRId);
+
+  var nameBox = document.getElementById(prefix + ".name");
+  var name = nameBox.value;
+  nameBox.value="";
+  var newTD = document.createElement("td");
+  newTD.innerHTML = name + 
+    "<input type=\"hidden\" name=\"" + elementId + ".name\" value=\"" + name + "\" /> ";
+  newTR.appendChild(newTD);
+
+  if (type != "distinguishedName") {
+    var classSelector = document.getElementById(prefix + ".class");
+    var class1 = classSelector.options[classSelector.selectedIndex].value;
+    newTD = document.createElement("td");
+    newTD.innerHTML = class1 + 
+      "<input type=\"hidden\" name=\"" + elementId + ".class\" value=\"" + class1 + "\" /> ";
+    newTR.appendChild(newTD);
+
+    if (type != "principal") {
+      var domainNameBox = document.getElementById(prefix + ".domainName");
+      var domainName = domainNameBox.value;
+      domainNameBox.value="";
+      newTD = document.createElement("td");
+      newTD.innerHTML = domainName + 
+        "<input type=\"hidden\" name=\"" + elementId + ".domainName\" value=\"" + domainName + "\" /> ";
+      newTR.appendChild(newTD);
+
+      if (type != "loginDomainPrincipal") {
+        var realmPrincipalSelector = document.getElementById(prefix + ".realmName");
+        var realmName = realmPrincipalSelector.options[realmPrincipalSelector.selectedIndex].value;
+        newTD = document.createElement("td");
+        newTD.innerHTML = realmName + 
+          "<input type=\"hidden\" name=\"" + elementId + ".realmName\" value=\"" + realmName + "\" /> ";
+        newTR.appendChild(newTD);
+      }
+    }
+  }
+
+  newTD = document.createElement("td");
+  newTD.innerHTML = "<a href=\"javascript:;\" " + 
+    "onclick=\"<portlet:namespace/>removeElement(\'" + roleId + "\',\'" + type + "\',\'" + newTRId + "\')\">remove</a>";
+  newTR.appendChild(newTD);
+
+  tbody.appendChild(newTR);
+  var counter = document.getElementById(roleId + "." + type + ".count");
+  counter.value = (counter.value - 1) + 2;
+  document.getElementById(roleId + ".selectList").selectedIndex = 0;
+  <portlet:namespace/>hideElement(roleId + "." + type + ".ui");
+}
+
+function <portlet:namespace/>removeElement(roleId, type, trId)
+{
+  var prefix = "<portlet:namespace/>" + roleId + "." + type;
+  var counter = document.getElementById(roleId + "." + type + ".count");
+  counter.value--;
+  if(counter.value == "0") {
+    var lastIndex = document.getElementById(roleId + "." + type + ".lastIndex");
+    lastIndex.value = "0";
+    var placeHolder = document.getElementById(prefix + ".placeHolder");
+    var table = document.getElementById(prefix + ".table");
+    placeHolder.removeChild(table);
+  } else {
+    var tbody = document.getElementById(prefix + ".table.tbody");
+    var tr = document.getElementById(trId);
+    tbody.removeChild(tr);
+  }
+}
+</script>
+
+<p><b>WAR - Security</b> -- Specify Security Realm and Role Mappings</p>
+
+<p>Description goes here ...</p>
+
+<!--   FORM TO COLLECT DATA FOR THIS PAGE   -->
+<form name="<portlet:namespace/>SecurityForm" action="<portlet:actionURL/>" method="POST">
+<input type="hidden" name="mode" value="security-after" />
+
+<table border="0">
+  <!-- ENTRY FIELD: Security Realm Name -->
+  <tr>
+    <th>
+    <div align="right">Security Realm Name:</div>
+    </th>
+    <td>
+      <select name="securityRealmName">
+        <c:forEach var="securityRealm" items="${deployedSecurityRealms}">
+          <option value="${securityRealm.realmName}">${securityRealm.realmName}</option>
+        </c:forEach>
+      </select>
+    </td>
+  </tr>
+  <tr>
+    <td></td>
+    <td>Enter description about Security Realm Name here</td>
+  </tr>
+
+  <!-- Security Role Mappings -->
+  <tr>
+    <th colspan="2" align="left">
+    <div>Security Role Mappings</div>
+    </th>
+  </tr>
+  <c:set var="backgroundClass" value='MediumBackground'/>
+  <c:forEach var="role" items="${data.security.roleMappings.roleArray}" varStatus="status1">
+    <c:choose>
+      <c:when test="${backgroundClass == 'MediumBackground'}" >
+        <c:set var="backgroundClass" value='LightBackground'/>
+      </c:when>
+      <c:otherwise>
+        <c:set var="backgroundClass" value='MediumBackground'/>
+      </c:otherwise>
+    </c:choose>
+    <c:set var="roleId" value="security.roleMappings.${status1.index}" />
+    <input type="hidden" name="${roleId}.roleName" value="${role.roleName}" />
+    <tr>
+      <th valign="top" class="${backgroundClass}"><div align="right">${role.roleName}:</div></th>
+      <td class="${backgroundClass}">
+        <div id="<portlet:namespace/>${roleId}.principal.placeHolder"></div>
+        <div id="<portlet:namespace/>${roleId}.loginDomainPrincipal.placeHolder"></div>
+        <div id="<portlet:namespace/>${roleId}.realmPrincipal.placeHolder"></div>
+        <div id="<portlet:namespace/>${roleId}.distinguishedName.placeHolder"></div>
+        <div align="justify">Add: 
+        <select id="${roleId}.selectList" 
+          onchange="<portlet:namespace/>handleAddClick('${roleId}', this.value)">
+          <option value=""></option>
+          <option value="principal">Principal</option>
+          <option value="loginDomainPrincipal">Login Domain Principal</option>
+          <option value="realmPrincipal">Realm Principal</option>
+          <option value="distinguishedName">Distinguished Name</option>
+        </select></div>
+
+        <div id="<portlet:namespace/>${roleId}.principal.ui" style="display:none">
+          <input type="hidden" id="${roleId}.principal.lastIndex" 
+            name="${roleId}.principal.lastIndex" value="0">
+          <table border="0">
+            <tr>
+              <th><div align="right">Name:</div></th>
+              <td><input type="text" id="<portlet:namespace/>${roleId}.principal.name"/></td>
+            </tr>
+            <tr>
+              <th><div align="right">Class:</div></th>
+              <td>
+                <select id="<portlet:namespace/>${roleId}.principal.class">
+                  <option value="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal">Group Principal</option>
+                  <option value="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal">User Principal</option>
+                </select>
+              </td>
+            </tr>
+            <tr>
+              <th><div align="right"></div></th>
+              <td>
+                <input type="button" value="Add" onclick="<portlet:namespace/>addElement('${roleId}', 'principal')"/>
+                <input type="button" value="Cancel" 
+                  onclick="<portlet:namespace/>hideElement('${roleId}.principal.ui');
+                  document.getElementById('${roleId}.selectList').selectedIndex = 0;"/>
+              </td>
+            </tr>
+          </table>
+        </div>
+
+        <div id="<portlet:namespace/>${roleId}.loginDomainPrincipal.ui" style="display:none">
+          <input type="hidden" id="${roleId}.loginDomainPrincipal.lastIndex" 
+            name="${roleId}.loginDomainPrincipal.lastIndex" value="0">
+          <table border="0">
+            <tr>
+              <th><div align="right">Name:</div></th>
+              <td><input type="text" id="<portlet:namespace/>${roleId}.loginDomainPrincipal.name"/></td>
+            </tr>
+            <tr>
+              <th><div align="right">Class:</div></th>
+              <td>
+                <select id="<portlet:namespace/>${roleId}.loginDomainPrincipal.class">
+                  <option value="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal">Group Principal</option>
+                  <option value="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal">User Principal</option>
+                </select>
+              </td>
+            </tr>
+            <tr>
+              <th><div align="right">Domain Name:</div></th>
+              <td><input type="text" id="<portlet:namespace/>${roleId}.loginDomainPrincipal.domainName"/></td>
+            </tr>
+            <tr>
+              <th><div align="right"></div></th>
+              <td>
+                <input type="button" value="Add" onclick="<portlet:namespace/>addElement('${roleId}', 'loginDomainPrincipal')"/>
+                <input type="button" value="Cancel" 
+                  onclick="<portlet:namespace/>hideElement('${roleId}.loginDomainPrincipal.ui');
+                  document.getElementById('${roleId}.selectList').selectedIndex = 0;"/>
+              </td>
+            </tr>
+          </table>
+        </div>
+
+        <div id="<portlet:namespace/>${roleId}.realmPrincipal.ui" style="display:none">
+          <input type="hidden" id="${roleId}.realmPrincipal.lastIndex" 
+            name="${roleId}.realmPrincipal.lastIndex" value="0">
+          <table border="0">
+            <tr>
+              <th><div align="right">Name:</div></th>
+              <td><input type="text" id="<portlet:namespace/>${roleId}.realmPrincipal.name"/></td>
+            </tr>
+            <tr>
+              <th><div align="right">Class:</div></th>
+              <td>
+                <select id="<portlet:namespace/>${roleId}.realmPrincipal.class">
+                  <option value="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal">Group Principal</option>
+                  <option value="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal">User Principal</option>
+                </select>
+              </td>
+            </tr>
+            <tr>
+              <th><div align="right">Domain Name:</div></th>
+              <td><input type="text" id="<portlet:namespace/>${roleId}.realmPrincipal.domainName"/></td>
+            </tr>
+            <tr>
+              <th><div align="right">Realm Name:</div></th>
+              <td>
+                <select id="<portlet:namespace/>${roleId}.realmPrincipal.realmName">
+                  <c:forEach var="securityRealm" items="${deployedSecurityRealms}">
+                    <option value="${securityRealm.realmName}">${securityRealm.realmName}</option>
+                  </c:forEach>
+                </select>
+              </td>
+            </tr>
+            <tr>
+              <th><div align="right"></div></th>
+              <td>
+                <input type="button" value="Add" onclick="<portlet:namespace/>addElement('${roleId}', 'realmPrincipal')"/>
+                <input type="button" value="Cancel" 
+                  onclick="<portlet:namespace/>hideElement('${roleId}.realmPrincipal.ui');
+                  document.getElementById('${roleId}.selectList').selectedIndex = 0;"/>
+              </td>
+            </tr>
+          </table>
+        </div>
+
+        <div id="<portlet:namespace/>${roleId}.distinguishedName.ui" style="display:none">
+          <input type="hidden" id="${roleId}.distinguishedName.lastIndex" 
+            name="${roleId}.distinguishedName.lastIndex" value="0">
+          <table border="0">
+            <tr>
+              <th><div align="right">Name:</div></th>
+              <td><input type="text" id="<portlet:namespace/>${roleId}.distinguishedName.name"/></td>
+            </tr>
+            <tr>
+              <th><div align="right"></div></th>
+              <td>
+                <input type="button" value="Add" onclick="<portlet:namespace/>addElement('${roleId}', 'distinguishedName')"/>
+                <input type="button" value="Cancel" 
+                  onclick="<portlet:namespace/>hideElement('${roleId}.distinguishedName.ui');
+                  document.getElementById('${roleId}.selectList').selectedIndex = 0;"/>
+              </td>
+            </tr>
+          </table>
+        </div>
+        <br>
+
+      </td>
+    </tr>
+  </c:forEach>
+
+  <!-- SUBMIT BUTTON -->
+  <tr>
+    <th>
+    <div align="right"></div>
+    </th>
+    <td><input type="submit" value="Next" /></td>
+  </tr>
+</table>
+</form>
+<!--   END OF FORM TO COLLECT DATA FOR THIS PAGE   -->
+
+<p><a href="<portlet:actionURL portletMode="view">
+              <portlet:param name="mode" value="index-before" />
+            </portlet:actionURL>">Cancel</a></p>

Propchange: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/configcreator/security.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/configcreator/security.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/configcreator/security.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/web.xml?view=diff&rev=565397&r1=565396&r2=565397
==============================================================================
--- geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/web.xml (original)
+++ geronimo/server/trunk/applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/web.xml Mon Aug 13 09:21:44 2007
@@ -281,6 +281,20 @@
     </servlet>
     <servlet>
         <description>Automated generated Portlet Wrapper</description>
+        <display-name>Pluto Wrapper for Create Plan Portlet</display-name>
+        <servlet-name>CreatePlan</servlet-name>
+        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
+        <init-param>
+            <param-name>portlet-class</param-name>
+            <param-value>org.apache.geronimo.console.configcreator.CreatePlanPortlet</param-value>
+        </init-param>
+        <init-param>
+            <param-name>portlet-guid</param-name>
+            <param-value>console-standard.CreatePlan</param-value>
+        </init-param>
+    </servlet>
+    <servlet>
+        <description>Automated generated Portlet Wrapper</description>
         <display-name>Pluto Wrapper for Database Wizard Portlet</display-name>
         <servlet-name>DBWizard</servlet-name>
         <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
@@ -955,6 +969,10 @@
     <servlet-mapping>
         <servlet-name>Deployment</servlet-name>
         <url-pattern>/Deployment/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>CreatePlan</servlet-name>
+        <url-pattern>/CreatePlan/*</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
         <servlet-name>DBWizard</servlet-name>

Modified: geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java?view=diff&rev=565397&r1=565396&r2=565397
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java Mon Aug 13 09:21:44 2007
@@ -300,6 +300,8 @@
     }
 
     public static class AdminObjectRefProcessor extends ResourceAnnotationHelper.ResourceProcessor {
+        public static final AdminObjectRefProcessor INSTANCE = new AdminObjectRefProcessor(null, null, null);
+
         private final EARContext earContext;
         private final Map<String, GerResourceEnvRefType> refMap;
         private final Map<String, Map<String, GerMessageDestinationType>> messageDestinations;
@@ -345,25 +347,40 @@
             }
 
             //if it maps to a message-destination in the geronimo plan, it's a message-destination.
-            GerMessageDestinationType gerMessageDestinationType = getMessageDestination(resourceName, messageDestinations);
+            GerMessageDestinationType gerMessageDestinationType = null;
+            if (messageDestinations != null) {
+                gerMessageDestinationType = getMessageDestination(resourceName, messageDestinations);
+            }
             if (gerMessageDestinationType != null) {
                 addMethodDestinationRef(annotatedApp, resourceName, resourceType, method, field, annotation);
                 return true;
             } else {
                 //if it maps to a resource-env-ref in the geronimo plan, it's a resource-ref
-                GerResourceEnvRefType resourceEnvRefType = refMap.get(resourceName);
+                GerResourceEnvRefType resourceEnvRefType = null;
+                if (refMap != null) {
+                    resourceEnvRefType = refMap.get(resourceName);
+                }
                 if (resourceEnvRefType != null || resourceType.equals("javax.transaction.UserTransaction")) {
                     //mapped resource-env-ref
                     addResourceEnvRef(annotatedApp, resourceName, resourceType, method, field, annotation);
                     return true;
                 } else {
-                    //look for an JCAAdminObject gbean with the right name
-                    AbstractNameQuery containerId = buildAbstractNameQuery(null, null, resourceName, NameFactory.JCA_ADMIN_OBJECT, NameFactory.RESOURCE_ADAPTER_MODULE);
-                    try {
-                        earContext.findGBean(containerId);
-                    } catch (GBeanNotFoundException e) {
-                        //not identifiable as an admin object ref
-                        return false;
+                    if (earContext != null) {
+                        // look for an JCAAdminObject gbean with the right name
+                        AbstractNameQuery containerId = buildAbstractNameQuery(null, null, resourceName,
+                                NameFactory.JCA_ADMIN_OBJECT, NameFactory.RESOURCE_ADAPTER_MODULE);
+                        try {
+                            earContext.findGBean(containerId);
+                        } catch (GBeanNotFoundException e) {
+                            // not identifiable as an admin object ref
+                            return false;
+                        }
+                    } else {
+                        if (!("javax.jms.Queue".equals(resourceType) || "javax.jms.Topic".equals(resourceType) 
+                                || "javax.jms.Destination".equals(resourceType))) {
+                            // not identifiable as an admin object ref
+                            return false;
+                        }
                     }
                     addResourceEnvRef(annotatedApp, resourceName, resourceType, method, field, annotation);
                     return true;

Added: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/jsr88/MessageDestination.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/jsr88/MessageDestination.java?view=auto&rev=565397
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/jsr88/MessageDestination.java (added)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/jsr88/MessageDestination.java Mon Aug 13 09:21:44 2007
@@ -0,0 +1,102 @@
+/**
+ *  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.naming.deployment.jsr88;
+
+import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType;
+
+/**
+ * Represents an element of the message-destinationType in a Geronimo deployment
+ * plan.
+ *                                             <p>
+ * Has 4 JavaBean Properties                   <br />
+ *  - messageDestinationName (type String)     <br />
+ *  - pattern (type Pattern)                   <br />
+ *  - adminObjectModule (type String)          <br />
+ *  - adminObjectLink (type String)            </p>
+ *
+ * @version $Rev$ $Date$
+ */
+public class MessageDestination extends HasPattern {
+    public MessageDestination() {
+        super(null);
+    }
+
+    public MessageDestination(GerMessageDestinationType xmlObject) {
+        super(xmlObject);
+    }
+
+    public void setMessageDestinationName(String name) {
+        String old = getMessageDestination().getMessageDestinationName();
+        getMessageDestination().setMessageDestinationName(name);
+        pcs.firePropertyChange("messageDestinationName", old, name);
+    }
+
+    public String getMessageDestinationName() {
+        return getMessageDestination().getMessageDestinationName();
+    }
+
+    public String getAdminObjectLink() {
+        return getMessageDestination().getAdminObjectLink();
+    }
+
+    public void setAdminObjectLink(String link) {
+        GerMessageDestinationType ref = getMessageDestination();
+        if(link != null && ref.isSetPattern()) {
+            clearPatternFromChoice();
+        }
+        String old = getAdminObjectLink();
+        ref.setAdminObjectLink(link);
+        pcs.firePropertyChange("adminObjectLink", old, link);
+    }
+
+    public String getAdminObjectModule() {
+        return getMessageDestination().getAdminObjectModule();
+    }
+
+    public void setAdminObjectModule(String module) {
+        GerMessageDestinationType ref = getMessageDestination();
+        if(module != null && ref.isSetPattern()) {
+            clearPatternFromChoice();
+        }
+        String old = getAdminObjectModule();
+        ref.setAdminObjectModule(module);
+        pcs.firePropertyChange("adminObjectModule", old, module);
+    }
+
+
+    protected void clearNonPatternFromChoice() {
+        GerMessageDestinationType ref = getMessageDestination();
+        if(ref.isSetAdminObjectLink()) {
+            String temp = ref.getAdminObjectLink();
+            ref.unsetAdminObjectLink();
+            pcs.firePropertyChange("adminObjectLink", temp, null);
+        }
+        if(ref.isSetAdminObjectModule()) {
+            String temp = ref.getAdminObjectModule();
+            ref.unsetAdminObjectModule();
+            pcs.firePropertyChange("adminObjectModule", temp, null);
+        }
+    }
+
+    protected GerMessageDestinationType getMessageDestination() {
+        return (GerMessageDestinationType) getXmlObject();
+    }
+
+    public void configure(GerMessageDestinationType xml) {
+        setXmlObject(xml);
+    }
+}

Propchange: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/jsr88/MessageDestination.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/jsr88/MessageDestination.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/jsr88/MessageDestination.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/modules/geronimo-test-ddbean/src/main/java/org/apache/geronimo/deployment/tools/loader/WebDeployable.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-test-ddbean/src/main/java/org/apache/geronimo/deployment/tools/loader/WebDeployable.java?view=diff&rev=565397&r1=565396&r2=565397
==============================================================================
--- geronimo/server/trunk/modules/geronimo-test-ddbean/src/main/java/org/apache/geronimo/deployment/tools/loader/WebDeployable.java (original)
+++ geronimo/server/trunk/modules/geronimo-test-ddbean/src/main/java/org/apache/geronimo/deployment/tools/loader/WebDeployable.java Mon Aug 13 09:21:44 2007
@@ -25,6 +25,8 @@
 import javax.enterprise.deploy.model.exceptions.DDBeanCreateException;
 import javax.enterprise.deploy.shared.ModuleType;
 
+import org.apache.geronimo.kernel.config.MultiParentClassLoader;
+
 /**
  *
  *
@@ -33,7 +35,11 @@
 public class WebDeployable extends AbstractDeployable {
     private final ClassLoader webLoader;
 
-    public WebDeployable(URL moduleURL) throws DDBeanCreateException {
+    public WebDeployable(URL moduleURL) throws DDBeanCreateException{
+        this(moduleURL, null);
+    }
+    
+    public WebDeployable(URL moduleURL, List parentClassLoaders) throws DDBeanCreateException {
         super(ModuleType.WAR, moduleURL, "WEB-INF/web.xml");
         ClassLoader parent = super.getModuleLoader();
         List path = new ArrayList();
@@ -48,10 +54,17 @@
                 }
             }
         }
-        webLoader = new URLClassLoader((URL[]) path.toArray(new URL[path.size()]), parent);
+        URL[] urls = (URL[]) path.toArray(new URL[path.size()]);
+        if (parentClassLoaders != null) {
+            parentClassLoaders.add(parent);
+            ClassLoader[] parents = (ClassLoader[]) parentClassLoaders.toArray(new ClassLoader[parentClassLoaders.size()]);
+            webLoader = new MultiParentClassLoader(null, urls, parents);
+        } else {
+            webLoader = new URLClassLoader(urls, parent);
+        }
     }
 
-    protected ClassLoader getModuleLoader() {
+    public ClassLoader getModuleLoader() {
         return webLoader;
     }
 }

Modified: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/WebAppDConfigBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/WebAppDConfigBean.java?view=diff&rev=565397&r1=565396&r2=565397
==============================================================================
--- geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/WebAppDConfigBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/WebAppDConfigBean.java Mon Aug 13 09:21:44 2007
@@ -17,13 +17,29 @@
 
 package org.apache.geronimo.web.deployment;
 
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
 import javax.enterprise.deploy.model.DDBean;
 import javax.enterprise.deploy.spi.DConfigBean;
 import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException;
 import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
 
 import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
+import org.apache.geronimo.deployment.service.jsr88.EnvironmentData;
 import org.apache.geronimo.naming.deployment.ENCHelper;
+import org.apache.geronimo.naming.deployment.jsr88.EjbLocalRef;
+import org.apache.geronimo.naming.deployment.jsr88.EjbRef;
+import org.apache.geronimo.naming.deployment.jsr88.MessageDestination;
+import org.apache.geronimo.naming.deployment.jsr88.ResourceEnvRef;
+import org.apache.geronimo.naming.deployment.jsr88.ResourceRef;
+import org.apache.geronimo.xbeans.geronimo.j2ee.GerAbstractSecurityType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerEjbLocalRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerEjbRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceEnvRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
 import org.apache.xmlbeans.SchemaTypeLoader;
 
@@ -32,6 +48,12 @@
  */
 public class WebAppDConfigBean extends DConfigBeanSupport {
     private final ENCHelper encHelper;
+    private EnvironmentData environment;
+    private EjbRef[] ejbRefs = new EjbRef[0];
+    private EjbLocalRef[] ejbLocalRefs = new EjbLocalRef[0];
+    private ResourceRef[] resourceRefs = new ResourceRef[0];
+    private ResourceEnvRef[] resourceEnvRefs = new ResourceEnvRef[0];
+    private MessageDestination[] messageDestinations = new MessageDestination[0];
 
     WebAppDConfigBean(DDBean ddBean, GerWebAppType webApp) {
         super(ddBean, webApp);
@@ -77,4 +99,214 @@
         return WebAppDConfigRoot.SCHEMA_TYPE_LOADER;
     }
 
+    // ----------------------- JavaBean Properties for web-app ----------------------
+
+    public EnvironmentData getEnvironment() {
+        return environment;
+    }
+
+    public void setEnvironment(EnvironmentData environment) {
+        EnvironmentData old = this.environment;
+        this.environment = environment;
+        if ((old == null && environment == null) || (old != null && old == environment)) {
+            return;
+        }
+        if (old != null) {
+            getWebApp().unsetEnvironment();
+        }
+        if (environment != null) {
+            environment.configure(getWebApp().addNewEnvironment());
+        }
+        pcs.firePropertyChange("environment", old, environment);
+    }
+
+    public EjbRef[] getEjbRefs() {
+        return ejbRefs;
+    }
+
+    public void setEjbRefs(EjbRef[] ejbRefs) {
+        EjbRef[] old = this.ejbRefs;
+        Set before = new HashSet();
+        for (int i = 0; i < old.length; i++) {
+            before.add(old[i]);
+        }
+        this.ejbRefs = ejbRefs;
+        // Handle current or new ejbRefs
+        for (int i = 0; i < ejbRefs.length; i++) {
+            EjbRef ejbRef = ejbRefs[i];
+            //if(ejbRef.getEjbRef() == null) {
+                ejbRef.configure(getWebApp().addNewEjbRef());
+            //} else {
+            //    before.remove(ejbRef);
+            //}
+        }
+        // Handle removed or new ejbRefs
+        for (Iterator it = before.iterator(); it.hasNext();) {
+            EjbRef adapter = (EjbRef) it.next();
+            GerEjbRefType all[] = getWebApp().getEjbRefArray();
+            for (int i = 0; i < all.length; i++) {
+                if(all[i] == adapter) {
+                    getWebApp().removeEjbRef(i);
+                    break;
+                }
+            }
+        }
+        pcs.firePropertyChange("ejb-ref", old, ejbRefs);
+    }
+
+    public EjbLocalRef[] getEjbLocalRefs() {
+        return ejbLocalRefs;
+    }
+
+    public void setEjbLocalRefs(EjbLocalRef[] ejbLocalRefs) {
+        EjbLocalRef[] old = this.ejbLocalRefs;
+        Set before = new HashSet();
+        for (int i = 0; i < old.length; i++) {
+            before.add(old[i]);
+        }
+        this.ejbLocalRefs = ejbLocalRefs;
+        // Handle current or new ejbLocalRefs
+        for (int i = 0; i < ejbLocalRefs.length; i++) {
+            EjbLocalRef ejbLocalRef = ejbLocalRefs[i];
+            //if(ejbLocalRef.getEjbLocalRef() == null) {
+                ejbLocalRef.configure(getWebApp().addNewEjbLocalRef());
+            //} else {
+            //    before.remove(ejbLocalRef);
+            //}
+        }
+        // Handle removed or new ejbLocalRefs
+        for (Iterator it = before.iterator(); it.hasNext();) {
+            EjbLocalRef adapter = (EjbLocalRef) it.next();
+            GerEjbLocalRefType all[] = getWebApp().getEjbLocalRefArray();
+            for (int i = 0; i < all.length; i++) {
+                if(all[i] == adapter) {
+                    getWebApp().removeEjbLocalRef(i);
+                    break;
+                }
+            }
+        }
+        pcs.firePropertyChange("ejb-local-ref", old, ejbLocalRefs);
+    }
+
+    public ResourceRef[] getResourceRefs() {
+        return resourceRefs;
+    }
+
+    public void setResourceRefs(ResourceRef[] resourceRefs) {
+        ResourceRef[] old = this.resourceRefs;
+        Set before = new HashSet();
+        for (int i = 0; i < old.length; i++) {
+            before.add(old[i]);
+        }
+        this.resourceRefs = resourceRefs;
+        // Handle current or new resourceRefs
+        for (int i = 0; i < resourceRefs.length; i++) {
+            ResourceRef resourceRef = resourceRefs[i];
+            //if(resourceRef.getResourceRef() == null) {
+            resourceRef.configure(getWebApp().addNewResourceRef());
+            //} else {
+            //    before.remove(resourceRef);
+            //}
+        }
+        // Handle removed or new resourceRefs
+        for (Iterator it = before.iterator(); it.hasNext();) {
+            ResourceRef adapter = (ResourceRef) it.next();
+            GerResourceRefType all[] = getWebApp().getResourceRefArray();
+            for (int i = 0; i < all.length; i++) {
+                if(all[i] == adapter) {
+                    getWebApp().removeResourceRef(i);
+                    break;
+                }
+            }
+        }
+        pcs.firePropertyChange("resource-ref", old, resourceRefs);
+    }
+
+    public ResourceEnvRef[] getResourceEnvRefs() {
+        return resourceEnvRefs;
+    }
+
+    public void setResourceEnvRefs(ResourceEnvRef[] resourceEnvRefs) {
+        ResourceEnvRef[] old = this.resourceEnvRefs;
+        Set before = new HashSet();
+        for (int i = 0; i < old.length; i++) {
+            before.add(old[i]);
+        }
+        this.resourceEnvRefs = resourceEnvRefs;
+        // Handle current or new resourceEnvRefs
+        for (int i = 0; i < resourceEnvRefs.length; i++) {
+            ResourceEnvRef resourceEnvRef = resourceEnvRefs[i];
+            //if(resourceEnvRef.getResourceEnvRef() == null) {
+            resourceEnvRef.configure(getWebApp().addNewResourceEnvRef());
+            //} else {
+            //    before.remove(resourceEnvRef);
+            //}
+        }
+        // Handle removed or new resourceEnvRefs
+        for (Iterator it = before.iterator(); it.hasNext();) {
+            ResourceEnvRef adapter = (ResourceEnvRef) it.next();
+            GerResourceEnvRefType all[] = getWebApp().getResourceEnvRefArray();
+            for (int i = 0; i < all.length; i++) {
+                if(all[i] == adapter) {
+                    getWebApp().removeResourceEnvRef(i);
+                    break;
+                }
+            }
+        }
+        pcs.firePropertyChange("resource-env-ref", old, resourceEnvRefs);
+    }
+
+    public MessageDestination[] getMessageDestinations() {
+        return messageDestinations;
+    }
+
+    public void setMessageDestinations(MessageDestination[] messageDestinations) {
+        MessageDestination[] old = this.messageDestinations;
+        Set before = new HashSet();
+        for (int i = 0; i < old.length; i++) {
+            before.add(old[i]);
+        }
+        this.messageDestinations = messageDestinations;
+        // Handle current or new messageDestinations
+        for (int i = 0; i < messageDestinations.length; i++) {
+            MessageDestination messageDestination = messageDestinations[i];
+            //if(messageDestination.getMessageDestination() == null) {
+            messageDestination.configure(getWebApp().addNewMessageDestination());
+            //} else {
+            //    before.remove(messageDestination);
+            //}
+        }
+        // Handle removed or new messageDestinations
+        for (Iterator it = before.iterator(); it.hasNext();) {
+            MessageDestination adapter = (MessageDestination) it.next();
+            GerMessageDestinationType all[] = getWebApp().getMessageDestinationArray();
+            for (int i = 0; i < all.length; i++) {
+                if(all[i] == adapter) {
+                    getWebApp().removeMessageDestination(i);
+                    break;
+                }
+            }
+        }
+        pcs.firePropertyChange("message-destination", old, messageDestinations);
+    }
+
+    public String getSecurityRealmName() {
+        return getWebApp().getSecurityRealmName();
+    }
+
+    public void setSecurityRealmName(String securityRealmName) {
+        pcs.firePropertyChange("securityRealmName", getSecurityRealmName(), securityRealmName);
+        getWebApp().setSecurityRealmName(securityRealmName);
+    }
+
+    public GerAbstractSecurityType getSecurity() {
+        return getWebApp().getSecurity();
+    }
+
+    public void setSecurity(GerAbstractSecurityType security) {
+        pcs.firePropertyChange("security", getSecurity(), security);
+        getWebApp().setSecurity(security);
+    }
+
+    // ----------------------- End of JavaBean Properties ----------------------
 }

Modified: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?view=diff&rev=565397&r1=565396&r2=565397
==============================================================================
--- geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java Mon Aug 13 09:21:44 2007
@@ -743,15 +743,17 @@
     }
 
     protected ClassFinder createWebAppClassFinder(WebAppType webApp, WebModule webModule) throws DeploymentException {
+        // Get the classloader from the module's EARContext
+        ClassLoader classLoader = webModule.getEarContext().getClassLoader();
+        return createWebAppClassFinder(webApp, classLoader);
+    }
 
+    public static ClassFinder createWebAppClassFinder(WebAppType webApp, ClassLoader classLoader) throws DeploymentException {
         //------------------------------------------------------------------------------------
         // Find the list of classes from the web.xml we want to search for annotations in
         //------------------------------------------------------------------------------------
         List<Class> classes = new ArrayList<Class>();
 
-        // Get the classloader from the module's EARContext
-        ClassLoader classLoader = webModule.getEarContext().getClassLoader();
-
         // Get all the servlets from the deployment descriptor
         ServletType[] servlets = webApp.getServletArray();
         for (ServletType servlet : servlets) {
@@ -796,7 +798,7 @@
         return new ClassFinder(classes);
     }
 
-    private void addClass(List<Class> classes, Class<?> clas) {
+    private static void addClass(List<Class> classes, Class<?> clas) {
         while (clas != Object.class) {
             classes.add(clas);
             clas = clas.getSuperclass();



Mime
View raw message