Changeset 3081


Ignore:
Timestamp:
08/27/11 21:34:15 (9 months ago)
Author:
garth
Message:

java - renamed logback config listener, added ZW IBISQResult controller, refactored result controller so that the IBISQ result could use core code, added the UserAuthoritiesToXMLParameter controller, added the CreateUserDetailsAndLogUserPreAuthenticationProcessingFilter? which was being used but not versioned, changed web.xmls for the logback listener class name change, changed core view app's layout to be centered with a gradient top, refactored page.xslt to handle page layout better.

Location:
trunk/src/main
Files:
6 added
4 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main/java/org/ibisph/mvc/controller/AbstractModelAndView.java

    r3013 r3081  
    169169   * Spring Controller handleRequest implementation.  This is the main action 
    170170   * handler that sets the model and specifies the view to be used.  Called by 
    171    * the Spring Framework's RequestDispatcher servlet based on the URL mapping. 
     171   * the AbstractController's handleRequest (which does some request method type 
     172   * checking, some cache checking, and session checking).  The handleRequest 
     173   * is called via Spring Framework's RequestDispatcher servlet and is based on  
     174   * the URL mapping. 
    172175   * 
    173176   * @param request HTTP Servlet Request passed from the servlet. 
  • trunk/src/main/java/org/ibisph/mvc/controller/xml/XMLModelAndDate.java

    r2197 r3081  
    190190    if(this.includeRequestParameters) { 
    191191      String paramName, paramValue; 
    192       java.util.Enumeration parameterName = request.getParameterNames(); 
     192      java.util.Enumeration<String> parameterName = request.getParameterNames(); 
    193193      while( parameterName.hasMoreElements() ) { 
    194         paramName  = (String)parameterName.nextElement(); 
     194        paramName  = parameterName.nextElement(); 
    195195        paramValue = request.getParameter(paramName); 
    196196        parametersMap.put(paramName, paramValue); 
  • trunk/src/main/java/org/ibisph/mvc/controller/xml/query/Result.java

    r2773 r3081  
    33import org.ibisph.util.NetLib; 
    44import org.ibisph.util.StrLib; 
    5 import org.ibisph.util.XMLLib; 
    65 
    76/** 
     
    6766   * measure and chart name values.  The view is responsible for recognizing 
    6867   * what to display and if the page needs a redirect.  Both of these items are  
    69    * determined by whether a QUERY_RESULT element is present.  If present then  
    70    * display the data.  If not then display the please wait and do a Result get. 
    71    * The controller will then inspect the user's query module object from their 
    72    * session and will invoke the approp business rules. 
     68   * determined by whether a IBISQ_QUERY_RESULT element is present.  If present  
     69   * then display the data.  If not then display the please wait and do a  
     70   * Result get.  The controller will then inspect the user's query module  
     71   * object from their session and will invoke the approp business rules. 
    7372   *  
    7473   * @param request Provides access to the HTTP request which the XML System ID 
     
    111110    // add the result to the query module object, and set the result date time. 
    112111    else if(!this.queryModuleService.hasQueryResponse(queryModule)) { 
    113       String url = this.queryModuleService.getBaseQueryApplicationURL(queryModule); 
    114       if(url == null) url = this.queryApplicationURL; 
    115       url = url + "?" + this.queryModuleService.getQueryURLParameters(queryModule, this.urlCharacterEncoding, this.controlParameterPrefix); 
    116       this.queryModuleService.setCompleteQueryURL(queryModule, url); 
    117       this.queryModuleService.setRequestSubmittedDateTimeStamp(queryModule, queryDateFormat.format(new java.util.Date())); 
    118       String queryResult = null; 
    119       try { 
    120         queryResult = NetLib.getURLContent(url, username, password); 
    121         if(!StrLib.isSomething(queryResult)) 
    122           this.queryModuleService.setRequestError(queryModule,  
    123             "Query Application did NOT respond",  
    124             "This is typically a network connection problem." 
    125           );  
    126         else { 
    127           logger.debug(".getXMLModelAndDate - Query Result Content: {}", queryResult); 
    128           this.queryModuleService.setQueryResult(queryModule, queryResult); 
    129           this.queryModuleService.setResultGroupByDimensionNames(queryModule); 
    130         } 
    131       }  
    132       catch(Exception e) { 
    133         // clear so doesn't throw although maybe should throw with approp message. 
    134         // typically when this happens it is using the query proxy and the URL  
    135         // contains a "<=" type sequence which the dest tomcat can't handle. 
    136         logger.error(".getXMLModelAndDate - Exception with getting Query Result. URL: " + url, e); 
    137         logger.debug(".getXMLModelAndDate - Query result problem content: {}", queryResult); 
    138  
    139         if(e instanceof org.dom4j.DocumentException)  
    140           this.queryModuleService.setRequestError( 
    141             queryModule,  
    142             "IBIS-Q returned malformed/invalid XML.", 
    143             "This is typically backend module configuration problem.  Parsing Exception: "+e.getMessage(),  
    144             queryResult 
    145           ); 
    146         else if(e instanceof java.io.FileNotFoundException) 
    147           this.queryModuleService.setRequestError( 
    148             queryModule,  
    149             "Could not locate the requested Query server.",  
    150             "This is typically a network connection problem or using the proxy and the query contains a &lt;= parameter." 
    151           );  
    152         else 
    153           this.queryModuleService.setRequestError( 
    154             queryModule,  
    155             "Problem processing the query result XML.", e.getMessage() 
    156           ); 
    157       } 
    158       this.queryModuleService.setRequestFinishedDateTimeStamp( queryModule, queryDateFormat.format(new java.util.Date()) ); 
     112      getResultAndProcess(request, queryModule); 
    159113    } 
    160114 
     
    174128  } // ---------------------------End of method------------------------------- 
    175129 
     130 
     131  /** 
     132   * Helper that localizes getting the IBISQ result and adding results to the  
     133   * query module XML. 
     134   * @param request 
     135   * @param queryModule 
     136   * @throws Exception 
     137   */ 
     138  protected void getResultAndProcess( 
     139    javax.servlet.http.HttpServletRequest request,  
     140    org.dom4j.Document queryModule 
     141  ) throws Exception { 
     142    String url = this.queryModuleService.getBaseQueryApplicationURL(queryModule); 
     143    if(url == null) url = this.queryApplicationURL; 
     144    url = url + "?" + this.queryModuleService.getQueryURLParameters(queryModule, this.urlCharacterEncoding, this.controlParameterPrefix); 
     145    this.queryModuleService.setCompleteQueryURL(queryModule, url); 
     146    this.queryModuleService.setRequestSubmittedDateTimeStamp(queryModule, queryDateFormat.format(new java.util.Date())); 
     147    String queryResult = null; 
     148    try { 
     149      queryResult = NetLib.getURLContent(url, username, password); 
     150      if(!StrLib.isSomething(queryResult)) 
     151        this.queryModuleService.setRequestError(queryModule,  
     152          "Query Application did NOT respond",  
     153          "This is typically a network connection problem." 
     154        );  
     155      else { 
     156        logger.debug(".getXMLModelAndDate - Query Result Content: {}", queryResult); 
     157        this.queryModuleService.setQueryResult(queryModule, queryResult); 
     158        this.queryModuleService.setResultGroupByDimensionNames(queryModule); 
     159      } 
     160    }  
     161    catch(Exception e) { 
     162      // clear so doesn't throw although maybe should throw with approp message. 
     163      // typically when this happens it is using the query proxy and the URL  
     164      // contains a "<=" type sequence which the dest tomcat can't handle. 
     165      logger.error(".getXMLModelAndDate - Exception with getting Query Result. URL: " + url, e); 
     166      logger.debug(".getXMLModelAndDate - Query result problem content: {}", queryResult); 
     167   
     168      if(e instanceof org.dom4j.DocumentException)  
     169        this.queryModuleService.setRequestError( 
     170          queryModule,  
     171          "IBIS-Q returned malformed/invalid XML.", 
     172          "This is typically backend module configuration problem.  Parsing Exception: "+e.getMessage(),  
     173          queryResult 
     174        ); 
     175      else if(e instanceof java.io.FileNotFoundException) 
     176        this.queryModuleService.setRequestError( 
     177          queryModule,  
     178          "Could not locate the requested Query server.",  
     179          "This is typically a network connection problem or using the proxy and the query contains a &lt;= parameter." 
     180        );  
     181      else 
     182        this.queryModuleService.setRequestError( 
     183          queryModule,  
     184          "Problem processing the query result XML.", e.getMessage() 
     185        ); 
     186    } 
     187    this.queryModuleService.setRequestFinishedDateTimeStamp( queryModule, queryDateFormat.format(new java.util.Date()) ); 
     188  } // ---------------------------End of method------------------------------- 
     189 
    176190} // ============================= End of Class ================================= 
  • trunk/src/main/webapps/ibisph-admin/WEB-INF/web.xml

    r3016 r3081  
    298298                        to be defined above (which specifies the config file to be used). 
    299299                </description> 
    300                 <listener-class>org.ibisph.listener.LogbackConfigListener</listener-class> 
     300                <listener-class>org.ibisph.listener.ConfigureLogback</listener-class> 
    301301        </listener> 
    302302 
  • trunk/src/main/webapps/ibisph-view/WEB-INF/config/spring/dispatcher_servlet.xml

    r2936 r3081  
    7777                                <prop key="/query/result/**/*.html"         >Query.Result.Controller</prop> 
    7878                                <prop key="/query/result/**/*.xls"          >Query.Result.Controller</prop>     <!-- put here so can plug in Excel specifici controller in the future. --> 
    79  
     79                                <prop key="/query/result/**/*.xml"          >Query.IBISQResult.Controller</prop>         
    8080                                <prop key="/query/result/graphic/Map/**/*.*">Query.MapGraphic.Controller</prop> 
    8181                                <prop key="/query/result/graphic/**/*.*"    >Query.ChartGraphic.Controller</prop> 
  • trunk/src/main/webapps/ibisph-view/WEB-INF/config/spring/query.xml

    r2508 r3081  
    8686                <property name="queryModuleService">  <ref bean="Query.Module.Service"/></property> 
    8787                <property name="view">                <ref bean="Query.Builder.View"/></property> 
    88     <property name="XMLDateFormat">       <ref bean="Common.DateFormat"/></property> 
     88                <property name="XMLDateFormat">       <ref bean="Common.DateFormat"/></property> 
    8989                <property name="XMLDateParameterName"><ref bean="Common.XMLDateParameterName"/></property> 
    9090                <property name="noCacheHTTPHeader">   <value>true</value></property> 
     
    117117                <property name="view"><ref bean="Query.MapGraphic.View"/></property> 
    118118                <property name="noCacheHTTPHeader"><value>true</value></property> 
     119        </bean> 
     120 
     121        <bean id="Query.IBISQResult.Controller" class="org.ibisph.mvc.controller.xml.query.IBISQResult"> 
     122                <property name="queryModuleService">  <ref bean="Query.Module.Service"/></property> 
     123                <property name="XMLDateFormat">       <ref bean="Common.DateFormat"/></property> 
     124                <property name="XMLDateParameterName"><ref bean="Common.XMLDateParameterName"/></property> 
     125                <property name="noCacheHTTPHeader">   <value>true</value></property> 
    119126        </bean> 
    120127 
  • trunk/src/main/webapps/ibisph-view/WEB-INF/web.xml

    r3016 r3081  
    322322                        to be defined above (which specifies the config file to be used). 
    323323                </description> 
    324                 <listener-class>org.ibisph.listener.LogbackConfigListener</listener-class> 
     324                <listener-class>org.ibisph.listener.ConfigureLogback</listener-class> 
    325325        </listener> 
    326326 
  • trunk/src/main/webapps/ibisph-view/css/_default.css

    r2832 r3081  
    1919} 
    2020 
     21 
    2122body 
    2223{ 
    23         width:                          755px; 
     24        width:                          100%; 
    2425        height:                         100%; 
    25         margin:                         0px;    /* see collapsing margins if margin and padding not specified */ 
    26         padding:                        0px;    /* can't set for NN 4.x tables and assoc elements - messes things up */ 
    27         background-color:       #cccccc; 
     26        margin:                         0; 
     27        padding:                        0;      /* can't set for NN 4.x tables and assoc elements - messes things up */ 
     28        background:                     url('http://www.hss.state.ak.us/css/images/background.gif') repeat-x #003366; 
    2829        font-size:                      0.75em; /* .70 (IE) -72 (FF)=original small.  75%=little bit bigger */ 
    2930} 
    3031 
     32 
     33div.Body 
     34{ 
     35        width:                          755px; 
     36        margin:                         auto;   /* centers block on page - whole point of this container */ 
     37        padding-top:            20px; 
     38} 
    3139 
    3240 
  • trunk/src/main/webapps/ibisph-view/css/header.css

    r2832 r3081  
    1919#siteHeader  
    2020{ 
    21         height:                         95px; 
    22         background:                     white url(../image/header.gif) no-repeat left top; 
     21        height:                         105px; 
     22        background:                     transparent url(../image/header.gif) no-repeat left top; 
    2323 
    2424        position:                       relative;       /* so that the pf and menu will be relative */ 
  • trunk/src/main/webapps/ibisph-view/css/siteNavigationMenu.css

    r1891 r3081  
    3030        float:                          left; 
    3131        width:                          100%; 
    32         top:                            49px; 
     32        top:                            59px; 
    3333        left:                           155px; 
    3434        padding:                        0; 
  • trunk/src/main/webapps/ibisph-view/xslt/html/Page.xslt

    r3053 r3081  
    407407        <xsl:template name="Page._body" ibis:doc="Produces the HTML BODY element and contents."> 
    408408                <body id="_body"> 
    409                         <xsl:call-template name="Page.header"/> 
    410                         <xsl:call-template name="Page.body"/> 
    411                         <xsl:call-template name="Page.footer"/> 
     409                        <div class="Body"> 
     410                                <xsl:call-template name="Page.header"/> 
     411                                <xsl:call-template name="Page.body"/> 
     412                                <xsl:call-template name="Page.footer"/> 
     413                        </div> 
    412414                </body> 
    413415        </xsl:template> 
Note: See TracChangeset for help on using the changeset viewer.