Changeset 1866 for MDService2
- Timestamp:
- 04/06/12 20:36:22 (12 years ago)
- Location:
- MDService2/branches/MDService_simple3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_searchclause.js
r1800 r1866 696 696 697 697 }; 698 698 699 function findValueValue(e) { 700 var i = $('.focused','#searchclauselist').closest('.sc-i').attr("id"); 701 var j = $('.focused','#searchclauselist').closest('.sc-j').attr("id"); 702 //alert(i+ ',' + j + sValue); 703 var termsetitem = $('#' + 'sc' + i + '-' + j).find('.value-input').data('item'); 704 var termset = ""; 705 if (termsetitem != null) termset = termsetitem.key; 706 searchclauseset.searchclauses[i][j].value = e.value; 707 708 } 709 710 function selectItemValue(li) { 711 findValueValue(li); 712 } 713 714 function initValueAutocomplete(i,j,index, term_index){ 715 716 $('#' + 'sc' + i + '-' + j).find('.value-input').autocomplete({ 717 source: element_autocomplete[index].data[term_index].values, 718 autoFill:true, 719 width:150, 720 minLength: 0, 721 matchContains:true, 722 delay: 0, 723 select: function( event, ui ) { 724 $(this).data("item", ui.item); 725 selectItemValue(ui.item); 726 } 727 }).data( "autocomplete" )._renderItem = function( ul, item ) { 728 var t, re; 729 if (this.term == ""){ 730 t = item.value; 731 } else { 732 re = new RegExp(this.term + "+") ; 733 t = item.value.replace(re,"<span style='font-weight:bold;color:Blue;'>" + 734 this.term + 735 "</span>"); 736 } 737 738 return $( "<li></li>" ) 739 .data( "item.autocomplete", item ) 740 .append( "<a>" + t + "</a>" ) 741 .appendTo( ul ); 742 }; 743 744 745 // reset the index value 746 $('#' + 'sc' + i + '-' + j).find('.value-input').val(""); 747 searchclauseset.searchclauses[i][j].value = ""; 748 $('#' + 'sc' + i + '-' + j).find('.value-input').show(); 749 $('body').find('.ac_results').css({'z-index' : '1000'}); 750 751 752 $('.focused','#searchclauselist').find('.value-input').focus(); 753 754 755 }; 756 699 757 function findValueTerm(e) { 700 758 … … 709 767 searchclauseset.searchclauses[i][j].index = termset + ":" + e.value; 710 768 711 //handleTermsSelection(i,j,sValue); 769 //handleTermsSelection(i,j,sValue); 770 //find element value 771 var index; 772 $.each(element_autocomplete,function(i, item){ 773 if (this.key == elem.key){ 774 index = i; 775 return; 776 } 777 }); 778 var term_index; 779 $.each(element_autocomplete[index],function(i, item){ 780 if (this.key == e.key){ 781 term_index = i; 782 return; 783 } 784 }); 785 if (element_autocomplete[index].data[term_index].values.length == 0){ 786 jQuery.get(link('fcs','?operation=scan&scanClause=' + e.value),function(data){ 787 $(data).find('sru:term').each(function(i){ 788 element_autocomplete[index].data[term_index].values[i] = {label:$(this).find('sru:value').text()}; 789 }); 790 initValueAutocomplete(i,j, index, term_index); 791 }); 792 } else { 793 initValueAutocomplete(i,j, index, term_index); 794 } 795 712 796 713 797 } … … 716 800 findValueTerm(li); 717 801 } 718 719 802 720 803 function initTermsetAutocomplete(i,j,index){ … … 752 835 .append( "<a>" + t + "</a>" ) 753 836 .appendTo( ul ); 754 };837 }; 755 838 756 839 … … 805 888 jQuery.get(link('smc','list/?context=' + element_autocomplete[index].key),function(data){ 806 889 $(data).find('Term').each(function(i){ 807 element_autocomplete[index].data[i] = {label:$(this).text(), value:$(this).text(), id:$(this).attr("concept-id") };890 element_autocomplete[index].data[i] = {label:$(this).text(), value:$(this).text(), id:$(this).attr("concept-id"),values:[] }; 808 891 }); 809 892 initTermsetAutocomplete(i,j, index); -
MDService2/branches/MDService_simple3/src/eu/clarin/cmdi/mdservice/action/FCSAction.java
r1852 r1866 35 35 import eu.clarin.cmdi.mdservice.model.WorkspaceProfile; 36 36 import eu.clarin.cmdi.mdservice.proxy.FCSProxy; 37 import eu.clarin.cmdi.mdservice.proxy.LocalProxy; 37 38 import eu.clarin.cmdi.mdservice.proxy.MDRepoProxy; 38 39 import eu.clarin.cmdi.mdservice.proxy.Pz2Proxy; … … 93 94 94 95 @Override 95 public String getFullFormat() { 96 public String getFullFormat() { 97 //TODO how to get around ?? 98 if (getActionkey().equals("static")){ 99 return getActionkey() + "2" + getFormat(); 100 } 96 101 return getActionkey() + getOperation() + "2" + getFormat(); 97 102 } … … 142 147 // set defaults 143 148 149 if ((getParam("operation").equals("")) && (getParam("query").equals(""))){ 150 addParam("operation","explain"); 151 } 152 if ( (getParam("operation").equals("explain")) && (getParam("query").equals(""))){ 153 addParam("q", "explain"); 154 //TODO how to get around ? 155 this.setActionkey("static"); 156 } 144 157 if (params.get("x-context") != null){ 145 158 … … 195 208 //TODO case scan,explain 196 209 197 if ((getRepository().equals("")) && (getParam("operation").equals("scan"))){ 198 setTargetProxy(new WorkspaceProxy()); 199 return; 210 if (getRepository().equals("")){ 211 if ((getParam("operation").equals("scan")) && (getParam("scanClause").equals("fcs.resource"))){ 212 setTargetProxy(new WorkspaceProxy()); 213 return; 214 } 215 if (getParam("operation").equals("explain")){ 216 setTargetProxy(new LocalProxy()); 217 return; 218 } 219 200 220 } 201 221
Note: See TracChangeset
for help on using the changeset viewer.