Changeset 3512 in main
- Timestamp:
- 02/11/12 21:38:45 (11 years ago)
- Location:
- adopters/ut/trunk/src/main/webapps/ibisph-view
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
adopters/ut/trunk/src/main/webapps/ibisph-view/WEB-INF/config/spring/dispatcher_servlet.xml
r3420 r3512 2 2 3 3 <!-- 4 Spring MVC Dispatcher Servlet URL patterns to Controllers mappings. 4 Spring MVC Dispatcher Servlet URL patterns to Controllers mappings. This 5 is a special bean file that is specified for the Dispatcher Servlet via 6 a web.xml init param. The servlet processes the beans specified by the 7 interface they implement. So the beans can be named anything. 5 8 6 Controllers are named generically in hopes of limiting the changes that are 7 needed to this file by an adopter. For example, to use a different 8 publishing mechanism, an adopter would modify the web.xml and load the 9 approp publish*.xml spring application context file. The different publish 10 app context spring bean config files would have their publishing controllers 11 named what they are named in this file but would use different IBIS classes 12 with different property definitions. 9 Controller Naming Phiolsophy: Controllers are named generically in hopes of 10 limiting the changes that are needed to this file by an adopter. For 11 example, to use a different publishing mechanism, an adopter would modify 12 the web.xml and load the approp publish*.xml spring application context 13 file. The different publish app context spring bean config files would 14 have their publishing controllers named the same (what they are named in 15 this file) but would use different IBIS classes with different property 16 definitions. So different bean configuration files need to have the assoc 17 controller samed the same so that this file does not have to be edited 18 when an adopter changes publishing mechanisms etc. 19 20 This file should be changed/needs to be changed when the URL patterns or 21 controllers are different or when an adopter wishes to turn off certain 22 features and/or turn on others. In these cases then the mappings need 23 to be changed and the adopter should place the file under their config 24 management. 13 25 --> 14 <beans default-lazy-init="false" default-dependency-check="none" default-autowire="no" 26 27 <beans default-lazy-init="false" default-autowire="no" 15 28 xmlns="http://www.springframework.org/schema/beans" 16 29 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 17 xsi:schemaLocation= 18 "http://www.springframework.org/schema/beans 19 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" 30 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd" 20 31 > 21 32 22 33 <!-- see 12.4 Handler mappings for some property options --> 23 <bean id="URLToBean.Mapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 24 25 <!-- The "alwaysUseFullPath" path = "true" is needed because of servlet mappings. 26 To differentiate between various IBIS requests, the full path is needed. 27 The "alwaysUseFullPath" controls how the request dispatcher servlet 28 determines which controller object should be used to handle the request. 29 If "false" then request's getResquestURL method to be used to get the 30 path to resolve. If "true" then the getPathInfo method is used (which 31 is based on the requested URL sans the path defined in the servlet mapping 32 url). When/if the Spring type filter config is used and the mapping for the 33 dispatcher is /* then this should be set to false - which is the default. 34 <bean id="RequestDispatcher.URLToBean.Mapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> 35 36 <!-- 37 The "alwaysUseFullPath" controls how the servlet matches the URL 38 mapping. From the docs: if true use the full path within the current 39 servlet context. Else, the path within the current servlet mapping. 40 Put another way if true use getRequestURI sans the servlet context 41 path prefix to match, else use getPathInfo. 42 43 For IBIS-PH the value is set to "true" so that the mapping is a more 44 complete explicit URL which can provide a 100% sure and safe mapping 45 to the approriate controller. Also, using the full path is easier 46 to maintain and understand as the web.xml servlet mappings do not 47 impact the URL mapping key. The property value has NO effect on the 48 HTTP Request's getPathInfo() or getRequestURI value. However, the 49 getPathInfo's value is impacted by the web.xml's SERVLET MAPPINGS. 34 50 --> 35 <property name="alwaysUseFullPath"><value>true</value></property> 51 <property name="alwaysUseFullPath" value="true"/> 52 <property name="pathMatcher"><bean class="org.springframework.util.AntPathMatcher"/></property> 36 53 37 54 <!-- 38 ORDERING: Not sure how it orders but it appears that it doesn't matter 39 if listed most specific to least specific. It appears that it tries 40 to match up the most specific then falls back... 55 ORDERING: The best practice is to be order most specific to least. 41 56 --> 42 <property name="mappings"> 43 <props> 44 57 <property name="urlMap"> 58 <map> 45 59 <!-- H O M E --> 46 <prop key="/home/**">Home.HTMLContent.Controller</prop> 60 <entry key="/home/phom**" value-ref="PHOM.HTMLContent.Controller"/> 61 <entry key="/home/**" value-ref="Home.HTMLContent.Controller"/> 62 47 63 48 64 <!-- P U B L I C A T I O N S --> 49 < prop key="/publications/**">Publications.HTMLContent.Controller</prop>50 < prop key="/publications/index/Chronological.html">Publications.ChronologicalIndex.Controller</prop>51 < prop key="/publications/index/Topical.html" >Publications.TopicalIndex.Controller</prop>65 <entry key="/publications/index/Chronological.html" value-ref="Publications.ChronologicalIndex.Controller"/> 66 <entry key="/publications/index/Topical.html" value-ref="Publications.TopicalIndex.Controller"/> 67 <entry key="/publications/**" value-ref="Publications.HTMLContent.Controller"/> 52 68 53 69 54 70 <!-- I N D I C A T O R --> 55 <prop key="/indicator/**">Indicator.HTMLContent.Controller</prop> 56 57 <prop key="/indicator/index/Alphabetical.html" >Indicator.AlphabeticalIndex.Controller</prop> 58 <prop key="/indicator/index/Categorized.html" >Indicator.CategorizedIndex.Controller</prop> 59 60 <prop key="/indicator/view/*.html" >Indicator.View.Controller</prop> 61 <prop key="/indicator/important_facts/*.html" >Indicator.ImportantFacts.Controller</prop> 62 <prop key="/indicator/available_services/*.html" >Indicator.AvailableServices.Controller</prop> 63 <prop key="/indicator/related/*/*.html" >Indicator.RelatedIndicators.Controller</prop> 64 <prop key="/indicator/other_resources/*.html" >Indicator.OtherResources.Controller</prop> 65 <prop key="/indicator/complete_profile/**/*.html">Indicator.CompleteProfile.Controller</prop> 66 <prop key="/indicator/view_numbers/*.html" >Indicator.ViewNumbers.Controller</prop> 67 68 <prop key="/indicator/graphic/**/*.*" >Indicator.ChartGraphic.Controller</prop> 71 <entry key="/indicator/index/Alphabetical.html" value-ref="Indicator.AlphabeticalIndex.Controller"/> 72 <entry key="/indicator/index/Categorized.html" value-ref="Indicator.CategorizedIndex.Controller"/> 73 74 <entry key="/indicator/view/*.html" value-ref="Indicator.View.Controller"/> 75 <entry key="/indicator/important_facts/*.html" value-ref="Indicator.ImportantFacts.Controller"/> 76 <entry key="/indicator/available_services/*.html" value-ref="Indicator.AvailableServices.Controller"/> 77 <entry key="/indicator/related/*/*.html" value-ref="Indicator.RelatedIndicators.Controller"/> 78 <entry key="/indicator/other_resources/*.html" value-ref="Indicator.OtherResources.Controller"/> 79 <entry key="/indicator/complete_profile/*.html" value-ref="Indicator.CompleteProfile.Controller"/> 80 <entry key="/indicator/view_numbers/*.html" value-ref="Indicator.ViewNumbers.Controller"/> 81 82 <entry key="/indicator/graphic/**" value-ref="Indicator.ChartGraphic.Controller"/> 83 84 <entry key="/indicator/**/*.html" value-ref="Indicator.HTMLContent.Controller"/> 85 <entry key="/indicator" value-ref="Indicator.HTMLContent.Controller"/> 69 86 70 87 71 88 <!-- Q U E R Y --> 72 <prop key="/query/**">Query.HTMLContent.Controller</prop> 73 74 <prop key="/query/selection/**/*.html" >Query.Selection.Controller</prop> 75 <prop key="/query/configuration/**/*.xml" >Query.Configuration.Controller</prop> 76 <prop key="/query/builder/**/*.html" >Query.Builder.Controller</prop> 77 <prop key="/query/result/**/*.html" >Query.Result.Controller</prop> 78 <prop key="/query/result/**/*.xls" >Query.Result.Controller</prop> <!-- put here so can plug in Excel specifici controller in the future. --> 79 80 <prop key="/query/result/graphic/Map/**/*.*">Query.MapGraphic.Controller</prop> 81 <prop key="/query/result/graphic/**/*.*" >Query.ChartGraphic.Controller</prop> 82 83 <prop key="/query/proxy*" >Query.QueryApplicationProxy.Controller</prop> 89 <entry key="/query/selection/**" value-ref="Query.Selection.Controller"/> 90 <entry key="/query/configuration/**" value-ref="Query.Configuration.Controller"/> 91 <entry key="/query/builder/**" value-ref="Query.Builder.Controller"/> 92 <entry key="/query/submit/**" value-ref="Query.Submit.Controller"/> 93 <entry key="/query/result/graphic/Map/**" value-ref="Query.MapGraphic.Controller"/> 94 <entry key="/query/result/graphic/**" value-ref="Query.ChartGraphic.Controller"/> 95 <entry key="/query/result/**/*.html" value-ref="Query.Result.Controller"/> 96 <entry key="/query/result/**/*.xls" value-ref="Query.Result.Controller"/> <!-- put here so can plug in Excel specifici controller in the future. --> 97 <entry key="/query/result/**/*.xml" value-ref="Query.IBISQResult.Controller"/> 98 99 <entry key="/query/proxy*" value-ref="Query.QueryApplicationProxy.Controller"/> 100 101 <entry key="/query/**/*.html" value-ref="Query.HTMLContent.Controller"/> 102 <entry key="/query" value-ref="Query.HTMLContent.Controller"/> 103 104 105 <entry key="/query/definition/list.html" value-ref="QueryDefinition.DefinitionList.Controller"/> 106 107 <entry key="/query/definition/result.html" value-ref="QueryDefinition.DefinitionResult.Controller"/> 108 <entry key="/query/definition/builder.html" value-ref="QueryDefinition.DefinitionBuilder.Controller"/> 109 <entry key="/query/criteria/builder.html" value-ref="QueryDefinition.CriteriaBuilder.Controller"/> 110 111 <entry key="/query/definition/detail/edit*" value-ref="QueryDefinition.EditDetail.Controller"/> 112 <entry key="/query/definition/detail/save*" value-ref="QueryDefinition.SaveDetail.Controller"/> 113 <entry key="/query/definition/delete" value-ref="QueryDefinition.DeleteDefinition.Controller"/> 114 115 <!-- run directly with name being specified as a get... 116 <entry key="/query/definition/result/**/*.html" value-ref="QueryDefinition.DefinitionResult.Controller"/> 117 <entry key="/query/definition/system/result/**/*.html" value-ref="QueryDefinition.SystemResult.Controller"/> 118 --> 119 84 120 85 121 86 122 <!-- C O M M U N I T Y --> 87 < prop key="/community/snapshot/Builder.html">Community.Snapshot.Builder.Controller</prop>123 <entry key="/community/snapshot/Builder.html" value-ref="Community.Snapshot.Builder.Controller"/> 88 124 <!-- 89 < prop key="/community/snapshot/Report.html">Community.Snapshot.Report.Controller</prop>125 <entry key="/community/snapshot/Report.html" value-ref="Community.Snapshot.Report.Controller"/> 90 126 --> 91 127 <!-- path: graphic/indicator view name/community name/community value.svg --> 92 < prop key="/community/highlight/graphic/*/*/*.*" >Community.Highlight.ChartGraphic.Controller</prop>93 94 < prop key="/community/highlight/index/*/*.html" >Community.Highlight.Index.Controller</prop>95 < prop key="/community/highlight/introduction/*/*.html">Community.Highlight.Introduction.Controller</prop>96 < prop key="/community/highlight/report/*/*.html" >Community.Highlight.Report.Controller</prop>97 < prop key="/community/highlight/*/*/*.html" >Community.Highlight.Profile.Controller</prop>98 < prop key="/community/highlight/**" >Community.Highlight.Selection.Controller</prop>99 100 < prop key="/community/**" >Community.HTMLContent.Controller</prop>128 <entry key="/community/highlight/graphic/*/*/*.*" value-ref="Community.Highlight.ChartGraphic.Controller"/> 129 130 <entry key="/community/highlight/index/*/*.html" value-ref="Community.Highlight.Index.Controller"/> 131 <entry key="/community/highlight/introduction/*/*.html" value-ref="Community.Highlight.Introduction.Controller"/> 132 <entry key="/community/highlight/report/*/*.html" value-ref="Community.Highlight.Report.Controller"/> 133 <entry key="/community/highlight/*/*/*.html" value-ref="Community.Highlight.Profile.Controller"/> 134 <entry key="/community/highlight/**" value-ref="Community.Highlight.Selection.Controller"/> 135 136 <entry key="/community/**" value-ref="Community.HTMLContent.Controller"/> 101 137 102 138 103 139 <!-- O T H E R - G E N E R I C T R A S F O R M A T I O N --> 104 < prop key="/view">View.Controller</prop>140 <entry key="/view" value-ref="View.Controller"/> 105 141 106 142 107 143 <!-- P H O M R E P O R T P A G E S --> 108 <prop key="/home/phom**" >PHOM.HTMLContent.Controller</prop> 109 <prop key="/phom/expanded_view/*.html">PHOM.ExpandedView.Controller</prop> 110 <prop key="/phom/view/*.html" >PHOM.CondensedView.Controller</prop> 111 <prop key="/phom/**" >PHOM.HTMLContent.Controller</prop> 144 <entry key="/phom/expanded_view/*.html" value-ref="PHOM.ExpandedView.Controller"/> 145 <entry key="/phom/view/*.html" value-ref="PHOM.CondensedView.Controller"/> 146 <entry key="/phom/**" value-ref="PHOM.HTMLContent.Controller"/> 147 148 149 <!-- E P H T --> 150 <entry key="/epht/**" value-ref="EPHT.HTMLContent.Controller"/> 112 151 113 152 … … 116 155 configured in the admin app does no harm as these URLs are never hit. 117 156 --> 118 <prop key="/publish/indicator/categorized_index.xml">Publish.CategorizedIndex.Controller</prop> 119 <prop key="/publish/indicator/*.xml" >Publish.Indicator.Controller</prop> 120 <prop key="/publish/org_units.xml" >Publish.OrgUnits.Controller</prop> 121 122 123 <!-- E P H T --> 124 <prop key="/epht/**">EPHT.HTMLContent.Controller</prop> 125 157 <entry key="/publish/categorized_index.xml" value-ref="Publish.CategorizedIndex.Controller"/> 158 <entry key="/publish/indicator/*.xml" value-ref="Publish.Indicator.Controller"/> 159 <entry key="/publish/org_units.xml" value-ref="Publish.OrgUnits.Controller"/> 160 161 162 <!-- U S E R P R O F I L E --> 163 <entry key="/user/Login.html" value-ref="User.HTMLContent.Controller"/> 164 <entry key="/user/email/Password.html" value-ref="User.EmailPassword.Controller"/> 165 <entry key="/user/new/Registration.html" value-ref="User.HTMLContent.Controller"/> 166 <entry key="/user/save/Registration" value-ref="User.SaveRegistration.Controller"/> 167 <entry key="/user/verify/Registration" value-ref="User.VerifyRegistration.Controller"/> 168 <entry key="/user/edit/Profile.html" value-ref="User.EditProfile.Controller"/> 169 <entry key="/user/save/Profile" value-ref="User.SaveProfile.Controller"/> 170 171 <!-- external URL blocker mapping --> 172 <entry key="/xml/users/**/*.xml" value-ref="Common.BannedXMLAccess.Controller"/> 173 126 174 127 175 <!-- W E L C O M E / I N D E X H A N D L E R --> … … 131 179 (what was a redirect within the index.html file). 132 180 --> 133 <prop key="/">Home.HTMLContent.Controller</prop> 134 135 </props> 181 <entry key="/Welcome" value-ref="Home.HTMLContent.Controller"/> 182 <entry key="/" value-ref="Home.HTMLContent.Controller"/> 183 184 </map> 136 185 </property> 137 186 </bean> … … 147 196 </bean> 148 197 --> 198 <bean id="RequestDispatcher.BeanName.ViewResolver" class="org.springframework.web.servlet.view.BeanNameViewResolver"/> 149 199 150 200 </beans> 201 -
adopters/ut/trunk/src/main/webapps/ibisph-view/WEB-INF/config/spring/epht.xml
r3420 r3512 26 26 </bean> 27 27 28 <bean id="EPHT.HTMLContent.XMLModel" class="org.ibisph.mvc.model.xml.systemid.SystemIDFromHTTPRequestEndOfPathInfo"> 29 <property name="XMLPath" ref="EPHT.HTMLContent.XML.Path"/> 30 </bean> 31 <bean id="EPHT.DefaultHTMLContent.XMLModel" class="org.ibisph.mvc.model.xml.object.StaticObjectIfNullObject"> 32 <property name="modelObject" ref="EPHT.Introduction.XML.SystemID"/> 33 </bean> 34 28 35 29 36 <!-- C O N T R O L L E R S --> 30 <bean id="EPHT.HTMLContent.Controller" class="org.ibisph.mvc.controller.xml.SystemIDFromEndOfPathInfoXMLModelAndDate"> 31 <property name="XMLPath"> <ref bean="EPHT.HTMLContent.XML.Path"/></property> 32 <property name="view"> <ref bean="EPHT.HTMLContent.View"/></property> 33 <property name="defaultXMLSystemID"> <ref local="EPHT.Introduction.XML.SystemID"/></property> 34 <property name="defaultResponseContentType"><value>text/html</value></property> 35 <property name="XMLDateFormat"> <ref bean="Common.DateFormat"/></property> 36 <property name="XMLDateParameterName"><ref bean="Common.XMLDateParameterName"/></property> 37 <bean id="EPHT.HTMLContent.Controller" class="org.ibisph.mvc.controller.xml.XMLModelAndParameterMap" parent="Common.FileSystemID.Controller.CommonProperties"> 38 <property name="XMLModelList"> 39 <list> 40 <ref bean="EPHT.HTMLContent.XMLModel"/> 41 <ref bean="EPHT.DefaultHTMLContent.XMLModel"/> 42 </list> 43 </property> 44 <property name="view" ref="EPHT.HTMLContent.View"/> 37 45 </bean> 38 46 -
adopters/ut/trunk/src/main/webapps/ibisph-view/WEB-INF/web.xml
r3292 r3512 2 2 3 3 <!-- 4 This file contains a basic configuration with basic publishing security and 5 remote publishing. Direct file publishing can be configured for the admin 6 app without impacting (having to do any reconfiguration) this application's 7 publishing configuration. Put another way, if the admin is configured to 8 publish directly to this applications XML directory then this application 9 never recieves a publish request so the view app's remote publishing is 10 never invoked - so it doesn't matter if it is setup or properly configured 11 as it will never be hit (so the site specific publish related configuration 4 This file contains the standard Java Web Application Server application 5 definitions for the IBIS-PH View application. See the admin app's 6 web.xml for detailed comments that describes how requests flow, spring 7 configuration, JNDI resources - info about webapp configuration. 8 9 The configuration implemented in this file contains a basic configuration 10 with remote publishing and NO user security (but publishing security). 11 12 NOTE: Direct file publishing can be configured for the admin app without 13 impacting (having to do any reconfiguration) this application's publishing 14 configuration. Put another way, if the admin is configured to publish 15 directly to this applications XML directory then this application never 16 receives a publish request so the view app's remote publishing is never 17 invoked - so it doesn't matter if it is setup or properly configured as it 18 will never be hit (so the site specific publish related configuration 12 19 properties could be ignored but only IF the admin app uses direct publishing). 13 14 BASIC APPLICATION REQUEST FLOW:15 The following provides a high level basic sequence for a user web request:16 1) Application server receives the request and determines which application17 the request should be sent to.18 2) Filter code is executed for a given request. This is optional and19 is based on the request's URL and the mapping defined in this file.20 3) If the request's URL matches a servlet pattern (defined in this file)21 then that request is handed to that servlet. In the case of IBIS-PH22 all requests that need special IBIS-PH processing (anything other than23 a typical file request like an image file, css file, javascript file24 etc) is handled by the Spring MVC dispatcher servlet.25 4) The dispatcher servlet is basically a glorified proxy that determines26 which IBIS-PH controller should be used to handle the request. The27 dispatcher servlet uses a URL to controller mapping that is specified28 in the dispatcher_servlet.xml file.29 5) The controller then receives the request and processes it according to30 how it was coded and configured.31 32 APPLICATION CONFIGURATION:33 The following shows the 4 main types of configuration that an adopter needs34 to be aware of to be able to properly configure and manage their appliction:35 1) The web.xml file (this file). web.xml defines which Spring Application36 Context XML files should be loaded as well as request filter and servlet37 definitions and URL mappings. It also contains other information like38 session life and mime type mappings. Adopters should mainly be39 concerned with the Spring context files to be loaded and filter/servlet40 URL mappings.41 2) Property files that IBIS-PH Spring configuration files use. These files42 are typically named "site_specific*.properties" and contain values that43 are typically changed for each adopter's site. These values are pulled44 in via the Spring PropertyPlaceholderConfigurer mechanism and consumed45 in various application context files.46 3) Property and configuration files that non IBIS-PH code uses directly.47 These are files like the logback.xml (logging definitions), and the48 AgileBlox charting package properties. Many of these values are site49 specific and will be modified by an adopter. Since the source code is50 outside of IBIS-PH control their values can not be injected via Spring51 without doing some wrapping.52 4) IBIS-PH Spring Framework bean configurations. These files are referred53 to as Spring Application Context files or bean definition files. They54 specify what objects to use for the application and what the properties55 are for that object to provide the desired behavior. The web.xml file56 contains ALL of the Spring bean definition files to be used for the57 application.58 59 GENERAL CONFIGURATION APPROACH:60 The general approach for configuring an adopter's web application is to:61 1) Edit this web.xml and specify the Spring application context XML files62 to be used as well as the filters that should be applied to the various63 URLs. If a different publishing or security configuration is wanted64 then these need to be specified here (bean definition files and the65 URL filter and servlet mappings). Also verify that the servlet mappings66 are correct.67 2) Edit/verify that the Request Dispatcher servlet configuration (dispatcher_servlet.xml)68 file contains the URL to controller mappings needed for the desired web69 request handling.70 3) Edit/verify that an IBIS-PH controller exists and is named according to71 how it is mapped in the dispatcher servlet configuration. Controllers72 are named according to what configuration file they reside in. For73 example a controller named Publish.OrgUnits.Controller will be defined74 in a spring file named publish*.xml. Controllers are named generically75 as to minimize the impact of having to change the URL to controller76 mappings.77 4) Edit/verify that the various Spring filters contain the correct URL78 mappings. These are typically in a security*.xml spring bean file.79 See the web.xml definitions as the starting point along with the Srping80 context files specified and connect the dots.81 5) Update the site_specific type property files with the appropriate values.82 6) Update any spring applicaiton context files as needed.83 84 SUMMARY:85 Controllers are named generically go lessen URL mapping impacts and have86 their context file as the prefix of their name. Controllers and filter87 bean definition files are specified in the web.xml file. Filters must88 be mapped in the web.xml file as well as within the main filter proxy.89 Same goes for servlet mappings. Common almost always changed IBIS-PH90 related property values are specified in the "site_specific*.properties"91 type files. Non IBIS-PH code configurations are defined in their own92 files.93 94 In all cases, any file that is touched should be placed under some kind of95 configuation management control and documented. When upgrading to a new96 code base these changes will have to be reimplemented/merged into the new97 configuration code/files.98 99 NOTE: the WEB-INF/lib directory should contain the compiled Java library100 jar files as specified in the various Spring Bean configuration files.101 20 --> 21 102 22 <web-app 103 23 version="2.5" … … 108 28 109 29 <icon> 110 <small-icon>image/ ibisph-view_16x16.ico</small-icon>111 <large-icon>image/ ibisph-view.ico</large-icon>30 <small-icon>image/application.ico</small-icon> 31 <large-icon>image/application.ico</large-icon> 112 32 </icon> 113 33 <display-name>IBIS-PH - Public View</display-name> … … 119 39 controlled via Java controllers built on the Spring framework. 120 40 </description> 121 122 123 <!-- ========================================== C O N T E X T - P A R A M S 124 Values used by the listeners 125 --> 41 <distributable/> 42 43 44 <!-- =========================================== J N D I R E S O U R C E S --> 45 <!-- not all adopters will use a db. this is provided for those who do: 46 <resource-ref> 47 <description>Resource reference to the app server container managed JNDI database connection factory</description> 48 <res-ref-name>jdbc/doh_ibisph</res-ref-name> 49 <res-ref-type>javax.sql.DataSource</res-ref-type> 50 <res-auth>Container</res-auth> 51 </resource-ref> 52 --> 53 <resource-ref> 54 <description>Resource reference to the app server container managed JNDI JavaMail factory</description> 55 <res-ref-name>mail/doh_ibisph</res-ref-name> 56 <res-type>javax.mail.Session</res-type> 57 <res-auth>Container</res-auth> 58 <!-- 59 <res-sharing-scope>Shareable</res-sharing-scope> 60 --> 61 </resource-ref> 62 63 64 <!-- ========================================== C O N T E X T - P A R A M S --> 65 <!-- Values used by the listeners --> 126 66 <context-param> 127 <description>128 This parameter value specifies the Spring Framework's Log4j config file.129 130 Using the jcl-over-slf4j lib allows slf4j (logback in this case) to131 be used instead of Spring's usage of the Apache JCL (Common's Logger).132 Using the LogbackConfigListener listener defined below allows the Spring133 logging to be controlled very early in the app's startup sequence.134 </description>135 67 <param-name>logbackConfigLocation</param-name> 136 68 <param-value>/WEB-INF/config/logback.xml</param-value> … … 139 71 <context-param> 140 72 <description> 141 Defines the Spring application context definition files to be used 142 the application. These files are Spring bean definitions which will 143 be loaded by the Spring Bean Factory. 73 Defines the global, app context wide Spring application context 74 definition files to be used for the application. These files are 75 Spring bean definitions which will be loaded by the Spring Bean 76 Factory and are availaable to any object within the app. 144 77 145 78 See the context listener defined below which uses this param (list). 79 80 Optional context files: 81 /WEB-INF/config/spring/security-db_authentication.xml 82 /WEB-INF/config/spring/https.xml 146 83 </description> 147 84 <param-name>contextConfigLocation</param-name> 148 85 <param-value> 149 86 /WEB-INF/config/spring/common.xml 150 151 87 /WEB-INF/config/spring/filter.xml 88 152 89 /WEB-INF/config/spring/security-remote_publish.xml 153 90 154 /WEB-INF/config/spring/home.xml 155 /WEB-INF/config/spring/publications.xml 156 /WEB-INF/config/spring/indicator.xml 157 /WEB-INF/config/spring/community.xml 158 /WEB-INF/config/spring/query.xml 159 /WEB-INF/config/spring/phom.xml 160 /WEB-INF/config/spring/epht.xml 161 162 /WEB-INF/config/spring/chart-agileblox.xml 163 /WEB-INF/config/spring/publish-remote.xml 164 /WEB-INF/config/spring/view.xml 91 /WEB-INF/config/spring/security.xml 92 /WEB-INF/config/spring/security-pre_authentication.xml 93 /WEB-INF/config/spring/security-xml_authentication.xml 165 94 </param-value> 166 95 </context-param> 167 96 168 97 169 <!-- ========================================================= F I L T E R S 170 The IBIS Filters can either be specified in this web.xml file or handled 171 within the Spring environment. To allow filters to have their values 172 set via property files or Spring bean injection configuration files as 173 well as to utilize the more robust filter url mapping mechanism the 174 Spring filter mechanism is used. 175 176 The IBIS filters used by the system is implemented by using these of 2 177 types of Spring filters: 178 - DelegatingFilterProxy - part of the core spring web package. This 179 filter proxy simply wraps a normal filter object and allows spring 180 bean managemement/injection. It does NOT provide any filter mapping. 181 182 - FilterChainProxy is part of the security package. In addition to what 183 the DelegatingFilterProxy object provides, it adds a filter mapping 184 and chaining mechanmism. This chaining is specified as a property in 185 an ANT style url configuration. This approach has been implemented for 186 this app since it is easier to doc and understand the URL mapping vs 187 normal web.xml filter mappings. 188 189 Both are used for IBIS-PH. The initial "real" filter is the delegate 190 which simply passes things off to the bean enabled chain proxy. This 191 provides the ability to use the life cycle init parameter and allows 192 the properties to be set via the configuration xml file. 193 194 NOTE: For "Delegated" IBIS filters that extend/are based on the Abstract 195 PathPatternFilter, the filterLifecycle property must be set to true. 196 This can also be done via the "targetFilterLifecycle" init-param. This 197 must be set to true so that the filters will have their required the 198 init methods called properly. 199 200 <init-param> 201 <description> 202 Enforces invocation of the Filter.init and Filter.destroy lifecycle 203 methods on the target bean, letting the servlet container manage the 204 filter lifecycle. 205 </description> 206 <param-name>targetFilterLifecycle</param-name> 207 <param-value>true</param-value> 208 </init-param> 209 210 SEE: Version 1.7 and prior, April, 2008 for the older web.xml that had the 211 filter and filter mappings completely defined within the web.xml w/o spring. 212 --> 98 <!-- ===================================================== L I S T E N E R S --> 99 <listener> 100 <listener-class>org.ibisph.listener.ConfigureLogback</listener-class> 101 </listener> 102 103 <listener> 104 <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 105 </listener> 106 107 <listener> 108 <description> 109 Publishes events for session creation and destruction through the app 110 context. Optional unless concurrent session control is being used. 111 </description> 112 <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class> 113 </listener> 114 115 116 <!-- ========================================================= F I L T E R S --> 213 117 <filter> 214 118 <filter-name>StandardFilters</filter-name> … … 261 165 </filter-mapping> 262 166 263 <!-- Entries needed to check that publish requests are originating from a 167 <filter-mapping> 168 <filter-name>StandardFilters</filter-name> 169 <url-pattern>/css/*</url-pattern> 170 </filter-mapping> 171 <filter-mapping> 172 <filter-name>StandardFilters</filter-name> 173 <url-pattern>/image/*</url-pattern> 174 </filter-mapping> 175 <filter-mapping> 176 <filter-name>StandardFilters</filter-name> 177 <url-pattern>/js/*</url-pattern> 178 </filter-mapping> 179 180 <filter-mapping> 181 <filter-name>SecurityFilters</filter-name> 182 <url-pattern>/user/*</url-pattern> 183 </filter-mapping> 184 <filter-mapping> 185 <filter-name>SecurityFilters</filter-name> 186 <url-pattern>/query/definition/*</url-pattern> 187 </filter-mapping> 188 <filter-mapping> 189 <filter-name>SecurityFilters</filter-name> 190 <url-pattern>/query/criteria/*</url-pattern> 191 </filter-mapping> 192 193 <filter-mapping> 194 <filter-name>SecurityFilters</filter-name> 195 <url-pattern>/secure/*</url-pattern> 196 </filter-mapping> 197 198 <!-- 199 Entries needed to check that publish requests are originating from a 264 200 specified IP address. The address is specified either in the spring 265 201 bean config file or in a property file and should be set to the IP … … 279 215 280 216 281 <!-- ===================================================== L I S T E N E R S -->282 283 <listener>284 <description>285 Listener that if defined before the spring context listener loader286 will allow the logging to be configured prior to spring's initalizing287 the app's beans (Spring uses JCL but a wrapper allows this logging288 to be captured in logback). If the listener is not used to specify289 the logback.xml configuration file then the App's Spring common.xml290 file can be used to configure logging. If that is not used the291 standard logback configuration mechanisms are to place the logback.xml292 (or loback-test.xml) file on the classpath (WEB-INF/classes) or to293 define system property or specify on the Java command line.294 295 Prior to July 2011, logging was being configured at app startup via296 common.xml. Using common.xml allowed the app to redefine the logging297 properties using the site specific property file. Using common.xml298 worked well but is too late to capture the Spring app startup log out299 as Spring was already being invoked and already logging. Some adopters300 wanted more robust logging definitions which required changing the301 logback.xml configuration file. This was more work and confusing to302 have to specify logging properties in the ss.prop and then maintain303 a custom logback.xml. So the logging was complete removed from common304 and logback.xml is now an adopter maintained file (if they want their305 logging to be different from the stanard definition).306 307 NOTE: This listener requires a context-param "logbackConfigLocation"308 to be defined above (which specifies the config file to be used).309 </description>310 <listener-class>org.ibisph.listener.LogbackConfigListener</listener-class>311 </listener>312 313 <listener>314 <description>315 Listener that loads/inits Spring. This listener uses the context-param316 named contextConfigLocation defined above to load the bean definitions317 when the context is loaded.318 319 - Loads the root application context of this web app at startup.320 - The application context is then available via321 WebApplicationContextUtils.getWebApplicationContext(servletContext).322 323 - This also allows for custom objects that can load global property324 files at startup etc. see/implement: ServletContextListener325 326 NOTE: Some containers (like Tomcat) prefer listeners, some like Websphere327 like servlets. Listed below is the servlet code for such enviros.328 <![CDATA[329 <servlet>330 <servlet-name>ContextLoaderServlet</servlet-name>331 <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>332 <load-on-startup>2</load-on-startup>333 </servlet>334 ]]>335 </description>336 <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>337 </listener>338 339 <!-- Publishes events for session creation and destruction through the app340 context. Optional unless concurrent session control is being used.341 -->342 <listener>343 <listener-class>org.springframework.security.ui.session.HttpSessionEventPublisher</listener-class>344 </listener>345 346 347 217 <!-- ======================================================= S E R V L E T S --> 348 218 <servlet> … … 351 221 <init-param> 352 222 <param-name>contextConfigLocation</param-name> 353 <param-value>/WEB-INF/config/spring/dispatcher_servlet.xml</param-value> 223 <param-value> 224 /WEB-INF/config/spring/home.xml 225 /WEB-INF/config/spring/publications.xml 226 /WEB-INF/config/spring/indicator.xml 227 /WEB-INF/config/spring/community.xml 228 /WEB-INF/config/spring/query.xml 229 /WEB-INF/config/spring/phom.xml 230 /WEB-INF/config/spring/epht.xml 231 /WEB-INF/config/spring/view.xml 232 233 /WEB-INF/config/spring/query_definition.xml 234 /WEB-INF/config/spring/user.xml 235 236 /WEB-INF/config/spring/chart-agileblox.xml 237 /WEB-INF/config/spring/publish-remote.xml 238 239 /WEB-INF/config/spring/dispatcher_servlet.xml</param-value> 354 240 </init-param> 355 241 <load-on-startup>10</load-on-startup> … … 357 243 358 244 359 <!-- ======================================= S E R V L E T M A P P I N G S 245 <!-- ======================================= S E R V L E T M A P P I N G S --> 246 <!-- 360 247 NOTE: need to map each system and NOT have a general /* mapping because 361 248 the servlet will then receive requests for image files, js, css etc... … … 383 270 <servlet-mapping> 384 271 <servlet-name>Dispatcher.Servlet</servlet-name> 272 <url-pattern>/user/*</url-pattern> 273 </servlet-mapping> 274 <servlet-mapping> 275 <servlet-name>Dispatcher.Servlet</servlet-name> 385 276 <url-pattern>/phom/*</url-pattern> 386 277 </servlet-mapping> … … 389 280 <url-pattern>/epht/*</url-pattern> 390 281 </servlet-mapping> 391 282 392 283 <!-- generic transformation request handler --> 393 284 <servlet-mapping> … … 396 287 </servlet-mapping> 397 288 398 <!-- NOTE: These mappings are mainly used as a mechanism to remove a path prefix. 289 <!-- 290 NOTE: These mappings are mainly used as a mechanism to remove a path prefix. 399 291 For this to work, the request's getPathInfo() method is used, not the get 400 URL method. Also, for Spring's dispatcher _requestservlet to property resolve/292 URL method. Also, for Spring's dispatcher servlet to property resolve/ 401 293 handle full paths the "alwaysUseFullPath" property must be set to "true". 402 294 Example of usage is for ip charts it strips off the /indicator/graphic/ from … … 423 315 <servlet-mapping> 424 316 <servlet-name>Dispatcher.Servlet</servlet-name> 317 <url-pattern>/query/submit/*</url-pattern> 318 </servlet-mapping> 319 <servlet-mapping> 320 <servlet-name>Dispatcher.Servlet</servlet-name> 425 321 <url-pattern>/query/result/*</url-pattern> 426 322 </servlet-mapping> … … 430 326 </servlet-mapping> 431 327 432 <!-- default publishing URL mapping that even if direct publishing is 328 <!-- 329 Default publishing URL mapping that even if direct publishing is 433 330 configured in the admin app does no harm as these URLs are never hit. 434 331 --> … … 441 338 <url-pattern>/unpublish/*</url-pattern> 442 339 </servlet-mapping> 340 443 341 <servlet-mapping> 444 342 <servlet-name>Dispatcher.Servlet</servlet-name> 445 343 <url-pattern>/Welcome</url-pattern> 344 </servlet-mapping> 345 346 <!-- Blocked direct file access URLs. Files that need to be blocked from 347 public access can have a general mapping that goes to a simple controller 348 that returns a missing resource page. This could also be mapped to a 349 general controller that simply returns a 404 or 403 error. Remember that 350 a corresponding mapping needs to exist in the dispatcher_servlet.xml 351 file as well as here in the servlet mapping. There are other ways to 352 impelment like putting the files within a WEB-INF/* subdirectory. Can 353 also be done via a filter (like the CheckAllowedRequesterIPAddressFilter) 354 or via a similar filter etc. 355 --> 356 <servlet-mapping> 357 <servlet-name>Dispatcher.Servlet</servlet-name> 358 <url-pattern>/xml/users/*</url-pattern> 446 359 </servlet-mapping> 447 360 … … 479 392 <mime-mapping> 480 393 <extension>xml</extension> 481 <mime-type> application/xml</mime-type>394 <mime-type>text/xml</mime-type> 482 395 </mime-mapping> 483 396 <mime-mapping> … … 544 457 </mime-mapping> 545 458 546 547 <!-- =============================== D E F A U L T / W E L C O M E P A G E 548 NOTE: This has to be a physical file for anything prior to Servlet API 2.4. 549 If 2.4+ you can map the servlet then use the servlet name in the welcome 550 list. 551 --> 459 460 <!-- =============================== D E F A U L T / W E L C O M E P A G E --> 552 461 <welcome-file-list> 553 462 <welcome-file>Welcome</welcome-file> … … 557 466 <!-- ======================================= H T T P E R R O R P A G E S --> 558 467 <error-page><error-code>401</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=You are not authorized to view the requested resource.</location></error-page> 559 <error-page><error-code>403</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=You are trying to view a forbiddenresource. The request was understood by the server but a response was refused.</location></error-page>468 <error-page><error-code>403</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=You are trying to view a restricted resource. The request was understood by the server but a response was refused.</location></error-page> 560 469 <error-page><error-code>404</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=Requested resource was not found. It has either moved or is unavailable.</location></error-page> 561 470 <error-page><error-code>405</error-code><location>/WEB-INF/jsp/error/detail.jsp?message=The page tried to use a method which is not supported for this URL.</location></error-page> … … 575 484 <error-page><exception-type>java.lang.Throwable</exception-type><location>/WEB-INF/jsp/error/detail.jsp?message=Uncaught System Run Time Exception</location></error-page> 576 485 </web-app> 486 -
adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/SiteSpecific.xslt
r2956 r3512 212 212 213 213 214 <xsl:template name="Page. body"214 <xsl:template name="Page.content" 215 215 ibis:doc="Provides the Utah specific layout by overriding the standard 216 216 content container. This layout consists of an HTML table that has two … … 248 248 </td> 249 249 <td class="RightColumn"> 250 <xsl:call-template name="Page. contentHeader"/>251 <xsl:call-template name="Page. contentBody"/>252 <xsl:call-template name="Page. contentFooter"/>250 <xsl:call-template name="Page.sectionsHeader"/> 251 <xsl:call-template name="Page.sectionsContent"/> 252 <xsl:call-template name="Page.sectionsFooter"/> 253 253 </td> 254 254 </tr> … … 257 257 258 258 259 <xsl:template name="Page. contentHeader"259 <xsl:template name="Page.sectionsHeader" 260 260 ibis:doc="Utah specific page's content top that defaults to provding the 261 ' page.contentTitle' text within an HTML h1 container and a stubbed261 'Page.sectionsTitle' text within an HTML h1 container and a stubbed 262 262 out navigation path template 'siteSpecific.navigationPath'. If 263 263 the content title text does not exist, then the nothing is inserted." 264 264 > 265 <xsl:if test="string-length($Page. contentTitle) > 0">266 <h1 id="contentHeader"><xsl:value-of select="$Page. contentTitle"/></h1>265 <xsl:if test="string-length($Page.sectionsTitle) > 0"> 266 <h1 id="contentHeader"><xsl:value-of select="$Page.sectionsTitle"/></h1> 267 267 </xsl:if> 268 268 <div id="navigationPath" title="{$Page.pageTitle}"> -
adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/community/highlight/profile/SiteSpecific.xslt
r2956 r3512 165 165 166 166 167 <xsl:template name="Page. contentFooter"167 <xsl:template name="Page.sectionsFooter" 168 168 ibis:doc="Override the default with nothing since org unit is included 169 169 as part of the page already." -
adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/community/highlight/report/SiteSpecific.xslt
r2956 r3512 108 108 109 109 110 <xsl:template name="Page. contentFooter"110 <xsl:template name="Page.sectionsFooter" 111 111 ibis:doc="Override the default with nothing since org unit is included 112 112 for each profile on the report page." -
adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/phom/profile/expanded/SiteSpecific.xslt
r3368 r3512 53 53 54 54 55 <xsl:template name="Page. contentBody"55 <xsl:template name="Page.sectionsContent" 56 56 ibis:doc="Main page content template which pretty much calls all 57 57 of the indicator profile element field templates (complete indicator -
adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/query/module/builder/SiteSpecific.xslt
r2956 r3512 293 293 <!-- 294 294 <xsl:value-of select="$Builder.moduleConfiguration/TITLE"/> 295 <xsl:value-of select="$Page. contentTitle"/>295 <xsl:value-of select="$Page.sectionsTitle"/> 296 296 --> 297 297 </xsl:template> -
adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/secure/query/module/builder/SiteSpecific.xslt
r2956 r3512 189 189 <!-- 190 190 <xsl:value-of select="$Builder.moduleConfiguration/TITLE"/> 191 <xsl:value-of select="$Page. contentTitle"/>191 <xsl:value-of select="$Page.sectionsTitle"/> 192 192 --> 193 193 </xsl:template> -
adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/secure/query/module/result/SiteSpecific.xslt
r2956 r3512 135 135 <xsl:value-of select="$Builder.moduleConfiguration/TITLE"/> 136 136 <xsl:value-of select="/QUERY_MODULE/TITLE"/></a> > 137 <xsl:value-of select="$Page. contentTitle"/>137 <xsl:value-of select="$Page.sectionsTitle"/> 138 138 --> 139 139 <a href="{$SiteSpecific.builderURL}" title="Query module builder page">Query Builder</a>
Note: See TracChangeset
for help on using the changeset viewer.