geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bjr...@apache.org
Subject svn commit: r722121 - in /geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor: EjbJ2EEDeploymentDescriptor.java EjbJavaEEDeploymentDescriptor.java
Date Mon, 01 Dec 2008 16:40:16 GMT
Author: bjreed
Date: Mon Dec  1 08:40:15 2008
New Revision: 722121

URL: http://svn.apache.org/viewvc?rev=722121&view=rev
Log:
GERONIMODEVTOOLS-536 for reading in security roles from EJB.  Thanks to Delos Dai for the
patch.

Modified:
    geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJ2EEDeploymentDescriptor.java
    geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJavaEEDeploymentDescriptor.java

Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJ2EEDeploymentDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJ2EEDeploymentDescriptor.java?rev=722121&r1=722120&r2=722121&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJ2EEDeploymentDescriptor.java
(original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJ2EEDeploymentDescriptor.java
Mon Dec  1 08:40:15 2008
@@ -16,11 +16,13 @@
  */
 package org.apache.geronimo.st.core.descriptor;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
+import org.eclipse.jst.j2ee.common.SecurityRole;
+import org.eclipse.jst.j2ee.ejb.AssemblyDescriptor;
 import org.eclipse.jst.j2ee.ejb.EJBJar;
-import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
 
 /**
  * @version $Rev$ $Date$
@@ -38,12 +40,17 @@
     }
 
     public List<String> getSecurityRoles() {
-        /*  TODO Not as easy as the others, need to work on this some more
-        requiredInfo.put("infoGetter", "getSecurityRoles");
-        requiredInfo.put("implClass", "org.eclipse.jst.j2ee.common.internal.impl.SecurityRoleImpl");
-        requiredInfo.put("nameGetter", "getRoleName");
-        return getDeploymentDescriptorInfo(requiredInfo);
-        */
+        EJBJar ejb = (EJBJar)this.obj;
+        AssemblyDescriptor ad = ejb.getAssemblyDescriptor();
+        
+        if (ad != null) {
+            List<SecurityRole> roles = ad.getSecurityRoles();
+            ArrayList<String> result = new ArrayList<String>();
+            for (SecurityRole role: roles) {
+                result.add(role.getRoleName());
+            }
+            return result;
+        }
         return null;
     }
 }

Modified: geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJavaEEDeploymentDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJavaEEDeploymentDescriptor.java?rev=722121&r1=722120&r2=722121&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJavaEEDeploymentDescriptor.java
(original)
+++ geronimo/devtools/eclipse-plugin/branches/2.1.4/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJavaEEDeploymentDescriptor.java
Mon Dec  1 08:40:15 2008
@@ -16,9 +16,12 @@
  */
 package org.apache.geronimo.st.core.descriptor;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
+import org.eclipse.jst.javaee.core.SecurityRole;
+import org.eclipse.jst.javaee.ejb.AssemblyDescriptor;
 import org.eclipse.jst.javaee.ejb.EJBJar;
 
 /**
@@ -35,12 +38,17 @@
         requiredInfo.put("class", "org.eclipse.jst.javaee.ejb.EJBJar");
     }
     public List<String> getSecurityRoles() {
-        /*  TODO Not as easy as the others, need to work on this some more
-        requiredInfo.put("infoGetter", "getSecurityRoles");
-        requiredInfo.put("implClass", "org.eclipse.jst.javaee.core.internal.impl.SecurityRoleImpl");
-        requiredInfo.put("nameGetter", "getRoleName");
-        return getDeploymentDescriptorInfo(requiredInfo);
-        */
+        EJBJar ejb = (EJBJar)this.obj;
+        AssemblyDescriptor ad = ejb.getAssemblyDescriptor();
+        
+        if (ad != null) {
+            List<SecurityRole> roles = ad.getSecurityRoles();
+            ArrayList<String> result = new ArrayList<String>();
+            for (SecurityRole role: roles) {
+                result.add(role.getRoleName());
+            }
+            return result;
+        }
         return null;
     }
 }



Mime
View raw message