geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jb...@apache.org
Subject svn commit: r661834 - in /geronimo/samples/branches/2.1/samples/timereport/timereport-war/src/main/webapp/WEB-INF: geronimo-web.xml web.xml
Date Fri, 30 May 2008 19:42:08 GMT
Author: jbohn
Date: Fri May 30 12:42:08 2008
New Revision: 661834

URL: http://svn.apache.org/viewvc?rev=661834&view=rev
Log:
merge 661502 and 661518 from trunk - timereport sample cleanup.  Install realm. don't use
an ear when a war will do. Use the db pool for sql realm. - mostly reformatting, also include
SampleDatabase dependency

Modified:
    geronimo/samples/branches/2.1/samples/timereport/timereport-war/src/main/webapp/WEB-INF/geronimo-web.xml
    geronimo/samples/branches/2.1/samples/timereport/timereport-war/src/main/webapp/WEB-INF/web.xml

Modified: geronimo/samples/branches/2.1/samples/timereport/timereport-war/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/timereport/timereport-war/src/main/webapp/WEB-INF/geronimo-web.xml?rev=661834&r1=661833&r2=661834&view=diff
==============================================================================
--- geronimo/samples/branches/2.1/samples/timereport/timereport-war/src/main/webapp/WEB-INF/geronimo-web.xml
(original)
+++ geronimo/samples/branches/2.1/samples/timereport/timereport-war/src/main/webapp/WEB-INF/geronimo-web.xml
Fri May 30 12:42:08 2008
@@ -19,47 +19,66 @@
 -->
 <web-app
         xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
-        
-        <environment>
-                <moduleId>
-                        <groupId>${pom.groupId}</groupId>
-                        <artifactId>${pom.artifactId}</artifactId>
-                        <version>${version}</version> 
-                        <type>war</type>
-                </moduleId>             
-        </environment>
-                
-        <context-root>/timereport</context-root>
-        
-        <security-realm-name>TimeReportRealm</security-realm-name>
-        
-        <security>
-                <default-principal realm-name="TimeReportRealm">
-                        <principal name="anonymous"
-                                   class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"
-                                   />
-                </default-principal>
-                <role-mappings>                 
-                        <role role-name="employee">
-                                <realm realm-name="TimeReportRealm">
-                                        <principal name="EmployeeGroup"
-                                           class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"
-                                        />
-                                </realm>
-                                <realm realm-name="TimeReportRealm">
-                                        <principal name="ManagerGroup"
-                                           class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"
-                                        />                                      
-                                </realm>
-                        </role>
-                        <role role-name="manager">
-                                <realm realm-name="TimeReportRealm">
-                                        <principal name="ManagerGroup"
-                                           class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"
-                                        />                                      
-                                </realm>                                          
                     
-                        </role>
-                </role-mappings>
+
+  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
+    <dep:moduleId>
+      <dep:groupId>org.apache.geronimo.samples</dep:groupId>
+      <dep:artifactId>timereport-plugin</dep:artifactId>
+      <dep:version>${version}</dep:version>
+      <dep:type>car</dep:type>
+    </dep:moduleId>
+    <dep:dependencies>
+      <dep:dependency>
+        <dep:groupId>org.apache.geronimo.samples</dep:groupId>
+        <dep:artifactId>SampleDatasource</dep:artifactId>
+        <dep:version>${version}</dep:version>
+        <dep:type>car</dep:type>
+      </dep:dependency>
+    </dep:dependencies>
+    <dep:hidden-classes/>
+    <dep:non-overridable-classes/>
+  </dep:environment>
+    <context-root>/timereport</context-root>
+
+    <security-realm-name>TimeReportRealm</security-realm-name>
+
+    <security>
+        <default-principal realm-name="TimeReportRealm">
+            <principal name="anonymous" class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal"/>
+        </default-principal>
+        <role-mappings>
+            <role role-name="employee">
+                <realm realm-name="TimeReportRealm">
+                    <principal name="EmployeeGroup" class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"/>
+                </realm>
+                <realm realm-name="TimeReportRealm">
+                    <principal name="ManagerGroup" class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"/>
+                </realm>
+            </role>
+            <role role-name="manager">
+                <realm realm-name="TimeReportRealm">
+                    <principal name="ManagerGroup" class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal"/>
+                </realm>
+            </role>
+        </role-mappings>
     </security>
     
+    <gbean name="TimeReportRealm" class="org.apache.geronimo.security.realm.GenericSecurityRealm">
+        <attribute name="realmName">TimeReportRealm</attribute>
+        <reference name="ServerInfo">
+            <name>ServerInfo</name>
+        </reference>
+        <xml-reference name="LoginModuleConfiguration">
+            <log:login-config xmlns:log="http://geronimo.apache.org/xml/ns/loginconfig-1.1">
+                <log:login-module control-flag="REQUIRED" wrap-principals="false">
+                    <log:login-domain-name>TimeReportRealm</log:login-domain-name>
+                    <log:login-module-class>org.apache.geronimo.security.realm.providers.SQLLoginModule</log:login-module-class>
+                    <log:option name="dataSourceName">SampleNoTxDatasource</log:option>
+                    <log:option name="userSelect">select userid, password from users
where userid=?</log:option>
+                    <log:option name="groupSelect">select userid, groupname from usergroups
where userid=?</log:option>
+                </log:login-module>
+            </log:login-config>
+        </xml-reference>
+    </gbean>
+
 </web-app>

