Author: jleroux
Date: Sat Oct 6 08:17:08 2007 New Revision: 582509 URL: http://svn.apache.org/viewvc?rev=582509&view=rev Log: A patch from Adrian Crum "Move common requests to a separate xml file to reduce component's controller.xml file size" (https://issues.apache.org/jira/browse/OFBIZ-1230) Thanks to BJ Freeman to review and suggestion Added: ofbiz/trunk/framework/common/webcommon/WEB-INF/ ofbiz/trunk/framework/common/webcommon/WEB-INF/common-requests.xml (with props) Modified: ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml Added: ofbiz/trunk/framework/common/webcommon/WEB-INF/common-requests.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/WEB-INF/common-requests.xml?rev=582509&view=auto ============================================================================== --- ofbiz/trunk/framework/common/webcommon/WEB-INF/common-requests.xml (added) +++ ofbiz/trunk/framework/common/webcommon/WEB-INF/common-requests.xml Sat Oct 6 08:17:08 2007 @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +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. +--> + +<site-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd"> + <description>Common Requests Configuration File</description> + <owner>Copyright 2001-2007 The Apache Software Foundation</owner> + + <errorpage>/error/error.jsp</errorpage> + + <!-- event handlers --> + <handler name="java" type="request" class="org.ofbiz.webapp.event.JavaEventHandler"/> + <handler name="soap" type="request" class="org.ofbiz.webapp.event.SOAPEventHandler"/> + <handler name="service" type="request" class="org.ofbiz.webapp.event.ServiceEventHandler"/> + <handler name="simple" type="request" class="org.ofbiz.webapp.event.SimpleEventHandler"/> + + <!-- view handlers --> + <handler name="screen" type="view" class="org.ofbiz.widget.screen.ScreenWidgetViewHandler"/> + <handler name="screenfop" type="view" class="org.ofbiz.widget.screen.ScreenFopViewHandler"/> + <handler name="jsp" type="view" class="org.ofbiz.webapp.view.JspViewHandler"/> + <handler name="http" type="view" class="org.ofbiz.webapp.view.HttpViewHandler"/> + + <preprocessor> + <!-- Events to run on every request before security (chains exempt) --> + <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="check509CertLogin"/> + <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="checkExternalLoginKey"/> + </preprocessor> + <postprocessor> + <!-- Events to run on every request after all other processing (chains exempt) --> + </postprocessor> + + <!-- Security Mappings --> + <request-map uri="checkLogin" edit="false"> + <description>Verify a user is logged in.</description> + <security https="true" auth="false"/> + <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="checkLogin" /> + <response name="success" type="view" value="main"/> + <response name="error" type="view" value="login"/> + </request-map> + <request-map uri="login"> + <security https="true" auth="false"/> + <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="login"/> + <response name="success" type="view" value="main"/> + <response name="error" type="view" value="login"/> + </request-map> + <request-map uri="logout"> + <security https="true" auth="true"/> + <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="logout"/> + <response name="success" type="request" value="checkLogin"/> + <response name="error" type="view" value="main"/> + </request-map> + + <!-- Common Mappings used for locales and timezones --> + <request-map uri="setSessionLocale"> + <security https="true" auth="false"/> + <event type="java" path="org.ofbiz.common.CommonEvents" invoke="setSessionLocale"/> + <response name="success" type="view" value="main"/> + <response name="error" type="view" value="main"/> + </request-map> + <request-map uri="setSessionTimeZone"> + <security https="true" auth="false"/> + <event type="java" path="org.ofbiz.common.CommonEvents" invoke="setSessionTimeZone"/> + <response name="success" type="view" value="main"/> + <response name="error" type="view" value="main"/> + </request-map> + <request-map uri="LookupLocales"> + <security https="true" auth="false" /> + <response name="success" type="view" value="LookupLocales" /> + </request-map> + <request-map uri="LookupTimezones"> + <security https="true" auth="false" /> + <response name="success" type="view" value="LookupTimezones" /> + </request-map> + + <!-- View Mappings --> + <view-map name="error" page="/error/error.jsp"/> + <view-map name="LookupLocales" type="screen" page="component://common/widget/LookupScreens.xml#LookupLocales"/> + <view-map name="LookupTimezones" type="screen" page="component://common/widget/LookupScreens.xml#LookupTimezones"/> +</site-conf> Propchange: ofbiz/trunk/framework/common/webcommon/WEB-INF/common-requests.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/framework/common/webcommon/WEB-INF/common-requests.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/framework/common/webcommon/WEB-INF/common-requests.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml?rev=582509&r1=582508&r2=582509&view=diff ============================================================================== --- ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml (original) +++ ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml Sat Oct 6 08:17:08 2007 @@ -20,83 +20,13 @@ <site-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd"> + <!-- The request handlers and requests that are common to all OFBiz components + can be found in the following xml file. A component can override the + requests found in the common-requests.xml file. --> + <include location="component://common/webcommon/WEB-INF/common-requests.xml"/> + <description>Example Component Site Configuration File</description> - <owner>Copyright 2001-2006 The Apache Software Foundation</owner> - <errorpage>/error/error.jsp</errorpage> - - <!-- event handlers --> - <handler name="java" type="request" class="org.ofbiz.webapp.event.JavaEventHandler"/> - <handler name="soap" type="request" class="org.ofbiz.webapp.event.SOAPEventHandler"/> - <handler name="service" type="request" class="org.ofbiz.webapp.event.ServiceEventHandler"/> - <handler name="simple" type="request" class="org.ofbiz.webapp.event.SimpleEventHandler"/> - - <!-- view handlers --> - <handler name="screen" type="view" class="org.ofbiz.widget.screen.ScreenWidgetViewHandler"/> - <handler name="screenfop" type="view" class="org.ofbiz.widget.screen.ScreenFopViewHandler"/> - <handler name="jsp" type="view" class="org.ofbiz.webapp.view.JspViewHandler"/> - <handler name="http" type="view" class="org.ofbiz.webapp.view.HttpViewHandler"/> - - <!-- - These can be used to return the reports as views; make sure the classes are compiled and available - <handler name="datavision" type="view" class="org.ofbiz.webapp.view.DataVisionViewHandler"/> - <handler name="jasperreportspdf" type="view" class="org.ofbiz.webapp.view.JasperReportsPdfViewHandler"/> - <handler name="jasperreportsxml" type="view" class="org.ofbiz.webapp.view.JasperReportsXmlViewHandler"/> - --> - - <preprocessor> - <!-- Events to run on every request before security (chains exempt) --> - <!-- <event type="java" path="org.ofbiz.webapp.event.TestEvent" invoke="test"/> --> - <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="checkExternalLoginKey"/> - </preprocessor> - <postprocessor> - <!-- Events to run on every request after all other processing (chains exempt) --> - <!-- <event type="java" path="org.ofbiz.webapp.event.TestEvent" invoke="test"/> --> - </postprocessor> - - <!-- Security Mappings --> - <request-map uri="checkLogin" edit="false"> - <description>Verify a user is logged in.</description> - <security https="true" auth="false"/> - <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="checkLogin" /> - <response name="success" type="view" value="main"/> - <response name="error" type="view" value="login"/> - </request-map> - <request-map uri="login"> - <security https="true" auth="false"/> - <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="login"/> - <response name="success" type="view" value="main"/> - <response name="requirePasswordChange" type="view" value="requirePasswordChange"/> - <response name="error" type="view" value="login"/> - </request-map> - <request-map uri="logout"> - <security https="true" auth="true"/> - <event type="java" path="org.ofbiz.webapp.control.LoginWorker" invoke="logout"/> - <response name="success" type="request" value="checkLogin"/> - <response name="error" type="view" value="main"/> - </request-map> - <!-- End of Security Mappings --> - - <!-- Common Mappings used for locales and timezones --> - <request-map uri="setSessionLocale"> - <security https="true" auth="false"/> - <event type="java" path="org.ofbiz.common.CommonEvents" invoke="setSessionLocale"/> - <response name="success" type="view" value="main"/> - <response name="error" type="view" value="main"/> - </request-map> - <request-map uri="setSessionTimeZone"> - <security https="true" auth="false"/> - <event type="java" path="org.ofbiz.common.CommonEvents" invoke="setSessionTimeZone"/> - <response name="success" type="view" value="main"/> - <response name="error" type="view" value="main"/> - </request-map> - <request-map uri="LookupLocales"> - <security https="true" auth="false" /> - <response name="success" type="view" value="LookupLocales" /> - </request-map> - <request-map uri="LookupTimezones"> - <security https="true" auth="false" /> - <response name="success" type="view" value="LookupTimezones" /> - </request-map> + <owner>Copyright 2001-2007 The Apache Software Foundation</owner> <!-- Request Mappings --> <request-map uri="main"><security https="true" auth="true"/><response name="success" type="view" value="main"/></request-map> @@ -198,13 +128,9 @@ <!-- end of request mappings --> <!-- View Mappings --> - <view-map name="error" page="/error/error.jsp"/> - <view-map name="main" type="screen" page="component://example/widget/example/CommonScreens.xml#main"/> <view-map name="login" type="screen" page="component://example/widget/example/CommonScreens.xml#login"/> <view-map name="requirePasswordChange" type="screen" page="component://example/widget/example/CommonScreens.xml#requirePasswordChange"/> - <view-map name="LookupLocales" type="screen" page="component://common/widget/LookupScreens.xml#LookupLocales"/> - <view-map name="LookupTimezones" type="screen" page="component://common/widget/LookupScreens.xml#LookupTimezones"/> <view-map name="FindExample" type="screen" page="component://example/widget/example/ExampleScreens.xml#FindExample"/> <view-map name="EditExample" type="screen" page="component://example/widget/example/ExampleScreens.xml#EditExample"/> |
Free forum by Nabble | Edit this page |