Changeset 20092 in main


Ignore:
Timestamp:
03/24/20 16:40:36 (11 days ago)
Author:
GarthBraithwaite_STG
Message:

java, view - Updated the QueryModuleFromHTTPRequest.java service to load QM files based on the full path vs path segments. Updated community/Page.xslt to check community dim names to match name list.

Location:
trunk
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ibisph-view/src/main/webapp/xslt/html/community/Page.xslt

    r19927 r20092  
    4141
    4242        <xsl:param name="Dimensions"/>
    43         <xsl:param name="Page.dimensions" select="$Dimensions/DIMENSIONS"/>
     43        <xsl:param name="Page.dimensions" select="$Dimensions/DIMENSIONS/DIMENSION[COMMUNITY_FLAG = 'x']"/>
    4444        <xsl:param name="Measures"/>
    4545        <xsl:param name="Page.measures"   select="$Measures/MEASURES"/>
     
    5757        <xsl:param name="DimensionName"/>
    5858        <xsl:param name="DimensionValue"/>
    59         <xsl:param name="Page.dimensionName"  select="if(0 = string-length($DimensionName)) then $PathSegments[last()] else $DimensionName"/>
    60         <xsl:param name="Page.dimensionValue" select="$DimensionValue"/>
    61 
    62         <xsl:param name="Page.communityDimension"      select="$Page.dimensions/DIMENSION[NAME = $Page.dimensionName]"/>
    63         <xsl:param name="Page.communityDimensionValue" select="$Page.communityDimension/VALUES/VALUE[normalize-space(text()[1]) = $Page.dimensionValue]"/>
    64         <xsl:param name="Page.previousDimensionValue"  select="$Page.communityDimensionValue/preceding-sibling::*[not(NOT_SELECTABLE_FLAG)][1]"/>
    65         <xsl:param name="Page.nextDimensionValue"      select="$Page.communityDimensionValue/following-sibling::*[not(NOT_SELECTABLE_FLAG)][1]"/>
    66 
    67         <xsl:param name="Page.communityDimensionTitle" select="ibis:getDimensionTitle($Page.communityDimension)"/>
    68 
     59
     60
     61        <!-- GARTH TODO: discuss with Lois/CoP
     62                Implemented as a simple list so that adopters can override
     63                -or-
     64                adopters can simply deselect the COMMUNITY_FLAG in the db for those
     65                dimensions they don't want to be considered a community.
     66                xsl:param name="Page.communityDimensionNames" select="$Page.dimensions/NAME"/
     67        -->
    6968        <xsl:param name="Page.communityDimensionNames">
    7069                <NAME>GeoCnty</NAME>
     
    7776                <NAME>Income5Grps</NAME>
    7877        </xsl:param>
     78
     79        <xsl:param name="Page.dimensionName"  select="if(exists($Page.communityDimensionNames[NAME = $DimensionName])) then $DimensionName else $Page.communityDimensionNames/NAME[1]"/>
     80        <xsl:param name="Page.dimensionValue" select="$DimensionValue"/>
     81
     82        <xsl:param name="Page.communityDimension"      select="$Page.dimensions[NAME = $Page.dimensionName]"/>
     83        <xsl:param name="Page.communityDimensionValue" select="$Page.communityDimension/VALUES/VALUE[normalize-space(text()[1]) = $Page.dimensionValue]"/>
     84        <xsl:param name="Page.previousDimensionValue"  select="$Page.communityDimensionValue/preceding-sibling::*[not(NOT_SELECTABLE_FLAG)][1]"/>
     85        <xsl:param name="Page.nextDimensionValue"      select="$Page.communityDimensionValue/following-sibling::*[not(NOT_SELECTABLE_FLAG)][1]"/>
     86
     87        <xsl:param name="Page.communityDimensionTitle" select="ibis:getDimensionTitle($Page.communityDimension)"/>
     88
    7989
    8090        <!-- XML file paths injected by controller - renaming so downstream XSLT knows where this came from -->
     
    342352                                                        onchange="location=this.options[this.selectedIndex].getAttribute('href');"
    343353                                                >
    344                                                         <xsl:for-each select="$Page.dimensions/DIMENSION[NAME = $Page.communityDimensionNames/NAME]">
     354                                                        <xsl:for-each select="$Page.dimensions[NAME = $Page.communityDimensionNames/NAME]">
    345355                                                                <xsl:sort select="SORT_ORDER" data-type="number" order="ascending"/>
    346356                                                                <xsl:sort select="LABEL" order="ascending"/>
  • trunk/ibisph/src/main/java/org/ibisph/communityprofile/modelmap/ModelFromHTTPRequestPath.java

    r19906 r20092  
    132132      }
    133133    }
    134     catch(IndexOutOfBoundsException ioe) {}
     134    catch(IndexOutOfBoundsException ioobe) {}
    135135
    136136
  • trunk/ibisph/src/main/java/org/ibisph/querymodule/modelmap/QueryModuleFromHTTPRequest.java

    r6282 r20092  
    2828  protected String reloadRequestParameterName      = "Reload"; // request param name used to start new query.
    2929  protected String configurationPathParameterName  = null;     // request param name for the qm configuration path.
    30   protected String configurationPathPrefixToRemove = null;
     30// GARTH TODO: remove  protected String configurationPathPrefixToRemove = null;
    3131
    3232  protected QueryModuleXML queryModuleService = null;
     
    7878   * @param configurationPathPrefixToRemove string to be subtracted from the
    7979   *   HTTP request path to be passed into the load query module.
     80  public void setConfigurationPathPrefixToRemove(String configurationPathPrefixToRemove) {this.configurationPathPrefixToRemove = configurationPathPrefixToRemove;}
     81GARTH TODO: remove
    8082   */
    81   public void setConfigurationPathPrefixToRemove(String configurationPathPrefixToRemove) {this.configurationPathPrefixToRemove = configurationPathPrefixToRemove;}
    8283
    8384
     
    106107    if(StrLib.isSomething(this.configurationPathParameterName)) configurationPath = request.getParameter(this.configurationPathParameterName);
    107108    if(!StrLib.isSomething(configurationPath)) {
    108       String[] pathSegment = IOPath.getPathSegments(IOPath.getFilePathAndNameWithoutExtension(request.getRequestURI()));
    109       String configurationName = pathSegment[pathSegment.length-1];
    110       String moduleName        = pathSegment[pathSegment.length-2];
    111       String moduleDirectory   = pathSegment[pathSegment.length-3];
    112       configurationPath = moduleDirectory + "/" + moduleName + "/" + configurationName;
     109      String requestPath = IOPath.getFilePathAndNameWithoutExtension(request.getPathInfo());
     110      int firstPathSegmentSlash = requestPath.indexOf("/", 1) + 1;
     111      configurationPath = requestPath.substring(firstPathSegmentSlash);
    113112    }
    114     else if(StrLib.isSomething(this.configurationPathPrefixToRemove) && configurationPath.startsWith(this.configurationPathPrefixToRemove)) {
     113/* GARTH TODO: remove
     114    if(StrLib.isSomething(this.configurationPathPrefixToRemove) && configurationPath.startsWith(this.configurationPathPrefixToRemove)) {
    115115      configurationPath = configurationPath.substring(this.configurationPathPrefixToRemove.length());
    116116    }
    117 
     117*/
    118118    // if the query module doesn't already exist in mem or the current module
    119119    // does not match the requested module or the user wants to start over with
Note: See TracChangeset for help on using the changeset viewer.