Changeset 1918 for MDService2/branches
- Timestamp:
- 04/28/12 22:48:55 (13 years ago)
- Location:
- MDService2/branches/MDService_simple3
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_searchclause.js
r1874 r1918 81 81 //} 82 82 var x = "<div id='" + this.j + "' class='sc-j or_level' ><div id='" + this.listid + "' class='sc-wrapper focused' > " + 83 "<div class='search'><span class=' index-search'><select class='index_select'/><input type='text' class='index-input-termset autocomplete-input' /><input type='text' class='index-input autocomplete-input' /></span>" +83 "<div class='search'><span class='cmd cmd_sc_autocomplete cmd_sca_explain'></span><span class='index-search'><select class='index_select'/><input type='text' class='index-input-termset autocomplete-input' /><input type='text' class='index-input autocomplete-input' /></span>" + 84 84 //index_detail + 85 85 //"<select type='text' class='rel_input' />" + … … 212 212 213 213 try{ 214 this.initAutocomplete(); 214 this.initAutocomplete(false); 215 this.initAutocomplete(true); 215 216 } catch (e){ 216 217 notifyUser("autocomplete failed: " + e.message); … … 219 220 }; 220 221 221 SearchClause.prototype.initAutocomplete = function(){ 222 223 if (element_autocomplete.length == 0) return; 224 225 $(this.GetIndexInputTermset()).autocomplete({ 226 source: element_autocomplete, 227 autoFill:true, 228 width:150, 229 //onFindValue:findValueTermset, 230 //onItemSelect:selectItemTermset, 231 minLength: 0, 232 matchContains:true, 233 delay: 0, 234 select: function( event, ui ) { 235 $(this).data("item", ui.item); 236 selectItemTermset(ui.item); 237 } 238 }).data( "autocomplete" )._renderItem = function( ul, item ) { 239 var t, re; 240 if (this.term == ""){ 241 t = item.value; 242 } else { 243 re = new RegExp(this.term + "+") ; 244 t = item.value.replace(re,"<span style='font-weight:bold;color:Blue;'>" + 245 this.term + 246 "</span>"); 247 } 248 249 return $( "<li></li>" ) 250 .data( "item.autocomplete", item ) 251 .append( "<a>" + t + "</a>" ) 252 .appendTo( ul ); 253 }; 222 223 SearchClause.prototype.initAutocomplete = function(is_explain){ 224 225 if (is_explain){ 226 if (element_autocomplete_explain.length == 0) return; 227 228 $(this.GetIndexInputTermset()).autocomplete({ 229 source: element_autocomplete_explain, 230 autoFill:true, 231 width:150, 232 //onFindValue:findValueTermset, 233 //onItemSelect:selectItemTermset, 234 minLength: 0, 235 matchContains:true, 236 delay: 0, 237 select: function( event, ui ) { 238 $(this).data("item", ui.item); 239 selectItemTermsetExplain(ui.item); 240 } 241 }).data( "autocomplete" )._renderItem = function( ul, item ) { 242 var t, re; 243 if (this.term == ""){ 244 t = item.value; 245 } else { 246 re = new RegExp(this.term + "+") ; 247 t = item.value.replace(re,"<span style='font-weight:bold;color:Blue;'>" + 248 this.term + 249 "</span>"); 250 } 251 252 return $( "<li></li>" ) 253 .data( "item.autocomplete", item ) 254 .append( "<a>" + t + "</a>" ) 255 .appendTo( ul ); 256 }; 257 258 } else { 259 if (element_autocomplete.length == 0) return; 260 261 $(this.GetIndexInputTermset()).autocomplete({ 262 source: element_autocomplete, 263 autoFill:true, 264 width:150, 265 //onFindValue:findValueTermset, 266 //onItemSelect:selectItemTermset, 267 minLength: 0, 268 matchContains:true, 269 delay: 0, 270 select: function( event, ui ) { 271 $(this).data("item", ui.item); 272 selectItemTermset(ui.item); 273 } 274 }).data( "autocomplete" )._renderItem = function( ul, item ) { 275 var t, re; 276 if (this.term == ""){ 277 t = item.value; 278 } else { 279 re = new RegExp(this.term + "+") ; 280 t = item.value.replace(re,"<span style='font-weight:bold;color:Blue;'>" + 281 this.term + 282 "</span>"); 283 } 284 285 return $( "<li></li>" ) 286 .data( "item.autocomplete", item ) 287 .append( "<a>" + t + "</a>" ) 288 .appendTo( ul ); 289 }; 290 291 } 254 292 $('body').find('.ac_results').css({'z-index' : '1000'}); 255 293 … … 619 657 }, 620 658 621 initAutocomplete: function( ) {659 initAutocomplete: function(is_explain) { 622 660 notifyUser("init autocomplete",'debug'); 623 661 624 662 for (var i = this.searchclauses.length - 1; i > -1; i--){ 625 663 for (var j = this.searchclauses[i].length - 1; j > -1; j--){ 626 this.searchclauses[i][j].initAutocomplete( );664 this.searchclauses[i][j].initAutocomplete(is_explain); 627 665 } 628 666 } … … 674 712 675 713 //autocomplete 676 // not used677 function handleTermsSelection(i,j,elem){678 /*679 var context = $('#' + 'sc' + i + '-' + j).find('.index-context');680 // fill context681 //$(context).remove();682 $(context).html(elements_hashtable[elem]);683 $(context).show();684 //notifyUser($('#' + 'sc' + i + '-' + j).find('.index-input').val(), 'debug');685 //$('#' + 'sc' + i + '-' + j).find('.index-input').focus();686 687 $('#' + 'sc' + i + '-' + j).find('.index-input').blur(function(){688 $(context).hide();689 });690 $('#' + 'sc' + i + '-' + j).find('.index-input').focusin(function(){691 $(context).hide();692 });693 */694 //$('#' + 'sc' + i + '-' + j).find('.index-input').hide();695 //$('#' + 'sc' + i + '-' + j).find('.index-input-termset').show();696 697 };698 714 699 715 function findValueValue(e) { … … 707 723 708 724 } 709 710 725 function selectItemValue(li) { 711 726 findValueValue(li); … … 754 769 755 770 }; 771 function initValueAutocompleteExplain(i,j,index, term_index){ 772 773 // reset the index value 774 $('#' + 'sc' + i + '-' + j).find('.value-input').val(""); 775 searchclauseset.searchclauses[i][j].value = ""; 776 $('#' + 'sc' + i + '-' + j).find('.value-input').show(); 777 $('body').find('.ac_results').css({'z-index' : '1000'}); 778 779 780 $('.focused','#searchclauselist').find('.value-input').focus(); 781 782 783 }; 756 784 757 785 function findValueTerm(e) { 758 759 760 761 762 763 764 var termsetitem = $('#' + 'sc' + i + '-' + j).find('.index-input-termset').data('item');765 var termset = "";766 if (termsetitem != null) termset = termsetitem.key;767 var str = e.id;768 str = str.substring(str.lastIndexOf('/')+1, str.length);769 var termsetindex = termset + ":" + str;770 searchclauseset.searchclauses[i][j].index = termsetindex;771 772 //handleTermsSelection(i,j,sValue);773 //find element value774 775 var index;776 $.each(element_autocomplete,function(i, item){ 777 if (this.key == termset){778 index = i;779 return;780 }781 });782 var term_index;783 784 $.each(element_autocomplete[index].data,function(i, item){785 if (this.id == e.id){786 term_index = i;787 return;788 }789 });790 if (element_autocomplete[index].data[term_index].values.length == 0){791 jQuery.get(link('fcs','?operation=scan&scanClause=' + termsetindex + '&x-context=clarin.eu:mdrepo'),function(data){792 $(data).find("sru\\:term").each(function(i){793 element_autocomplete[index].data[term_index].values[i] = {label:$(this).find('sru\\:value').text()};794 });795 initValueAutocomplete(i,j, index, term_index);796 797 } else {798 initValueAutocomplete(i,j, index, term_index);799 }800 801 786 787 //var sValue = e.selectValue; 788 789 var i = $('.focused','#searchclauselist').closest('.sc-i').attr("id"); 790 var j = $('.focused','#searchclauselist').closest('.sc-j').attr("id"); 791 //alert(i+ ',' + j + sValue); 792 var sClause = $('#' + 'sc' + i + '-' + j); 793 var context = ""; 794 var termsetitem = $(sClause).find('.index-input-termset').data('item'); 795 var termset = ""; 796 if (termsetitem != null) termset = termsetitem.key; 797 var str = e.id; 798 str = str.substring(str.lastIndexOf('/')+1, str.length); 799 var termsetindex = termset + ":" + str; 800 searchclauseset.searchclauses[i][j].index = termsetindex; 801 802 //handleTermsSelection(i,j,sValue); 803 //find element value 804 805 var index; 806 $.each(element_autocomplete,function(i, item){ 807 if (this.key == termset){ 808 index = i; 809 return; 810 } 811 }); 812 var term_index; 813 814 $.each(element_autocomplete[index].data,function(i, item){ 815 if (this.id == e.id){ 816 term_index = i; 817 return; 818 } 819 }); 820 if (element_autocomplete[index].data[term_index].values.length == 0){ 821 jQuery.get(link('fcs','?operation=scan&scanClause' + termsetindex + '&x-context=' + getSelectedRepository()),function(data){ 822 $(data).find("sru\\:term").each(function(i){ 823 element_autocomplete[index].data[term_index].values[i] = {label:$(this).find('sru\\:value').text()}; 824 }); 825 initValueAutocomplete(i,j, index, term_index); 826 }); 827 } else { 828 initValueAutocomplete(i,j, index, term_index); 829 } 802 830 } 803 831 function findValueTermExplain(e) { 832 833 //var sValue = e.selectValue; 834 835 var i = $('.focused','#searchclauselist').closest('.sc-i').attr("id"); 836 var j = $('.focused','#searchclauselist').closest('.sc-j').attr("id"); 837 //alert(i+ ',' + j + sValue); 838 var sClause = $('#' + 'sc' + i + '-' + j); 839 var context = ""; 840 var termsetitem = $(sClause).find('.index-input-termset').data('item'); 841 var termset = ""; 842 if (termsetitem != null) termset = termsetitem.key; 843 var str = e.id; 844 str = str.substring(str.lastIndexOf('/')+1, str.length); 845 var termsetindex = termset + ":" + str; 846 searchclauseset.searchclauses[i][j].index = termsetindex; 847 848 //find element value 849 850 var index; 851 $.each(element_autocomplete_explain,function(i, item){ 852 if (this.key == termset){ 853 index = i; 854 return; 855 } 856 }); 857 var term_index; 858 859 $.each(element_autocomplete_explain[index].data,function(i, item){ 860 if (this.id == e.id){ 861 term_index = i; 862 return; 863 } 864 }); 865 if (element_autocomplete_explain[index].data[term_index].values.length == 0){ 866 jQuery.get(link('fcs','?operation=scan&scanClause' + termsetindex + '&x-context=' + getSelectedRepository()),function(data){ 867 $(data).find("sru\\:term").each(function(i){ 868 element_autocomplete[index].data[term_index].values[i] = {label:$(this).find('sru\\:value').text()}; 869 }); 870 initValueAutocompleteExplain(i,j, index, term_index); 871 }); 872 } else { 873 initValueAutocompleteExplain(i,j, index, term_index); 874 } 875 } 876 804 877 function selectItemTerm(li) { 805 findValueTerm(li); 806 } 878 findValueTerm(li); 879 } 880 function selectItemTermExplain(li) { 881 findValueTermExplain(li); 882 } 807 883 808 884 function initTermsetAutocomplete(i,j,index){ 809 //$('#' + 'sc' + i + '-' + j).find('.index-input').hide();810 811 // not working812 //searchclauseset.searchclauses[i][j].initAutocompleteTerms(elem);813 885 814 886 $('#' + 'sc' + i + '-' + j).find('.index-input').autocomplete({ … … 816 888 autoFill:true, 817 889 width:150, 818 //onFindValue:findValueTerm,819 //onItemSelect:selectItemTerm,820 890 minLength: 0, 821 891 matchContains:true, … … 824 894 $(this).data("item", ui.item); 825 895 selectItemTerm(ui.item); 826 }896 } 827 897 }).data( "autocomplete" )._renderItem = function( ul, item ) { 828 898 var t, re; … … 835 905 "</span>"); 836 906 } 837 838 839 840 841 907 908 return $( "<li></li>" ) 909 .data( "item.autocomplete", item ) 910 .append( "<a>" + t + "</a>" ) 911 .appendTo( ul ); 842 912 }; 843 844 845 // reset the index value913 914 915 // reset the index value 846 916 $('#' + 'sc' + i + '-' + j).find('.index-input').val(""); 847 917 searchclauseset.searchclauses[i][j].index = ""; 918 $('#' + 'sc' + i + '-' + j).find('.value-input').val(""); 919 searchclauseset.searchclauses[i][j].value = ""; 848 920 $('#' + 'sc' + i + '-' + j).find('.index-input').show(); 849 921 $('body').find('.ac_results').css({'z-index' : '1000'}); … … 851 923 852 924 $('.focused','#searchclauselist').find('.index-input').focus(); 853 854 855 }; 856 /* 857 function handleTermsetSelection(i,j,elem){ 858 859 // create apropriate array, than initialize autocomplete 860 if ($('#elements_hashtable_'+elem).children().length == 0) { 861 $('#elements_hashtable_'+elem).load(link('smc','list/?context='+elem),function(){ 862 //var e = $(this).attr("id"); 863 $(this).find('Term').each(function(index){ 864 elements_hashtable[elem][index] = $(this).text(); 865 }); 866 initTermsetAutocomplete(i,j,elem); 867 }); 868 } else { 869 initTermsetAutocomplete(i,j,elem); 870 } 871 }; 872 */ 925 }; 926 function initTermsetAutocompleteExplain(i,j,index){ 927 928 $('#' + 'sc' + i + '-' + j).find('.index-input').autocomplete({ 929 source: element_autocomplete_explain[index].data, 930 autoFill:true, 931 width:150, 932 minLength: 0, 933 matchContains:true, 934 delay: 0, 935 select: function( event, ui ) { 936 $(this).data("item", ui.item); 937 selectItemTermExplain(ui.item); 938 } 939 }).data( "autocomplete" )._renderItem = function( ul, item ) { 940 var t, re; 941 if (this.term == ""){ 942 t = item.value; 943 } else { 944 re = new RegExp(this.term + "+") ; 945 t = item.value.replace(re,"<span style='font-weight:bold;color:Blue;'>" + 946 this.term + 947 "</span>"); 948 } 949 950 return $( "<li></li>" ) 951 .data( "item.autocomplete", item ) 952 .append( "<a>" + t + "</a>" ) 953 .appendTo( ul ); 954 }; 955 956 957 // reset the index value 958 $('#' + 'sc' + i + '-' + j).find('.index-input').val(""); 959 searchclauseset.searchclauses[i][j].index = ""; 960 $('#' + 'sc' + i + '-' + j).find('.index-input').show(); 961 $('body').find('.ac_results').css({'z-index' : '1000'}); 962 963 964 $('.focused','#searchclauselist').find('.index-input').focus(); 965 }; 966 873 967 874 968 function findValueTermset(elem) { 875 969 //var sValue = e.selectValue; 876 970 877 971 var i = $('.focused','#searchclauselist').closest('.sc-i').attr("id"); 878 972 var j = $('.focused','#searchclauselist').closest('.sc-j').attr("id"); 879 973 880 974 //searchclauseset.searchclauses[i][j].index = sValue; 881 975 //handleTermsetSelection(i,j,sValue); 882 976 883 977 //find element 884 978 var index; … … 889 983 } 890 984 }); 891 985 892 986 if (element_autocomplete[index].data.length == 0){ 893 987 jQuery.get(link('smc','list/?context=' + element_autocomplete[index].key),function(data){ … … 900 994 initTermsetAutocomplete(i,j, index); 901 995 } 902 903 996 } 904 997 function findValueTermsetExplain(elem) { 998 999 var i = $('.focused','#searchclauselist').closest('.sc-i').attr("id"); 1000 var j = $('.focused','#searchclauselist').closest('.sc-j').attr("id"); 1001 1002 //find element 1003 var index; 1004 $.each(element_autocomplete_explain,function(i, item){ 1005 if (this.key == elem.key){ 1006 index = i; 1007 return; 1008 } 1009 }); 1010 1011 if (element_autocomplete_explain[index].data.length == 0){ 1012 jQuery.get(link('fcs','?operation=explain&x-context=' + getSelectedRepository()),function(data){ 1013 $(data).find('indexInfo').children('index').children('map').children('name[set='+ element_autocomplete_explain[index].key +']').each(function(i){ 1014 element_autocomplete_explain[index].data[i] = {label:$(this).text(), value:$(this).text(), id:$(this).text(),values:[] }; 1015 }); 1016 initTermsetAutocompleteExplain(i,j, index); 1017 }); 1018 } else { 1019 initTermsetAutocompleteExplain(i,j, index); 1020 } 1021 1022 } 1023 1024 905 1025 function selectItemTermset(li) { 906 1026 findValueTermset(li); 907 } 908 1027 } 1028 function selectItemTermsetExplain(li) { 1029 findValueTermsetExplain(li); 1030 } 1031 -
MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_ui.js
r1588 r1918 69 69 70 70 function getSelectedRepository(){ 71 return $(' #repositories_select').find("option:selected").text();71 return $('select[name="x-context"]').find("option:selected").val(); 72 72 } 73 73 … … 84 84 */ 85 85 function addFunctionality(){ 86 87 //change context_selects 88 $('select[name=x-context]').live('click', function(){ 89 //delete the autocomplete arrays, reset the index input values 90 //element_autocomplete.splice(0, element_autocomplete.length); 91 element_autocomplete_explain.splice(0, element_autocomplete_explain.length ); 92 searchclauseset.clear(); 93 //load new 94 loadTermsAutocompleteExplain(); 95 }); 86 96 87 97 //switch the input simple query vs complex query … … 205 215 206 216 217 218 $('.cmd_sc_autocomplete').live('click', function(event) { 219 var i = $(this).closest('.sc-i').attr('id'); 220 var j = $(this).closest('.sc-j').attr('id'); 221 searchclauseset.searchclauses[i][j].initAutocomplete($(this).hasClass('cmd_sca_explain')); 222 $(this).toggleClass('cmd_sca_explain cmd_sca_smc'); 223 }); 207 224 208 225 // cmd_up cmd_down -
MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_ui_load.js
r1852 r1918 19 19 //loadComponentsRegistry(); 20 20 //loadDCR(); 21 22 21 } 23 22 … … 240 239 } 241 240 241 function loadTermAutocompleteExplain(){ 242 $('#termset_autocomplete_explain').children().remove(); 243 $('#termset_autocomplete_explain').css('display','none'); 244 $('#terms_autocomplete_explain').children().remove(); 245 $('#terms_autocomplete_explain').css('display','none'); 246 247 $('#termset_autocomplete_explain').load(link('fcs','?operation=explain&x-context=' + getSelectedRepository()),function(){ 248 $(this).find("indexInfo").children("set").each(function(index){ 249 //element_autocomplete[index].data[term_index].values[i] = {label:$(this).find('index').children('title').text()}; 250 var _key, _name, _id, _parent, _isleaf = 0; 251 _key = $(this).attr("name"); 252 _name = $(this).children("title").text(); 253 _parent = $(this).parents('indexInfo'); 254 _id = $(this).attr("identifier"); 255 _isleaf = 1;//TODO 256 257 element_autocomplete_explain[index] = { label:_name, value:_name, key:_key, id:_id, parent:_parent, isleaf:_isleaf, data:[]}; 258 }); 259 // add autocomplete 's 260 //searchclauseset.initAutocomplete(true); 261 //columns_widget.initAutocomplete(element_autocomplete_explain, true); 262 }); 263 264 }; 265 242 266 function loadTermsAutocomplete(){ 243 267 244 var elem;268 //var elem; 245 269 $('#termset_autocomplete').children().remove(); 246 270 $('#termset_autocomplete').css('display','none'); 247 271 $('#terms_autocomplete').children().remove(); 248 272 $('#terms_autocomplete').css('display','none'); 273 274 275 //$.get(link('smc','list/?context=*'),function(){ 249 276 $('#termset_autocomplete').load(link('smc','list/?context=*'),function(){ 250 277 $(this).find('Termset').each(function(index){ … … 265 292 }); 266 293 // add autocomplete 's 267 searchclauseset.initAutocomplete(); 268 columns_widget.initAutocomplete(element_autocomplete); 269 }); 294 searchclauseset.initAutocomplete(false); 295 //columns_widget.initAutocomplete(element_autocomplete); 296 //load explain autocomplete array 297 loadTermAutocompleteExplain(); 298 }); 299 300 270 301 }; 271 302 -
MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_ui_settings.js
r1874 r1918 19 19 20 20 var element_autocomplete = new Array(); 21 var element_autocomplete_explain = new Array(); 21 22 var elements_hashtable = {}; 22 23 -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/GenericAction.java
r1907 r1918 24 24 import eu.clarin.cmdi.mdservice.model.Diagnostic; 25 25 import eu.clarin.cmdi.mdservice.model.Diagnostics; 26 import eu.clarin.cmdi.mdservice.model.Repositories; 26 27 import eu.clarin.cmdi.mdservice.model.WorkspaceProfile; 27 28 import eu.clarin.cmdi.mdservice.proxy.ProxyInterface; … … 208 209 209 210 public String getMaxdepth() { 210 return getParam(" maxdepth");211 return getParam("x-maximumDepth"); 211 212 } 212 213 … … 377 378 378 379 if ( params.get("x-cmd-maxdepth") == null){ 379 if (params.get(" maxdepth") == null){380 addParam(" maxdepth","2");380 if (params.get("x-maximumDepth") == null){ 381 addParam("x-maximumDepth","2"); 381 382 } 382 383 } else { 383 addParam(" maxdepth",params.get("x-cmd-maxdepth")[0]);384 addParam("x-maximumDepth",params.get("x-cmd-maxdepth")[0]); 384 385 } 385 386 /* … … 401 402 addParam("x-context",params.get("x-cmd-repository")[0]); 402 403 } 403 404 if (params.get("x-context") == null){ 405 addParam("x-context",Repositories.getRepositories().getRepositoryByIndex(0)); 406 } 404 407 if ( params.get("x-cmd-cache") == null){ 405 408 if (params.get("cache") == null){ … … 433 436 434 437 addParam("fullformat",getFullFormat()); 438 439 if (params.get("base_url") == null){ 440 addParam("base_url",Utils.getConfig("base.uri")); 441 } 442 443 if (params.get("scripts_url") == null){ 444 addParam("scripts_url",Utils.getConfig("webscripts.uri")); 445 } 446 435 447 } 436 448 /** -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/RepoAction.java
r1832 r1918 132 132 133 133 if (!Repositories.getRepositories().repositoryExists(getRepository())){ 134 getDiagnostics().Add(Diagnostic.UNSUPPORTED_PARAMETERVALUE, "repository", "repository=" + getRepository() ); 134 getDiagnostics().Add(Diagnostic.UNSUPPORTED_PARAMETERVALUE, "repository", "repository=" + getRepository() ); 135 135 return; 136 136 } -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/model/Query.java
r1907 r1918 79 79 sarr = new String[1]; 80 80 sarr[0] = "1"; 81 put(" maxdepth", sarr);81 put("x_maximumDepth", sarr); 82 82 83 83 }}; … … 410 410 if (type.equals(MODEL)) { 411 411 //targetRequest = fromCMDIndex2Xpath() + "&maxdepth=" + getMaxdepth() ; /* + "&maxdepth=" + getMaxdepth() ); "&collection=" + getCollection() + */ 412 targetRequest = fromCMDIndex2Xpath() + "&maxdepth=" + getParam(" maxdepth") ; /* + "&maxdepth=" + getMaxdepth() ); "&collection=" + getCollection() + */412 targetRequest = fromCMDIndex2Xpath() + "&maxdepth=" + getParam("x-maximumDepth") ; /* + "&maxdepth=" + getMaxdepth() ); "&collection=" + getCollection() + */ 413 413 } 414 414 else if (type.equals(COLLECTION)) { 415 targetRequest = getParam("collection") + "&maxdepth=" + getParam(" maxdepth") ; /* + "&maxdepth=" + getMaxdepth() ); "&collection=" + getCollection() + */415 targetRequest = getParam("collection") + "&maxdepth=" + getParam("x-maximumDepth") ; /* + "&maxdepth=" + getMaxdepth() ); "&collection=" + getCollection() + */ 416 416 417 417 } else if (type.equals(SRUEXTERN)) { -
MDService2/branches/MDService_simple3/src/mdservice.properties
r1879 r1918 5 5 terms.file=terms_setup.xml 6 6 webscripts.uri = /MDService2 7 base.uri = /MDService2 7 //base.uri = /MDService2 8 base.uri =http://localhost:8080/MDService2/fcs 8 9 virtualcollection.uri = http://clarin.ids-mannheim.de/vcr/service/virtualcollection 9 10 -
MDService2/branches/MDService_simple3/src/xsl/fcs/commons_v1.xsl
r1814 r1918 21 21 <xsl:template match="/"> 22 22 <!--<xsl:message>root_document-uri:<xsl:value-of select="$root_uri"/> 23 </xsl:message>24 <xsl:message>format:<xsl:value-of select="$format"/>25 23 </xsl:message>--> 26 24 <xsl:choose> -
MDService2/branches/MDService_simple3/src/xsl/fcs/html_snippets.xsl
r1907 r1918 22 22 <link href="{$base_dir}/style/jquery/jquery-treeview/jquery.treeview.css" rel="stylesheet"/> 23 23 </xsl:if>--> 24 25 26 <xsl:if test="contains($format,'htmljspage')"> 27 <link href="{$scripts_url}/style/jquery/jquery-treeview/jquery.treeview.css" rel="stylesheet" /> 28 <link href="{$scripts_url}/style/jquery/treetable/jquery.treeTable.css" rel="stylesheet" ></link> 29 <link href="{$scripts_url}/style/jquery/jquery-autocomplete/jquery-ui.css" rel="stylesheet" type="text/css"></link> 30 31 <script src="{$scripts_url}/scripts/jquery/js/jquery.min.js" type="text/javascript"></script> 32 <script src="{$scripts_url}/scripts/jquery/js/jquery-ui.min.js" type="text/javascript"></script> 33 34 <script src="{$scripts_url}/scripts/jquery/jquery-treeview/jquery.treeview.js" type="text/javascript"></script> 35 <script src="{$scripts_url}/scripts/jquery/jquery-treeTable/jquery.treeTable.js" type="text/javascript"></script> 36 <script src="{$scripts_url}/scripts/jquery/jsTree.v.1.0rc2/jquery.jstree.js" type="text/javascript"></script> 37 38 <script src="{$scripts_url}/scripts/mdservice_helpers.js" type="text/javascript"></script> 39 <script src="{$scripts_url}/scripts/jquery/jquery-layout/jquery.layout-1.3.0.rc29.12.js" type="text/javascript"></script> 40 41 <script src="{$scripts_url}/scripts/mdservice_ui_settings.js" type="text/javascript"></script> 42 <script src="{$scripts_url}/scripts/mdservice_helpers.js" type="text/javascript"></script> 43 <script src="{$scripts_url}/scripts/mdservice_ui_helpers.js" type="text/javascript"></script> 44 <script src="{$scripts_url}/scripts/mdservice_widgets.js" type="text/javascript"></script> 45 46 <script src="{$scripts_url}/scripts/mdservice_searchclause.js" type="text/javascript"></script> 47 <script src="{$scripts_url}/scripts/mdservice_model.js" type="text/javascript"></script> 48 <script src="{$scripts_url}/scripts/mdservice_pz2.js" type="text/javascript"></script> 49 <script src="{$scripts_url}/scripts/mdservice_ui_detail.js" type="text/javascript"></script> 50 <script src="{$scripts_url}/scripts/mdservice_ui_load.js" type="text/javascript"></script> 51 52 <script src="{$scripts_url}/scripts/mdservice_ui.js" type="text/javascript"></script> 53 54 </xsl:if> 24 55 </xsl:template> 25 56 <xsl:template name="page-header"> … … 156 187 </form> 157 188 </div> 189 <!-- gs --> 190 <div id="termset_autocomplete" /> 191 <div id="termset_autocomplete_explain" /> 192 <div id="terms_autocomplete" /> 158 193 </div> 159 194 </xsl:template> … … 232 267 </span> 233 268 </a> 269 234 270 </xsl:template> 235 271 <xsl:template name="query-list"> -
MDService2/branches/MDService_simple3/src/xsl/fcs/params.xsl
r1907 r1918 24 24 25 25 <!-- gs --> 26 <xsl:param name="x_maximumDepth" select="0" /> 27 <xsl:param name="autocolumns_limit" select="6" /> 26 28 <xsl:param name="name_element" select="('title', 'name', 'resourcename', 'md-title')" /> 27 29 -
MDService2/branches/MDService_simple3/src/xsl/fcs/result2view_v1.xsl
r1812 r1918 25 25 <xsl:call-template name="header"/> 26 26 </xsl:if> 27 <xsl:apply-templates select="sru:records" mode="list"/> 28 27 <xsl:apply-templates select="sru:records" mode="list"/> 28 <!-- switch mode depending on the $format-parameter --> 29 29 <!--<xsl:choose> 30 30 <xsl:when test="contains($format,'htmltable')"> -
MDService2/branches/MDService_simple3/src/xsl/mdset2view.xsl
r1907 r1918 19 19 <xsl:import href="model2matrix.xsl"/> 20 20 <xsl:import href="terms2view.xsl"/> 21 <xsl:import href="cmd_functions.xsl"/> 21 22 22 23 <!-- method="xhtml" is saxon-specific! prevents collapsing empty <script> tags, that makes browsers choke --> … … 30 31 --> 31 32 32 < xsl:include href="cmd_commons.xsl"/>33 <!-- <xsl:include href="cmd_commons.xsl"/> --> 33 34 34 35 <!-- <xsl:param name="format" select="'table'" /> table|list|detail --> … … 86 87 <xsl:call-template name="header" /> 87 88 </xsl:if> 88 <xsl:if test="contains($format, ' page')">89 <xsl:if test="contains($format, 'htmlpage')"> 89 90 <xsl:call-template name="query-input" /> 90 91 </xsl:if> 91 92 92 93 93 <xsl:choose> 94 94 <xsl:when test="contains($format,'htmltable')"> … … 193 193 </xsl:choose> 194 194 </xsl:variable> 195 195 196 <a class="internal prev" href="{my:formsearchURL($prev_startRecord,$maximumRecords)}"> 196 197 <span> … … 205 206 </span> 206 207 </a> 208 207 209 <a class="internal next" href="{my:formsearchURL($next_startRecord,$maximumRecords)}"> 210 208 211 <span class="cmd cmd_next"> 209 212 <xsl:choose> … … 447 450 </td> 448 451 <td colspan="{count($cols/*)}" > 449 < xsl:call-template name="getContext" />450 < div class="title" ><xsl:call-template name="getName" /></div>452 <!-- <xsl:call-template name="getContext" /> --> 453 <!-- <div class="title" ><xsl:call-template name="getName" /></div>--> 451 454 </td> 452 455 </tr> -
MDService2/branches/MDService_simple3/src/xsl/model2matrix.xsl
r1907 r1918 16 16 </history> 17 17 --> 18 <xsl:import href="cmd_commons.xsl"/> 18 <xsl:include href="./fcs/commons.xsl"/> 19 <!-- <xsl:include href="cmd_commons.xsl"/> --> 19 20 20 21 <xsl:output method="xml" indent="yes" > </xsl:output> … … 62 63 <!-- else get the full summary for given termset --> 63 64 <xsl:otherwise> 64 <xsl:variable name="resolved_termset_uri" select="concat($model_matrix_uri,$termset_name,'&maxdepth=8&x-context=',$x-context)" /> 65 <!-- <xsl:variable name="resolved_termset_uri" select="concat($model_matrix_uri,$termset_name,'&maxdepth=8&x-context=',$x-context)" /> --> 66 <xsl:variable name="resolved_termset_uri" select="concat('',$termset_name,'&maxdepth=8&x-context=',$x-context)" /> 65 67 <xsl:message>processing model-term($resolved_termset_uri): <xsl:value-of select="$resolved_termset_uri" /> </xsl:message> 66 68 <xsl:copy-of select="document($resolved_termset_uri)" /> … … 88 90 </xsl:when> 89 91 <xsl:otherwise> 90 <xsl:variable name="termset_name" select="Term/@name" />92 <!-- <xsl:variable name="termset_name" select="Term/@name" /> 91 93 <xsl:variable name="profile" select="my:profilematrix($termset_name)" /> 94 92 95 <xsl:message>corresponding profile: <xsl:value-of select="concat($profile/@name, '#', $profile/@id)"/> </xsl:message> 93 <!-- <xsl:copy-of select="$profile" /> --> 94 95 <xsl:variable name="setup_entry" select="$terms_setup//Termset[@name=$termset_name]" /> 96 <xsl:variable name="setup_entry" select="Termset[@name=$termset_name]" /> 96 97 <xsl:message>corresponding terms_setup-entry: <xsl:value-of select="$setup_entry/concat(@name, '#', @id)"/> </xsl:message> 97 98 … … 114 115 <xsl:with-param name="matrix" select="$prematrix"></xsl:with-param> 115 116 </xsl:apply-templates> 116 <!--117 <xsl:copy>118 <xsl:copy-of select="@*"></xsl:copy-of>119 <xsl:attribute name="path" select="$path" />120 </xsl:copy>121 -->122 117 </xsl:for-each> 123 118 </Termset> … … 125 120 126 121 <xsl:copy-of select="$matrix" /> 127 122 --> 128 123 </xsl:otherwise> 129 124 </xsl:choose> … … 134 129 <xsl:template name="full-matrix" > 135 130 <!-- collect all model termMatrix --> 131 <!-- 136 132 <xsl:variable name="model_termsets_uri" select="concat($model_matrix_uri,'Components', '&maxdepth=1&x-context=',$x-context)" /> 137 133 <xsl:message>full-matrix.model_termsets_uri: <xsl:value-of select="$model_termsets_uri"/> </xsl:message> … … 139 135 140 136 141 <!-- collect all datcat terms --> 137 138 139 <!- collect all datcat terms 142 140 <xsl:variable name="datcats_uri" select="$datcats_terms_uri" /> 143 141 <xsl:variable name="datcat_termsets" select="document($datcats_uri)" /> 144 142 145 <!- - resolve/invert datcat->Terms -->143 <!- resolve/invert datcat->Terms 146 144 <xsl:variable name="datcat_termsets_resolved" > 147 145 <xsl:apply-templates select="$datcat_termsets//Termset[@type='dcr']" mode="resolve-datcat" > … … 150 148 </xsl:variable> 151 149 152 <!- - + resolve RR: rels(datcat,datcat) -->150 <!- + resolve RR: rels(datcat,datcat) 153 151 <xsl:variable name="relcat_termsets_resolved" > 154 152 <xsl:apply-templates select="$datcat_termsets//Termset[@type='rr']" mode="resolve-relcat" > … … 163 161 </Termsets> 164 162 165 163 --> 166 164 </xsl:template> 167 165 … … 401 399 <xsl:param name="profile" /> 402 400 403 <xsl:variable name="context" select="my:context(.)" > 401 <!-- <xsl:variable name="context" select="my:context(.)" > --> 402 <xsl:variable name="context" select="''" > 404 403 <!-- <xsl:for-each select="ancestor::CMD_Component" > 405 404 <xsl:value-of select="@name" />.</xsl:for-each>--> -
MDService2/branches/MDService_simple3/src/xsl/static2view.xsl
r1907 r1918 14 14 </history> 15 15 --> 16 17 < xsl:include href="cmd_commons.xsl"/>16 <xsl:include href="./fcs/commons.xsl"/> 17 <!-- <xsl:include href="cmd_commons.xsl"/> --> 18 18 19 19 <!--<xsl:param name="title" select="if (//div[1][@class='title']) then concat('CMDRSB: ', //div[1][@class='title']) else 'CMDRSB docs'" />--> -
MDService2/branches/MDService_simple3/src/xsl/terms2view.xsl
r1574 r1918 13 13 </history> 14 14 --> 15 <xsl:import href="cmd_commons.xsl"/> 15 <!-- <xsl:import href="cmd_commons.xsl"/> --> 16 <xsl:import href="./fcs/commons_v1.xsl"/> 17 <xsl:import href="cmd_functions.xsl"/> 16 18 17 19 <!-- <xsl:output method="xml" /> --> … … 64 66 <xsl:apply-templates select=".//Termset" mode="select"/> 65 67 </select> 66 <a href="{my:formURL('terms','htmlpage','all')}">overview</a> 68 <a href="{my:formURL('terms','htmlpage','all')}">overview</a> 67 69 </xsl:when> 68 70 <xsl:otherwise> … … 117 119 <div class="terms"> 118 120 <span class="detail-caller"><xsl:value-of select="@name"/></span> 119 < xsl:call-template name="attr-detail-div" />121 <!-- <xsl:call-template name="attr-detail-div" /> --> 120 122 <!-- format:<xsl:value-of select="$format" /> --> 121 123 <!--<xsl:variable name="translated_term" select="translate(replace(/*/Term[1]/@path,'//',''),'/','.')" /> … … 140 142 <span class="cmd cmd_detail" ><xsl:text> </xsl:text></span> 141 143 <span class="cmd cmd_columns" ><xsl:text> </xsl:text></span> 142 < xsl:call-template name="attr-detail-div" />144 <!-- <xsl:call-template name="attr-detail-div" /> --> 143 145 <!-- <div class="detail"> 144 146 <xsl:for-each select="@*" > … … 229 231 <xsl:choose> 230 232 <xsl:when test="@corresponding_component" > 231 <a target="_blank" href="{concat($components_viewer_uri, @corresponding_component)}" ><xsl:value-of select="@path" /></a> 233 <!-- <a target="_blank" href="{concat($components_viewer_uri, @corresponding_component)}" ><xsl:value-of select="@path" /></a> --> 234 <a target="_blank" href="{concat('', @corresponding_component)}" ><xsl:value-of select="@path" /></a> 232 235 </xsl:when> 233 236 <xsl:otherwise> … … 240 243 <td class="treecol" ><span class="cmd cmd_query" ></span><span class="cmd cmd_columns" ></span> 241 244 <span class="column-elem"><xsl:copy-of select="$path_anchored" /></span><span class="cmd cmd_info" ></span> 242 <xsl:if test="@datcat!=''" >[<a target="_blank" href="{@datcat}" ><xsl:value-of select="my:shortURL(@datcat)" /></a>]</xsl:if> 245 <xsl:if test="@datcat!=''" >[<a target="_blank" href="{@datcat}" > 246 <!-- <xsl:value-of select="my:shortURL(@datcat)" /> --> 247 <xsl:value-of select="''" /> 248 </a>]</xsl:if> 243 249 </td> 244 250 <!-- <td><xsl:value-of select="@path" />,<xsl:value-of select="@context" /></td>--> … … 255 261 256 262 <td class="number"> 257 < xsl:if test="not(Term)"><a class="value-caller" href="{my:formURL('values', 'htmllist', concat(@path,'&sort=size'))}" ><xsl:value-of select="format-number(@count_distinct_text,'#.##0','european')" /></a>258 <xsl:message><xsl:value-of select="concat('formURL: ',my:formURL('values', 'htmllist', concat(@path,'&sort=size')))"></xsl:value-of></xsl:message>259 </xsl:if> 263 <!-- <xsl:if test="not(Term)"><a class="value-caller" href="{my:formURL('values', 'htmllist', concat(@path,'&sort=size'))}" ><xsl:value-of select="format-number(@count_distinct_text,'#.##0','european')" /></a> 264 <xsl:message><xsl:value-of select="concat('formURL: ',my:formURL('values', 'htmllist', concat(@path,'&sort=size')))"></xsl:value-of></xsl:message> 265 </xsl:if>--> 260 266 <xsl:if test="Term"><xsl:value-of select="format-number(sum(descendant::Term/@count_distinct_text),'#.##0','european')" /></xsl:if> 261 267 </td> … … 270 276 271 277 </tr> 272 <xsl:if test="Term and ($lv<$ max_depth or $max_depth=0)">278 <xsl:if test="Term and ($lv<$x_maximumDepth or $x_maximumDepth=0)"> 273 279 274 280 <xsl:choose> … … 329 335 </span> 330 336 331 < xsl:call-template name="attr-detail-div" />337 <!-- <xsl:call-template name="attr-detail-div" /> --> 332 338 <ul> 333 339 <xsl:apply-templates select="context" mode="autocomplete" /> … … 389 395 <xsl:sort select="lower-case(@datcat)" order="ascending"/> 390 396 <tr> 397 <!-- 391 398 <td valign="top"><xsl:value-of select="my:shortURL(@datcat)"/></td> 392 399 <td valign="top"><xsl:value-of select="my:rewriteURL(@datcat)"/></td> 400 393 401 <td valign="top" align="right"> 394 402 <span class="detail-caller" ><xsl:value-of select="count(distinct-values(current-group()/@name))"/></span> … … 426 434 <xsl:value-of select="."/>, 427 435 </xsl:for-each> 428 </td> 436 </td> 437 --> 429 438 </tr> 430 439 </xsl:for-each-group>
Note: See TracChangeset
for help on using the changeset viewer.