Changeset 1081
- Timestamp:
- 01/19/11 14:18:18 (13 years ago)
- Location:
- MDService2/trunk/MDService2
- Files:
-
- 1 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/WebContent/WEB-INF/web.xml
r766 r1081 44 44 <web-resource-name>MDService Workspace</web-resource-name> 45 45 <description></description> 46 <url-pattern>/workspace.jsp</url-pattern> 46 <url-pattern>/workspace.jsp</url-pattern> 47 47 </web-resource-collection> 48 48 <auth-constraint> -
MDService2/trunk/MDService2/WebContent/index.jsp
r1076 r1081 36 36 <% if ( request.getRemoteUser() == null) { %> 37 37 <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> 39 39 40 40 <% } else { %> … … 148 148 </div> 149 149 <input type="checkbox" checked="false" id="input-withsummary" name="WS"/><label>with Summary</label> 150 <a class="open-in-context" target="_blank" href="docs/htmlpage/queries" > example queries</a> 150 151 </td> 151 152 </tr></table> -
MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js
r1071 r1081 160 160 var blankdata = "<html><\html>"; 161 161 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 } 172 175 } 173 176 … … 197 200 { 198 201 $('#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(); 200 204 $('#detail-float').dialog( "option", "title", title ); 201 205 … … 649 653 $(".treeview","#collections").find(".showselection").css("color","white"); 650 654 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 651 668 // handle treeview click 652 669 $(".treeview","#collections").find(".selection").click(function() { … … 1153 1170 }); 1154 1171 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 1155 1185 // RECORDSET searchRetrieve 1156 1186 $('#searchretrieve').submit( function(event) { … … 1472 1502 function loadQuery(q){ 1473 1503 if (q["bookmark"] == "1") { 1474 var uri = " http://localhost:8080/MDService2/record/htmldetail/" + q["querystring"];1504 var uri = "/MDService2/record/htmldetail/" + q["querystring"]; 1475 1505 showDetail(null,'html'); 1476 1506 $.get(uri, showDetail,'html'); -
MDService2/trunk/MDService2/WebContent/scripts/mdservice_helpers.js
r1077 r1081 13 13 }).next().hide(); 14 14 */ 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>'); 16 17 $(elems).find('.cmd-collapse').click(function(event) { 17 18 $(this).closest('.header').next().toggle('fast'); … … 21 22 22 23 $(elems).each(function(i) { 24 // default is: hidden 23 25 if ($(this).hasClass('init-show')) { 24 26 $(this).children('.content').show(); 25 27 $(this).find('.cmd-collapse').toggleClass('cmd_down cmd_up'); 26 } 28 } else { 29 $(this).children('.content').hide(); 30 } 31 27 32 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>'); 29 34 $(this).find('.cmd_close').click(function(event) { 30 35 $(this).closest('.header').parent().parent('.cmds-ui-closable').remove(); … … 50 55 } 51 56 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">' + 53 58 '</input></span>' + 54 59 '<span class="label" >max:</span><span><input type="text" class="value maximum-items paging-input" ></input></span>' + … … 67 72 // '</xsl:when>' + 68 73 // '</xsl:choose>' + 69 '</span> ';74 '</span></div'; 70 75 71 76 $(header).append(paging); -
MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js
r1076 r1081 454 454 var qid = $(this).closest('.query_wrapper').attr("id"); 455 455 var q = queryset.getQuery(qid); 456 q.format = $(this).find('option:selected'). text().trim();456 q.format = $(this).find('option:selected').val(); 457 457 queryset.resubmit(qid); 458 458 -
MDService2/trunk/MDService2/WebContent/static/info.xml
r1076 r1081 1 1 <info xml:lang="en" > 2 <div id="title">Information</div>2 <div class="title">Information</div> 3 3 <div id="welcome"> 4 4 … … 6 6 <p>Metadata Service is the user-interface for exploring the CMDRepository. Yes, you can: 7 7 <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> 9 11 <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> 12 13 <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 Data categories,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> 16 17 <li>view individual metadata records </li> 17 18 <li>page through the results</li> … … 50 51 <div id="terms-info"> 51 52 <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> 54 56 </div> 55 57 <div id="compreg-info"> 56 58 <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> 58 60 </div> 59 61 <div id="query-input-info"> 60 62 <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> 66 80 </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> 75 87 </div> 76 88 <div id="querylist-info"> … … 84 96 <dt id="cmd_add_or">Add a alternative condition (OR)</dt> 85 97 <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> 86 100 <dt id="userqueries.cmd_del" idref="#userqueries .cmd_del" >Delete!</dt> 87 101 <dd>Delete the stored query!</dd> … … 96 110 <dt id="cmd_reload">Reload</dt> 97 111 <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> 100 116 <dt id="cmd_up">Collapse view</dt> 101 117 <dt id="cmd_prev" >Page back</dt> -
MDService2/trunk/MDService2/WebContent/static/queries.xml
r1076 r1081 1 1 <info xml:lang="en" > 2 2 <div> 3 <div id="title">Example metadata queries</div>3 <div class="title">Example metadata queries</div> 4 4 <dt >simple term</dt> 5 5 <dd><p>just one word like:</p> 6 6 <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> 9 9 <li><a href="/MDService2/?squery=acquisition">acquisition</a></li> 10 10 </ul> 11 11 </dd> 12 <dt> multiple terms - any(OR)</dt>12 <dt>any of multiple terms (OR)</dt> 13 13 <dd> 14 14 <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> 16 16 </ul> 17 17 </dd> 18 <dt > multiple terms - all(AND)</dt>18 <dt >all of multiple terms (AND)</dt> 19 19 <dd> 20 20 <ul> 21 21 <li><a href="">child acquisition</a></li> 22 <li><a href="">child & 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 24 25 </ul> 25 26 </dd> … … 27 28 <dd>a sequence of terms 28 29 <ul> 29 <li><a href=" ">system</a></li>30 <li><a href="/MDService2/?squery=%2522longitudinal%2520study%2522">"longitudinal study"</a></li> 30 31 </ul> 31 32 </dd> 32 33 <dt >Bookmarks</dt> 33 34 <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> 36 36 <li><a href="/MDService2/record/htmlpage/clarin-at:aac-test-corpus:C4:158">clarin-at:aac-test-corpus:C4:158</a></li> 37 37 <li><a href="/MDService2/record/htmlpage/clarin%252Eeu%3Alrt%3A1001">GENOMA</a></li> … … 48 48 <code>phrase in index </code> 49 49 <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 > 1910) and (tei%3Aimprint.date < 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 )&squery=university">university and (title any system)</a></li> 51 66 </ul> 52 67 </dd> 53 68 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) 56 71 <ul> 57 <li><a href="/MDService2/?q=(title contains a) and ( tei%3Aimprint.date > 1910) and (tei%3Aimprint.date < 1920)">title contains a and imprint.date between 1910 and 1920</a></li>58 </ul> 72 <li><a href="/MDService2/?q=&squery=&collection=clarin-at:aac-test-corpus">aac-test-corpus</a></li> 73 </ul> 59 74 </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> 61 89 </div> 62 90 </info> -
MDService2/trunk/MDService2/WebContent/style/cmds-ui.css
r1076 r1081 70 70 .cmds-ui-block { margin: 2px; text-align: left;} 71 71 72 .cmds-elem-plus .detail, 72 73 .ui-context-dialog { display:none; position:absolute; border 1px solid #A6C9E2; background-color: #fafaff; z-index:1; } 73 74 74 .cmds-elem-plus .detail { display: none; border: 1px solid #A6C9E2;} 75 /* .cmds-elem-plus .detail { display: none; border: 1px solid #A6C9E2;} */ 75 76 76 77 .cmds-elem-prop {} … … 88 89 .cmds-xmlelem .attributes .label {} 89 90 .cmds-xmlelem .attributes .value {} 91 90 92 91 93 … … 114 116 .value_input { width:32%; } 115 117 .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 122 different render (cmds-navi-header.paging-input too small) */ 123 .cmds-navi-header .paging-input { height: 1.2em;} 124 116 125 .paging-input { width: 3em; text-align: right; height: 1em;} 117 126 118 .result-header { float: right; }119 127 .query {margin-right: 4px;} 120 128 -
MDService2/trunk/MDService2/src/mdservice.properties
r1076 r1081 71 71 xsl.admin2htmlpage = cache2view.xsl 72 72 xsl.docs2htmlpage = docs2view.xsl 73 xsl.docs2htmldetail = docs2view.xsl -
MDService2/trunk/MDService2/src/terms_setup.xml
r1076 r1081 6 6 <Termset type="model" id="tcp" name="TextCorpusProfile" url="" format="terms|cmdrepo" /> 7 7 <Termset type="model" id="tei" name="teiHeader" url="" format="terms" /> 8 8 9 9 <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" /> 15 14 </Termsets> -
MDService2/trunk/MDService2/src/xsl/XCQL2Xpath.xsl
r1076 r1081 211 211 </xsl:when> 212 212 <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> 214 214 </xsl:when> 215 215 <xsl:otherwise> -
MDService2/trunk/MDService2/src/xsl/cmd_functions.xsl
r1076 r1081 91 91 <xsl:param name="resolve" /> <!-- true|false--> 92 92 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> --> 94 94 95 95 <xsl:variable name="profile" select="doc($cmdprofiles_uri)//profileDescription[name=$term]" /> … … 154 154 <xsl:param name="url" /> 155 155 <!-- <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> --> 160 161 <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" /> 161 162 </xsl:function> … … 209 210 </xsl:function> 210 211 211 <!-- 212 <!-- 212 213 <xsl:function name="my:numberFormat"> 213 214 <xsl:param name="unit" /> … … 280 281 281 282 <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,'//')" /> 285 288 <xsl:variable name="termset" select="$terms_setup/Termsets/Termset[@name=$prefix]" /> 286 289 … … 293 296 <xsl:when test="not($termset/@id)"> 294 297 <!-- 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,'//'))" /> 296 299 </xsl:when> 297 300 <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,'//'))" /> 299 302 </xsl:otherwise> 300 303 </xsl:choose> 301 304 </xsl:when> 302 <xsl:otherwise><xsl:value-of select="$ p_xpath" />305 <xsl:otherwise><xsl:value-of select="$stripped" /> 303 306 </xsl:otherwise> 304 307 </xsl:choose> -
MDService2/trunk/MDService2/src/xsl/collection2view.xsl
r748 r1081 2 2 <xsl:stylesheet 3 3 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"> 5 5 <!-- 6 6 <purpose> convert fsls to html-list-snippet</purpose> … … 89 89 <xsl:value-of select="@handle"/> 90 90 </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> 93 93 <!-- 94 94 <span class="folder"><xsl:value-of select="@n" />(<xsl:value-of select="@cnt" />) -
MDService2/trunk/MDService2/src/xsl/mdset2view.xsl
r1071 r1081 247 247 248 248 <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()" /> 249 250 <tr> 250 251 <td> … … 252 253 <xsl:when test="exists(.//MdSelfLink)" > 253 254 <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" /> 255 256 </a> 256 257 <span class="cmd cmd_detail" ></span> 257 258 <span class="cmd cmd_save" ></span> 258 259 </xsl:when> 259 <xsl:otherwise><xsl:value-of select=" position()" /></xsl:otherwise>260 <xsl:otherwise><xsl:value-of select="$absolute_position" /></xsl:otherwise> 260 261 </xsl:choose> 261 262 </td> … … 309 310 310 311 <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()" /> 311 313 <tr> 312 314 <td> … … 314 316 <xsl:when test="exists(.//MdSelfLink)" > 315 317 <a class="internal" href="{concat('record/htmldetail/', my:encodePID(.//MdSelfLink))}" > 316 <xsl:value-of select=" position()" />318 <xsl:value-of select="$absolute_position" /> 317 319 </a> 318 320 <span class="cmd cmd_detail" ></span> 319 321 <span class="cmd cmd_save" ></span> 320 322 </xsl:when> 321 <xsl:otherwise><xsl:value-of select=" position()" /></xsl:otherwise>323 <xsl:otherwise><xsl:value-of select="$absolute_position" /></xsl:otherwise> 322 324 </xsl:choose> 323 325 </td> -
MDService2/trunk/MDService2/src/xsl/model2matrix.xsl
r1071 r1081 201 201 <xsl:param name="datcat_termsets" /> 202 202 <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]" /> 204 204 <!-- <xsl:variable name="matching_datcat_relterms" select="$datcat_termsets//Term[@datcat=current()/@datcat]" /> --> 205 205 <xsl:variable name="name" select="($matching_datcat_terms//@name)[1]"></xsl:variable> … … 208 208 <xsl:copy-of select="@*"></xsl:copy-of> 209 209 <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"> 211 211 <xsl:with-param name="datcat_termsets" select="$datcat_termsets"/> 212 212 </xsl:apply-templates> … … 406 406 </xsl:variable> 407 407 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]" /> 409 409 <!-- 410 410 <xsl:message>context: <xsl:copy-of select="$context" /> </xsl:message> -
MDService2/trunk/MDService2/src/xsl/params.xsl
r1071 r1081 34 34 <xsl:param name="components_uri" select="'http://localhost:8080/MDService2/comp/xml/'" /> 35 35 <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='" /> 38 37 39 38 <xsl:param name="autocolumns_limit" select="6" /> -
MDService2/trunk/MDService2/src/xsl/terms2view.xsl
r1076 r1081 41 41 <xsl:call-template name="header"/> 42 42 <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> 44 46 </div> 45 47 </xsl:when> 46 48 <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> 48 52 </xsl:when> 49 53 <xsl:when test="$format='terms2flat'" > … … 216 220 </xsl:variable> 217 221 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}"> 219 225 <xsl:if test="not(parent::Termset) or parent::Termset[@type='dcr' or @type='rr']" > 220 226 <xsl:attribute name="class" select="concat('child-of-',$parentid)" /> 221 227 </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 224 244 <td class="number"><xsl:value-of select="@count" /></td> 225 245 <!-- has children don't show the text-count - they are empty on non-terminals … … 227 247 --> 228 248 <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 ''" /> 230 252 </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,'&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> 234 257 </td> 235 258 <td class="number"> … … 237 260 <xsl:variable name="count_elems" select="parent::Term/@count" /> 238 261 <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 ''" /> 240 263 </xsl:if> 241 264 242 265 </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 246 267 </tr> 247 268 <xsl:if test="Term and ($lv<$max_depth or $max_depth=0)">
Note: See TracChangeset
for help on using the changeset viewer.