Changeset 3512 in main


Ignore:
Timestamp:
02/11/12 21:38:45 (11 years ago)
Author:
Garth Braithwaite
Message:

ut view webapp - temp commit of UI working but not 100%

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  
    22
    33<!--
    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.
    58       
    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.
    1325-->
    14 <beans default-lazy-init="false" default-dependency-check="none" default-autowire="no"
     26
     27<beans default-lazy-init="false" default-autowire="no"
    1528        xmlns="http://www.springframework.org/schema/beans"
    1629        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"
    2031>
    2132
    2233        <!-- 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.
    3450                -->
    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>
    3653
    3754                <!--
    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.
    4156                -->
    42                 <property name="mappings">
    43                         <props>
    44 
     57                <property name="urlMap">
     58                        <map>
    4559                                <!-- 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
    4763
    4864                                <!-- 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"/>
    5268
    5369
    5470                                <!-- 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"/>
    6986
    7087
    7188                                <!-- 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
    84120
    85121
    86122                                <!-- 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"/>
    88124<!--
    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"/>
    90126-->
    91127                                <!-- 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"/>
    101137
    102138
    103139                                <!-- 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"/>
    105141
    106142
    107143                                <!-- 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"/>
    112151
    113152
     
    116155                                        configured in the admin app does no harm as these URLs are never hit.
    117156                                -->
    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                               
    126174
    127175                                <!-- W E L C O M E   /   I N D E X    H A N D L E R -->
     
    131179                                        (what was a redirect within the index.html file).
    132180                                -->
    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>
    136185                </property>
    137186        </bean>
     
    147196        </bean>
    148197        -->
     198        <bean id="RequestDispatcher.BeanName.ViewResolver" class="org.springframework.web.servlet.view.BeanNameViewResolver"/>
    149199
    150200</beans>
     201
  • adopters/ut/trunk/src/main/webapps/ibisph-view/WEB-INF/config/spring/epht.xml

    r3420 r3512  
    2626        </bean>
    2727
     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
    2835
    2936        <!--  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"/>
    3745        </bean>
    3846
  • adopters/ut/trunk/src/main/webapps/ibisph-view/WEB-INF/web.xml

    r3292 r3512  
    22
    33<!--
    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
    1219        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 application
    17            the request should be sent to.
    18         2) Filter code is executed for a given request.  This is optional and
    19            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-PH
    22            all requests that need special IBIS-PH processing (anything other than
    23            a typical file request like an image file, css file, javascript file
    24            etc) is handled by the Spring MVC dispatcher servlet. 
    25         4) The dispatcher servlet is basically a glorified proxy that determines
    26            which IBIS-PH controller should be used to handle the request.  The
    27            dispatcher servlet uses a URL to controller mapping that is specified
    28            in the dispatcher_servlet.xml file.
    29         5) The controller then receives the request and processes it according to
    30            how it was coded and configured.
    31        
    32         APPLICATION CONFIGURATION:
    33         The following shows the 4 main types of configuration that an adopter needs
    34         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 Application
    36            Context XML files should be loaded as well as request filter and servlet
    37            definitions and URL mappings.  It also contains other information like
    38            session life and mime type mappings.  Adopters should mainly be
    39            concerned with the Spring context files to be loaded and filter/servlet
    40            URL mappings.
    41         2) Property files that IBIS-PH Spring configuration files use.  These files
    42            are typically named "site_specific*.properties" and contain values that
    43            are typically changed for each adopter's site.  These values are pulled
    44            in via the Spring PropertyPlaceholderConfigurer mechanism and consumed
    45            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 the
    48            AgileBlox charting package properties.  Many of these values are site
    49            specific and will be modified by an adopter.  Since the source code is
    50            outside of IBIS-PH control their values can not be injected via Spring
    51            without doing some wrapping.
    52         4) IBIS-PH Spring Framework bean configurations.  These files are referred
    53            to as Spring Application Context files or bean definition files.  They
    54            specify what objects to use for the application and what the properties
    55            are for that object to provide the desired behavior.  The web.xml file
    56            contains ALL of the Spring bean definition files to be used for the
    57            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 files
    62            to be used as well as the filters that should be applied to the various
    63            URLs.  If a different publishing or security configuration is wanted
    64            then these need to be specified here (bean definition files and the
    65            URL filter and servlet mappings).  Also verify that the servlet mappings
    66            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 web
    69            request handling.
    70         3) Edit/verify that an IBIS-PH controller exists and is named according to
    71            how it is mapped in the dispatcher servlet configuration.  Controllers
    72            are named according to what configuration file they reside in.  For
    73            example a controller named Publish.OrgUnits.Controller will be defined
    74            in a spring file named publish*.xml.  Controllers are named generically
    75            as to minimize the impact of having to change the URL to controller
    76            mappings.
    77         4) Edit/verify that the various Spring filters contain the correct URL
    78            mappings.  These are typically in a security*.xml spring bean file.
    79            See the web.xml definitions as the starting point along with the Srping
    80            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 have
    86         their context file as the prefix of their name.  Controllers and filter
    87         bean definition files are specified in the web.xml file.  Filters must
    88         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-PH
    90         related property values are specified in the "site_specific*.properties"
    91         type files.  Non IBIS-PH code configurations are defined in their own
    92         files. 
    93 
    94         In all cases, any file that is touched should be placed under some kind of
    95         configuation management control and documented.  When upgrading to a new
    96         code base these changes will have to be reimplemented/merged into the new
    97         configuration code/files.
    98 
    99         NOTE: the WEB-INF/lib directory should contain the compiled Java library
    100         jar files as specified in the various Spring Bean configuration files.
    10120-->
     21
    10222<web-app
    10323        version="2.5"
     
    10828
    10929        <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>
    11232        </icon>
    11333        <display-name>IBIS-PH - Public View</display-name>
     
    11939                controlled via Java controllers built on the Spring framework.
    12040        </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 -->
    12666        <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) to
    131                         be used instead of Spring's usage of the Apache JCL (Common's Logger). 
    132                         Using the LogbackConfigListener listener defined below allows the Spring
    133                         logging to be controlled very early in the app's startup sequence.
    134                 </description>
    13567                <param-name>logbackConfigLocation</param-name>
    13668                <param-value>/WEB-INF/config/logback.xml</param-value>
     
    13971        <context-param>
    14072                <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. 
    14477
    14578                        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
    14683                </description>
    14784                <param-name>contextConfigLocation</param-name>
    14885                <param-value>
    14986                        /WEB-INF/config/spring/common.xml
    150 
    15187                        /WEB-INF/config/spring/filter.xml
     88
    15289                        /WEB-INF/config/spring/security-remote_publish.xml
    15390
    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
    16594                </param-value>
    16695        </context-param>
    16796
    16897
    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 -->
    213117        <filter>
    214118                <filter-name>StandardFilters</filter-name>
     
    261165        </filter-mapping>
    262166
    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
    264200                specified IP address.  The address is specified either in the spring
    265201                bean config file or in a property file and should be set to the IP
     
    279215
    280216
    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 loader
    286                         will allow the logging to be configured prior to spring's initalizing
    287                         the app's beans (Spring uses JCL but a wrapper allows this logging
    288                         to be captured in logback).  If the listener is not used to specify
    289                         the logback.xml configuration file then the App's Spring common.xml
    290                         file can be used to configure logging.  If that is not used the
    291                         standard logback configuration mechanisms are to place the logback.xml
    292                         (or loback-test.xml) file on the classpath (WEB-INF/classes) or to
    293                         define system property or specify on the Java command line. 
    294 
    295                         Prior to July 2011, logging was being configured at app startup via
    296                         common.xml.  Using common.xml allowed the app to redefine the logging
    297                         properties using the site specific property file.  Using common.xml
    298                         worked well but is too late to capture the Spring app startup log out
    299                         as Spring was already being invoked and already logging.  Some adopters
    300                         wanted more robust logging definitions which required changing the
    301                         logback.xml configuration file.  This was more work and confusing to
    302                         have to specify logging properties in the ss.prop and then maintain
    303                         a custom logback.xml.  So the logging was complete removed from common
    304                         and logback.xml is now an adopter maintained file (if they want their
    305                         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-param
    316                         named contextConfigLocation defined above to load the bean definitions
    317                         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 via
    321                                 WebApplicationContextUtils.getWebApplicationContext(servletContext).
    322 
    323                         - This also allows for custom objects that can load global property
    324                                 files at startup etc. see/implement: ServletContextListener
    325 
    326                         NOTE: Some containers (like Tomcat) prefer listeners, some like Websphere
    327                         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 app
    340                 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 
    347217        <!-- ======================================================= S E R V L E T S -->
    348218        <servlet>
     
    351221                <init-param>
    352222                        <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>
    354240                </init-param>
    355241                <load-on-startup>10</load-on-startup>
     
    357243
    358244
    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        <!--
    360247                NOTE: need to map each system and NOT have a general /* mapping because
    361248                the servlet will then receive requests for image files, js, css etc...
     
    383270        <servlet-mapping>
    384271                <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>
    385276                <url-pattern>/phom/*</url-pattern>
    386277        </servlet-mapping>
     
    389280                <url-pattern>/epht/*</url-pattern>
    390281        </servlet-mapping>
    391        
     282
    392283        <!-- generic transformation request handler -->
    393284        <servlet-mapping>
     
    396287        </servlet-mapping>
    397288
    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.
    399291                For this to work, the request's getPathInfo() method is used, not the get
    400                 URL method.  Also, for Spring's dispatcher_request servlet to property resolve/
     292                URL method.  Also, for Spring's dispatcher servlet to property resolve/
    401293                handle full paths the "alwaysUseFullPath" property must be set to "true".
    402294                Example of usage is for ip charts it strips off the /indicator/graphic/ from
     
    423315        <servlet-mapping>
    424316                <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>
    425321                <url-pattern>/query/result/*</url-pattern>
    426322        </servlet-mapping>
     
    430326        </servlet-mapping>
    431327
    432         <!-- default publishing URL mapping that even if direct publishing is
     328        <!--
     329                Default publishing URL mapping that even if direct publishing is
    433330                configured in the admin app does no harm as these URLs are never hit.
    434331        -->
     
    441338                <url-pattern>/unpublish/*</url-pattern>
    442339        </servlet-mapping>
     340
    443341        <servlet-mapping>
    444342                <servlet-name>Dispatcher.Servlet</servlet-name>
    445343                <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>
    446359        </servlet-mapping>
    447360
     
    479392        <mime-mapping>
    480393                <extension>xml</extension>
    481                 <mime-type>application/xml</mime-type>
     394                <mime-type>text/xml</mime-type>
    482395        </mime-mapping>
    483396        <mime-mapping>
     
    544457        </mime-mapping>
    545458
    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 -->
    552461        <welcome-file-list>
    553462                <welcome-file>Welcome</welcome-file>
     
    557466        <!-- ======================================= H T T P   E R R O R   P A G E S -->
    558467        <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 forbidden resource.  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>
    560469        <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>
    561470        <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>
     
    575484        <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>
    576485</web-app>
     486
  • adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/SiteSpecific.xslt

    r2956 r3512  
    212212
    213213
    214         <xsl:template name="Page.body"
     214        <xsl:template name="Page.content"
    215215                ibis:doc="Provides the Utah specific layout by overriding the standard
    216216                        content container. This layout consists of an HTML table that has two
     
    248248                                </td>
    249249                                <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"/>
    253253                                </td>
    254254                        </tr>
     
    257257
    258258
    259         <xsl:template name="Page.contentHeader"
     259        <xsl:template name="Page.sectionsHeader"
    260260                ibis:doc="Utah specific page's content top that defaults to provding the
    261                         'page.contentTitle' text within an HTML h1 container and a stubbed
     261                        'Page.sectionsTitle' text within an HTML h1 container and a stubbed
    262262                        out navigation path template 'siteSpecific.navigationPath'. If
    263263                        the content title text does not exist, then the nothing is inserted."
    264264        >
    265                 <xsl:if test="string-length($Page.contentTitle) &gt; 0">
    266                         <h1 id="contentHeader"><xsl:value-of select="$Page.contentTitle"/></h1>
     265                <xsl:if test="string-length($Page.sectionsTitle) &gt; 0">
     266                        <h1 id="contentHeader"><xsl:value-of select="$Page.sectionsTitle"/></h1>
    267267                </xsl:if>
    268268                <div id="navigationPath" title="{$Page.pageTitle}">
  • adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/community/highlight/profile/SiteSpecific.xslt

    r2956 r3512  
    165165
    166166
    167         <xsl:template name="Page.contentFooter"
     167        <xsl:template name="Page.sectionsFooter"
    168168                ibis:doc="Override the default with nothing since org unit is included
    169169                        as part of the page already."
  • adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/community/highlight/report/SiteSpecific.xslt

    r2956 r3512  
    108108
    109109
    110         <xsl:template name="Page.contentFooter"
     110        <xsl:template name="Page.sectionsFooter"
    111111                ibis:doc="Override the default with nothing since org unit is included
    112112                        for each profile on the report page."
  • adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/phom/profile/expanded/SiteSpecific.xslt

    r3368 r3512  
    5353   
    5454   
    55         <xsl:template name="Page.contentBody"
     55        <xsl:template name="Page.sectionsContent"
    5656                ibis:doc="Main page content template which pretty much calls all
    5757                        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  
    293293<!--
    294294                <xsl:value-of select="$Builder.moduleConfiguration/TITLE"/>
    295                 <xsl:value-of select="$Page.contentTitle"/>
     295                <xsl:value-of select="$Page.sectionsTitle"/>
    296296-->
    297297        </xsl:template>
  • adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/secure/query/module/builder/SiteSpecific.xslt

    r2956 r3512  
    189189<!--
    190190                <xsl:value-of select="$Builder.moduleConfiguration/TITLE"/>
    191                 <xsl:value-of select="$Page.contentTitle"/>
     191                <xsl:value-of select="$Page.sectionsTitle"/>
    192192-->
    193193        </xsl:template>
  • adopters/ut/trunk/src/main/webapps/ibisph-view/xslt/html/secure/query/module/result/SiteSpecific.xslt

    r2956 r3512  
    135135                <xsl:value-of select="$Builder.moduleConfiguration/TITLE"/>
    136136                        <xsl:value-of select="/QUERY_MODULE/TITLE"/></a> &gt;
    137                 <xsl:value-of select="$Page.contentTitle"/>
     137                <xsl:value-of select="$Page.sectionsTitle"/>
    138138-->
    139139                <a href="{$SiteSpecific.builderURL}" title="Query module builder page">Query Builder</a>
Note: See TracChangeset for help on using the changeset viewer.