Changeset 24487 in main


Ignore:
Timestamp:
01/14/22 21:56:49 (4 months ago)
Author:
GarthBraithwaite_STG
Message:

java, view - IndicatorDataBeanToXML.java added all VALUE_TYPES (ancil values) to the published IP XML for self contained internal use. Added javascript format pattern notes into Kendo.xslt.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ibisph-view/src/main/webapp/xslt/json/IndicatorContentJavaScript.xslt

    r24448 r24487  
    166166                <xsl:param name="dataSources"     select="if($UseExternalXML) then $DataSources/DATA_SOURCES         else $indicator/DATA_SOURCES"/>
    167167                <xsl:param name="valueTypes"      select="if($UseExternalXML) then $ValueTypes/VALUE_TYPES           else $indicator/VALUE_TYPES"/>
     168<!--
     169<xsl:param name="valueTypes"      select="document('http://localhost/ibisph-view/value_types.xml')/VALUE_TYPES"/>
     170-->
     171
    168172                <xsl:param name="valueAttributes" select="if($UseExternalXML) then $ValueAttributes/VALUE_ATTRIBUTES else $indicator/VALUE_ATTRIBUTES"/>
    169173                <xsl:param name="dimensions"      select="if($UseExternalXML) then $Dimensions/DIMENSIONS            else $indicator/DIMENSIONS"/>
     
    231235                        </xsl:message>
    232236                </xsl:fallback>
     237<!--
     238<xsl:message select="'VTs: ', $valueTypes"/>
     239<xsl:message select="'DOC: ', document('http://localhost/ibisph-view/value_types.xml')"/>
     240-->
    233241
    234242                var <xsl:sequence select="$javascriptContentName"/> =
     
    489497                        ,"init": function()
    490498                        {
    491                                 alert("init - before setting fields");
     499//                              alert("init - before setting fields");
    492500                                for(var i=1; i &lt; this.textField.length; i++)
    493501                                {
  • trunk/ibisph-view/src/main/webapp/xslt/json/Kendo.xslt

    r24448 r24487  
    430430                        script generated. 
    431431                -->
     432
    432433                <xsl:param name="valueAxisTemplate">
    433434                        <xsl:choose>
    434                                 <xsl:when test="$measureValueType/JAVASCRIPT_FORMAT_PATTERN">#=kendo.toString(value, "<xsl:sequence select="$measureValueType/JAVASCRIPT_FORMAT_PATTERN"/>")#</xsl:when>
     435<!--
     436        NOTE: no # is acceptable unless escaped because it is part of the template expression.
     437        <JAVASCRIPT_FORMAT_PATTERN>,0.0\"%\"</JAVASCRIPT_FORMAT_PATTERN>
     438        <JAVASCRIPT_FORMAT_PATTERN>,0.0\\'%\\'</JAVASCRIPT_FORMAT_PATTERN>
     439        <JAVASCRIPT_FORMAT_PATTERN>,0.0\\&apos;%\\&apos;</JAVASCRIPT_FORMAT_PATTERN>
     440
     441        CODE: IF want to use the XSLT format pattern - note removal of #.
     442                                                                                                                   #=kendo.toString(value, "<xsl:sequence select="translate(replace($measureValueType/JAVASCRIPT_FORMAT_PATTERN, '#', ''), '''', '\&quot;')")#
     443        <xsl:when test="$measureValueType/XSLT_FORMAT_PATTERN">#=kendo.toString(value, '<xsl:sequence select="translate(replace($measureValueType/JAVASCRIPT_FORMAT_PATTERN, '#', ''), '''', '\&quot;\')"/>')#</xsl:when>
     444        <xsl:when test="$measureValueType/XSLT_FORMAT_PATTERN">#=kendo.toString(value, '<xsl:sequence select="translate(replace($measureValueType/JAVASCRIPT_FORMAT_PATTERN, '#', ''), '''', '\&quot;\')"/>')#</xsl:when>
     445        <xsl:when test="$measureValueType/JAVASCRIPT_FORMAT_PATTERN">#=kendo.toString(value, '<xsl:sequence select="$measureValueType/JAVASCRIPT_FORMAT_PATTERN"/>')#</xsl:when>
     446-->
     447                                <xsl:when test="$measureValueType/JAVASCRIPT_FORMAT_PATTERN">#=kendo.toString(value, '<xsl:sequence select="$measureValueType/JAVASCRIPT_FORMAT_PATTERN"/>')#</xsl:when>
    435448                                <xsl:when test="contains($valueTitle, 'Percent')">#=kendo.toString(value, '0.0')#%</xsl:when>
    436                                 <xsl:when test="contains($valueTitle, 'Number') or contains($valueTitle, 'Count')"  >#=kendo.toString(value, ',0')#</xsl:when>
     449                                <xsl:when test="contains($valueTitle, 'Number') or contains($valueTitle, 'Count')">#=kendo.toString(value, ',0')#</xsl:when>
    437450                                <xsl:otherwise>#=kendo.toString(value, ',0.0')#</xsl:otherwise>
    438451                        </xsl:choose>
    439452                </xsl:param>
     453<!--
     454<xsl:message select="'VAT: ', $valueAxisTemplate"/>
     455<xsl:message select="'MVT: ', $measureValueType"/>
     456<xsl:message select="'VT: ', $ValueTypes"/>
     457-->
    440458
    441459<xsl:text>{</xsl:text>
  • trunk/ibisph/src/main/java/org/ibisph/indicatorprofile/service/IndicatorDataBeanToXML.java

    r23428 r24487  
    102102    if(this.includeDependentXML) {
    103103      XMLLib.addNode(document, getMeasuresNode(document));
     104      XMLLib.addNode(document, getAncillaryValuesNode(document));
    104105      XMLLib.addNode(document, getValueTypesNode(document));
    105106      XMLLib.addNode(document, getValueAttributesNode(document));
     
    284285
    285286
     287  public Node getAncillaryValuesNode(Node containerNode) throws Exception {
     288    List<Node> ancillaryValueNamesNode = XMLLib.getNodes(containerNode, "//ANCILLARY_VALUE_NAME", "text()", true);
     289
     290    Node ancillaryValuesNode = XMLLib.newNode("ANCILLARY_VALUES");
     291    for(Node ancillaryValueNameNode : ancillaryValueNamesNode) {
     292      AncillaryValue ancillaryValue = new AncillaryValue();
     293      this.dataBeanDAOService.load(ancillaryValue, "NAME", XMLLib.getText(ancillaryValueNameNode));
     294      XMLLib.addNode(ancillaryValuesNode, this.newNode("ANCILLARY_VALUE", ancillaryValue));
     295    }
     296    return(ancillaryValuesNode);
     297  } //-------------------------- End of Method ------------------------------
     298
     299
    286300  public Node getValueTypesNode(Node containerNode) throws Exception {
    287301    List<Node> valueTypeNamesNode = XMLLib.getNodes(containerNode, "//VALUE_TYPE_NAME", "text()", true);
Note: See TracChangeset for help on using the changeset viewer.