Changeset 20976 in main


Ignore:
Timestamp:
07/06/20 23:04:12 (5 weeks ago)
Author:
GarthBraithwaite_STG
Message:

view - TEMP ibis:include commit to capture include processing tries. Secure query SS to set the related base path.

Location:
trunk/ibisph-view/src/main/webapp/xslt
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ibisph-view/src/main/webapp/xslt/_ibis-include.xslt

    r20915 r20976  
    122122                        and to copy its text, attributes, and processing instructions.
    123123
    124                         Provides the IBISPH system the ability to do simple xinclude
    125                         type operations.  As of 6-2004 the xerces parser 2.6.x has xinclude support
     124                        Provides the IBISPH system the ability to do simple xinclude type
     125                        operations.  As of 6-2004 the xerces parser 2.6.x has xinclude support
    126126                        but it must be configured when starting the Java JVM or with Java system
    127127                        properties.  Since this might not be an option for some deployments (like
     
    163163
    164164
    165         <xsl:template match="ibis:include[boolean(@child-name)]" mode="#all"
    166                 ibis:doc="
    167                         Provides the ability to limit includes to a given child element that
    168                         has a NAME that matches the supplied child-name attribute. 
    169                 "
    170         >
    171                 <xsl:variable name="url" select="if(0 != string-length(@use-prefix)) then concat($ibis.baseRequestPath, @href) else @href"/>
    172                 <xsl:variable name="childNameElementValue" select="@child-name"/>
    173                 <xsl:apply-templates select="document($url, /)/*/*[NAME=$childNameElementValue]" mode="ibis.copy"/>
    174         </xsl:template>
    175 
    176 
    177165        <xsl:template match="ibis:include[boolean(@child-name-list)]" mode="#all"
    178166                ibis:doc="
    179                         Provides the ability to limit includes to a given child element that
    180                         has a NAME that matches the supplied child-name attribute. 
    181                 "
    182         >
    183                 <xsl:variable name="childNames" select="tokenize(normalize-space(replace(@child-name-list, ',', ' ')), '\s+')"/>
    184                 <xsl:variable name="url" select="if(0 != string-length(@use-prefix)) then concat($ibis.baseRequestPath, @href) else @href"/>
    185                 <xsl:variable name="doc" select="document($url, /)"/>
    186 
    187                 <xsl:if test="not(@children-only-flag)">
    188                         <xsl:element name="{name($doc/*)}">
    189                                 <xsl:apply-templates select="$doc/*/*[NAME=$childNames]" mode="ibis.copy"/>
    190                         </xsl:element>
    191                 </xsl:if>
    192                 <xsl:if test="boolean(@children-only-flag)">
    193                         <xsl:apply-templates select="$doc/*/*[NAME=$childNames]" mode="ibis.copy"/>
    194                 </xsl:if>
     167                        Provides the ability to limit included DIMENSION and any other include
     168                        that has the standard NAME element.  This provides a mechanism to
     169                        limit child elements to a given name or a CSV or white space delimited
     170                        list of names.  See the ibis:include function for more info about
     171                        this template mechanism works.
     172
     173                        This template should only be implemented for child elements that
     174                        contain a sub NAME element.
     175                "
     176        >
     177                <xsl:variable name="names"       select="tokenize(normalize-space(replace(@child-name-list, ',', ' ')), '\s+')"/>
     178                <xsl:variable name="rootElement" select="document(@href)/*"/>
     179
     180<xsl:message select="concat('in NEW child name list, href=', @href, ', Count of elements: ', count($rootElement/*), ', ibis.baseRequestPath: ', $ibis.baseRequestPath)"/>
     181<xsl:message select="."/>
     182                <xsl:for-each select="$names">
     183<xsl:message select="."/>
     184                        <xsl:apply-templates select="$rootElement/*[NAME=current()]" mode="ibis.copy"/>
     185                </xsl:for-each>
     186        </xsl:template>
     187
     188
     189
     190        <xsl:template match="ibis:xxxxxxxinclude[boolean(@child-name-list)]" mode="#all"
     191                ibis:doc="
     192                        Provides the ability to limit included DIMENSION and any other include
     193                        that has the standard child NAME element.  This provides a mechanism to
     194                        limit child elements to a given name or a CSV or white space delimited
     195                        list of names.  By definition this include already handles the child
     196                        only inclusions so no special include processing is done for this. 
     197                        Also the special QM config name list processing is handled in specific
     198                        QM XSLT XML code.  See the ibis:include function for more info about
     199                        how the ibis:include mechanism works.
     200                "
     201        >
     202                <xsl:variable name="names"       select="tokenize(normalize-space(replace(@child-name-list, ',', ' ')), '\s+')"/>
     203                <xsl:variable name="rootElement" select="document(@href, /)"/>
     204
     205                <xsl:for-each select="$names">
     206<xsl:message select="."/>
     207<xsl:message select="$rootElement/*"/>
     208                        <xsl:apply-templates select="$rootElement/*[NAME=current()]" mode="ibis.copy"/>
     209                </xsl:for-each>
    195210        </xsl:template>
    196211
    197212</xsl:stylesheet>
    198 
    199 
    200 
    201 <!-- left here for posterity - a way to totally replace an element...
    202         <xsl:template match="ibis:a">
    203                 <xsl:element name="a">
    204                         <xsl:attribute name="href"><xsl:value-of select="concat($ibis.baseRequestPath, @href)"/></xsl:attribute>
    205                         <xsl:copy-of select="attribute::*[name() != 'href']"/>
    206                         <xsl:apply-templates select="current()/text() | current()/*"/>
    207                 </xsl:element>
    208         </xsl:template>
    209 -->
    210 <!-- img elements do not contain any text or other elements so it doesn't need
    211                 to process/worry about anything other than it's attributes.
    212         <xsl:template match="ibis:img">
    213                 <img>
    214                         <xsl:attribute name="src"><xsl:value-of select="concat($ibis.baseRequestPath, @src)"/></xsl:attribute>
    215                         <xsl:copy-of select="attribute::*[name() != 'src']"/>
    216                 </img>
    217         </xsl:template>
    218 -->
    219 <!-- Since the a element can contain images, divs etc need to process text
    220                 and elements contained within.
    221         <xsl:template match="ibis:form">
    222                 <xsl:element name="form">
    223                         <xsl:attribute name="action"><xsl:value-of select="concat($ibis.baseRequestPath, @action)"/></xsl:attribute>
    224                         <xsl:copy-of select="attribute::*[name() != 'action']"/>
    225                         <xsl:apply-templates select="current()/text() | current()/*"/>
    226                 </xsl:element>
    227         </xsl:template>
    228 -->
    229 
    230213<!-- ============================= End of File ============================= -->
  • trunk/ibisph-view/src/main/webapp/xslt/html/query/module/result/Page.xslt

    r20835 r20976  
    2323                </description>
    2424        </ibis:doc>
    25 
    26 <!-- GARTH TODO: use or remove
    27         <xsl:param name="DataSources"/>
    28         <xsl:param name="Page.dataSources" select="$DataSources/DATA_SOURCES"/>
    29 -->
    3025
    3126       
  • trunk/ibisph-view/src/main/webapp/xslt/html/secure/query/SiteSpecific.xslt

    r15958 r20976  
    1919                </description>
    2020        </ibis:doc>
     21
     22        <xsl:param name="Page.queryBaseRequestPath" select="concat($ibis.baseRequestPath, 'secure/query/')"/>
     23
    2124</xsl:stylesheet>
    2225<!-- ============================= End of File ============================= -->
  • trunk/ibisph-view/src/main/webapp/xslt/xml/query/module/ConfigurationIncludeCriteriaExclude.xslt

    r20915 r20976  
    5050                ibis:doc="Configuration match template that simply eats the non matching
    5151                        CONFIGURATION elements.  See prior 7/27/2018 versions that was
    52                         implemented differently using a parameter.
    53                 "
    54         >
     52                        implemented differently using a parameter.  At some point might want
     53                        to have UI selection to get alternate configs.  In this case can
     54                        uncomment the code below and/or add addiontal fields etc.
     55                "
     56        >
     57<!--
    5558        <CONFIGURATION>
    5659                <xsl:copy-of select="NAME" copy-namespaces="no"/>
     
    5861                <xsl:copy-of select="MEASURE_NAME" copy-namespaces="no"/>
    5962        </CONFIGURATION>
     63-->
    6064        </xsl:template>
    6165
     
    99103        />
    100104
    101 <!-- can't do AUTHORITY processing because the UserInfo is NOT injected into the
    102         QueryModule getModel service - only the QM config is injected - the only param.
    103         Thus until the getModel service is changed to include the UserInfo object being
    104         passed as a param the AUTHORITY checking can not be done within here.
    105         <xsl:template match="DIMENSION/VALUES/VALUE[exists(AUTHORITY)]" mode="ibis.copy"
    106                 ibis:doc="Test user privs if authority exists."
    107         >
    108 <xsl:message select="AUTHORITY"/>
    109                 <xsl:if test="ibis:hasAuthority(AUTHORITY)"><xsl:copy-of select="."/></xsl:if>
    110         </xsl:template>
    111 -->
    112105
    113106        <xsl:template match="ibis:include[boolean(@configuration-name-list)]" mode="#all"
    114107                ibis:doc="
    115                         Provides the ability to limit includes to a given configuration name or
    116                         CSV list of names.  See the ibis:include function for more info about
    117                         this template.
    118 
    119                         This template handles a space and/or comma separated list of configuration
    120                         name list.  This code handles multiple spaces etc.
    121 
    122                         If a children-only-flag attribute exists in the element then only
    123                         only the sub elements and child text are included and processed.
    124                         This is useful for including an element's text without having to
    125                         include its root element.
     108                        Provides the ability to limit includes to a given configuration name(s)
     109                        via a delimited list of names.  The list can be space and/or comma
     110                        and or line break separated list of configuration names. 
     111
     112                        If the name matches the Java injected QM config name then this
     113                        template recreates a similar ibis:include sans the configuration-name-list
     114                        and calls apply templates so that the standard ibis:include code is
     115                        applied.  See the ibis:include function for more info. 
    126116                "
    127117        >
    128118                <xsl:variable name="configurationNames" select="tokenize(normalize-space(replace(@configuration-name-list, ',', ' ')), '\s+')"/>
    129 
    130                 <!-- Child only flag note:
    131                         OLD CODE:   then document(@href, /)/(text() | *)
    132                         had an issue seen with the topic HTML_CONTENT pages including textual
    133                         blocks with child specified (see ibis.xslt line 598).  What happened
    134                         was that the root container element was being copyied into the doc. 
    135                         So it looked okay but was producing invalid HTML as it contained the
    136                         XML container element.  Same issue existed with this code...
    137                 -->
    138119                <xsl:if test="$configurationNames = $ConfigurationName">
    139                         <xsl:apply-templates select=
    140                                 "if(exists(@children-only-flag))
    141                                         then document(@href, /)/(*/text() | */*)
    142                                         else document(@href, /)
    143                                 "
    144                                 mode="ibis.copy"
    145                         />
     120                        <xsl:variable name="url" select="if(0 != string-length(@use-prefix)) then concat($ibis.baseRequestPath, @href) else @href"/>
     121                        <xsl:choose>
     122                                <xsl:when test="exists(@child-name-list)">
     123                                        <xsl:variable name="names"       select="tokenize(normalize-space(replace(@child-name-list, ',', ' ')), '\s+')"/>
     124                                        <xsl:variable name="rootElement" select="document($url)/*"/>
     125                                        <xsl:for-each select="$names">
     126                                                <xsl:apply-templates select="$rootElement/*[NAME=current()]" mode="ibis.copy"/>
     127                                        </xsl:for-each>
     128                                </xsl:when>
     129                                <xsl:when test="exists(@children-only-flag)">
     130                                        <xsl:apply-templates select="document($url, /)/(*/text() | */*)" mode="ibis.copy"/>
     131                                </xsl:when>
     132                                <xsl:otherwise>
     133                                        <xsl:apply-templates select="document($url, /)/*" mode="ibis.copy"/>
     134                                </xsl:otherwise>
     135                        </xsl:choose>
    146136                </xsl:if>
    147137        </xsl:template>
    148138
    149139
    150         <xsl:template match="ibis:include[boolean(@name-list)]" mode="#all"
    151                 ibis:doc="
    152                         Provides the ability to limit included DIMENSION and any other include
    153                         that has the standard NAME element.  This provides a mechanism to
    154                         limit child elements to a given name or a CSV or white space delimited
    155                         list of names.  See the ibis:include function for more info about
    156                         this template mechanism works.
    157 
    158                         This template should only be implemented for child elements that
    159                         contain a sub NAME element.
    160                 "
    161         >
    162                 <xsl:variable name="names"      select="tokenize(normalize-space(replace(@name-list, ',', ' ')), '\s+')"/>
    163                 <xsl:variable name="rootElement"        select="document(@href, /)/*"/>
    164 
    165                 <xsl:for-each select="$names">
    166                         <xsl:apply-templates select="$rootElement/*[NAME=current()]" mode="ibis.copy"/>
    167                 </xsl:for-each>
    168         </xsl:template>
     140
     141<!--
     142UNSUCCESSFUL TRIES:
     143
     144<xsl:variable name="ibisIncludeElement">
     145                                <xsl:element name="ibis:include">
     146                                        <xsl:attribute name="href"><xsl:value-of select="if(exists(@use-prefix)) then concat($ibis.baseRequestPath, @href) else @href"/></xsl:attribute>
     147                                        <xsl:if test="0 != string-length(@child-name-list)"><xsl:attribute name="child-name-list"><xsl:value-of select="@child-name-list"/></xsl:attribute></xsl:if>
     148                                        <xsl:if test="0 != string-length(@children-only-flag)"><xsl:attribute name="children-only-flag"><xsl:value-of select="@children-only-flag"/></xsl:attribute></xsl:if>
     149                                </xsl:element>
     150                        </xsl:variable>
     151<xsl:message select="$ibisIncludeElement"/>
     152
     153                        <xsl:apply-templates select="$ibisIncludeElement" mode="ibis.copy"/>
     154
     155
     156<xsl:attribute-set name="font">
     157  <xsl:attribute name="fname">Arial</xsl:attribute>
     158  <xsl:attribute name="size">14px</xsl:attribute>
     159  <xsl:attribute name="color">red</xsl:attribute>
     160</xsl:attribute-set>
     161
     162<xsl:element
     163  name="element-name"
     164  namespace="URI"
     165  use-attribute-sets="qname"
     166>
     167</xsl:element>
     168
     169<xsl:variable name="ibisIncludeElement">
     170                        <xsl:copy-of select=". | @* except @configuration-name-list"/>
     171</xsl:variable>
     172
     173<xsl:variable name="ibisIncludeElement" select="@* except @configuration-name-list | *"/>
     174
     175                        <xsl:apply-templates select="$ibisIncludeElement" mode="ibis.copy"/>
     176
     177
     178<xsl:variable name="ibisIncludeElement">
     179                                <xsl:element name="ibis:include" >
     180                                        <xsl:attribute name="href"><xsl:value-of select="if(exists(@use-prefix)) then concat($ibis.baseRequestPath, @href) else @href"/></xsl:attribute>
     181                                        <xsl:if test="0 != string-length(@child-name-list)"><xsl:attribute name="child-name-list"><xsl:value-of select="@child-name-list"/></xsl:attribute></xsl:if>
     182                                        <xsl:if test="0 != string-length(@children-only-flag)"><xsl:attribute name="children-only-flag"><xsl:value-of select="@children-only-flag"/></xsl:attribute></xsl:if>
     183                                </xsl:element>
     184                        </xsl:variable>
     185
     186                        <xsl:apply-templates select="$ibisIncludeElement" mode="ibis.copy"/>
     187
     188                        <xsl:apply-templates select="node()  | @* except @configuration-name-list"/>
     189
     190
     191<xsl:message select="$ConfigurationName"/>
     192<xsl:message select="node() | @* except @configuration-name-list"/>
     193                        <xsl:apply-templates select="node() | (@* except @configuration-name-list)"  mode="ibis.copy"/>
     194
     195                        <xsl:variable name="rootElement" select="document(@href)/*">
     196                                <xsl:if test="0 != string-length(@child-name-list)"><xsl:attribute name="child-name-list"><xsl:value-of select="@child-name-list"/></xsl:attribute></xsl:if>
     197                                <xsl:if test="0 != string-length(@children-only-flag)"><xsl:attribute name="children-only-flag"><xsl:value-of select="@children-only-flag"/></xsl:attribute></xsl:if>
     198                        </xsl:variable>
     199                        <xsl:apply-templates select="$rootElement" mode="ibis.copy"/>
     200
     201<xsl:message select="$ConfigurationName"/>
     202                        <xsl:apply-templates select="node() | (@* except @configuration-name-list)" mode="ibis.copy"/>
     203-->
    169204
    170205
Note: See TracChangeset for help on using the changeset viewer.