Changeset 794


Ignore:
Timestamp:
10/16/10 12:48:18 (14 years ago)
Author:
vronk
Message:

finishing terms (autocomplete, htmlselect)

Location:
MDService2/trunk/MDService2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js

    r793 r794  
    1010                                current:''},
    1111                terms: {
    12                         base_uri: "/MDService2/model/",                 
    13                         current:'Components'},
     12                        base_uri: "/MDService2/terms/",                 
     13                        current:'all'},
    1414                terms_autocomplete: {
    1515                                base_uri: "/MDService2/terms/",                 
  • MDService2/trunk/MDService2/build.properties

    r560 r794  
    2626build.home=./build
    2727dist.home=./dist
    28 #deploy.dir = C:/apps/ApacheTomcat/webapps
    29 deploy.dir = C:/apache-tomcat-6.0.26/webapps
     28deploy.dir = C:/apps/apache-tomcat/webapps
     29#deploy.dir = C:/apache-tomcat-6.0.26/webapps
    3030
    3131
  • MDService2/trunk/MDService2/src/mdservice.properties

    r775 r794  
    3131xsl.model2htmlselect = model2view.xsl
    3232xsl.terms2htmlselect = terms2view.xsl
     33xsl.terms2htmllist = terms2view.xsl
     34xsl.terms2autocomplete = terms2view.xsl
    3335xsl.terms2htmlpage = terms2view.xsl
    3436xsl.terms2htmltable = terms2view.xsl
    35 xsl.terms2autocomplete = terms2view.xsl
     37
    3638xsl.comp2htmllist = comp2view.xsl
    3739xsl.comp2htmldetail = comp2view.xsl
     
    5052xsl.collection2html = collection2view.xsl
    5153xsl.complist2xmlresolved = complist_resolved.xsl
    52 xsl.terms2htmllist = complist2terms.xsl
     54
    5355xsl.terms2txt = complist2termstxt.xsl
    5456xsl.xml2json = xml2json.xsl
  • MDService2/trunk/MDService2/src/xsl/cmd_commons.xsl

    r789 r794  
    148148    <!-- Stop includes -->
    149149
     150<!--  generic templates -->
     151<xsl:template name="attr-detail-div" >
     152                <div class="detail">
     153                        <xsl:for-each select="@*" >
     154                                <div class="cmds-elem-prop"><span class="label"><xsl:value-of select="name()" />: </span>
     155                                        <span class="value"><xsl:value-of select="." /></span></div>
     156                        </xsl:for-each>
     157                </div>
     158</xsl:template>
    150159
    151160<!--  should be obsoleted by model2matrix.xsl
    152 
     161but it is not..
     162-->
    153163<xsl:variable name="term_matrix" >
    154164               
     
    163173       
    164174</xsl:variable>
    165 
     175<!--
    166176<xsl:template match="Term" mode="matrix" >
    167177               
     
    294304        </xsl:function>
    295305               
     306                <!--  previously known as comppath -->
    296307        <xsl:function name="my:context" >
    297308                <xsl:param name="child" />
  • MDService2/trunk/MDService2/src/xsl/comp2view.xsl

    r649 r794  
    185185                <xsl:variable name="detail_uri" select="if(@ComponentId) then concat($detail_comp_prefix, my:extractID(@ComponentId)) else concat($detail_profile_prefix, my:extractID(parent::CMD_ComponentSpec/Header/ID))" />
    186186                <li><a href="{$detail_uri}" ><xsl:value-of select="@name" /></a>
    187                         <span class="data comppath" ><xsl:value-of select="my:comppath(.)" /></span>
     187                        <span class="data comppath" ><xsl:value-of select="my:context(.)" /></span>
    188188                       
    189189                <span class="cmd cmd_filter"><xsl:text> </xsl:text></span><span class="cmd cmd_detail" ><xsl:text> </xsl:text></span>
     
    202202        <xsl:template match="CMD_Element" mode="list">
    203203                        <li><xsl:value-of select="@name" />
    204                                 <span class="data comppath" ><xsl:value-of select="my:comppath(.)" /></span>
     204                                <span class="data comppath" ><xsl:value-of select="my:context(.)" /></span>
    205205                                <span class="cmd cmd_filter"><xsl:text> </xsl:text></span><span class="cmd cmd_detail" ><xsl:text> </xsl:text></span>
    206206                        </li>
  • MDService2/trunk/MDService2/src/xsl/model2matrix.xsl

    r789 r794  
    160160        <xsl:param name="model_termsets" />
    161161        <xsl:copy>
     162                <xsl:attribute name="path" select="concat(ancestor::Termset/@id,':',@name)"></xsl:attribute>
    162163                <xsl:copy-of select="*|@*"></xsl:copy-of>
    163164                <xsl:variable name="matching_model_terms" select="$model_termsets//Term[@datcat=current()/@datcat]" />
     
    177178</xsl:template>
    178179               
    179 <xsl:template match="Term" mode="resolve-relcat" >
     180<xsl:template match="Term[@type='rel']" mode="resolve-relcat" >
    180181        <xsl:param name="datcat_termsets" />
    181182        <xsl:copy>
    182183                <xsl:variable name="matching_datcat_terms" select="$datcat_termsets//Term[@datcat=current()/@datcat]" />
    183                 <xsl:attribute name="name" select="($matching_datcat_terms//@name)[1]"></xsl:attribute>
    184                 <xsl:copy-of select="*|@*"></xsl:copy-of>
     184                <!-- <xsl:variable name="matching_datcat_relterms" select="$datcat_termsets//Term[@datcat=current()/@datcat]" /> -->
     185                <xsl:variable name="name" select="($matching_datcat_terms//@name)[1]"></xsl:variable>
     186                <xsl:attribute name="name" select="$name"></xsl:attribute>
     187                <xsl:attribute name="path" select="concat(ancestor::Termset/@id,':',$name)"></xsl:attribute>
     188                <xsl:copy-of select="@*"></xsl:copy-of>         
    185189                <xsl:copy-of select="$matching_datcat_terms" />
     190                <xsl:apply-templates select="Term" mode="resolve-relcat">
     191                        <xsl:with-param name="datcat_termsets" select="$datcat_termsets"/>
     192                </xsl:apply-templates>         
    186193        </xsl:copy>
    187194</xsl:template>
  • MDService2/trunk/MDService2/src/xsl/terms2view.xsl

    r789 r794  
    5050                            <div id="terms-matrix">
    5151                                <xsl:apply-templates select="Termsets/Termset" mode="terms-tree" />                             
    52                                 </div>           
    53                                                                                
     52                                </div>                                                                                         
    5453                        </xsl:when>                             
    55 <!--                    <xsl:when test="$format='terms2htmllist'" >                     
     54                <xsl:when test="$format='terms2htmllist'" >                     
    5655                        <xsl:call-template name="list"/>   
    57                 </xsl:when> -->
    58                 <xsl:when test="$format='terms2autocomplete'" >                         
    59                         <xsl:call-template name="autocomplete"/>   
    6056                </xsl:when>
    61                 <xsl:when test="$format='terms2htmlselect'" >                                                         
     57                <xsl:when test="$format='terms2autocomplete'" >
     58                        <xsl:variable name="terms_flat" >                                       
     59                                <xsl:call-template name="terms-flat"/>
     60                        </xsl:variable>                         
     61                        <xsl:apply-templates select="$terms_flat" mode="autocomplete"/>                             
     62                </xsl:when>
     63                <xsl:when test="$format='terms2htmlselect'" >
    6264                                        <select id="terms-select">             
    6365                                                        <xsl:apply-templates select=".//Termset" mode="select"/>                                                       
    64                                                 </select>                                                               
     66                                        </select>                                                               
    6567                        </xsl:when>
    6668                <xsl:otherwise>
     
    104106
    105107<xsl:template name="list">
    106         <div id="terms">               
     108        <div class="terms">             
    107109                <!--  format:<xsl:value-of select="$format" /> -->
    108110                <xsl:variable name="translated_term" select="translate(replace(/*/Term[1]/@path,'//',''),'/','.')" />
    109111                <!-- <input id="query_terms" value="{$translated_term}" /> -->         
    110112                <ul class="treeview">
    111                         <xsl:apply-templates select="/*/Term/Term" mode="list" />                       
     113                        <xsl:apply-templates select="/*/Term" mode="list" />                   
    112114                </ul>   
    113115        </div>
     
    123125                                        <span class="cmd cmd_detail" ><xsl:text> </xsl:text></span>
    124126                                        <span class="cmd cmd_columns" ><xsl:text> </xsl:text></span>
    125                                                 <div class="detail">
     127                                        <xsl:call-template name="attr-detail-div" />
     128                                                <!--  <div class="detail">
    126129                                                        <xsl:for-each select="@*" >
    127130                                                                <div class="cmds-elem-prop"><span class="label"><xsl:value-of select="name()" />: </span>
    128131                                                                        <span class="value"><xsl:value-of select="." /></span></div>
    129132                                                        </xsl:for-each>
    130                                                 </div>
     133                                                </div> -->
    131134                                        </div>
    132135                                        <ul><xsl:apply-templates select="*" mode="list" /></ul>                         
     
    202205</xsl:template>
    203206
    204 <xsl:template name="autocomplete">
    205        
    206                 <xsl:for-each-group select="//Term[exists(@name)][not(ancestor::Term[@type='datcat'])]" group-by="lower-case(@name)" >
     207<xsl:template match="Term" mode="autocomplete">
     208        <xsl:copy>
     209                <xsl:copy-of select="@*" />
     210                <div class="term-contexts">
     211                        <xsl:apply-templates mode="autocomplete" />
     212                </div>
     213        </xsl:copy>                                     
     214</xsl:template>
     215
     216<xsl:template match="context" mode="autocomplete">
     217        <div class="context cmds-elem-plus">
     218                <span class="detail-caller"><a href="{concat($detail_model_prefix,@path)}" >
     219                                <xsl:value-of select="@path"/></a></span>
     220                                       
     221                <xsl:call-template name="attr-detail-div" />
     222                <xsl:apply-templates mode="autocomplete" />
     223        </div>                                 
     224</xsl:template>
     225
     226
     227<xsl:template name="terms-flat">
     228       
     229                <!--  group union of model, dcr and rr Terms --> 
     230                <xsl:for-each-group select=".//Termset[@type='model']//Term | .//Termset[@type='dcr']/Term | .//Termset[@type='rr']//Term[@type='rel']" group-by="lower-case(@name)" >
     231<!--            <xsl:for-each-group select="//Term[exists(@name)][parent::Termset]" group-by="lower-case(@name)" >-->
    207232                        <xsl:sort select="lower-case(@name)" />
    208                         <xsl:if test="exists(current-group()[not(@type='datcat')])" >
     233                        <!--  <xsl:if test="exists(current-group()[not(@type='datcat')])" >  -->
    209234                                <Term name="{@name}">
    210235                                        <xsl:for-each select="current-group()[not(@type='datcat' or @type='rel')]" >
    211                                                 <context><!-- <xsl:value-of select="ancestor::Termset[1]/@id" />:  --><xsl:value-of select="@path" /></context>
     236                                                <context><!-- <xsl:value-of select="ancestor::Termset[1]/@id" />:  -->
     237                                                        <xsl:copy-of select="@*" />
     238                                                <xsl:value-of select="@path" /></context>
    212239                                        </xsl:for-each>
    213                                         <xsl:for-each select="current-group()[@type='datcat' or @type='rel']" >
     240                                        <xsl:for-each select="current-group()[@type='datcat'][parent::Termset]" >
    214241                                                <xsl:variable name="datcat" select="." />
    215                                                 <context><xsl:value-of select="ancestor::Termset[1]/@id" />:<xsl:value-of select="@name" />
     242                                                <context><xsl:copy-of select="@*" /><xsl:value-of select="ancestor::Termset[1]/@id" />:<xsl:value-of select="@name" />
    216243                                                <xsl:for-each-group select="$datcat/Term" group-by="@path" >
    217                                                         <context><xsl:value-of select="@path" /></context>
     244                                                        <context><xsl:copy-of select="@*" /><xsl:copy-of select="@*" /><xsl:value-of select="@path" /></context>
    218245                                                </xsl:for-each-group>
    219246                                                </context>                             
    220247                                        </xsl:for-each>
     248                                       
     249                                        <xsl:for-each select="current-group()[@type='rel']" >
     250                                                <xsl:variable name="datcat" select="if(parent::Term[@type='rel']) then parent::Term[@type='rel'] else . " />
     251                                                                <context><xsl:copy-of select="@*" /><!-- <xsl:value-of select="ancestor::Termset[1]/@id" />: --><xsl:value-of select="@path" />
     252<!--                                            <xsl:for-each-group select="$datcat//Term[@type!='datcat']" group-by="@path" >-->
     253                                                               
     254                                                        <xsl:for-each select="$datcat//Term[@type='datcat']" > <!-- [Term/@path] -->
     255                                                                <context><xsl:copy-of select="@*" /><xsl:value-of select="@path" />
     256                                                                <xsl:for-each-group select="Term[@path]" group-by="@path" >
     257                                                                                <context><xsl:copy-of select="@*" /><xsl:value-of select="@path" /></context>
     258                                                                </xsl:for-each-group>
     259                                                                </context>
     260                                                        </xsl:for-each>
     261                                                </context>                             
     262                                        </xsl:for-each>
    221263                                </Term>
    222                         </xsl:if>
     264<!--                    </xsl:if>-->
    223265                </xsl:for-each-group>
    224266</xsl:template>
Note: See TracChangeset for help on using the changeset viewer.