Modified: geronimo/samples/branches/2.1/samples/timereport/timereport-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/timereport/timereport-war/src/main/webapp/WEB-INF/web.xml?rev=661834&r1=661833&r2=661834&view=diff
==============================================================================
--- geronimo/samples/branches/2.1/samples/timereport/timereport-war/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/samples/branches/2.1/samples/timereport/timereport-war/src/main/webapp/WEB-INF/web.xml
Fri May 30 12:42:08 2008
@@ -18,69 +18,69 @@
     under the License.
 -->
 <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
-	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
 	 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
-	 version="2.4">	
-	 
-	<welcome-file-list>
-		<welcome-file>index.html</welcome-file>
-  	</welcome-file-list>
-  	
-	<security-constraint>
-		<web-resource-collection>
-			<web-resource-name>employee</web-resource-name>
-			<url-pattern>/employee/*</url-pattern>			
-		</web-resource-collection>
-		<auth-constraint>
-			<role-name>employee</role-name>			 
-		</auth-constraint>
-	</security-constraint>
-	
-	<security-constraint>
-		<web-resource-collection>
-			<web-resource-name>manager</web-resource-name>
-			<url-pattern>/manager/*</url-pattern>			
-		</web-resource-collection>
-		<auth-constraint>
-			<role-name>manager</role-name>
-		</auth-constraint>
-	</security-constraint>
-	
-	<login-config>
-		<auth-method>FORM</auth-method>
-		<realm-name>TimeReportRealm</realm-name>
-		<form-login-config>
-			<form-login-page>/login/login.jsp</form-login-page>
-			<form-error-page>/login/login_error.jsp</form-error-page>
-		</form-login-config>
-	</login-config>
-	
-	<security-role>
-		<role-name>employee</role-name>		
-    	</security-role>
-	<security-role>
-		<role-name>manager</role-name>		
+         version="2.4">
+
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+    </welcome-file-list>
+
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>employee</web-resource-name>
+            <url-pattern>/employee/*</url-pattern>
+        </web-resource-collection>
+        <auth-constraint>
+            <role-name>employee</role-name>
+        </auth-constraint>
+    </security-constraint>
+
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>manager</web-resource-name>
+            <url-pattern>/manager/*</url-pattern>
+        </web-resource-collection>
+        <auth-constraint>
+            <role-name>manager</role-name>
+        </auth-constraint>
+    </security-constraint>
+
+    <login-config>
+        <auth-method>FORM</auth-method>
+        <realm-name>TimeReportRealm</realm-name>
+        <form-login-config>
+            <form-login-page>/login/login.jsp</form-login-page>
+            <form-error-page>/login/login_error.jsp</form-error-page>
+        </form-login-config>
+    </login-config>
+
+    <security-role>
+        <role-name>employee</role-name>
     </security-role>
-    	
+    <security-role>
+        <role-name>manager</role-name>
+    </security-role>
+
+    <servlet>
+        <display-name>AddTimeRecordServlet</display-name>
+        <servlet-name>AddTimeRecordServlet</servlet-name>
+        <servlet-class>org.apache.geronimo.samples.timereport.web.AddTimeRecordServlet</servlet-class>
+    </servlet>
     <servlet>
-	    <display-name>AddTimeRecordServlet</display-name>
-	    <servlet-name>AddTimeRecordServlet</servlet-name>
-	    <servlet-class>org.apache.geronimo.samples.timereport.web.AddTimeRecordServlet</servlet-class>
-  	</servlet>
-  	<servlet>
-	    <display-name>AddEmployeeServlet</display-name>
-	    <servlet-name>AddEmployeeServlet</servlet-name>
-	    <servlet-class>org.apache.geronimo.samples.timereport.web.AddEmployeeServlet</servlet-class>
-  	</servlet>
-  	
-  	<servlet-mapping>
-	    <servlet-name>AddTimeRecordServlet</servlet-name>
-	    <url-pattern>/employee/add_timerecord</url-pattern>
+        <display-name>AddEmployeeServlet</display-name>
+        <servlet-name>AddEmployeeServlet</servlet-name>
+        <servlet-class>org.apache.geronimo.samples.timereport.web.AddEmployeeServlet</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>AddTimeRecordServlet</servlet-name>
+        <url-pattern>/employee/add_timerecord</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
-	    <servlet-name>AddEmployeeServlet</servlet-name>
-	    <url-pattern>/manager/add_employee</url-pattern>
+        <servlet-name>AddEmployeeServlet</servlet-name>
+        <url-pattern>/manager/add_employee</url-pattern>
     </servlet-mapping>
-        
+
 </web-app>
\ No newline at end of file



Mime
View raw message