geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcco...@apache.org
Subject svn commit: r689667 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/ org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ org.apache.geronimo.st.v2...
Date Wed, 27 Aug 2008 23:35:30 GMT
Author: mcconne
Date: Wed Aug 27 16:35:29 2008
New Revision: 689667

URL: http://svn.apache.org/viewvc?rev=689667&view=rev
Log:
GERONIMODEVTOOLS-503 Read security info from deployment descriptor(s). Thanks to BJ Reed for
this patch !!

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationDeploymentDescriptor.java
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJ2EEDeploymentDescriptor.java
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJavaEEDeploymentDescriptor.java
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbDeploymentDescriptor.java
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJ2EEDeploymentDescriptor.java
  (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJavaEEDeploymentDescriptor.java
  (with props)
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/DeploymentDescriptorUtils.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecurityRoleMappingsSection.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/DeploymentDescriptorUtils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/DeploymentDescriptorUtils.java?rev=689667&r1=689666&r2=689667&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/DeploymentDescriptorUtils.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/DeploymentDescriptorUtils.java
Wed Aug 27 16:35:29 2008
@@ -17,6 +17,10 @@
 package org.apache.geronimo.st.core;
 
 import org.apache.geronimo.st.core.descriptor.AbstractDeploymentDescriptor;
+import org.apache.geronimo.st.core.descriptor.ApplicationJ2EEDeploymentDescriptor;
+import org.apache.geronimo.st.core.descriptor.ApplicationJavaEEDeploymentDescriptor;
+import org.apache.geronimo.st.core.descriptor.EjbJ2EEDeploymentDescriptor;
+import org.apache.geronimo.st.core.descriptor.EjbJavaEEDeploymentDescriptor;
 import org.apache.geronimo.st.core.descriptor.WebJ2EEDeploymentDescriptor;
 import org.apache.geronimo.st.core.descriptor.WebJavaEEDeploymentDescriptor;
 import org.eclipse.core.resources.IProject;
@@ -35,9 +39,21 @@
         if (obj instanceof org.eclipse.jst.j2ee.webapplication.WebApp) {
             return (new WebJ2EEDeploymentDescriptor((org.eclipse.jst.j2ee.webapplication.WebApp)
obj));
         }
-        if (obj instanceof org.eclipse.jst.javaee.web.WebApp) {
+        else if (obj instanceof org.eclipse.jst.javaee.web.WebApp) {
             return (new WebJavaEEDeploymentDescriptor((org.eclipse.jst.javaee.web.WebApp)
obj));
         }
+        else if (obj instanceof org.eclipse.jst.j2ee.application.Application) {
+            return (new ApplicationJ2EEDeploymentDescriptor((org.eclipse.jst.j2ee.application.Application)
obj));
+        }
+        else if (obj instanceof org.eclipse.jst.javaee.application.Application) {
+            return (new ApplicationJavaEEDeploymentDescriptor((org.eclipse.jst.javaee.application.Application)
obj));
+        }
+        else if (obj instanceof org.eclipse.jst.j2ee.ejb.EJBJar) {
+            return (new EjbJ2EEDeploymentDescriptor((org.eclipse.jst.j2ee.ejb.EJBJar) obj));
+        }
+        else if (obj instanceof org.eclipse.jst.javaee.ejb.EJBJar) {
+            return (new EjbJavaEEDeploymentDescriptor((org.eclipse.jst.javaee.ejb.EJBJar)
obj));
+        }
         return null;
     }
 

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationDeploymentDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationDeploymentDescriptor.java?rev=689667&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationDeploymentDescriptor.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationDeploymentDescriptor.java
Wed Aug 27 16:35:29 2008
@@ -0,0 +1,28 @@
+/*
+ * 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.st.core.descriptor;
+
+import java.util.List;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface ApplicationDeploymentDescriptor {
+
+    public List<String> getSecurityRoles();
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJ2EEDeploymentDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJ2EEDeploymentDescriptor.java?rev=689667&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJ2EEDeploymentDescriptor.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJ2EEDeploymentDescriptor.java
Wed Aug 27 16:35:29 2008
@@ -0,0 +1,45 @@
+/*
+ * 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.st.core.descriptor;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.jst.j2ee.application.Application;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ApplicationJ2EEDeploymentDescriptor extends AbstractDeploymentDescriptor implements
+        ApplicationDeploymentDescriptor {
+
+    HashMap<String, String> requiredInfo;
+
+    public ApplicationJ2EEDeploymentDescriptor(Application app) {
+        super(app);
+        requiredInfo = new HashMap<String, String>();
+        requiredInfo.put("class", "org.eclipse.jst.j2ee.application.Application");
+        requiredInfo.put("nameGetter", "getName");
+    }
+
+    public List<String> getSecurityRoles() {
+        requiredInfo.put("infoGetter", "getSecurityRoles");
+        requiredInfo.put("implClass", "org.eclipse.jst.j2ee.common.internal.impl.SecurityRoleImpl");
+        requiredInfo.put("nameGetter", "getRoleName");
+        return getDeploymentDescriptorInfo(requiredInfo);
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJ2EEDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJ2EEDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJ2EEDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJavaEEDeploymentDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJavaEEDeploymentDescriptor.java?rev=689667&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJavaEEDeploymentDescriptor.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJavaEEDeploymentDescriptor.java
Wed Aug 27 16:35:29 2008
@@ -0,0 +1,43 @@
+/*
+ * 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.st.core.descriptor;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.jst.javaee.application.Application;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ApplicationJavaEEDeploymentDescriptor extends AbstractDeploymentDescriptor implements
+        ApplicationDeploymentDescriptor {
+
+    HashMap<String, String> requiredInfo;
+
+    public ApplicationJavaEEDeploymentDescriptor(Application app) {
+        super(app);
+        requiredInfo = new HashMap<String, String>();
+        requiredInfo.put("class", "org.eclipse.jst.javaee.application.Application");
+    }
+    public List<String> getSecurityRoles() {
+        requiredInfo.put("infoGetter", "getSecurityRoles");
+        requiredInfo.put("implClass", "org.eclipse.jst.javaee.core.internal.impl.SecurityRoleImpl");
+        requiredInfo.put("nameGetter", "getRoleName");
+        return getDeploymentDescriptorInfo(requiredInfo);
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJavaEEDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJavaEEDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/ApplicationJavaEEDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbDeploymentDescriptor.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbDeploymentDescriptor.java?rev=689667&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbDeploymentDescriptor.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbDeploymentDescriptor.java
Wed Aug 27 16:35:29 2008
@@ -0,0 +1,28 @@
+/*
+ * 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.st.core.descriptor;
+
+import java.util.List;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface EjbDeploymentDescriptor {
+
+    public List<String> getSecurityRoles();
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/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/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJ2EEDeploymentDescriptor.java?rev=689667&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJ2EEDeploymentDescriptor.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJ2EEDeploymentDescriptor.java
Wed Aug 27 16:35:29 2008
@@ -0,0 +1,49 @@
+/*
+ * 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.st.core.descriptor;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.jst.j2ee.ejb.EJBJar;
+import org.eclipse.jst.j2ee.ejb.EnterpriseBean;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EjbJ2EEDeploymentDescriptor extends AbstractDeploymentDescriptor implements
+        EjbDeploymentDescriptor {
+
+    HashMap<String, String> requiredInfo;
+
+    public EjbJ2EEDeploymentDescriptor(EJBJar ejb) {
+        super(ejb);
+        requiredInfo = new HashMap<String, String>();
+        requiredInfo.put("class", "org.eclipse.jst.j2ee.ejb.EJBJar");
+        requiredInfo.put("nameGetter", "getName");
+    }
+
+    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);
+        */
+        return null;
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJ2EEDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJ2EEDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJ2EEDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/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/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJavaEEDeploymentDescriptor.java?rev=689667&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJavaEEDeploymentDescriptor.java
(added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJavaEEDeploymentDescriptor.java
Wed Aug 27 16:35:29 2008
@@ -0,0 +1,46 @@
+/*
+ * 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.st.core.descriptor;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.jst.javaee.ejb.EJBJar;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class EjbJavaEEDeploymentDescriptor extends AbstractDeploymentDescriptor implements
+        EjbDeploymentDescriptor {
+
+    HashMap<String, String> requiredInfo;
+
+    public EjbJavaEEDeploymentDescriptor(EJBJar ejb) {
+        super(ejb);
+        requiredInfo = new HashMap<String, String>();
+        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);
+        */
+        return null;
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJavaEEDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJavaEEDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/descriptor/EjbJavaEEDeploymentDescriptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecurityRoleMappingsSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecurityRoleMappingsSection.java?rev=689667&r1=689666&r2=689667&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecurityRoleMappingsSection.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.ui/src/main/java/org/apache/geronimo/st/v21/ui/sections/SecurityRoleMappingsSection.java
Wed Aug 27 16:35:29 2008
@@ -29,6 +29,8 @@
 import org.apache.geronimo.jee.security.RoleMappings;
 import org.apache.geronimo.jee.security.Security;
 import org.apache.geronimo.st.core.descriptor.AbstractDeploymentDescriptor;
+import org.apache.geronimo.st.core.descriptor.ApplicationDeploymentDescriptor;
+import org.apache.geronimo.st.core.descriptor.EjbDeploymentDescriptor;
 import org.apache.geronimo.st.core.descriptor.WebDeploymentDescriptor;
 import org.apache.geronimo.st.core.jaxb.JAXBUtils;
 import org.apache.geronimo.st.ui.CommonMessages;
@@ -174,8 +176,18 @@
     }
 
     protected boolean addRolesFromDeploymentDescriptor() {
-        List<String> declaredRoleNames = ((WebDeploymentDescriptor) getDescriptor()).getSecurityRoles();
-        if (declaredRoleNames.size() <= 0) {
+        List<String> declaredRoleNames = null;
+        if (WebDeploymentDescriptor.class.isInstance(getDescriptor())) {
+            declaredRoleNames = ((WebDeploymentDescriptor)getDescriptor()).getSecurityRoles();
+        }
+        else if (ApplicationDeploymentDescriptor.class.isInstance(getDescriptor())) {
+            declaredRoleNames = ((ApplicationDeploymentDescriptor)getDescriptor()).getSecurityRoles();
+        }
+        else if (EjbDeploymentDescriptor.class.isInstance(getDescriptor())) {
+            declaredRoleNames = ((EjbDeploymentDescriptor)getDescriptor()).getSecurityRoles();
+        }
+        
+        if (declaredRoleNames == null || declaredRoleNames.size() <= 0) {
             return false;
         }
         List<Role> definedRoles = getRoles(getPlan(), true);



Mime
View raw message