Changeset 13450 in main


Ignore:
Timestamp:
03/28/17 11:30:42 (3 years ago)
Author:
Garth Braithwaite
Message:

admin, view, db, java - temp commit.

Location:
trunk
Files:
1 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/db/src/main/scripts/mysql/data-cleanup.sql

    r13039 r13450  
    115115
    116116
     117/* might want to remove these invalid chars from all IP, IPV, IPDS, DIM names:
     118'.-+%$#@^*()=/'
     119*/
     120
    117121
    118122/* set the new v3 ip.synopsis column */
  • trunk/ibisph-admin/src/main/webapp/WEB-INF/config/spring/publish-direct.xml

    r13418 r13450  
    5353        </bean>
    5454
     55        <bean id="publishOrgUnitsXMLFilePathAndName" class="org.ibisph.model.StringHolder">     
     56                <description>used by indicator indexes</description>
     57                <constructor-arg value="org_units.xml"/>
     58        </bean>
     59        <bean id="publishPublishedIndicatorProfilesXMLFilePathAndName" class="org.ibisph.model.StringHolder">
     60                <description>used by indicator indexes</description>
     61                <constructor-arg value="indicator/published_profiles.xml"/>
     62        </bean>
     63        <bean id="publishIndicatorProfileXMLPath" class="org.ibisph.model.StringHolder">
     64                <constructor-arg value="indicator/profile"/>
     65        </bean>
     66
    5567        <bean id="publishXMLBasePath" class="org.ibisph.model.StringHolder">
    5668                <description>
     
    6678                <constructor-arg value="../ibisph-view/xml"/>
    6779        </bean>
    68         <bean id="publishCategorizedIndexXMLFilePathAndName" class="org.ibisph.model.StringHolder">     
    69                 <description>used by indicator indexes</description>
    70                 <constructor-arg value="indicator/categorized_index.xml"/>
    71         </bean>
    72         <bean id="publishOrgUnitsXMLFilePathAndName" class="org.ibisph.model.StringHolder">     
    73                 <description>used by indicator indexes</description>
    74                 <constructor-arg value="org_units.xml"/>
    75         </bean>
    76         <bean id="publishPublishedIndicatorProfilesXMLFilePathAndName" class="org.ibisph.model.StringHolder">
    77                 <description>used by indicator indexes</description>
    78                 <constructor-arg value="indicator/published_profiles.xml"/>
    79         </bean>
    80         <bean id="publishIndicatorProfileXMLPath" class="org.ibisph.model.StringHolder">
    81                 <constructor-arg value="indicator/profile"/>
    82         </bean>
    8380
    8481        <bean id="publishBaseXMLPathURL" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
     
    110107                        within the text.
    111108                </description>
    112                 <property name="basePath"             ref="publishBaseXMLPathURL"/>
     109                <property name="basePath" ref="publishBaseXMLPathURL"/>
    113110                <property name="outputFormat">
    114111                        <bean class="org.dom4j.io.OutputFormat">
     
    123120                                        western english characters.
    124121                                </description>
    125                                 <property name="encoding"      value="ISO-8859-1"/>
     122                                <property name="encoding"      value="#{publishXMLEncodingScheme.string}"/>
    126123                                <property name="indentSize"    value="1"/>     <!-- count of indents -->
    127124                                <property name="indent"        value="&#09;"/> <!-- tab value: &#09; = horizontal tab or spaces etc -->
     
    166163                <property name="rootXMLElementName" value="ORG_UNITS"/>
    167164        </bean>
    168 
    169165
    170166        <bean id="publishIndicatorToXMLFileProperties" abstract="true">
     
    189185                                                        trim text for the embedded CR formatting.
    190186                                                </description>
    191                                                 <property name="encoding"      value="ISO-8859-1"/>
     187                                                <property name="encoding"      value="#{publishXMLEncodingScheme.string}"/>
    192188                                                <property name="indentSize"    value="1"/>     <!-- count of indents -->
    193189                                                <property name="indent"        value="&#09;"/> <!-- tab value: &#09; = horizontal tab or spaces etc -->
  • trunk/ibisph-admin/src/main/webapp/WEB-INF/jsp/indicator/view/dimensions.jsp

    r13348 r13450  
    1616                {
    1717                        min-height: 400px;
     18                }
     19                th.Selection.Usage
     20                {
     21                        min-width:      75px;
    1822                }
    1923        </style>
     
    138142                                                                        <th scope="col" class="Title" title="Description of the dimension">Dimension Description</th>
    139143                                                                        <th scope="col" class="Selection" title="Do NOT include this dimension for the view's dimension values">Not Used</th>
    140                                                                         <th scope="col" class="Selection" title="Include this dimension for the View's category dimension values">Used as Category</th>
    141                                                                         <th scope="col" class="Selection" title="Include this dimension for the View's series dimension values">Used as Series</th>
     144                                                                        <th scope="col" class="Selection Usage" title="Include this dimension for the View's category dimension values">Used as Category</th>
     145                                                                        <th scope="col" class="Selection Usage" title="Include this dimension for the View's series dimension values">Used as Series</th>
     146                                                                        <th scope="col" class="Selection Usage" title="Include this dimension for the View's constant dimension values">Used as Constant</th>
    142147                                                                </tr>
    143148
     
    157162                                                                                <input type="radio" name="periodDimensionUsagePLACEHOLDER" id="__periodDimensionUsage.series"   value="series" ${onClick} ${radioControl}
    158163                                                                                        ${indicatorViewDimension[periodDimensionName].series ? "checked=\"checked\"" : ""}
     164                                                                                />
     165                                                                        </td>
     166                                                                        <td class="Selection" title="Include the period dimension as part of the view's constant selection">
     167                                                                                <input type="radio" name="periodDimensionUsagePLACEHOLDER" id="__periodDimensionUsage.constant"   value="constant" ${onClick} ${radioControl}
     168                                                                                        ${indicatorViewDimension[periodDimensionName].constant ? "checked=\"checked\"" : ""}
    159169                                                                                />
    160170                                                                        </td>
     
    182192                                                                                <input type="radio" name="${dimension.name}" value="series" ${onClick} ${radioControl}
    183193                                                                                        ${indicatorViewDimension[dimension.name].series ? "checked=\"checked\"" : ""}
     194                                                                                />
     195                                                                        </td>
     196                                                                        <td class="Selection" title="Include ${dimension.name} as part of the view's constant values">
     197                                                                                <input type="radio" name="${dimension.name}" value="constant" ${onClick} ${radioControl}
     198                                                                                        ${indicatorViewDimension[dimension.name].constant ? "checked=\"checked\"" : ""}
    184199                                                                                />
    185200                                                                        </td>
  • trunk/ibisph-admin/src/main/webapp/js/common.js

    r13316 r13450  
    5454        return(false);
    5555} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     56
     57
    5658
    5759
     
    158160} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    159161
     162/**
     163 * Helper that is used by the requestPage code to get the "selectedName" from
     164 * the supplied URL parameter.  Returns null or blank string if not found.
     165 *@param url url's last segment sans ".html" should be the selectedName.
     166 */
     167function getSelectedNameFromURL(url)
     168{
     169        var dotHTMLIndex = url.indexOf(".html");
     170        var lastSlash = url.lastIndexOf("/") + 1;
     171        var selectedName = url.substring(lastSlash, dotHTMLIndex);
     172        return(selectedName);
     173} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     174
     175// returns the tag element object
     176// used by requestPage and deletePage
     177function getSelectedNameElement()
     178{
     179//alert(getSelectedNameCount());
     180        var count = getSelectedNameCount();
     181        if(1 == count)
     182        {
     183                return(document.form.selectedName);
     184        }
     185        for(var i=0; i<count; i++)
     186        {
     187                if(true == document.form.selectedName[i].checked) return(document.form.selectedName[i]);
     188        }
     189        return(null);
     190} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     191
     192// returns: 0=Doesn't Exist, 1 for singular, 2+ means array
     193// USED BY: getSelectedNameElement
     194function getSelectedNameCount()
     195{
     196        if(isDefined(document.form.selectedName))
     197        {
     198                if(isDefined(document.form.selectedName.length))
     199                        return(document.form.selectedName.length);
     200                else
     201                        return(1);
     202        }
     203        else
     204                return(0);
     205} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     206
     207// sets the "checked" tag element object
     208// only used by requestPage
     209function setSelectedNameElement(value)
     210{
     211        var count = getSelectedNameCount();
     212        if(count == 1)
     213        {
     214                document.form.selectedName.checked = true;
     215        }
     216        else
     217        {
     218                for(var i=0; i<count; i++)
     219                {
     220                        if(value == document.form.selectedName[i].value)
     221                        {
     222                                document.form.selectedName[i].checked = true;
     223                                return;
     224                        }
     225                }
     226        }
     227        return(null);
     228} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     229
    160230
    161231/**
     
    205275//alert("newWindow: "+pageURL);
    206276        window.open(pageURL);
    207 } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    208 
    209 
    210 
    211 
    212 /**
    213  * Helper that is used by the requestPage code to get the "selectedName" from
    214  * the supplied URL parameter.  Returns null or blank string if not found.
    215  *@param url url's last segment sans ".html" should be the selectedName.
    216  */
    217 function getSelectedNameFromURL(url)
    218 {
    219         var dotHTMLIndex = url.indexOf(".html");
    220         var lastSlash = url.lastIndexOf("/") + 1;
    221         var selectedName = url.substring(lastSlash, dotHTMLIndex);
    222         return(selectedName);
    223 } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    224 
    225 // returns: 0=Doesn't Exist, 1 for singular, 2+ means array
    226 // USED BY: getSelectedNameElement
    227 function getSelectedNameCount()
    228 {
    229         if(isDefined(document.form.selectedName))
    230         {
    231                 if(isDefined(document.form.selectedName.length))
    232                         return(document.form.selectedName.length);
    233                 else
    234                         return(1);
    235         }
    236         else
    237                 return(0);
    238 } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    239 
    240 // returns the tag element object
    241 // used by requestPage and deletePage
    242 function getSelectedNameElement()
    243 {
    244 //alert(getSelectedNameCount());
    245         var count = getSelectedNameCount();
    246         if(1 == count)
    247         {
    248                 return(document.form.selectedName);
    249         }
    250         for(var i=0; i<count; i++)
    251         {
    252                 if(true == document.form.selectedName[i].checked) return(document.form.selectedName[i]);
    253         }
    254         return(null);
    255 } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    256 
    257 // sets the "checked" tag element object
    258 // only used by requestPage
    259 function setSelectedNameElement(value)
    260 {
    261         var count = getSelectedNameCount();
    262         if(count == 1)
    263         {
    264                 document.form.selectedName.checked = true;
    265         }
    266         else
    267         {
    268                 for(var i=0; i<count; i++)
    269                 {
    270                         if(value == document.form.selectedName[i].value)
    271                         {
    272                                 document.form.selectedName[i].checked = true;
    273                                 return;
    274                         }
    275                 }
    276         }
    277         return(null);
    278277} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    279278
     
    392391
    393392
    394 function setCheckBox(index)
    395 {
    396         if( isDefined(document.form.check) )
    397         {
    398                 if( isDefined(document.form.check[index]) )
    399                 {
    400                         if(document.form.check[index].checked)
    401                                 document.form.name[index].value = document.form.check[index].value;
    402                         else
    403                                 document.form.name[index].value = "";
    404                 }
    405                 else
    406                 {
    407                         if(document.form.check.checked)
    408                                 document.form.name.value = document.form.check.value;
    409                         else
    410                                 document.form.name.value = "";
    411                 }
    412                 setModified(index);
    413         }
    414         else
    415                 alert("Application Problem:  This page will not work properly. \n\nPlease contact the system admins and tell them you're \ntrying to set Checkbox and it doesn't exist.  \nThank you for your patience and help."); 
    416 } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    417 
    418 
    419 
    420393
    421394//========================================= F O C U S   R E G I S T R A T I O N
     
    446419        elements = document.getElementsByTagName(tagName);
    447420        for(var i=0; i<elements.length; i++)
     421        {
    448422                if(!elements[i].disabled)
    449423                {
     
    464438                        }
    465439                }
    466 } //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    467 
     440        }
     441} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    468442
    469443
     
    544518
    545519
     520
     521
    546522//========================================================= V A L I D A T I O N
    547523// Returns true is any element has their modfiied element set to anything that
     
    569545*/
    570546} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    571 
    572        
    573547
    574548
     
    612586        return(true);
    613587} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    614 
    615588
    616589
     
    681654
    682655
    683 
    684656// called when the "add new" is clicked. 
    685657function addNewName(newName, editDetailPageRequestURL)
     
    704676                {
    705677                        alert(  "The New Name '" + newName + "' contains an invalid character of: " + i + " which causes problems.\n" +
    706                                         "Alphbet and numeric characters are allowed as well as the underscore ' _ ', the\n"+
     678                                        "Alphabet and numeric characters are allowed as well as the underscore ' _ ', the\n"+
    707679                                        "period ' . ', the tilda ' ~ ' and the vertical bar ' | '.  The following lists the valid\n" +
    708680                                        "characters: ' A ' - ' z ',  ' 0 ' - ' 9 ',  ' . ',  ' _ ',  ' ~ ',  and  ' | '.\n" +
     
    750722
    751723
    752 
    753724function confirmReset()
    754725{
     
    885856} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    886857
     858
     859function setCheckBox(index)
     860{
     861        if( isDefined(document.form.check) )
     862        {
     863                if( isDefined(document.form.check[index]) )
     864                {
     865                        if(document.form.check[index].checked)
     866                                document.form.name[index].value = document.form.check[index].value;
     867                        else
     868                                document.form.name[index].value = "";
     869                }
     870                else
     871                {
     872                        if(document.form.check.checked)
     873                                document.form.name.value = document.form.check.value;
     874                        else
     875                                document.form.name.value = "";
     876                }
     877                setModified(index);
     878        }
     879        else
     880                alert("Application Problem:  This page will not work properly. \n\nPlease contact the system admins and tell them you're \ntrying to set Checkbox and it doesn't exist.  \nThank you for your patience and help."); 
     881} //~~~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     882
     883
    887884/*=============================== End of File ================================*/
    888885
  • trunk/ibisph-view/src/content/xml/indicator/published_profiles.xml

    r8549 r13450  
    22
    33<INDICATORS>
     4        <INDICATOR NAME="aa">
     5                <NAME>AlcoholBingeDrinkAdult</NAME>
     6                <TITLE>AAlcohol - Adult Binge Drinking</TITLE>
     7                <PUBLISHED_DATE>07/14/2011</PUBLISHED_DATE>
     8                <DATA_SOURCE_DATE>09/25/2008</DATA_SOURCE_DATE>
     9                <DEFAULT_INDICATOR_VIEW_NAME>AlcoholBingeDrinkAdult.Year.NM_US</DEFAULT_INDICATOR_VIEW_NAME>
     10        </INDICATOR>
     11
    412        <INDICATOR NAME="VLBW">
    513                <NAME>VLBW</NAME>
  • trunk/ibisph-view/src/main/webapp/xslt/html/Kendo.xslt

    r9600 r13450  
    160160                        "
    161161                />
    162 
     162<xsl:message select="$dimensions//DIMENSION"/>
    163163<xsl:text>{</xsl:text>
    164164        data:  <xsl:value-of select="$javascriptDataStructureVariableName"/>
     
    171171                        {
    172172                                rowID:         { type: "number", editable: false }
    173                 <xsl:for-each select="$dimensions/DIMENSION[string-length(NAME) != 0]">
     173                <xsl:for-each select="$dimensions//DIMENSION[string-length(NAME) != 0]">
    174174                                ,"<xsl:value-of select="NAME"/>":          { type: "string" }
    175175                                ,"<xsl:value-of select="NAME"/>Title":     { type: "string" }
    176176                                ,"<xsl:value-of select="NAME"/>SortOrder": { type: "number" }
    177177                </xsl:for-each>
    178                 <xsl:for-each select="$measures/MEASURE">
     178                <xsl:for-each select="$measures//MEASURE">
    179179                                ,"<xsl:value-of select="NAME"/>":           { type: "number" },  "<xsl:value-of select="NAME"/>Title":           { type: "string" }
    180180                                ,"<xsl:value-of select="NAME"/>LowerLimit": { type: "number" },  "<xsl:value-of select="NAME"/>LowerLimitTitle": { type: "string" }
  • trunk/ibisph-view/src/main/webapp/xslt/html/indicator/profile/interactive/Interactive.xslt

    r10079 r13450  
    2727
    2828
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38<!--
     39need code that uses the view's dataset to lookup the approp data records via
     40looping the view's series and cat dims.
     41
     42loops the series and category dim values
     43then looks up the values to use based on the dims
     44and the IPVs DSs.
     45
     46for ds json need to do the dim name as SERIES or CATEGORY
     47with the value being DIM_NAME.DIM_VALUE
     48
     49
     503 dims senerios
     51SERIES or CAT Year
     52SERIES or CAT Sex
     53PERIOD Year
     54== all good - no constant...
     55
     56SERIES or CAT County
     57SERIES or CAT Sex
     58PERIOD Year
     59== PERIOD is constant
     60
     61?????????????? What if they want to use PERIOD as a SERIES or CAT and hold the 3rd CONSTANT???????????
     62SERIES or CAT Year
     63SERIES or CAT Sex
     64PERIOD Year
     65CONSTANT County
     66==> PERIOD is constant
     67
     68
     69
     70the grid needs series to group by
     71
     72chart needs series and category
     73
     74how does constant work for this? 
     75Apply a filter.
     76
     77
     78all datasets have dim1, 2, and period.
     79
     80constant is only avail if period is dim 1 or 2    OR     dim 1 and 2 are not period...
     81
     82                <xsl:variable name="seriesDimensions"   select="$indicatorView/DIMENSIONS/SERIES/DIMENSION"/>
     83                <xsl:variable name="categoryDimensions" select="$indicatorView/DIMENSIONS/CATEGORY/DIMENSION"/>
     84                <xsl:variable name="constantDimensions" select="$indicatorView/DIMENSIONS/CONSTANT/DIMENSION"/>
     85
     86
     87
     88                <xsl:param name="indicatorView"/>
     89
     90-->
     91
     92
     93
     94
     95
     96        <xsl:variable name="Interactive.records" ibis:doc="create the actual dataset">
     97
     98                <xsl:variable name="seriesDimensions"   select="$indicatorView/DIMENSIONS/SERIES/DIMENSION"/>
     99                <xsl:variable name="categoryDimensions" select="$indicatorView/DIMENSIONS/CATEGORY/DIMENSION"/>
     100                <xsl:variable name="constantDimensions" select="$indicatorView/DIMENSIONS/CONSTANT/DIMENSION"/>
     101
     102                <xsl:for-each select="$seriesDimensions/VALUES/VALUE">
     103                        <xsl:sort select="DIMENSION_NAME" order="ascending" data-type="text"/>
     104                        <xsl:sort select="SORT_ORDER" order="ascending" data-type="number"/>
     105                        <xsl:variable name="seriesDimensionValue" select="."/>
     106
     107                        <xsl:for-each select="$categoryDimensions/VALUES/VALUE">
     108                                <xsl:sort select="DIMENSION_NAME" order="ascending" data-type="text"/>
     109                                <xsl:sort select="SORT_ORDER" order="ascending" data-type="number"/>
     110                                <xsl:variable name="categoryDimensionValue" select="."/>
     111<!--
     112<xsl:message select="$seriesDimensionValue"/>
     113
     114                                <xsl:for-each select="$constantDimensions/VALUES/VALUE">
     115                                        <xsl:sort select="DIMENSION_NAME" order="ascending" data-type="string"/>
     116                                        <xsl:sort select="SORT_ORDER" order="ascending" data-type="number"/>
     117                                        <xsl:variable name="constantDimensionValue" select="."/>
     118<RECORD>
     119        DIMENSIONS
     120                DIMENSION
     121                        NAME
     122                        TITLE
     123                        VALUE
     124                                TITLE
     125        VALUE
     126        TITLE
     127        LOWER_CONFIDENCE_LIMIT
     128        UPPER_CONFIDENCE_LIMIT
     129        NUMERATOR
     130        DENOMINATOR
     131        LABEL
     132-->
     133                                        <xsl:variable name="datasets" select="$indicator/DATASETS/DATASET[NAME = $indicatorView/DATASET_NAMES/DATASET_NAME]"/>
     134
     135                                        <xsl:copy-of select="
     136                                                $datasets/RECORDS/RECORD[
     137                                                        ((DIMENSIONS/DIMENSION/NAME  = $seriesDimensionValue/DIMENSION_NAME)
     138                                                                and
     139                                                         (DIMENSIONS/DIMENSION/VALUE = $seriesDimensionValue/VALUE))
     140                                                        and
     141                                                        ((DIMENSIONS/DIMENSION/NAME  = $categoryDimensionValue/DIMENSION_NAME)
     142                                                                and
     143                                                         (DIMENSIONS/DIMENSION/VALUE = $categoryDimensionValue/VALUE))
     144                                                ]"
     145                                        />
     146<!--
     147                                </xsl:for-each>
     148-->
     149                        </xsl:for-each>
     150                </xsl:for-each>
     151
     152        </xsl:variable>
     153
     154
     155
     156
     157
     158
     159
     160
    29161        <xsl:template name="Interactive.leafletKendoScript"
    30162                ibis:doc="Main page.xslt call - provides the kendo and leaflet javascript"
     
    36168                </xsl:variable>
    37169
    38                 <xsl:variable name="dimensions">
    39                         <xsl:call-template name="Interactive.indicatorViewSeriesCategoryToDimensionNodes">
    40                                 <xsl:with-param name="indicatorView"                select="$indicatorView"/>
    41                         </xsl:call-template>
    42                 </xsl:variable>
     170                <xsl:variable name="dimensions" select="$indicatorView/DIMENSIONS"/>
    43171
    44172                <!-- Need to have safe script field values - remove any values from name that conflict with JS -->
     
    314442                <xsl:param name="dimensions"/>
    315443                <xsl:param name="measureName"/>
    316                 <xsl:param name="valueFormatPattern" select="$indicatorView/VALUE_TYPE/XSLT_FORMAT_PATTERN/text()"/>
    317 
    318                 <xsl:variable name="seriesDimension"   select="$dimensions/DIMENSION[ACTUAL_NAME = $indicatorView/DATASET_SERIES/NAME]"/>
    319                 <xsl:variable name="categoryDimension" select="$dimensions/DIMENSION[ACTUAL_NAME = $indicatorView/DATASET_CATEGORY/NAME]"/>
     444                <xsl:param name="valueFormatPattern" select="$indicator/VALUE_TYPE/XSLT_FORMAT_PATTERN/text()"/>
     445
     446<xsl:message select="'garth'"/>
     447<xsl:message select="$Interactive.records"/>
     448
     449                <xsl:variable name="seriesDimensions"   select="$dimensions/SERIES/DIMENSION"/>
     450                <xsl:variable name="categoryDimensions" select="$dimensions/CATEGORYDIMENSION"/>
    320451<xsl:text>[</xsl:text>
    321452                <xsl:for-each select="$seriesDimension/VALUES/VALUE">
     453                        <xsl:sort select="DIMENSION_NAME" order="ascending" data-type="text"/>
    322454                        <xsl:sort select="SORT_ORDER" order="ascending" data-type="number"/>
    323                         <xsl:variable name="seriesValue" select="."/>
     455                        <xsl:variable name="seriesValue" select="concat(DIMENSION_NAME, '.', VALUE)"/>
    324456                        <xsl:variable name="seriesPosition" select="position()"/>
    325457
    326458                        <xsl:for-each select="$categoryDimension/VALUES/VALUE">
     459                                <xsl:sort select="DIMENSION_NAME" order="ascending" data-type="text"/>
    327460                                <xsl:sort select="SORT_ORDER" order="ascending" data-type="number"/>
    328461
     
    341474        rowID:<xsl:value-of select="concat($seriesPosition, '.', position())"/>
    342475        <xsl:if test="string-length($seriesDimension/NAME) != 0">
    343         ,"<xsl:value-of select="$seriesDimension/NAME"/>":"<xsl:value-of select="$seriesValue/text()"/>"
     476        ,"SERIES":"<xsl:value-of select="$seriesValue/text()"/>"
    344477        ,"<xsl:value-of select="$seriesDimension/NAME"/>Title":"<xsl:value-of select="$seriesValue/TITLE"/>"
    345478        ,"<xsl:value-of select="$seriesDimension/NAME"/>SortOrder":<xsl:value-of select="$seriesValue/SORT_ORDER"/>
    346479        </xsl:if>
    347         ,"<xsl:value-of select="$categoryDimension/NAME"/>":"<xsl:value-of select="text()"/>"
     480        ,"CATEGORY":"<xsl:value-of select="text()"/>"
    348481        ,"<xsl:value-of select="$categoryDimension/NAME"/>Title":"<xsl:value-of select="TITLE"/>"
    349482        ,"<xsl:value-of select="$categoryDimension/NAME"/>SortOrder":<xsl:value-of select="SORT_ORDER"/>
  • trunk/ibisph-view/src/main/webapp/xslt/ibis.xslt

    r12319 r13450  
    375375
    376376
    377         <xsl:function name="ibis:getCompleteIndicatorViewTitle" as="xs:string"
    378                 ibis:doc="Builds a complete view title."
    379         >
    380                 <xsl:param name="indicatorView" ibis:doc="Indicator Profile View to be used to build the title from."/>
    381                 <xsl:value-of select="concat($indicatorView/TITLE, ' ', $indicatorView/SUB_TITLE, ' ', $indicatorView/PERIOD_TITLE)"/>
    382         </xsl:function>
    383         <xsl:function name="ibis:getPartialIndicatorViewTitle" as="xs:string"
    384                 ibis:doc="Builds the view's partial, most specific title."
    385         >
    386                 <xsl:param name="indicatorView" ibis:doc="Indicator Profile View to be used to build the title from."/>
    387                 <xsl:value-of select="concat($indicatorView/SUB_TITLE, ' ', $indicatorView/PERIOD_TITLE)"/>
    388         </xsl:function>
     377<xsl:function name="ibis:getCompleteIndicatorViewTitle" as="xs:string"
     378        ibis:doc="Builds a complete view title."
     379>
     380        <xsl:param name="indicatorView" ibis:doc="Indicator Profile View to be used to build the title from."/>
     381        <xsl:value-of select="concat($indicatorView/TITLE, ' complete IPV title func ', $indicatorView/PERIOD_TITLE)"/>
     382</xsl:function>
     383<xsl:function name="ibis:getPartialIndicatorViewTitle" as="xs:string"
     384        ibis:doc="Builds the view's partial, most specific title."
     385>
     386        <xsl:param name="indicatorView" ibis:doc="Indicator Profile View to be used to build the title from."/>
     387        <xsl:value-of select="concat($indicatorView/TITLE, ' this is IP IPV struct ', $indicatorView/DIMENSIONS/PERIOD/DIMENSION/TITLE)"/>
     388</xsl:function>
    389389
    390390
  • trunk/ibisph/src/main/java/org/ibisph/indicatorprofile/databean/DimensionToIndicatorView.java

    r11873 r13450  
    1414  public static final String SERIES_USAGE   = "series";
    1515  public static final String PERIOD_USAGE   = "period";
     16  public static final String CONSTANT_USAGE = "constant";
    1617
    1718  // constructor
     
    4344    return( PERIOD_USAGE.equalsIgnoreCase(getDimensionUsage()) );
    4445  }
     46  public boolean isConstant() {
     47    return( CONSTANT_USAGE.equalsIgnoreCase(getDimensionUsage()) );
     48  }
    4549
    4650} //============================ END OF CLASS =================================
  • trunk/ibisph/src/main/java/org/ibisph/indicatorprofile/service/ChartDataFromIndicatorView.java

    r10275 r13450  
    1414
    1515/**
     16 *
     17 *
     18 *
     19 *
     20 *
     21 *
     22 * TODO: NEEDS REWORK - IF KEEPING
     23 *
     24 *
     25 *
     26 *
     27 *
     28 *
     29 *
     30 *
     31 *
     32 *
     33 *
    1634 * Reads the indicator view XML file and loads into Chart Data object.
    1735 *
  • trunk/ibisph/src/main/java/org/ibisph/indicatorprofile/service/IndicatorDataBeanToXML.java

    r13418 r13450  
    5151    addDataBeanToNode(document, indicator);
    5252
     53    XMLLib.addNode(document, getValueTypeElement(indicator));
    5354    XMLLib.addNode(document, getTopicsElement(indicator));
    5455    XMLLib.addNode(document, getInitiativesElement(indicator));
    5556    XMLLib.addNode(document, getRelationsElement(indicator));
    56     XMLLib.addNode(document, getDatasetsElement(indicator));
     57//    XMLLib.addNode(document, getDatasetsElement(indicator));
    5758    XMLLib.addNode(document, getIndicatorViewsElement(indicator));
    5859    return(document);
    5960  } //-------------------------- End of Method ------------------------------
    6061
     62
     63  /**
     64   * Creates VALUE_TYPE element based on the supplied indicator view.
     65   * @param indicator DataBean to be converted to XML
     66   * @return XML MEASURE element for the supplied indicator view
     67   *   DataBean.
     68   */
     69  public Node getValueTypeElement(Indicator indicator) throws Exception {
     70    ValueType valueType = new ValueType();
     71    this.dataBeanDAOService.load(valueType, "NAME", indicator.getValueTypeName());
     72    return(newNode("VALUE_TYPE", valueType));
     73  } //-------------------------- End of Method ------------------------------
    6174
    6275  /**
  • trunk/ibisph/src/main/java/org/ibisph/indicatorprofile/service/IndicatorDatasetDataBeanToXML.java

    r13418 r13450  
    1818
    1919  /**
     20   * Creates an indicator's DATASETS container and child DATASET elements.
     21   * @param indicator DataBean used to get the assoc datasets.
     22   * @return XML DATASETS element for the supplied indicator DataBean.
     23   */
     24  public Node getDatasetsElement(String indicatorName) throws Exception {
     25    Node datasetsElement = XMLLib.newNode("DATASETS");
     26
     27    // Since no intersection table for I to DS need to query the DSs based
     28    // on the IP NAME FK.  Need to sort by DS.SORT_ORDER and filter out all
     29    // inactives. 
     30    ArrayList<DataBean> datasetCollection = new ArrayList<DataBean>();
     31    Dataset dataset = new Dataset();
     32    dataset.setFieldValue("INDICATOR_NAME", indicatorName);
     33    dataset.setFieldValue("ACTIVE_FLAG",    this.dataBeanFlagValue);
     34    this.dataBeanDAOService.load(datasetCollection, dataset, new String[] {"SORT_ORDER", "TITLE"});
     35    for(int i=0; i<datasetCollection.size(); i++) {
     36      dataset = (Dataset)datasetCollection.get(i);
     37      XMLLib.addNode(datasetsElement, getDocument(dataset));
     38    }
     39    return(datasetsElement);
     40  } //-------------------------- End of Method ------------------------------
     41
     42
     43  /**
    2044   * Builds the XML document based on the indicator view name.
    2145   * @param datasetName name of the indicator view to have converted.
     
    5074    XMLLib.addNode(document, getDataSourcesElement(dataset));
    5175    XMLLib.addNode(document, getDatasetDimensionsElement(dataset, recordsCollection));
    52     XMLLib.addNode(document, getRecordsElement(dataset, recordsCollection));
     76    XMLLib.addNode(document, getRecordsElement(recordsCollection));
    5377    XMLLib.addNode(document, getSavedQueriesElement(dataset));
    5478   
     
    85109
    86110
    87   /**
     111
     112 
     113 
     114 
     115 
     116 
     117 
     118 
     119 
     120 
     121 
     122 
     123 
     124  /**
     125   *
     126   *
     127   *
     128   *
     129   *
     130   *
     131   * TODO: DELETE ME IF EMBEDDED IP DSs.
     132   *
     133   *
     134   *
     135   *
    88136   * Creates DATASET's DIMENSION and DIMENSION_VALUES container and child
    89137   * elements based on the supplied dataset and records.
     
    114162      dimensionValue.setFieldValue("DIMENSION_NAME", dimension.getName());
    115163      this.dataBeanDAOService.load(dimensionValueCollection, dimensionValue);
    116       Node dimensionValuesNode = XMLLib.newNode("DIMENSION_VALUES");
     164      Node dimensionValuesNode = XMLLib.newNode("VALUES");
    117165
    118166      // loop for all dimension values.  Add the element if it is used.
     
    154202   * @return XML INDICATOR_VIEW_VALUES element for the supplied indicator view DataBean.
    155203   */
    156   public Node getRecordsElement(
    157     Dataset dataset,
    158     ArrayList<DataBean> recordsCollection 
    159   ) throws Exception {
    160     Node recordsContainerElement = newNode("RECORDS", recordsCollection);
    161     return(recordsContainerElement);
    162   } //-------------------------- End of Method ------------------------------
    163 
     204  public Node getRecordsElement(ArrayList<DataBean> recordsCollection) throws Exception {
     205    Node recordsElement = XMLLib.newNode("RECORDS");
     206    for(int i=0; i<recordsCollection.size(); i++) {
     207      DatasetRecord datasetRecord = (DatasetRecord)recordsCollection.get(i);
     208      Node recordElement = XMLLib.newNode("RECORD");
     209      Node dimensionsElement = XMLLib.newNode("DIMENSIONS");
     210      XMLLib.addNode(recordElement, dimensionsElement);
     211
     212      Node dimensionElement = XMLLib.newNode("DIMENSION");
     213      XMLLib.addNode(dimensionElement, XMLLib.newNode("NAME", datasetRecord.getDimension1Name()));
     214      XMLLib.addNode(dimensionElement, XMLLib.newNode("VALUE",datasetRecord.getDimension1Value()));
     215      XMLLib.addNode(dimensionsElement, dimensionElement);
     216
     217      dimensionElement = XMLLib.newNode("DIMENSION");
     218      XMLLib.addNode(dimensionElement, XMLLib.newNode("NAME", datasetRecord.getDimension2Name()));
     219      XMLLib.addNode(dimensionElement, XMLLib.newNode("VALUE",datasetRecord.getDimension2Value()));
     220      XMLLib.addNode(dimensionsElement, dimensionElement);
     221
     222      dimensionElement = XMLLib.newNode("DIMENSION");
     223      XMLLib.addNode(dimensionElement, XMLLib.newNode("NAME", datasetRecord.getPeriodDimensionName()));
     224      XMLLib.addNode(dimensionElement, XMLLib.newNode("VALUE",datasetRecord.getPeriodDimensionValue()));
     225      XMLLib.addNode(dimensionsElement, dimensionElement);
     226
     227      XMLLib.addNode(recordElement, XMLLib.newNode("VALUE", datasetRecord.getValue()));
     228      XMLLib.addNode(recordElement, XMLLib.newNode("LOWER_CONFIDENCE_VALUE", datasetRecord.getLowerConfidenceValue()));
     229      XMLLib.addNode(recordElement, XMLLib.newNode("UPPER_CONFIDENCE_VALUE", datasetRecord.getUpperConfidenceValue()));
     230      XMLLib.addNode(recordElement, XMLLib.newNode("NUMERATOR", datasetRecord.getNumerator()));
     231      XMLLib.addNode(recordElement, XMLLib.newNode("DENOMINATOR", datasetRecord.getDenominator()));
     232      XMLLib.addNode(recordElement, XMLLib.newNode("LABEL", datasetRecord.getLabel()));
     233      XMLLib.addNode(recordElement, XMLLib.newNode("NOTE", datasetRecord.getNote()));
     234      XMLLib.addNode(recordElement, XMLLib.newNode("LONGITUDE", datasetRecord.getLongitude()));
     235      XMLLib.addNode(recordElement, XMLLib.newNode("LATITUDE", datasetRecord.getLatitude()));
     236
     237      XMLLib.addNode(recordsElement, recordElement);
     238    }
     239
     240    return(recordsElement);
     241  } //-------------------------- End of Method ------------------------------
    164242
    165243
  • trunk/ibisph/src/main/java/org/ibisph/indicatorprofile/service/IndicatorViewDataBeanToXML.java

    r13418 r13450  
    5151    XMLLib.addNode(dimensionsElement, getDimensionElement(indicatorView, "CATEGORY", DimensionToIndicatorView.CATEGORY_USAGE));
    5252    XMLLib.addNode(dimensionsElement, getDimensionElement(indicatorView, "PERIOD",   DimensionToIndicatorView.PERIOD_USAGE));
     53    XMLLib.addNode(dimensionsElement, getDimensionElement(indicatorView, "CONSTANT", DimensionToIndicatorView.CONSTANT_USAGE));
    5354    XMLLib.addNode(document, dimensionsElement);
     55
     56    XMLLib.addNode(document, getDatasetRecordsElement(indicatorView));
    5457
    5558// TODO: this needs to be determined if even needed/used and how...
     
    7881    dimensionToIndicatorView.setFieldValue("DIMENSION_USAGE",     dimensionUsage);
    7982    this.dataBeanDAOService.load(dimensionToIndicatorViewCollection, dimensionToIndicatorView);
    80 
     83// TODO: detail below probably isn't needed as the IPV will have access to the IP
     84// which contains the dataset as well as the actual dim definition.  However the VALUES are needed...
    8185    for(int i=0; i<dimensionToIndicatorViewCollection.size(); i++) {
    8286      dimensionToIndicatorView  = (DimensionToIndicatorView)dimensionToIndicatorViewCollection.get(i);
     
    8589      this.dataBeanDAOService.load(dimension);
    8690      Node dimensionElement = this.newNode("DIMENSION", dimension);
    87       Node dimensionValuesElement = XMLLib.newNode("DIMENSION_VALUES");
     91      Node dimensionValuesElement = XMLLib.newNode("VALUES");
    8892      XMLLib.addNode(dimensionElement, dimensionValuesElement);
    8993
     
    9397      dimensionValueToIndicatorView.setFieldValue("DIMENSION_NAME",      dimension.getName());
    9498      this.dataBeanDAOService.load(dimensionValueToIndicatorViewCollection, dimensionValueToIndicatorView);
    95       for(int j=0; i<dimensionValueToIndicatorViewCollection.size(); j++) {
     99      for(int j=0; j<dimensionValueToIndicatorViewCollection.size(); j++) {
    96100        dimensionValueToIndicatorView  = (DimensionValueToIndicatorView)dimensionValueToIndicatorViewCollection.get(j);
    97101        DimensionValue dimensionValue = new DimensionValue();
    98         dimensionValue.setFieldValue("DIMENSION_NAME",  dimensionValueToIndicatorView.getDimensionName());
    99         dimensionValue.setFieldValue("DIMENSION_VALUE", dimensionValueToIndicatorView.getDimensionValue());
     102        dimensionValue.setFieldValue("DIMENSION_NAME", dimensionValueToIndicatorView.getDimensionName());
     103        dimensionValue.setFieldValue("VALUE",          dimensionValueToIndicatorView.getDimensionValue());
    100104        this.dataBeanDAOService.load(dimensionValue);
    101105
    102         XMLLib.addNode(dimensionValuesElement, this.newNode("DIMENSION_VALUE", dimensionValue));
     106        XMLLib.addNode(dimensionValuesElement, this.newNode("VALUE", dimensionValue));
    103107      }
     108
     109      XMLLib.addNode(containerElement, dimensionElement);
    104110    }
    105111
     
    109115
    110116  /**
    111    * Creates the DATASETS container and child DATASET elements with their NAME
    112    * and TITLEs based on the supplied indicator view.  The TITLEs are grabbed 
    113    * here so that the XSLT code doesn't have to open the assoc dataset documents 
    114    * to get their title info.
     117   * Creates the DATASETS container and child DATASET elements.
     118 *
     119 *  with their NAME
     120 * and TITLEs based on the supplied indicator view.  The TITLEs are grabbed 
     121 * here so that the XSLT code doesn't have to open the assoc dataset documents 
     122 * to get their title info.
    115123   * @param indicatorView DataBean used to specify the assoc datasets.
    116    * @return XML DATASETS element for the supplied indicator DataBean.
     124   * @return XML DATASET_NAMES element for the supplied indicator view DataBean.
    117125   */
    118126  public Node getDatasetNamesElement(IndicatorView indicatorView) throws Exception {
     
    124132    this.dataBeanDAOService.load(datasetToIndicatorViewCollection, datasetToIndicatorView);
    125133
    126     Node datasetToIndicatorViewElement = this.newNode("DATASET_NAMES", "DATASET_NAME", datasetToIndicatorViewCollection);
    127     return(datasetToIndicatorViewElement);
     134    Node datasetNamesElement = XMLLib.newNode("DATASET_NAMES");
     135    for(int j=0; j<datasetToIndicatorViewCollection.size(); j++) {
     136      datasetToIndicatorView  = (DatasetToIndicatorView)datasetToIndicatorViewCollection.get(j);
     137      XMLLib.addNode(datasetNamesElement, XMLLib.newNode("DATASET_NAME", datasetToIndicatorView.getDatasetName()));
     138    }
     139
     140    return(datasetNamesElement);
    128141  } //-------------------------- End of Method ------------------------------
    129142
     
    165178    this.dataBeanDAOService.load(map, "NAME", indicatorView.getMapName());
    166179    return(newNode("MAP", map));
     180  } //-------------------------- End of Method ------------------------------
     181
     182
     183
     184  /* records/record
     185   *  dimensions/dimension
     186   *  values/value
     187   * 
     188   *  build a matrix of all possible values based on dimensions
     189   *  OR
     190   *  do this in XSLT (slower) but that code could then possibly
     191   *  be used for comparisons???????????????
     192   *  OR
     193   *  have java code that is involved to build the appro XML?
     194   * 
     195   *  Maybe have an IP View controller and not the generic XML controller?
     196   */
     197  public Node getDatasetRecordsElement(IndicatorView indicatorView) throws Exception {
     198    Node recordsElement = XMLLib.newNode("RECORDS");
     199
     200    ArrayList<DataBean> recordsCollection = new ArrayList<DataBean>();
     201    DatasetRecord datasetRecord = new DatasetRecord();
     202//    datasetRecord.setFieldValue("DATASET_NAME", dataset.getName());
     203    datasetRecord.setFieldValue("ACTIVE_FLAG",  this.dataBeanFlagValue);
     204    this.dataBeanDAOService.load(recordsCollection, datasetRecord);
     205
     206    return(recordsElement);
    167207  } //-------------------------- End of Method ------------------------------
    168208
  • trunk/ibisph/src/main/java/org/ibisph/indicatorprofile/springmvc/databean/PublishIndicatorToXMLFileController.java

    r13418 r13450  
    1919import org.ibisph.indicatorprofile.service.PublishedIndicatorsXML;
    2020import org.ibisph.util.IOPath;
     21import org.ibisph.util.XMLLib;
    2122import org.ibisph.xml.service.DocumentDAO;
    2223
     
    206207    }
    207208
    208     // if here and IF ACTIVE, then persist the XML doc to a file.  If not active
    209     // then delete it.
    210     try {
    211       if(indicatorDataBean.isActive()) {
     209    // If here and IF ACTIVE, then insert the datasets into the doc and persist
     210    // it.  If not active then delete it.
     211    if(indicatorDataBean.isActive()) {
     212      try {
     213        Node datasetsElement = indicatorDatasetDataBeanToXMLService.getDatasetsElement(indicatorDataBean.getName());
     214        XMLLib.addNode(indicatorDocument, datasetsElement);
     215      }
     216      catch(Exception e) {
     217        returnMessage.append(" Publish failed - problem adding DATASETS to ").append(indicatorDataBean.getName()).append(". ");
     218        logger.error(returnMessage.toString(), e);
     219        return(returnMessage.toString());
     220      }
     221
     222      try {
    212223        returnMessage.append( save(indicatorDocument, indicatorDataBean.getName()) );
    213       }
    214       else {
     224      }
     225      catch(Exception e) {
     226        returnMessage.append(" Publish failed - problem saving indicator ").append(indicatorDataBean.getName()).append(" to an XML file. ");
     227        logger.error(returnMessage.toString(), e);
     228        return(returnMessage.toString());
     229      }
     230    }
     231    else {
     232      try {
    215233        String filePathAndName = IOPath.concat(this.filePath, indicatorDataBean.getName() + ".xml", "/");
    216234        this.documentDAOService.delete(filePathAndName);
     
    220238        .append(") DELETED!. ");
    221239      }
    222     }
    223     catch(Exception e) {
    224       returnMessage.append(e.getMessage());
    225       return(returnMessage.toString());
    226     }
    227 
    228     // loop and save for all datasets.  If error don't abort as the ind file is
    229     // already saved.  Best that can do is report the error and have the user
    230     // correct.
    231     try {
    232       List<Node> nodes = indicatorDocument.selectNodes("/INDICATOR/DATASETS/DATASET/NAME");
    233       String datasetName;
    234       for(Node node:nodes) {
    235         datasetName = node.getText();
    236 
    237         if(indicatorDataBean.isActive()) {
    238           Node element = this.indicatorDatasetDataBeanToXMLService.getDocument(datasetName);
    239           String saveMessage = save(element, datasetName);
    240           returnMessage.append(saveMessage);
    241         }
    242         else {
    243           String filePathAndName = IOPath.concat(this.filePath, datasetName + ".xml", "/");
    244           this.documentDAOService.delete(filePathAndName);
    245           returnMessage
    246             .append("Indicator profile NOT active - dataset file (")
    247             .append(filePathAndName)
    248             .append(") DELETED!. ");
    249         }
    250       }
    251     }
    252     catch(Exception e) {
    253       returnMessage.append(e.getMessage());
     240      catch(Exception e) {
     241        returnMessage.append(" Publish failed - problem deleting inactive indicator ").append(indicatorDataBean.getName()).append(". ");
     242        return(returnMessage.toString());
     243      }
    254244    }
    255245
  • trunk/ibisph/src/main/java/org/ibisph/util/XMLLib.java

    r9041 r13450  
    424424   */
    425425  public static void addNode(Node containerNode, Node nodeToAdd) {
     426    if((null == containerNode) || (null == nodeToAdd)) return;
     427
    426428    Node newNode = nodeToAdd;
    427429    if(null != nodeToAdd.getParent())
Note: See TracChangeset for help on using the changeset viewer.