Changeset 1029


Ignore:
Timestamp:
01/02/11 19:30:58 (13 years ago)
Author:
vronk
Message:

changes to columns, terms (unfinished) ; .ui-context-dialog

Location:
MDService2/trunk/MDService2
Files:
1 added
16 edited

Legend:

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

    r1020 r1029  
    10501050        $('.autocomplete-select-caller').live('click',  function(event) {
    10511051               
    1052                 $(this).closest(".index-context").prev().parent().find(".autocomplete-input").val($(this).text());
     1052                $(this).closest(".index-context").prev().parent().find(".autocomplete-input").val($(this).text()).change();             
    10531053                $(this).closest(".index-context").hide();
    10541054        });
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js

    r1008 r1029  
    268268                        "<a class='cmd cmd_xml' target='_blank' href='" + this.link("xml") + "'>xml</a> <a class='cmd cmd_link' target='_blank' href='" + this.link("fullpage") + "' >link</a></div>" +
    269269                //      <span class='cmd cmd-xml'></span><span class='cmd cmd-page'></span><span class='cmd cmd-link'></span></div>" +         
    270                         "<div class='columns-wrapper'><div class='query-columns'></div><span class='cmd cmd_del'></span></div><div class='result ui-widget-content ui-corner-bottom'></div>";
     270                        //"<div class='ui-context-dialog columns-wrapper'><div class='query-columns'></div><span class='cmd cmd_del'></span></div><div class='result ui-widget-content ui-corner-bottom'></div>";
     271                        "<div class='result ui-widget-content ui-corner-bottom'></div>";
    271272        addToQuerylist(x);     
    272273       
    273274        this.container = $('#' + this.listid );
    274275       
    275         this.columns_widget = new ListWidget($(this.container).find('.query-columns'));
     276//      this.columns_widget = new ListWidget($(this.container).find('.query-columns'));
    276277        //$(this.container).find('.query-columns').append(this.columns_widget);
    277278       
    278         this.columns_widget.load(this.columns.split(','));
    279         this.columns_widget.initAutocomplete(element_autocomplete);
    280        
     279        //this.columns_widget.load(this.columns.split(','));
     280        //this.columns_widget.initAutocomplete(element_autocomplete);
     281        //$(this.container).find('.columns-wrapper').hide();
     282        notifyUser("DEBUG: setting up removing query:" + $(this).closest('.query_wrapper').attr('id'));
    281283        $(this.container).children('.query_header').find('.cmd_del').live('click',  function(event) {
     284                notifyUser("DEBUG: removing query:" + $(this).closest('.query_wrapper').attr('id'));
    282285                queryset.removequery($(this).closest('.query_wrapper').attr('id'));
    283286        });
    284 
     287       
    285288        /*
    286289        $(this.container).children('.columns-wrapper').children('.cmd_del').live('click',  function(event) {
    287290                $(this).parent().hide();
    288291        });
    289         */
    290        
    291         $(this.container).find('.columns-wrapper').hide();
    292                
     292        */     
    293293 };
    294294
     
    367367                                        });
    368368                                       
    369                                         $(this).find('.edit-columns').live('click',  function(event) {
    370                                                 $(this).closest('.query_wrapper').find('.columns-wrapper').show();
    371                                         });
    372                                        
     369                                        q_header.find('.columns-wrapper').hide();
     370                                        q_header.find('.cmd_columns').live('click',  function(event) {
     371                                                notifyUser("DEBUG: submit() .cmd_columns");
     372                                                $(this).closest('.query_wrapper').find('.columns-wrapper').toggle();
     373                                        });     
     374                       
    373375                                });
    374376
     
    426428                                                queryset.next(qid,1);
    427429                                });
    428                                 $(this).find('.edit-columns').live('click',  function(event) {
     430                                q_header.find('.cmd_columns').live('click',  function(event) {
     431                                        notifyUser("DEBUG: resubmit() .cmd_columns");
    429432                                        $(this).closest('.query_wrapper').find('.columns-wrapper').show();
    430                                 });     });
     433                                });     
     434                        });
    431435
    432436};
     
    595599};
    596600
    597 $('#querylist .columns-edit').live('click',function(){
    598         $(this).closest('query_wrapper').find('query-columns').show();
     601$('#querylist .cmd_columns').live('click',function(){
     602        notifyUser("DEBUG: #querylist.cmd_columns");
     603        $(this).closest('.query_wrapper').find('.columns-wrapper').toggle();
    599604});
    600605
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_searchclause.js

    r923 r1029  
    150150        //update after text change
    151151        e_index.bind('change', function(){
     152               
    152153                var i = $(this).closest('.sc-i').attr("id");
    153154                var j = $(this).closest('.sc-j').attr("id");
    154155                //alert("e-index-chabge;" + i + j + $(this).val());
    155156                searchclauseset.searchclauses[i][j].index = $(this).val();
    156                
     157                notifyUser("index_sc" + i + "-" + j + " changed to:" + searchclauseset.searchclauses[i][j].index, "debug");
    157158                searchclauseset.searchclauses[i][j].is_category = false;
    158159    });
  • MDService2/trunk/MDService2/WebContent/style/cmds-ui.css

    r893 r1029  
    6161.cmds-ui-block { margin: 2px; }
    6262
     63.ui-context-dialog { position:absolute; border 1px solid #A6C9E2; background-color: #faffff; }
     64
    6365.cmds-elem-plus .detail { display: none; border: 1px solid #A6C9E2;}
    6466
     
    109111 .sc-wrapper .index-context { display: none; border: 1px solid #A6C9E2;}
    110112
     113.columns-wrapper { right:0px;}
     114
    111115/* command icons */
    112116
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Cache.java

    r980 r1029  
    172172                }
    173173               
    174                 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-ddThh:mm:ss");
     174                DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
    175175                e.setAttribute("date", dateFormat.format(new Date()).toString());
    176176                cacheindex_doc.getFirstChild().appendChild(e);
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/CollectionProxyAction.java

    r862 r1029  
    3434                //targetURL =new URL( getBaseURL(), getActionkey());
    3535                //FIXME: get maxdepth-constant out of here !!
    36                 targetURL = new URL(getBaseURL(), "?operation=getCollections&maxdepth=3&collection=");
     36                targetURL = new URL(getBaseURL(), "?operation=getCollections&maxdepth=2&collection=");
    3737                //Admin.notifyUser("CollectionProxy.targetURL:" + targetURL);
    3838
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java

    r980 r1029  
    5656        private int maxdepth;
    5757        private String format;
     58        private String options;
    5859        private String actionContentType;
    5960        private String userMsg;
     
    142143        }
    143144
     145        public String getOptions() {
     146                return options;
     147        }
     148
     149        public void setOptions(String options) {
     150                this.options = options;
     151        }
     152
    144153        public String getActionContentType() {
    145                 if (format.toLowerCase().equals("xml")) {
     154                if (format.toLowerCase().startsWith("html")) {
     155                        this.actionContentType = "text/html";
     156                } else {
    146157                        this.actionContentType = "text/xml";
    147                 } else {
    148                         this.actionContentType = "text/html";
    149158                }
    150159               
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/MDRepoProxyAction.java

    r890 r1029  
    115115                        query.setMaximumRecords(getMaximumRecords());
    116116                        query.setStartRecord(getStartRecord());
     117                        query.setOptions(getOptions());
    117118                        //Admin.notifyUser("MDRPA.records:" + query.getStartRecord());
    118119                        //Admin.notifyUser("MDRPA.records:" + query.getMaximumRecords());
     
    120121                       
    121122                        targetURL =new URL( getBaseURL(), urls.get(getActionkey()) + query.toURLParam() );
     123                        Admin.notifyUser("MDRPA.targetURL.query.toURLParam:" + query.toURLParam());
    122124                        Admin.notifyUser("MDRPA.targetURL:" + targetURL);
    123125                return targetURL;
  • MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/model/Query.java

    r911 r1029  
    5858        private String maximumRecords = "50";
    5959        private String squery = null;
     60        private String options = null;
    6061        private int maxdepth=1;
    6162       
     
    199200        }
    200201       
     202        public String getOptions() {
     203                return options;
     204        }
     205
     206        public void setOptions(String options) {
     207                this.options = options;
     208        }
     209
    201210        public String getStartRecord() {
    202211                return startRecord;
     
    312321                        //  2010-07-11 this is just a hack, because url-encoding the handle acted strange
    313322                        //String corrid = getQueryString().replace('_', '/');
    314                         String corrid = getQueryString();
    315                         targetRequest = "//MdSelfLink[.='" + corrid + "']";                     
     323                        //  2010-12-28 needed for the lucene-index to recognize..
     324                                //  probably not the best place to handle -> move to repository: sanitize-query?
     325                        String corrid = getQueryString().replace(":","\\:").toLowerCase();
     326                        Admin.notifyUser("Query.toURLParam.corrid=" + corrid);
     327                        targetRequest = "//MdSelfLink[ft:query(.,'" + corrid + "')]";                   
    316328                } else {
    317329                        if (query_cql == null){
     
    322334                        if ((startRecord != null) && (maximumRecords != null)) {
    323335                                targetRequest = targetRequest +  "&startRecord=" + getStartRecord() + "&iend=" + getMaximumRecords();
     336                        }
     337                        if ((options != null)) {
     338                                targetRequest = targetRequest +  "&format=xml-" + getOptions();
    324339                        }
    325340                }
  • MDService2/trunk/MDService2/src/struts.xml

    r980 r1029  
    1313               
    1414                <global-results>
    15                             <result name="exception">/Exception.jsp</result>                       
     15                            <result name="exception">/Exception.jsp</result>
     16                            <!-- tried setting html-status, didn't work: 
     17                                <result name="exception">
     18                              <param name="status">500</param>
     19                              <param name="location">/Error.jsp</param>                     
     20                            </result> -->
    1621                            <result name="error">/Error.jsp</result>
    1722                </global-results>
     
    8994                                <param name="actionkey">profiles</param>
    9095                            <result type="stream">             
    91                                 <param name="contentType">$(actionContentType)</param>                         
     96                                <param name="contentType">${getActionContentType()}</param>                             
    9297                                <param name="inputName">resultStream</param>
    9398                            </result>
     
    98103                                <param name="actionkey">elements</param>
    99104                            <result type="stream">             
    100                                 <param name="contentType">text/xml</param>                             
     105                                <param name="contentType">${getActionContentType()}</param>                             
    101106                                <param name="inputName">resultStream</param>
    102107                            </result>
     
    117122                                <param name="q">{2}</param>
    118123                                <param name="actionkey">terms</param>
    119                             <result type="stream">             
    120                                 <param name="contentType">$(actionContentType)</param>
     124                            <result type="stream">
     125                               <param name="contentType">${getActionContentType()}</param>
    121126                                <!-- <param name="contentType">text/html</param>  -->                           
    122127                                <param name="inputName">resultStream</param>
     
    228233                           <param name="q">{3}</param>
    229234                           <result type="stream">                             
    230                                 <param name="contentType">${getactionContentType()}</param>
     235                                <param name="contentType">${getActionContentType()}</param>
    231236                                <!--<param name="contentType">text/html</param>
    232237                                 -->
  • MDService2/trunk/MDService2/src/xsl/XCQL2Xpath.xsl

    r890 r1029  
    11<?xml version="1.0" encoding="utf-8"?>
    22<xsl:stylesheet
    3   version="1.0"
    4   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     3  version="2.0"
     4  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  xmlns:my="myFunctions">
    55
    66<!--
     
    4040      -->
    4141     
    42 <xsl:include href="params.xsl"/>
     42
     43<xsl:include href="cmd_functions.xsl"/>
     44<!--<xsl:include href="params.xsl"/>
    4345<xsl:variable name="terms_setup" select="document($terms_setup_uri)" />
    4446<xsl:variable name="terms_flat" select="document($terms_flat_uri)" />
    45 
     47-->
    4648<xsl:output method="text" />
    4749
     
    152154               
    153155        </xsl:variable>
    154         <xsl:variable name="ix_xpathed" select="translate($ix_resolved, '.', '/')" ></xsl:variable>
     156        <!-- <xsl:variable name="ix_xpathed" select="translate($ix_resolved, '.', '/')" ></xsl:variable> -->
     157        <xsl:variable name="ix_xpathed" select="my:index2xpath(.)" ></xsl:variable>
    155158        <xsl:choose>
    156159                <xsl:when test=".='cql.serverChoice' or .='*'" >//Components</xsl:when>                         
  • MDService2/trunk/MDService2/src/xsl/cmd_commons.xsl

    r908 r1029  
    44
    55<!--
    6 <purpose>generic functions and templates for displaying/summarizing table-data</purpose>
     6<purpose>generic templates for MDService2</purpose>
    77<history>
    88        <change on="2010-03-19" type="created" by="vr">based on 3RMA/suki/dc4_commons.xsl</change>                     
    99        <change on="2010-03-23" type="changed" by="vr">really started rework - added html wrapper, ...</change>                 
     10        <change on="2010-12-29" type="changed" by="vr">extracted function into: cmd_functions.xsl</change>
    1011</history>
    1112
    1213-->
    13 <xsl:include href="params.xsl"/>
     14
     15<xsl:include href="cmd_functions.xsl"/>
     16
     17<!--<xsl:include href="params.xsl"/>-->
    1418
    1519<!-- <xsl:param name="mode" select="'html'" /> -->
    1620
    17 <xsl:param name="dict_file" select="'dict.xml'" />
    18 <xsl:variable name="dict" select="document($dict_file)" />
     21<!-- moved to cmd_functions.xsl-->
     22<!--<xsl:param name="dict_file" select="'dict.xml'" />-->
     23<!--<xsl:variable name="dict" select="document($dict_file)" />-->
     24<!--<xsl:variable name="terms_setup" select="document($terms_setup_uri)" />-->
     25<!--<xsl:variable name="terms_flat" select="document($terms_flat_uri)" />-->
     26
     27
    1928
    2029<!-- params for include-processing
     
    2736        <!--  FIXME: he? -->   
    2837        <xsl:param name="root_uri" select="$src_file" />               
    29 
    30 <xsl:variable name="terms_setup" select="document($terms_setup_uri)" />
    31 <xsl:variable name="terms_flat" select="document($terms_flat_uri)" />
    3238
    3339<xsl:template match="/">
     
    201207
    202208
    203 <!--  should be obsoleted by model2matrix.xsl
    204 but it is not..
    205 -->
    206 <xsl:variable name="term_matrix" >
    207                
    208                 <xsl:for-each select="//CMD_Element" >
    209                                         <xsl:variable name="context" select="my:context(.)" >
    210                                         </xsl:variable>
    211                         <Term  elem="{@name}" datcat="{@ConceptLink}" profile="{ancestor::profileDescription[1]/name}"
    212                                                         parent="{ancestor::CMD_Component[1]/@name}"  context="{$context}" >
    213                                                                 <xsl:copy-of select="." />
    214                         </Term>
    215                 </xsl:for-each>
    216        
    217 </xsl:variable>
    218 <!--
    219 <xsl:template match="Term" mode="matrix" >
    220                
    221                 <xsl:for-each select=".//Term" >
    222                         <xsl:variable name="context" select="my:context(.)" >
    223                                         </xsl:variable>
    224                         <Term  elem="{@name}" datcat="{my:term2datcat(@name)}" profile="{ancestor::profileDescription[1]/name}"
    225                                                         parent="{ancestor::Term[1]/@name}"  context="{$context}" >
    226                                                                 <xsl:copy-of select="." />
    227                         </Term>
    228                 </xsl:for-each>
    229        
    230 </xsl:template>
    231 
    232  -->
    233  
    234 <xsl:function name="my:profilematrix" >
    235     <xsl:param name="term"/>
    236    
    237     <xsl:variable name="profile" select="my:profile($term,true())" />
    238     <Terms name="{$profile/name}"  id="{$profile/id}">
    239         <xsl:for-each select="$profile//CMD_Component|$profile//CMD_Element" >
    240                                         <xsl:variable name="context" select="my:context(.)" />                                         
    241                                        
    242                                         <xsl:variable name="id"  >
    243                                                         <xsl:choose>
    244                                                                 <xsl:when test="@ComponentId">
    245                                                                         <xsl:value-of select="@ComponentId" />
    246                                                                 </xsl:when>
    247                                                                 <xsl:otherwise>
    248                                                                         <xsl:value-of select="ancestor::CMD_Component[@ComponentId][1]/@ComponentId" /><xsl:text>#</xsl:text>
    249                                                                         <xsl:for-each select="ancestor::CMD_Component[not(descendant-or-self::CMD_Component[@ComponentId])]" >
    250                                                                         <xsl:value-of select="@name" />.</xsl:for-each><xsl:value-of select="@name" />
    251                                                                 </xsl:otherwise>
    252                                                         </xsl:choose>                                                   
    253                                         </xsl:variable>
    254                         <Term  name="{@name}" datcat="{@ConceptLink}" id="{$id}"
    255                                                         parent="{ancestor::CMD_Component[1]/@name}" context="{$context}"
    256                                                         >
    257                                                                 <!--  <xsl:copy-of select="." /> -->
    258                         </Term>
    259                 </xsl:for-each>
    260         </Terms>
    261    
    262 </xsl:function>
    263 
    264 <xsl:function name="my:profile" >
    265     <xsl:param name="term"/>
    266     <xsl:param name="resolve" /> <!--  true|false-->
    267    
    268     <xsl:message>cmdprofiles_uri: <xsl:value-of select="$cmdprofiles_uri" /></xsl:message>
    269    
    270     <xsl:variable name="profile" select="doc($cmdprofiles_uri)//profileDescription[name=$term]" />
    271    
    272     <xsl:choose>
    273       <xsl:when test="$resolve=true()">
    274                 <xsl:apply-templates select="$profile" mode="include" />
    275       </xsl:when>
    276       <xsl:otherwise>
    277                 <xsl:copy-of select="$profile" />
    278       </xsl:otherwise>
    279     </xsl:choose>
    280    
    281        
    282 </xsl:function>
    283 
    284 <!--
    285 <xsl:function name="my:term2datcat">
    286     <xsl:param name="term"/>                             
    287     <xsl:value-of select="$term_matrix/*[@elem=$term]/@datcat" />                                       
    288 </xsl:function>
    289 -->
    290 
    291         <xsl:function name="my:dict">
    292      <xsl:param name="key"/>                             
    293      <xsl:value-of select="my:dict($key, $key)" />                                     
    294    </xsl:function>
    295    
    296         <xsl:function name="my:dict">
    297      <xsl:param name="key"/>                           
    298      <xsl:param name="fallback"/>     
    299                 <xsl:choose>
    300                         <xsl:when test="$dict/list/item[@key=$key]" >
    301                                 <xsl:value-of select="$dict/list/item[@key=$key]" />
    302                         </xsl:when>                     
    303                         <xsl:when test="$dict/list/item[.=$key]" >
    304                                 <xsl:value-of select="$dict/list/item[.=$key]/@key" />
    305                         </xsl:when>                     
    306                         <xsl:otherwise>
    307                         <xsl:value-of select="$fallback" />
    308                         </xsl:otherwise>
    309                 </xsl:choose>
    310    </xsl:function>
    311                
    312         <xsl:function name="my:extractID" >             
    313                 <xsl:param name="uri" />
    314                
    315                 <xsl:choose>
    316                         <xsl:when test="contains($uri,$isocat_base_uri)">
    317                                 <xsl:value-of select="substring-after($uri, $isocat_base_uri)" />
    318                         </xsl:when>
    319                         <xsl:when test="contains($uri,$components_id_prefix)">
    320                         <!--   <xsl:value-of select="substring-after($uri,$components_id_prefix)" /> -->
    321                                 <xsl:value-of select="substring-after($uri, $components_id_prefix)" />
    322                         </xsl:when>
    323                         <xsl:otherwise><xsl:value-of select="$uri" /></xsl:otherwise>
    324                 </xsl:choose>           
    325         </xsl:function>
    326        
    327        
    328         <xsl:function name="my:shortURL" >
    329                 <xsl:param name="url" />
    330                 <!--   <xsl:value-of select="replace($url, 'http://www.isocat.org/datcat/','isocat:')" /> -->
    331                 <xsl:variable name="matching_termset"  select="$terms_setup/Termsets/Termset[starts-with($url,@url_prefix)]" />
    332                 <!-- <xsl:message>shortURL: <xsl:copy-of select="$matching_termset" />:: <xsl:value-of select="$matching_termset[1]/@url_prefix" />
    333                                 <xsl:copy-of select="$url" />
    334                 </xsl:message>  -->             
    335                 <xsl:value-of select="if ($matching_termset/@url_prefix and $matching_termset/@url_prefix!='' and $url!='') then replace($url, $matching_termset[1]/@url_prefix, concat(string-join($matching_termset/@id,','),':')) else $url" />             
    336         </xsl:function>
    337        
    338         <!--  rewrite specific URLs (linking to target services) to redirect them locally (via MDService)
    339         should work for: dcif:dataCategory@pid, pcompone
    340         -->
    341         <xsl:function name="my:rewriteURL" >
    342                 <xsl:param name="url" />       
    343                 <xsl:choose>
    344                                 <xsl:when test="contains($url,$isocat_base_uri)">
    345                                                 <xsl:value-of select="replace($url, $isocat_uri_match, $isocat_uri_replace)" />
    346                                 </xsl:when>     
    347                                 <xsl:otherwise><xsl:value-of select="concat($detail_complist_prefix, my:extractID($url))" /></xsl:otherwise>
    348                         </xsl:choose>           
    349         </xsl:function>
    350                
    351                 <!--  previously known as comppath -->
    352         <xsl:function name="my:context" >
    353                 <xsl:param name="child" />
    354                 <xsl:variable name="collect" >
    355                                 <xsl:for-each select="$child/ancestor::CMD_Component|$child/ancestor::Term" >
    356                                                 <xsl:value-of select="@name" />.</xsl:for-each><xsl:value-of select="$child/@name" />
    357                 </xsl:variable>
    358                 <xsl:value-of select="$collect" />     
    359         </xsl:function>
    360 
    361         <xsl:function name="my:encodePID" >
    362                 <xsl:param name="pid" />                               
    363                 <xsl:value-of select="encode-for-uri(replace(replace($pid,'/','%2F'),'\.','%2E'))" />   
    364         </xsl:function>
    365    
    366 <!--
    367 <xsl:function name="my:numberFormat">
    368 <xsl:param name="unit" />
    369         <xsl:choose>
    370                 <xsl:when test="$unit='count' or $unit='count-distinct'" ><xsl:value-of select="$format_count" /></xsl:when>
    371                 <xsl:when test="$unit='kg'" ><xsl:value-of select="$format_kg" /></xsl:when>
    372                 <xsl:when test="$unit='t'" ><xsl:value-of select="$format_t" /></xsl:when>
    373                 <xsl:when test="$unit='m3'" ><xsl:value-of select="$format_m3" /></xsl:when>
    374                 <xsl:when test="$unit='per' or $unit='percent'" ><xsl:value-of select="$format_per" /></xsl:when>
    375                 <xsl:when test="$unit='sum'" ><xsl:value-of select="$format_kg" /></xsl:when>
    376                 <xsl:otherwise><xsl:value-of select="$format_default" /></xsl:otherwise>               
    377         </xsl:choose>
    378 </xsl:function>
    379 -->
    380 
    381209</xsl:stylesheet>
  • MDService2/trunk/MDService2/src/xsl/mdinst2view.xsl

    r893 r1029  
    109109        <xsl:template match="ResourceProxy" >
    110110       
    111                         <xsl:variable name="href" select="ResourceRef">
    112                         <!--
     111                        <xsl:variable name="href" >                                             
    113112                                <xsl:choose>
    114                                         <xsl:when test="contains(ResourceRef,$base_uri)">
    115                                                         <xsl:value-of select="substring-after(concat(substring-before(ResourceRef,'.xml'),'.html'),$base_uri)" />
     113                                        <xsl:when test="ResourceType='Resource'">
     114                                                        <xsl:value-of select="ResourceRef" />
    116115                                        </xsl:when>
    117116                                        <xsl:otherwise>
    118                                                         <xsl:value-of select="concat(substring-before(ResourceRef,'.xml'),'.html')" />
     117                                                        <xsl:value-of select="concat($default_prefix, my:encodePID(ResourceRef))" />
    119118                                        </xsl:otherwise>
    120                                 </xsl:choose>-->                               
     119                                </xsl:choose>                           
    121120                        </xsl:variable>
    122121                       
    123                 <li><span class="label" ><xsl:value-of select="ResourceType" />:</span> <a class="internal" href="{concat($default_prefix, my:encodePID($href))}" ><xsl:value-of select="$href" /></a></li>
     122                        <xsl:variable name="class" select=" if (ResourceType='Resource') then 'external' else 'internal'" />
     123                       
     124                <li><span class="label" ><xsl:value-of select="ResourceType" />: </span>
     125                                <a class="{$class}" href="{$href}" target="_blank" >
     126                                                <xsl:value-of select="ResourceRef" />
     127                                </a>
     128                </li>
    124129        </xsl:template>
    125130
  • MDService2/trunk/MDService2/src/xsl/mdset2view.xsl

    r1008 r1029  
    1616</history>
    1717-->
     18<xsl:import href="model2matrix.xsl"/>
     19<xsl:import href="terms2view.xsl"/>
    1820
    1921<xsl:output method="html" />
    2022
    2123<xsl:include href="cmd_commons.xsl"/>
     24
    2225
    2326<xsl:param name="startRecord">1</xsl:param>
     
    4851        <xsl:variable name="colarray" select="tokenize($cols,',')"/>
    4952        <xsl:for-each select="$colarray" >
    50                 <col key="{.}" label="{replace(.,'^.*\.([^.]+)$','$1')}" xpath="{replace(.,'\.','/')}" />
     53                <col key="{.}" label="{replace(.,'^.*\.([^.]+)$','$1')}" xpath_osbolete="{replace(.,'\.','/')}" xpath="{my:index2xpath(.)}" />
    5154                <!-- if (contains(.,'.')) then reverse(.) else . -->
    5255        </xsl:for-each>
     
    123126        <div class="result-header" >
    124127        <xsl:attribute name="max_value"><xsl:value-of select="numberOfRecords" /></xsl:attribute>
    125         <xsl:variable name="cnt_hits" select="number(diagnostics)" />   
     128        <xsl:variable name="cnt_hits" select="number(diagnostics)" />
     129       
    126130        <span class="label" >hits: </span><span class="value hilight"><xsl:value-of select="numberOfRecords" /></span>;
    127131        <span class="label" >from:</span><span><input type="text" class="value start_record paging-input"><xsl:attribute name="value">
     
    141145                </xsl:choose>
    142146        </span>
    143         <span class="cmd cmd_next">
     147        <span class="cmd cmd_next">     
    144148        <xsl:choose>
    145149                <xsl:when test="$maximumRecords &gt; numberOfRecords or $maximumRecords = numberOfRecords">
     
    148152                </xsl:choose>
    149153        </span>
     154        <span class="cmd cmd_columns" />       
     155        <div class='ui-context-dialog ui-widget-content columns-wrapper'>
     156                <div class='query-columns'>
     157                                <xsl:call-template name="columns" />
     158                </div><span class='cmd cmd_del'></span></div>
    150159    </div>
    151         <div class="note" ><span class="label" >echo: </span><span class="value"><xsl:value-of select="echoedSearchRetrieveRequest" /></span>;</div>
     160       <div class="note" ><span class="label" >echo: </span><span class="value"><xsl:value-of select="echoedSearchRetrieveRequest" /></span>;<span class="label" >duration: </span><span class="value"><xsl:value-of select="extraResponseData/duration" /></span>;</div>
    152161</xsl:template>
     162
     163<xsl:template name="columns">   
     164                <ul>
     165                        <xsl:for-each select="$columns/*">
     166                                <li><xsl:value-of select="@label"/></li>
     167                        </xsl:for-each>
     168                </ul>
     169        <xsl:if test="extraResponseData/usedProfiles" >
     170                <span class="label">used profiles in whole result</span>
     171                <ul>
     172                        <xsl:for-each select="extraResponseData/usedProfiles/profile" >
     173                                <li><a href="{@id}" ><xsl:value-of select="@name"/></a><span class="note">|<xsl:value-of select="@count"/>|</span></li>
     174                        </xsl:for-each>
     175                </ul>
     176        </xsl:if>
     177        <xsl:variable name="resultSummary" >
     178               
     179                <!-- wrap in <Terms> to make digestible for model2matrix -->
     180                <xsl:variable name="terms" >
     181                        <Terms>
     182                        <!-- if already provided by mdrepo, use that, otherwise DIY -->         
     183                        <xsl:choose>
     184                                <xsl:when test="extraResponseData/resultSummary"><xsl:copy-of select="extraResponseData/resultSummary/Term" /></xsl:when>
     185                                <xsl:otherwise>
     186                                <!-- TODO! -->
     187                                </xsl:otherwise>
     188                        </xsl:choose>
     189                        </Terms>
     190                </xsl:variable>
     191                <xsl:apply-templates select="$terms" mode="matrix" />
     192        </xsl:variable>         
     193        <span class="label">structure summary of shown result</span>
     194        <xsl:message><xsl:value-of select="$resultSummary/*/name()" /> </xsl:message>
     195                <ul class="treeview">
     196                        <xsl:for-each select="$resultSummary" >
     197                                <!--  calling template in terms2view.xsl -->
     198                                <xsl:call-template name="table" >
     199                                </xsl:call-template>
     200                        </xsl:for-each>
     201                <!--    <xsl:apply-templates select="$resultSummary/*/Term" mode="list" >
     202                                <xsl:with-param name="options" select="'all'"></xsl:with-param>
     203                        </xsl:apply-templates> -->                     
     204                </ul>   
     205                       
     206<!--            <xsl:for-each select="$resultSummary" >
     207                                <li><a href="{@id}" ><xsl:value-of select="@name"/></a><span class="note">|<xsl:value-of select="@count"/>|</span></li>
     208                        </xsl:for-each>
     209         -->                   
     210       
     211</xsl:template>
    153212
    154213<xsl:template match="records" mode="table">
     
    164223                        <xsl:for-each select="$columns/*">
    165224                                <th title="{@key}" ><xsl:value-of select="@label"/></th>
    166                         </xsl:for-each>
    167                         <th><span class="edit-columns"> edit...</span> </th>
     225                        </xsl:for-each>                         
    168226                </tr></thead>
    169227                <tbody>         
     
    209267                        <xsl:for-each select="$columns/*">
    210268                        <!-- <td ><xsl:value-of select="$curr_cmd//*[name()=current()]" /></td> -->
     269                        <xsl:message><xsl:copy-of select="."></xsl:copy-of> </xsl:message>
    211270                                 <xsl:variable name="curr_col_xpath" select="@xpath" />
    212271                        <td>                   
  • MDService2/trunk/MDService2/src/xsl/model2matrix.xsl

    r862 r1029  
    4646                <Termsets>
    4747                <xsl:for-each select="Term/Term" >
    48                         <xsl:variable name="termset_name" select="@name" />                     
    49                         <xsl:variable name="resolved_termset_uri" select="concat($model_matrix_uri,$termset_name,'&amp;maxdepth=8&amp;repository=',$repository_uri)" />
    50                         <xsl:message>processing model-term($resolved_termset_uri): <xsl:value-of select="$resolved_termset_uri" /> </xsl:message>
    51                         <xsl:variable name="termset" select="document($resolved_termset_uri)" />
     48                        <xsl:variable name="termset_name" select="@name" />                                             
     49                       
     50                        <xsl:variable name="termset" >
     51                                <xsl:choose>
     52                                        <!-- if existing children, process directly those (enrich them in a separate matrix-run  -->
     53                                        <xsl:when test="Term">
     54                                                <xsl:variable name="terms" >                                                   
     55                                                        <Terms>
     56                                                                <xsl:copy-of select="." />
     57                                                        </Terms>       
     58                                                </xsl:variable>                                         
     59                                               
     60                                                <xsl:apply-templates select="$terms" mode="matrix" />                                           
     61                                        </xsl:when>
     62                                        <!--  else get the full summary for given termset -->
     63                                        <xsl:otherwise>
     64                                        <xsl:variable name="resolved_termset_uri" select="concat($model_matrix_uri,$termset_name,'&amp;maxdepth=8&amp;repository=',$repository_uri)" />
     65                                                <xsl:message>processing model-term($resolved_termset_uri): <xsl:value-of select="$resolved_termset_uri" /> </xsl:message>                       
     66                                                <xsl:copy-of select="document($resolved_termset_uri)" />
     67                                        </xsl:otherwise>
     68                                </xsl:choose>
     69                        </xsl:variable>
     70                       
     71                        <xsl:message><xsl:copy-of select="$termset" ></xsl:copy-of></xsl:message>
    5272
    5373                        <xsl:variable name="termset_matrix" >
     
    81101                                <xsl:apply-templates mode="matrix"  >
    82102                                        <xsl:with-param name="profile" select="$profile"></xsl:with-param>
    83                                 </xsl:apply-templates>
     103                                </xsl:apply-templates>                         
    84104                        </Terms>
    85105                </xsl:variable>
     
    266286                </xsl:apply-templates>
    267287                       
    268                
     288                <xsl:copy-of select="v"  />
    269289        </xsl:copy>                                                     
    270290       
     
    395415                                        <xsl:with-param name="profile" select="$profile" />
    396416                                </xsl:apply-templates>
     417                               
    397418                        </Term>
    398419                       
  • MDService2/trunk/MDService2/src/xsl/terms2view.xsl

    r923 r1029  
    11<?xml version="1.0" encoding="utf-8"?>
    2 <xsl:stylesheet
    3   version="2.0"
     2<xsl:stylesheet  version="2.0"
    43  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    5   xmlns:xs="http://www.w3.org/2001/XMLSchema"
    6     xmlns:my="myFunctions"
     4  xmlns:xs="http://www.w3.org/2001/XMLSchema"    xmlns:my="myFunctions"
    75>
    86<!--
     
    1917<xsl:output method="xml" /> 
    2018
    21 
    2219<!-- <xsl:param name="size_lowerbound">0</xsl:param>
    2320<xsl:param name="max_depth">0</xsl:param>
    2421<xsl:param name="freq_limit">20</xsl:param>
    25 <xsl:param name="show">file</xsl:param> -->
     22<xsl:param name="show">file</xsl:param>
     23<xsl:param name="detail_uri_prefix"  select="'?q='"/>
     24<xsl:param name="mode" select="'htmldiv'" /> -->
     25
    2626<xsl:param name="sort">x</xsl:param> <!-- s=size|n=name|t=time|x=default -->
    2727<xsl:param name="name_col_width" >50%</xsl:param>
    28 
    29 <!-- <xsl:param name="mode" select="'htmldiv'" /> -->
    3028<xsl:param name="title" select="'Terms'" />
    31 
    32 <!--
    33 <xsl:param name="detail_uri_prefix"  select="'?q='"/>
    34 -->
    35  
    36 
    3729
    3830<xsl:decimal-format name="european" decimal-separator=',' grouping-separator='.' />
     
    9082        <table>
    9183                <caption>Terms Usage</caption>
    92                 <thead><tr><th>name/path</th><th>count elems</th><th>count text</th><th>count distinct text</th></tr></thead>
     84                <thead><tr><th>name/path</th><th>count elems</th><th>count text</th><th>count distinct text</th>
     85                <th>context</th><th>corresp comp</th><th>datcat</th></tr></thead>
    9386                <tbody>         
    9487                        <xsl:apply-templates select="*" mode="table" />                 
     
    10497                                                <td align="right"><xsl:value-of select="@count_text"/></td>                                             
    10598                                                <td align="right"><xsl:value-of select="@count_distinct_text"/></td>                                           
     99                                                <td><xsl:value-of select="@context"/></td>
     100                                                <td><xsl:value-of select="@corresponding_component"/></td>
     101                                                <td><xsl:value-of select="@datcat"/></td>
     102                                               
    106103                                </tr>                                                   
    107104                                <xsl:apply-templates select="*" mode="table" />                 
     
    120117
    121118<xsl:template match="Term" mode="list" >
     119<xsl:param name="options" select="''" />
    122120                <!--  <xsl:variable name="translated_path" select="translate(replace(@path,'//',''),'/','.')" /> -->
    123121                <!--  filter out empty datcats  -->
    124                 <xsl:if test="@elem or descendant::*[@elem]" >
     122                <xsl:if test="@elem or descendant::*[@elem] or $options='all'" >
    125123                                <li><div class="cmds-elem-plus"><span class="detail-caller"><!-- <a href="{concat($detail_model_prefix,@context)}" >  -->
    126124                                        <xsl:value-of select="@path"/></span>
     
    139137                                                </div> -->
    140138                                        </div>
    141                                         <ul><xsl:apply-templates select="Term" mode="list" /></ul>                             
     139                                        <ul><xsl:apply-templates select="Term" mode="list" >
     140                                                        <xsl:with-param name="options" select="$options"></xsl:with-param>
     141                                                </xsl:apply-templates>
     142                                        </ul>                           
    142143                                </li>   
    143144                </xsl:if>               
     
    336337        </xsl:template>
    337338
    338 
    339 
    340 
    341 
    342339<xsl:template name="callback-header" >
    343340        <style type="text/css">
     
    357354</xsl:template>
    358355
    359 
    360 
    361356</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.