Changeset 1081


Ignore:
Timestamp:
01/19/11 14:18:18 (13 years ago)
Author:
vronk
Message:
 
Location:
MDService2/trunk/MDService2
Files:
1 added
17 edited

Legend:

Unmodified
Added
Removed
  • MDService2/trunk/MDService2/WebContent/WEB-INF/web.xml

    r766 r1081  
    4444      <web-resource-name>MDService Workspace</web-resource-name>
    4545      <description></description>
    46       <url-pattern>/workspace.jsp</url-pattern>
     46      <url-pattern>/workspace.jsp</url-pattern>     
    4747    </web-resource-collection>
    4848    <auth-constraint>
  • MDService2/trunk/MDService2/WebContent/index.jsp

    r1076 r1081  
    3636                                        <% if ( request.getRemoteUser() == null) {  %>
    3737                                        <a href="workspace.jsp" >    login</a>
    38                                         <a href="docs/htmlpage/info" > docs</a>
     38                                        <a class="open-in-context" target="_blank" href="docs/htmlpage/info" > docs</a>
    3939                                       
    4040                                        <% } else {  %>
     
    148148                                                </div>
    149149                                <input type="checkbox" checked="false" id="input-withsummary" name="WS"/><label>with Summary</label>
     150                                &nbsp;&nbsp;&nbsp;<a class="open-in-context" target="_blank" href="docs/htmlpage/queries" > example queries</a>
    150151                                        </td>     
    151152                                </tr></table>           
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js

    r1071 r1081  
    160160                var blankdata = "<html><\html>";
    161161               
    162                 if (xmlhttpreq.responseXML != null){
    163                         var isinfo = xmlhttpreq.responseXML.baseURI.split("/static/info.xml?id=");
    164                         if (isinfo != "undefined"){
    165                                 if ( isinfo.length = 2){
    166                                         var infoid = new RegExp('[\\?]id=([^&#]*)').exec(xmlhttpreq.responseXML.baseURI);
    167                                         infoid = infoid[1] || 0;
    168                                         infoid = infoid + "-info";
    169                                         data = $(_data).find('#' + infoid);
    170                                 }
    171                         }               
     162                if(typeof xmlhttpreq!='undefined')
     163                {
     164                        if (xmlhttpreq.responseXML != null){
     165                                var isinfo = xmlhttpreq.responseXML.baseURI.split("/static/info.xml?id=");
     166                                if (isinfo != "undefined"){
     167                                        if ( isinfo.length = 2){
     168                                                var infoid = new RegExp('[\\?]id=([^&#]*)').exec(xmlhttpreq.responseXML.baseURI);
     169                                                infoid = infoid[1] || 0;
     170                                                infoid = infoid + "-info";
     171                                                data = $(_data).find('#' + infoid);
     172                                        }
     173                                }               
     174                        }
    172175                }
    173176               
     
    197200                {
    198201                        $('#detail-float').html(data);
    199                         var title =  $('#detail-float').find('.inner_title').attr("value");
     202                        var title =  $('#detail-float').find('.inner_title').attr('value');
     203                        if (title=='') title = $('#detail-float').find('.title, .inner_title').first().text();
    200204                        $('#detail-float').dialog( "option", "title", title );
    201205                       
     
    649653                                        $(".treeview","#collections").find(".showselection").css("color","white");
    650654       
     655                                        // activate detail_call
     656                                        $(".treeview","#collections").find(".cmd_detail").click(function(event) {
     657                                                        var uri = $(this).parent().find('.folder a').attr('href');
     658                                                        $.get(uri, showDetail,'html');
     659                                                        return false;   
     660                                        });                                     
     661                                        $(".treeview","#collections").find("a").click(function(event) {
     662                                                        event.preventDefault();
     663                                                var uri = $(this).attr('href');
     664                                                $.get(uri, showDetail,'html');
     665                                                return false;
     666                                        });
     667                                       
    651668                                        // handle treeview click
    652669                                        $(".treeview","#collections").find(".selection").click(function() {
     
    11531170        });
    11541171       
     1172         $('a.open-in-context').live('click', function(event) {
     1173                        event.preventDefault();
     1174                        var uri = $(this).attr('href');
     1175                        /* notifyUser("open_incontext:" + uri);
     1176                        $(this).after("<div class='ui-context-dialog cmds-ui-block' ></div>");
     1177                        var trg = $(this).next(".ui-context-dialog");
     1178                        trg.show();                                             
     1179                        $(trg).load(uri); //function(event) {   } */
     1180                        var contextual_uri = uri.replace('htmlpage','htmldetail');             
     1181                       
     1182                        $.get(contextual_uri, showDetail,'html');
     1183        });
     1184       
    11551185// RECORDSET searchRetrieve
    11561186        $('#searchretrieve').submit( function(event) {
     
    14721502function loadQuery(q){
    14731503        if (q["bookmark"] == "1") {
    1474                 var uri = "http://localhost:8080/MDService2/record/htmldetail/" + q["querystring"];
     1504                var uri = "/MDService2/record/htmldetail/" + q["querystring"];
    14751505                showDetail(null,'html');
    14761506                $.get(uri, showDetail,'html');
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_helpers.js

    r1077 r1081  
    1313        }).next().hide();
    1414        */
    15         $(elems).children('.header').append('<span class="cmd cmd-collapse cmd_down" > </span>');
     15       
     16        $(elems).children('.header').prepend('<span class="cmd cmd-collapse cmd_down" > </span>');
    1617        $(elems).find('.cmd-collapse').click(function(event) {
    1718                        $(this).closest('.header').next().toggle('fast');
     
    2122       
    2223        $(elems).each(function(i) {
     24                // default is: hidden
    2325                if ($(this).hasClass('init-show'))  {           
    2426                        $(this).children('.content').show();
    2527                        $(this).find('.cmd-collapse').toggleClass('cmd_down cmd_up');           
    26                 }
     28                } else {
     29                        $(this).children('.content').hide();                   
     30                }               
     31                       
    2732                if ($(this).parent().hasClass('cmds-ui-closable'))  {           
    28                         $(this).children('.header').append('<span class="cmd cmd_close" > </span>');
     33                        $(this).children('.header').prepend('<span class="cmd cmd_close" > </span>');
    2934                        $(this).find('.cmd_close').click(function(event) {
    3035                                        $(this).closest('.header').parent().parent('.cmds-ui-closable').remove();       
     
    5055        }
    5156
    52         var paging = '<span class="label" >from:</span><span><input type="text" class="value start-item paging-input">' +
     57        var paging = '<div class="cmds-navi-header ui-widget"><span class="label" >from:</span><span><input type="text" class="value start-item paging-input">' +
    5358        '</input></span>' +
    5459        '<span class="label" >max:</span><span><input type="text" class="value maximum-items paging-input" ></input></span>' +
     
    6772        //      '</xsl:when>' +
    6873        //      '</xsl:choose>' +
    69         '</span>';
     74        '</span></div';
    7075       
    7176        $(header).append(paging);
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js

    r1076 r1081  
    454454                                                var qid = $(this).closest('.query_wrapper').attr("id");
    455455                                                var q = queryset.getQuery(qid);
    456                                                 q.format = $(this).find('option:selected').text().trim();
     456                                                q.format = $(this).find('option:selected').val();
    457457                                                queryset.resubmit(qid);
    458458                                               
  • MDService2/trunk/MDService2/WebContent/static/info.xml

    r1076 r1081  
    11<info xml:lang="en" >
    2         <div id="title">Information</div>
     2        <div class="title">Information</div>
    33        <div id="welcome">
    44       
     
    66        <p>Metadata Service is the user-interface for exploring the CMDRepository. Yes, you can:
    77         <ul>
    8                 <li>simply search</li>
     8                <li>try one of the <a href="/MDService2/docs/htmlpage/queries" >sample queries</a></li>
     9                <li>simply search (simple terms, combined terms, phrases)</li>         
     10                <li>perform complex boolean-searches (according to the SRU/CQL standard)</li>           
    911                <li>browse the collections</li>
    10                 <li>try one of the sample queries</li>
    11                 <li>perform complex boolean-searches</li>
     12                <li>browse the (aggregated) xml-structure of the MD records</li>
    1213                <li>search by profiles</li>
    13                 <li>search by data categories</li>
    14                 <li>perform semantic search (elements of individual CMD-profiles are related via ConceptLinks to Datacategories,
    15                         which are in turn related in the <strong>Relation registry</strong></li>
     14                <li>search by data categories</li>             
     15                <li>perform semantic search (elements of individual CMD-profiles are related via ConceptLinks to Data Categories,
     16                        which are in turn related in the <strong>Relation Registry</strong>)</li>
    1617                <li>view individual metadata records </li>
    1718                <li>page through the results</li>
     
    5051        <div id="terms-info">
    5152                <span class="title">Terms</span>
    52                 <p>Terms combines information from MDRepository, ComponentRegistry, Datacategory Registries (isocat, dublincore) and Relationregistry to allow to search by profiles or data categories, or even perform semantic search</p>
    53                 <p>You can search in the fields of individual profiles instantiated as the MDrecords in the repository, or search over multiple profiles via datacategories.</p>
     53                <p>Terms combine information from MDRepository, <em>Component Registry</em>, Data Category Registries (<a target="_blank" href="http://www.isocat.org">isocat</a>, <a target="_blank" href="http://dublincore.org/">dublincore</a>)
     54                        and Relation Registry to allow to search by profiles or data categories, or even perform semantic search</p>
     55                <p>Thus you can search in the fields of individual profiles instantiated as the MDrecords in the repository, or search over multiple profiles via datacategories.</p>
    5456        </div> 
    5557        <div id="compreg-info">
    5658                <span class="title" >Component Registry</span>
    57                 <p>Overview of all profiles and components defined in the Component Registry</p>
     59                <p>Overview of all profiles and components defined in the Component Registry. (Proxy to Component Registry)</p>
    5860        </div>
    5961        <div id="query-input-info">
    6062                <span class="title" >Query Input</span>
    61                 <p>Form for entering the query. Either a simple or complex query</p>
    62                 <p>Both parts can be used in parallel: i.e. you can specify some terms for full-text search
    63                 and further refine them with.
    64                 The two parts are combined with boolean AND (the matching records have to satisfy both parts of the query.)
    65                 See <a href="queries" >example queries</a> for an overview of possible query types.
     63                <p>Form for entering the query. Either a simple or complex query.
     64                See <a href="queries" >example queries</a> for an overview of possible query types.</p>
     65                <dt id="input-simplequery-info">simple full-text search</dt>
     66                        <dd><p>individual terms, multiple terms, phrases</p>
     67                        </dd>
     68                <dt id="searchclauselist-info">complex queries</dt>
     69                <dd><p>complex queries according to SRU/CQL-standard</p>
     70                        <p>Basic <em>search clause</em> consists of: <code>index relation term</code>, e.g. <code>dc.title any system</code>.
     71                        You can combine these search clauses with boolean operators (AND, OR), to more complex queries. </p>
     72                </dd>
     73                <p>Both parts can be used in parallel - i.e. you can specify some terms for full-text search
     74                and further refine them with filters on specific indices -
     75                the two parts being combined with boolean AND (the matching records have to satisfy both parts of the query.).
     76                So the general syntax of the queries feasible within the query input is:
     77                <p><code>simple-query AND (XQ1 or XQ2) AND (XQ3 or XQ4 or ...) AND ...<br/></code>
     78                        <code>XQ</code> consisting of <code>index relation term</code> 
     79                </p>           
    6680                </p>
    67                 <div id="input-simplequery-info">
    68                         <p>simple full-text search: individual terms, multiple terms, phrases</p>
    69                 </div>
    70                 <div d="searchclauselist-info">
    71                         <p>complex queries according to SRU/CQL-standard</p>
    72                         <p>Basic <em>search clause</em> consists of: <code>index relation term</code>, e.g. <code>dc.title any system</code>.
    73                         You can combine this search clauses with boolean operators (AND, OR), to more complex queries</p>
    74                 </div>
     81                <dt id="repositories_select-info">Repository</dt>
     82                <dd><p>You can select target repository(-mirror).</p>
     83                        <p>The <em>Collections</em> and <em>Terms</em> are updated accordingly (but this can take a few seconds)</p>
     84                </dd>
     85                <dt id="input-withsummary-info" >with Summary</dt>
     86                <dd>This option provides a summary of the profiles used in the (whole) result and of the (XML-structure of the) displayed part of the result, but it obviously makes you wait a bit longer (generally 20-50% longer)</dd>
    7587        </div> 
    7688        <div id="querylist-info">
     
    8496        <dt id="cmd_add_or">Add a alternative condition (OR)</dt>
    8597        <dt id="cmd_columns">Manage columns/fields</dt>
     98        <dd>Allows to de/select the columns and change the list-format (list or table).
     99        It requires the option <em>withSummary</em> to be activated, to provide the list of elements/indices that can be added as columns/fields.</dd>
    86100        <dt id="userqueries.cmd_del" idref="#userqueries .cmd_del" >Delete!</dt>
    87101        <dd>Delete the stored query!</dd>
     
    96110        <dt id="cmd_reload">Reload</dt>
    97111        <dt id="cmd_resubmit">Reload</dt>
    98         <dt id="cmd_save">Store query/bookmark</dt>
    99         <dt id="cmd_sc_delete">Remove search clause</dt>
     112        <dt id="cmd_save">Store query/bookmark</dt>
     113        <dd>The query/bookmark will be added to the current Queryset in the <em>Personal Workspace</em>.</dd>
     114        <dt id="cmd_sc_delete">Remove search clause</dt>
     115        <dd>if only one search clause - clear it</dd>
    100116        <dt id="cmd_up">Collapse view</dt>       
    101117        <dt id="cmd_prev" >Page back</dt>
  • MDService2/trunk/MDService2/WebContent/static/queries.xml

    r1076 r1081  
    11<info xml:lang="en" >
    22        <div>
    3                 <div id="title">Example metadata queries</div> 
     3                <div class="title">Example metadata queries</div>       
    44        <dt >simple term</dt>
    55        <dd><p>just one word like:</p>
    66                <ul>           
    7                         <li><a href="?squery=system">system</a></li>
    8                         <li><a href="">-year-olds</a></li>
     7                        <li><a href="/MDService2/?squery=system">system</a></li>
     8                        <li><a href="">-year-olds</a> - a bug there (don't use '-'!)</li>
    99                        <li><a href="/MDService2/?squery=acquisition">acquisition</a></li>                     
    1010                </ul>
    1111        </dd>
    12         <dt>multiple terms - any (OR)</dt>
     12        <dt>any of multiple terms (OR)</dt>
    1313        <dd>
    1414                <ul>
    15                         <li><a href="/MDService2/?squery=children acquisition">system</a></li>
     15                        <li><a href="/MDService2/?squery=/?squery=child%20%7C%20acquisition">child | acquisition</a></li>
    1616                </ul>
    1717        </dd>
    18         <dt >multiple terms - all (AND)</dt>
     18        <dt >all of multiple terms (AND)</dt>
    1919        <dd>
    2020                <ul>
    2121                        <li><a href="">child acquisition</a></li>
    22                         <li><a href="">child &amp; acquisition</a></li>
    23                         <li><a href="">child AND acquisition</a></li>
     22                                <li><a href="/MDService2/?squery=child%20acquisition">child acquisition</a></li>
     23                                <li><a href="/MDService2/?squery=longitudinal%20study">longitudinal study</a></li>
     24                       
    2425                </ul>
    2526        </dd>
     
    2728        <dd>a sequence of terms
    2829                <ul>
    29                         <li><a href="">system</a></li>
     30                        <li><a href="/MDService2/?squery=%2522longitudinal%2520study%2522">"longitudinal study"</a></li>
    3031                </ul>
    3132        </dd>
    3233        <dt >Bookmarks</dt>     
    3334        <dd>search/remember individual records (by handle/identifier)
    34                 <ul>
    35                         <li><a href="/MDService2/record/htmlpage/oai:blc%2Eberkeley%2Eedu:la%2E131">oai:blc.berkeley.edu:la.131</a></li>
     35                <ul>                   
    3636                        <li><a href="/MDService2/record/htmlpage/clarin-at:aac-test-corpus:C4:158">clarin-at:aac-test-corpus:C4:158</a></li>
    3737                        <li><a href="/MDService2/record/htmlpage/clarin%252Eeu%3Alrt%3A1001">GENOMA</a></li>
     
    4848                <code>phrase in index </code>
    4949                <ul>
    50                         <li><a href="/MDService2/?q=Description contains 'spoken language'">Description contains 'spoken language'</a></li>
     50                        <li><a href='/MDService2/?q=Description contains "spoken language"'>Description contains "spoken language"</a></li>
     51                </ul>
     52        </dd>   
     53        <dt >CQL - boolean</dt>
     54        <dd>combine search clauses with boolean operators: AND, OR, (AND NOT)
     55                <ul>
     56                        <li><a href="/MDService2/?q=(title contains a)  and ( tei%3Aimprint.date &gt; 1910) and (tei%3Aimprint.date &lt; 1920)">title contains a and imprint.date between 1910 and 1920</a></li>
     57                <li><a href="/MDService2/?q=( title any system ) and  ( description contains ethnologue )" > ( title any system ) and  ( description contains ethnologue )</a></li>
     58                <li><a href="/MDService2/?q=%20%28%20%20%28%20title%20any%20language%20%29%20%20%29%20%20and%20%20%28%20%20%28%20identifier%20contains%20rosettaproject%20%29%20%20or%20%20%28%20publisher%20contains%20%22SIL%20International%22%20%29%20%20%29%20" >title any language and (identifier contains rosettaproject or publisher contains "SIL International")</a></li>
     59                                       
     60                </ul>                   
     61        </dd>
     62        <dt >Combine simple query and search clauses</dt>
     63        <dd>
     64                <ul>
     65                <li><a href="/MDService2/?q=( title any system )&amp;squery=university">university and (title any system)</a></li>
    5166                </ul>
    5267        </dd>
    5368       
    54         <dt >CQL - boolean</dt>
    55         <dd>combine search clauses with boolean operators: AND, OR, (AND NOT)
     69                <dt >Restriction by Collections</dt>
     70        <dd> Either all resources of a given collection, or restrict the search to selected collection(s) (not working at the moment)
    5671                <ul>
    57                         <li><a href="/MDService2/?q=(title contains a)  and ( tei%3Aimprint.date &gt; 1910) and (tei%3Aimprint.date &lt; 1920)">title contains a and imprint.date between 1910 and 1920</a></li>                         
    58                 </ul>                   
     72                <li><a href="/MDService2/?q=&amp;squery=&amp;collection=clarin-at:aac-test-corpus">aac-test-corpus</a></li>
     73                </ul>
    5974        </dd>
    60                
     75                <dt >Search in a profile</dt>
     76        <dd>show all records of given profile, or
     77                <ul>   
     78                <li><a href="/MDService2/?q= ( LrtInventoryResource contains * )">LrtInventoryResource</a></li>
     79                <li><a href="/MDService2/?q= ( LrtInventoryResource contains system )">LrtInventoryResource contains system</a></li>
     80                </ul>
     81        </dd>
     82                <dt >Search via Data categories (Semantic search)</dt>
     83        <dd>search over elements linked to the same Data cagetory, irrespectively of the containing profile 
     84                <ul>   
     85                <li><a href="MDService2/?q=%20%28%20%20%28%20relcat%3Adescription%20contains%20*%20%29%20%20%29%20">relcat:description</a></li>
     86                <li><a href="/MDService2/?q=%20%28%20%20%28%20isocat%3Acreation_date%20contains%20191%20%29%20%20%29%20">isocat:creationDate contains 191</a></li>
     87                </ul>
     88        </dd>
    6189        </div>
    6290</info>
  • MDService2/trunk/MDService2/WebContent/style/cmds-ui.css

    r1076 r1081  
    7070.cmds-ui-block { margin: 2px; text-align: left;}
    7171
     72.cmds-elem-plus .detail,
    7273.ui-context-dialog { display:none; position:absolute; border 1px solid #A6C9E2; background-color: #fafaff; z-index:1; }
    7374
    74 .cmds-elem-plus .detail { display: none; border: 1px solid #A6C9E2;}
     75/* .cmds-elem-plus .detail { display: none; border: 1px solid #A6C9E2;} */
    7576
    7677.cmds-elem-prop {}
     
    8889.cmds-xmlelem .attributes .label {}
    8990.cmds-xmlelem .attributes .value {}
     91
    9092
    9193
     
    114116.value_input { width:32%; }
    115117.sc_cmds { }
     118
     119.result-header { float: right; }
     120.cmds-navi-header { float:right;}
     121/* hack, for weird behaviour, the (appearingly) same rules for result-header.paging-input and cmds-navi-header.paging-input
     122different render (cmds-navi-header.paging-input too small) */
     123.cmds-navi-header .paging-input { height: 1.2em;}
     124
    116125.paging-input { width: 3em; text-align: right; height: 1em;}
    117126
    118 .result-header { float: right; }
    119127.query {margin-right: 4px;}
    120128 
  • MDService2/trunk/MDService2/src/mdservice.properties

    r1076 r1081  
    7171xsl.admin2htmlpage = cache2view.xsl
    7272xsl.docs2htmlpage = docs2view.xsl
     73xsl.docs2htmldetail = docs2view.xsl
  • MDService2/trunk/MDService2/src/terms_setup.xml

    r1076 r1081  
    66        <Termset type="model" id="tcp" name="TextCorpusProfile" url="" format="terms|cmdrepo" />
    77        <Termset type="model" id="tei" name="teiHeader" url="" format="terms" />
    8 
     8       
    99        <Termset type="dcr" id="isocat" name="isoCAT" url="http://www.isocat.org/rest/profile/5" url_prefix="http://www.isocat.org/datcat/" format="dcif" />
    10         <Termset type="dcr" id="dce" name="dublincore elements" url="http://purl.org/dc/elements/1.1/" format="rdf" />
    11         <Termset type="dcr" id="dct" name="dublincore terms" url="http://purl.org/dc/terms/" format="rdf" />   
    12         <Termset type="rr" id="relcat" name="Relation Registry CMDI-set" url="http://lux13.mpi.nl/relcat/rest/set/cmdi" format="rdf" />
    13         <Termset type="rr" id="hdcrel" name="Relation Registry DC-set" url="http://lux13.mpi.nl/relcat/rest/set/dc" format="rdf" />
    14        
     10        <Termset type="dcr" id="dce" name="dublincore elements" url="http://purl.org/dc/elements/1.1/" url_prefix="http://purl.org/dc/elements/1.1/"  format="rdf" />
     11        <Termset type="dcr" id="dct" name="dublincore terms" url="http://purl.org/dc/terms/" url_prefix="http://purl.org/dc/terms/"  format="rdf" />   
     12        <Termset type="rr" id="relcat" name="Relation Registry CMDI-set" url="http://lux13.mpi.nl/relcat/rest/set/cmdi" url_prefix="http://lux13.mpi.nl/relcat/rest/set/cmdi" format="rdf" />
     13        <Termset type="rr" id="reldc" name="Relation Registry DC-set" url="http://lux13.mpi.nl/relcat/rest/set/dc" url_prefix="http://lux13.mpi.nl/relcat/rest/set/dc" format="rdf" /> 
    1514</Termsets>
  • MDService2/trunk/MDService2/src/xsl/XCQL2Xpath.xsl

    r1076 r1081  
    211211                        </xsl:when>
    212212                        <xsl:when test="value='='" >
    213                                 <xsl:text>. eq </xsl:text> <xsl:text>'</xsl:text><xsl:value-of select="$sanitized_term"/><xsl:text>'</xsl:text>                         
     213                                <xsl:text>.%20eq%20</xsl:text> <xsl:text>'</xsl:text><xsl:value-of select="$sanitized_term"/><xsl:text>'</xsl:text>                             
    214214                        </xsl:when>
    215215                        <xsl:otherwise>         
  • MDService2/trunk/MDService2/src/xsl/cmd_functions.xsl

    r1076 r1081  
    9191    <xsl:param name="resolve" /> <!--  true|false-->
    9292   
    93     <xsl:message>cmdprofiles_uri: <xsl:value-of select="$cmdprofiles_uri" /></xsl:message>
     93    <!-- <xsl:message>cmdprofiles_uri: <xsl:value-of select="$cmdprofiles_uri" /></xsl:message>  -->
    9494   
    9595    <xsl:variable name="profile" select="doc($cmdprofiles_uri)//profileDescription[name=$term]" />
     
    154154                <xsl:param name="url" />
    155155                <!--   <xsl:value-of select="replace($url, 'http://www.isocat.org/datcat/','isocat:')" /> -->
    156                 <xsl:variable name="matching_termset"  select="if($url!='') then $terms_setup/Termsets/Termset[@url_prefix][starts-with($url,@url_prefix)] else ()" />
    157                  <xsl:message>shortURL: <xsl:copy-of select="$matching_termset" />:: <xsl:value-of select="$matching_termset[1]/@url_prefix" />
    158                                 <xsl:value-of select="$url" />
    159                 </xsl:message>                 
     156                 <xsl:variable name="matching_termset"  select="if($url!='') then $terms_setup/Termsets/Termset[@url_prefix][starts-with($url,@url_prefix)] else ()" />
     157                 <!-- <xsl:variable name="matchinge_termset"  select="if($url!='') then if ($terms_setup/Termsets/Termset[@url_prefix][starts-with($url,@url_prefix)]) then $terms_setup/Termsets/Termset[@url_prefix][starts-with($url,@url_prefix)][1]
     158                                                else if $terms_setup/Termsets/Termset[@url][starts-with($url,@url)] then $terms_setup/Termsets/Termset[@url][starts-with($url,@url)][1] else ()" /> --> 
     159                 <!--<xsl:message>shortURL: <xsl:value-of select="$matching_termset/@url_prefix" />:: <xsl:value-of select="$url" />
     160                </xsl:message> -->             
    160161                <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" />             
    161162        </xsl:function>
     
    209210        </xsl:function>
    210211   
    211 <!--
     212<!-- 
    212213<xsl:function name="my:numberFormat">
    213214<xsl:param name="unit" />
     
    280281
    281282        <xsl:variable name="ix_resolved" >
    282                 <xsl:choose>
    283                                 <xsl:when test="contains($p_xpath,'//')">
    284                                         <xsl:variable name="prefix" select="substring-before($p_xpath,'//')" />                         
     283                <!-- get rid off leading slashes -->
     284                <xsl:variable name="stripped" select="if (starts-with($p_xpath,'//')) then substring-after($p_xpath, '//') else $p_xpath"  />
     285                <xsl:choose>
     286                                <xsl:when test="contains($stripped,'//')">
     287                                        <xsl:variable name="prefix" select="substring-before($stripped,'//')" />                               
    285288                                        <xsl:variable name="termset" select="$terms_setup/Termsets/Termset[@name=$prefix]" />                           
    286289                                       
     
    293296                                                <xsl:when test="not($termset/@id)">
    294297                                                        <!-- when no matching termset, simply  use the original prefix  -->
    295                                                         <xsl:value-of select="concat($prefix,':',substring-after($p_xpath,'//'))" />
     298                                                        <xsl:value-of select="concat($prefix,':',substring-after($stripped,'//'))" />
    296299                                                </xsl:when>
    297300                                                <xsl:otherwise>
    298                                                         <xsl:value-of select="concat($termset/@id,':',substring-after($p_xpath,'//'))" />       
     301                                                        <xsl:value-of select="concat($termset/@id,':',substring-after($stripped,'//'))" />     
    299302                                                </xsl:otherwise>
    300303                                        </xsl:choose>                                   
    301304                                </xsl:when>
    302                                 <xsl:otherwise><xsl:value-of select="$p_xpath" />
     305                                <xsl:otherwise><xsl:value-of select="$stripped" />
    303306                                </xsl:otherwise>
    304307                        </xsl:choose>
  • MDService2/trunk/MDService2/src/xsl/collection2view.xsl

    r748 r1081  
    22<xsl:stylesheet
    33  version="1.0"
    4   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     4  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:my="myFunctions">
    55<!--
    66<purpose> convert fsls to html-list-snippet</purpose>
     
    8989        <xsl:value-of select="@handle"/>
    9090                </xsl:attribute>
    91                 <xsl:value-of select="@n" /></span>
    92      <span class="note"> |<xsl:value-of select="@cnt" />|</span>
     91                <a href="{my:formURL('record','htmldetail', @handle )}" ><xsl:value-of select="@n" /></a></span>               
     92     <span class="note"> |<xsl:value-of select="@cnt" />|</span><span class="cmd cmd_detail"> </span>
    9393        <!--
    9494        <span class="folder"><xsl:value-of select="@n" />(<xsl:value-of select="@cnt" />)
  • MDService2/trunk/MDService2/src/xsl/mdset2view.xsl

    r1071 r1081  
    247247
    248248<xsl:template match="CMD" mode="table">
     249        <xsl:variable name="absolute_position" select="if (number($startItem)=number($startItem)) then number($startItem) + position() - 1 else  position()" />
    249250                <tr>
    250251                <td>
     
    252253                                <xsl:when test="exists(.//MdSelfLink)" >
    253254                                <a class="internal" href="{concat('record/htmldetail/', my:encodePID(.//MdSelfLink), '?repository=', $repository_id)}" >
    254                                                 <xsl:value-of select="position()" />
     255                                                <xsl:value-of select="$absolute_position" />
    255256                                </a>
    256257                                <span class="cmd cmd_detail" ></span>                           
    257258                                <span class="cmd cmd_save" ></span>                                             
    258259                                </xsl:when>
    259                                 <xsl:otherwise><xsl:value-of select="position()" /></xsl:otherwise>
     260                                <xsl:otherwise><xsl:value-of select="$absolute_position" /></xsl:otherwise>
    260261                        </xsl:choose>
    261262                </td>
     
    309310
    310311<xsl:template match="CMD" mode="list">
     312        <xsl:variable name="absolute_position" select="if (number($startItem)=number($startItem)) then number($startItem) + position() - 1 else  position()" />
    311313                <tr>
    312314                <td>
     
    314316                                <xsl:when test="exists(.//MdSelfLink)" >
    315317                                <a class="internal" href="{concat('record/htmldetail/', my:encodePID(.//MdSelfLink))}" >
    316                                                 <xsl:value-of select="position()" />
     318                                                <xsl:value-of select="$absolute_position" />
    317319                                </a>
    318320                                <span class="cmd cmd_detail" ></span>                           
    319321                                <span class="cmd cmd_save" ></span>                                             
    320322                                </xsl:when>
    321                                 <xsl:otherwise><xsl:value-of select="position()" /></xsl:otherwise>
     323                                <xsl:otherwise><xsl:value-of select="$absolute_position" /></xsl:otherwise>
    322324                        </xsl:choose>
    323325                </td>
  • MDService2/trunk/MDService2/src/xsl/model2matrix.xsl

    r1071 r1081  
    201201        <xsl:param name="datcat_termsets" />
    202202        <xsl:copy>
    203                 <xsl:variable name="matching_datcat_terms" select="$datcat_termsets//Term[@datcat=current()/@datcat]" />
     203                <xsl:variable name="matching_datcat_terms" select="$datcat_termsets//Term[@type='datcat'][@datcat=current()/@datcat]" />
    204204                <!-- <xsl:variable name="matching_datcat_relterms" select="$datcat_termsets//Term[@datcat=current()/@datcat]" /> -->
    205205                <xsl:variable name="name" select="($matching_datcat_terms//@name)[1]"></xsl:variable>
     
    208208                <xsl:copy-of select="@*"></xsl:copy-of>         
    209209                <xsl:copy-of select="$matching_datcat_terms" />
    210                 <xsl:apply-templates select="Term" mode="resolve-relcat">
     210                <xsl:apply-templates select="Term[@type='rel']" mode="resolve-relcat">
    211211                        <xsl:with-param name="datcat_termsets" select="$datcat_termsets"/>
    212212                </xsl:apply-templates>         
     
    406406                                        </xsl:variable>
    407407                       
    408                         <xsl:variable name="corresp_cmdterm" select="$profile//*[@context=$context]" />                                 
     408                        <xsl:variable name="corresp_cmdterm" select="if (parent::Terms) then $profile else $profile//*[@context=$context]" />                                   
    409409                        <!--
    410410                        <xsl:message>context: <xsl:copy-of select="$context" /> </xsl:message> 
  • MDService2/trunk/MDService2/src/xsl/params.xsl

    r1071 r1081  
    3434        <xsl:param name="components_uri" select="'http://localhost:8080/MDService2/comp/xml/'" />               
    3535        <xsl:param name="components_id_prefix" select="'clarin.eu:cr1:'" />
    36 
    37 
     36        <xsl:param name="components_viewer_uri" select="'http://catalog.clarin.eu/ds/ComponentRegistry/?item='" />
    3837       
    3938        <xsl:param name="autocolumns_limit" select="6" />
  • MDService2/trunk/MDService2/src/xsl/terms2view.xsl

    r1076 r1081  
    4141                        <xsl:call-template name="header"/>
    4242                            <div id="terms-matrix">
    43                                 <xsl:apply-templates mode="terms-tree" />                               
     43                                <xsl:apply-templates mode="terms-tree" >
     44                                        <xsl:sort select="if (@type='model') then 1 else if (@type='dcr') then 2  else 3" data-type="number"  />
     45                                </xsl:apply-templates>                         
    4446                                </div>                                                                                         
    4547                        </xsl:when>                             
    4648                <xsl:when test="$format='terms2htmllist'" >                     
    47                         <xsl:apply-templates select=".//Termset" mode="list"/>   
     49                        <xsl:apply-templates select=".//Termset" mode="list">
     50                                <xsl:sort select="if (@type='model') then 1 else if (@type='dcr') then 2  else 3" data-type="number"  />
     51                        </xsl:apply-templates>   
    4852                </xsl:when>
    4953                <xsl:when test="$format='terms2flat'" >                                                                 
     
    216220        </xsl:variable>
    217221       
    218         <tr id="{$xid}" >
     222        <!--  this is especially for empty data-categories -->
     223        <xsl:variable name="is_empty" select="if(Term or @count) then '' else 'empty-term'" />
     224        <tr id="{$xid}">
    219225          <xsl:if test="not(parent::Termset) or parent::Termset[@type='dcr' or @type='rr']" >
    220226                <xsl:attribute name="class" select="concat('child-of-',$parentid)" />
    221227          </xsl:if>
    222                 <td class="treecol" ><span class="cmd cmd_add" > </span>
    223                                 <span class="column-elem"><xsl:value-of select="@path" /></span></td>           
     228          <xsl:variable name="path_anchored" >
     229                  <xsl:choose>
     230                          <xsl:when test="@corresponding_component" >
     231                                        <a target="_blank" href="{concat($components_viewer_uri, @corresponding_component)}" ><xsl:value-of select="@path" /></a>
     232                          </xsl:when>
     233                          <xsl:otherwise>
     234                                <xsl:value-of select="@path" />
     235                          </xsl:otherwise>
     236                  </xsl:choose>
     237         </xsl:variable>
     238                <td class="treecol {$is_empty}"  ><span class="cmd cmd_add" > </span>
     239                                <span class="column-elem"><xsl:copy-of select="$path_anchored" /></span>
     240                        <xsl:if test="@datcat!=''" >[<a target="_blank" href="{@datcat}" ><xsl:value-of select="my:shortURL(@datcat)" /></a>]</xsl:if>
     241                </td>
     242                <!-- <td><xsl:value-of select="@path" />,<xsl:value-of select="@context" /></td>-->                     
     243                               
    224244                <td class="number"><xsl:value-of select="@count" /></td>
    225245                <!--  has children don't show the text-count - they are empty on non-terminals
     
    227247                 -->
    228248                <td class="number"><!--   <xsl:if test="not(Term)"><xsl:value-of select="@count_text" /></xsl:if>-->
    229                                 <xsl:value-of select="format-number(if (not(Term)) then @count_text else sum(descendant::Term/@count_text),'#.##0','european' )" />
     249                                <xsl:variable name="count_text_sanitized" select="if (not(Term)) then @count_text else sum(descendant::Term/@count_text)" />
     250                                <xsl:value-of select="if (number($count_text_sanitized)=number($count_text_sanitized)) then
     251                                                                format-number(number($count_text_sanitized),'#.##0','european' ) else ''" />                   
    230252                </td>
    231                 <td class="number">
    232                         <xsl:if test="not(Term)"><a class="detail-caller" href="{my:formURL('values', 'htmllist', @path)}" ><xsl:value-of select="@count_distinct_text" /></a></xsl:if>
    233                         <xsl:if test="Term"><xsl:value-of select="format-number(sum(descendant::Term/@count_distinct_text),'#.##0','european' )" /></xsl:if>
     253                       
     254                <td class="number">                     
     255                        <xsl:if test="not(Term)"><a class="detail-caller" href="{my:formURL('values', 'htmllist', concat(@path,'&amp;sort=size'))}" ><xsl:value-of select="format-number(@count_distinct_text,'#.##0','european')" /></a></xsl:if>
     256                        <xsl:if test="Term"><xsl:value-of select="format-number(sum(descendant::Term/@count_distinct_text),'#.##0','european')" /></xsl:if>
    234257                </td>
    235258                <td class="number">                     
     
    237260                                <xsl:variable name="count_elems" select="parent::Term/@count" />
    238261                                <xsl:variable name="inf_content_ratio" select="if (@count_distinct_text!=0) then (@count_text div $count_elems) * (@count_text div @count_distinct_text) else ''" />
    239                                 <xsl:value-of select="format-number(number($inf_content_ratio),'#.##0,00','european' )" />
     262                                <xsl:value-of select="if (number($inf_content_ratio)=number($inf_content_ratio)) then format-number(number($inf_content_ratio),'#.##0,00','european' ) else ''" />
    240263                        </xsl:if>
    241264                       
    242265                </td>
    243                 <!-- <td><xsl:value-of select="@path" />,<xsl:value-of select="@context" /></td>                       
    244                 <td><xsl:value-of select="@corresponding_component" />,<xsl:value-of select="@datcat" /></td>
    245                  -->
     266                 
    246267     </tr>
    247268                <xsl:if test="Term and ($lv&lt;$max_depth or $max_depth=0)">
Note: See TracChangeset for help on using the changeset viewer.