Changeset 1029
- Timestamp:
- 01/02/11 19:30:58 (13 years ago)
- Location:
- MDService2/trunk/MDService2
- Files:
-
- 1 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js
r1020 r1029 1050 1050 $('.autocomplete-select-caller').live('click', function(event) { 1051 1051 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(); 1053 1053 $(this).closest(".index-context").hide(); 1054 1054 }); -
MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js
r1008 r1029 268 268 "<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>" + 269 269 // <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>"; 271 272 addToQuerylist(x); 272 273 273 274 this.container = $('#' + this.listid ); 274 275 275 this.columns_widget = new ListWidget($(this.container).find('.query-columns'));276 // this.columns_widget = new ListWidget($(this.container).find('.query-columns')); 276 277 //$(this.container).find('.query-columns').append(this.columns_widget); 277 278 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')); 281 283 $(this.container).children('.query_header').find('.cmd_del').live('click', function(event) { 284 notifyUser("DEBUG: removing query:" + $(this).closest('.query_wrapper').attr('id')); 282 285 queryset.removequery($(this).closest('.query_wrapper').attr('id')); 283 286 }); 284 287 285 288 /* 286 289 $(this.container).children('.columns-wrapper').children('.cmd_del').live('click', function(event) { 287 290 $(this).parent().hide(); 288 291 }); 289 */ 290 291 $(this.container).find('.columns-wrapper').hide(); 292 292 */ 293 293 }; 294 294 … … 367 367 }); 368 368 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 373 375 }); 374 376 … … 426 428 queryset.next(qid,1); 427 429 }); 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"); 429 432 $(this).closest('.query_wrapper').find('.columns-wrapper').show(); 430 }); }); 433 }); 434 }); 431 435 432 436 }; … … 595 599 }; 596 600 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(); 599 604 }); 600 605 -
MDService2/trunk/MDService2/WebContent/scripts/mdservice_searchclause.js
r923 r1029 150 150 //update after text change 151 151 e_index.bind('change', function(){ 152 152 153 var i = $(this).closest('.sc-i').attr("id"); 153 154 var j = $(this).closest('.sc-j').attr("id"); 154 155 //alert("e-index-chabge;" + i + j + $(this).val()); 155 156 searchclauseset.searchclauses[i][j].index = $(this).val(); 156 157 notifyUser("index_sc" + i + "-" + j + " changed to:" + searchclauseset.searchclauses[i][j].index, "debug"); 157 158 searchclauseset.searchclauses[i][j].is_category = false; 158 159 }); -
MDService2/trunk/MDService2/WebContent/style/cmds-ui.css
r893 r1029 61 61 .cmds-ui-block { margin: 2px; } 62 62 63 .ui-context-dialog { position:absolute; border 1px solid #A6C9E2; background-color: #faffff; } 64 63 65 .cmds-elem-plus .detail { display: none; border: 1px solid #A6C9E2;} 64 66 … … 109 111 .sc-wrapper .index-context { display: none; border: 1px solid #A6C9E2;} 110 112 113 .columns-wrapper { right:0px;} 114 111 115 /* command icons */ 112 116 -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/Cache.java
r980 r1029 172 172 } 173 173 174 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd Thh:mm:ss");174 DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); 175 175 e.setAttribute("date", dateFormat.format(new Date()).toString()); 176 176 cacheindex_doc.getFirstChild().appendChild(e); -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/CollectionProxyAction.java
r862 r1029 34 34 //targetURL =new URL( getBaseURL(), getActionkey()); 35 35 //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="); 37 37 //Admin.notifyUser("CollectionProxy.targetURL:" + targetURL); 38 38 -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/GenericProxyAction.java
r980 r1029 56 56 private int maxdepth; 57 57 private String format; 58 private String options; 58 59 private String actionContentType; 59 60 private String userMsg; … … 142 143 } 143 144 145 public String getOptions() { 146 return options; 147 } 148 149 public void setOptions(String options) { 150 this.options = options; 151 } 152 144 153 public String getActionContentType() { 145 if (format.toLowerCase().equals("xml")) { 154 if (format.toLowerCase().startsWith("html")) { 155 this.actionContentType = "text/html"; 156 } else { 146 157 this.actionContentType = "text/xml"; 147 } else {148 this.actionContentType = "text/html";149 158 } 150 159 -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/MDRepoProxyAction.java
r890 r1029 115 115 query.setMaximumRecords(getMaximumRecords()); 116 116 query.setStartRecord(getStartRecord()); 117 query.setOptions(getOptions()); 117 118 //Admin.notifyUser("MDRPA.records:" + query.getStartRecord()); 118 119 //Admin.notifyUser("MDRPA.records:" + query.getMaximumRecords()); … … 120 121 121 122 targetURL =new URL( getBaseURL(), urls.get(getActionkey()) + query.toURLParam() ); 123 Admin.notifyUser("MDRPA.targetURL.query.toURLParam:" + query.toURLParam()); 122 124 Admin.notifyUser("MDRPA.targetURL:" + targetURL); 123 125 return targetURL; -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/model/Query.java
r911 r1029 58 58 private String maximumRecords = "50"; 59 59 private String squery = null; 60 private String options = null; 60 61 private int maxdepth=1; 61 62 … … 199 200 } 200 201 202 public String getOptions() { 203 return options; 204 } 205 206 public void setOptions(String options) { 207 this.options = options; 208 } 209 201 210 public String getStartRecord() { 202 211 return startRecord; … … 312 321 // 2010-07-11 this is just a hack, because url-encoding the handle acted strange 313 322 //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 + "')]"; 316 328 } else { 317 329 if (query_cql == null){ … … 322 334 if ((startRecord != null) && (maximumRecords != null)) { 323 335 targetRequest = targetRequest + "&startRecord=" + getStartRecord() + "&iend=" + getMaximumRecords(); 336 } 337 if ((options != null)) { 338 targetRequest = targetRequest + "&format=xml-" + getOptions(); 324 339 } 325 340 } -
MDService2/trunk/MDService2/src/struts.xml
r980 r1029 13 13 14 14 <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> --> 16 21 <result name="error">/Error.jsp</result> 17 22 </global-results> … … 89 94 <param name="actionkey">profiles</param> 90 95 <result type="stream"> 91 <param name="contentType">$ (actionContentType)</param>96 <param name="contentType">${getActionContentType()}</param> 92 97 <param name="inputName">resultStream</param> 93 98 </result> … … 98 103 <param name="actionkey">elements</param> 99 104 <result type="stream"> 100 <param name="contentType"> text/xml</param>105 <param name="contentType">${getActionContentType()}</param> 101 106 <param name="inputName">resultStream</param> 102 107 </result> … … 117 122 <param name="q">{2}</param> 118 123 <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> 121 126 <!-- <param name="contentType">text/html</param> --> 122 127 <param name="inputName">resultStream</param> … … 228 233 <param name="q">{3}</param> 229 234 <result type="stream"> 230 <param name="contentType">${get actionContentType()}</param>235 <param name="contentType">${getActionContentType()}</param> 231 236 <!--<param name="contentType">text/html</param> 232 237 --> -
MDService2/trunk/MDService2/src/xsl/XCQL2Xpath.xsl
r890 r1029 1 1 <?xml version="1.0" encoding="utf-8"?> 2 2 <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"> 5 5 6 6 <!-- … … 40 40 --> 41 41 42 <xsl:include href="params.xsl"/> 42 43 <xsl:include href="cmd_functions.xsl"/> 44 <!--<xsl:include href="params.xsl"/> 43 45 <xsl:variable name="terms_setup" select="document($terms_setup_uri)" /> 44 46 <xsl:variable name="terms_flat" select="document($terms_flat_uri)" /> 45 47 --> 46 48 <xsl:output method="text" /> 47 49 … … 152 154 153 155 </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> 155 158 <xsl:choose> 156 159 <xsl:when test=".='cql.serverChoice' or .='*'" >//Components</xsl:when> -
MDService2/trunk/MDService2/src/xsl/cmd_commons.xsl
r908 r1029 4 4 5 5 <!-- 6 <purpose>generic functions and templates for displaying/summarizing table-data</purpose>6 <purpose>generic templates for MDService2</purpose> 7 7 <history> 8 8 <change on="2010-03-19" type="created" by="vr">based on 3RMA/suki/dc4_commons.xsl</change> 9 9 <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> 10 11 </history> 11 12 12 13 --> 13 <xsl:include href="params.xsl"/> 14 15 <xsl:include href="cmd_functions.xsl"/> 16 17 <!--<xsl:include href="params.xsl"/>--> 14 18 15 19 <!-- <xsl:param name="mode" select="'html'" /> --> 16 20 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 19 28 20 29 <!-- params for include-processing … … 27 36 <!-- FIXME: he? --> 28 37 <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)" />32 38 33 39 <xsl:template match="/"> … … 201 207 202 208 203 <!-- should be obsoleted by model2matrix.xsl204 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, pcompone340 -->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 381 209 </xsl:stylesheet> -
MDService2/trunk/MDService2/src/xsl/mdinst2view.xsl
r893 r1029 109 109 <xsl:template match="ResourceProxy" > 110 110 111 <xsl:variable name="href" select="ResourceRef"> 112 <!-- 111 <xsl:variable name="href" > 113 112 <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" /> 116 115 </xsl:when> 117 116 <xsl:otherwise> 118 <xsl:value-of select="concat( substring-before(ResourceRef,'.xml'),'.html')" />117 <xsl:value-of select="concat($default_prefix, my:encodePID(ResourceRef))" /> 119 118 </xsl:otherwise> 120 </xsl:choose> -->119 </xsl:choose> 121 120 </xsl:variable> 122 121 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> 124 129 </xsl:template> 125 130 -
MDService2/trunk/MDService2/src/xsl/mdset2view.xsl
r1008 r1029 16 16 </history> 17 17 --> 18 <xsl:import href="model2matrix.xsl"/> 19 <xsl:import href="terms2view.xsl"/> 18 20 19 21 <xsl:output method="html" /> 20 22 21 23 <xsl:include href="cmd_commons.xsl"/> 24 22 25 23 26 <xsl:param name="startRecord">1</xsl:param> … … 48 51 <xsl:variable name="colarray" select="tokenize($cols,',')"/> 49 52 <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(.)}" /> 51 54 <!-- if (contains(.,'.')) then reverse(.) else . --> 52 55 </xsl:for-each> … … 123 126 <div class="result-header" > 124 127 <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 126 130 <span class="label" >hits: </span><span class="value hilight"><xsl:value-of select="numberOfRecords" /></span>; 127 131 <span class="label" >from:</span><span><input type="text" class="value start_record paging-input"><xsl:attribute name="value"> … … 141 145 </xsl:choose> 142 146 </span> 143 <span class="cmd cmd_next"> 147 <span class="cmd cmd_next"> 144 148 <xsl:choose> 145 149 <xsl:when test="$maximumRecords > numberOfRecords or $maximumRecords = numberOfRecords"> … … 148 152 </xsl:choose> 149 153 </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> 150 159 </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> 152 161 </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> 153 212 154 213 <xsl:template match="records" mode="table"> … … 164 223 <xsl:for-each select="$columns/*"> 165 224 <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> 168 226 </tr></thead> 169 227 <tbody> … … 209 267 <xsl:for-each select="$columns/*"> 210 268 <!-- <td ><xsl:value-of select="$curr_cmd//*[name()=current()]" /></td> --> 269 <xsl:message><xsl:copy-of select="."></xsl:copy-of> </xsl:message> 211 270 <xsl:variable name="curr_col_xpath" select="@xpath" /> 212 271 <td> -
MDService2/trunk/MDService2/src/xsl/model2matrix.xsl
r862 r1029 46 46 <Termsets> 47 47 <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,'&maxdepth=8&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,'&maxdepth=8&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> 52 72 53 73 <xsl:variable name="termset_matrix" > … … 81 101 <xsl:apply-templates mode="matrix" > 82 102 <xsl:with-param name="profile" select="$profile"></xsl:with-param> 83 </xsl:apply-templates> 103 </xsl:apply-templates> 84 104 </Terms> 85 105 </xsl:variable> … … 266 286 </xsl:apply-templates> 267 287 268 288 <xsl:copy-of select="v" /> 269 289 </xsl:copy> 270 290 … … 395 415 <xsl:with-param name="profile" select="$profile" /> 396 416 </xsl:apply-templates> 417 397 418 </Term> 398 419 -
MDService2/trunk/MDService2/src/xsl/terms2view.xsl
r923 r1029 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <xsl:stylesheet 3 version="2.0" 2 <xsl:stylesheet version="2.0" 4 3 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" 7 5 > 8 6 <!-- … … 19 17 <xsl:output method="xml" /> 20 18 21 22 19 <!-- <xsl:param name="size_lowerbound">0</xsl:param> 23 20 <xsl:param name="max_depth">0</xsl:param> 24 21 <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 26 26 <xsl:param name="sort">x</xsl:param> <!-- s=size|n=name|t=time|x=default --> 27 27 <xsl:param name="name_col_width" >50%</xsl:param> 28 29 <!-- <xsl:param name="mode" select="'htmldiv'" /> -->30 28 <xsl:param name="title" select="'Terms'" /> 31 32 <!--33 <xsl:param name="detail_uri_prefix" select="'?q='"/>34 -->35 36 37 29 38 30 <xsl:decimal-format name="european" decimal-separator=',' grouping-separator='.' /> … … 90 82 <table> 91 83 <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> 93 86 <tbody> 94 87 <xsl:apply-templates select="*" mode="table" /> … … 104 97 <td align="right"><xsl:value-of select="@count_text"/></td> 105 98 <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 106 103 </tr> 107 104 <xsl:apply-templates select="*" mode="table" /> … … 120 117 121 118 <xsl:template match="Term" mode="list" > 119 <xsl:param name="options" select="''" /> 122 120 <!-- <xsl:variable name="translated_path" select="translate(replace(@path,'//',''),'/','.')" /> --> 123 121 <!-- filter out empty datcats --> 124 <xsl:if test="@elem or descendant::*[@elem] " >122 <xsl:if test="@elem or descendant::*[@elem] or $options='all'" > 125 123 <li><div class="cmds-elem-plus"><span class="detail-caller"><!-- <a href="{concat($detail_model_prefix,@context)}" > --> 126 124 <xsl:value-of select="@path"/></span> … … 139 137 </div> --> 140 138 </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> 142 143 </li> 143 144 </xsl:if> … … 336 337 </xsl:template> 337 338 338 339 340 341 342 339 <xsl:template name="callback-header" > 343 340 <style type="text/css"> … … 357 354 </xsl:template> 358 355 359 360 361 356 </xsl:stylesheet>
Note: See TracChangeset
for help on using the changeset viewer.