Project

General

Profile

« Previous | Next » 

Revision 5993

include data search - new form fields and semQuery schema to allow searching for Characteristics data

View differences:

lib/style/skins/semtools/search.js
32 32
        	    if (searchValue!="") {
33 33
	        	    submitFormObj.query.value += 
34 34
	        	    	"<condition " +
35
		        		"concept='" + searchClass + "' " +
36
						"operator='EQUALS'>" +
37
						searchValue +
38
					"</condition>";
35
		        		"type='" + searchClass + "' " +
36
		        		"concept='" + searchValue + "' " +
37
					"/>";
39 38
        	    }
40 39
    		} else {
41 40
	        	for (var i=0; i < submitFormObj.activeEntitiesValue.length; i++) {
42 41
	        		var searchClass = submitFormObj.activeEntitiesClass[i].value;
43 42
	        	    var searchValue = submitFormObj.activeEntitiesValue[i].value;
44 43
	        	    if (searchValue!="") {
45
		        	    submitFormObj.query.value += 
44
	        	    	submitFormObj.query.value += 
46 45
		        	    	"<condition " +
47
			        		"concept='" + searchClass + "' " +
48
							"operator='EQUALS'>" +
49
							searchValue +
50
						"</condition>";
46
			        		"type='" + searchClass + "' " +
47
			        		"concept='" + searchValue + "' " +
48
						"/>";
51 49
	        	    }
52 50
	        	}
53 51
    		}
......
55 53
    		if (submitFormObj.activeCharacteristicsClass.value) {
56 54
    			var searchClass = submitFormObj.activeCharacteristicsClass.value;
57 55
        	    var searchValue = submitFormObj.activeCharacteristicsValue.value;
56
        	    var dataValue = submitFormObj.dataValue.value;
57
        	    var dataOperator = submitFormObj.dataOperator.value;
58 58
        	    if (searchValue!="") {
59 59
	        	    submitFormObj.query.value += 
60 60
	        	    	"<condition " +
61
		        		"concept='" + searchClass + "' " +
62
						"operator='EQUALS'>" +
63
						searchValue +
61
		        		"type='" + searchClass + "' " +
62
		        		"concept='" + searchValue + "' " +
63
						"operator='" + dataOperator + "'>" +
64
						dataValue +
64 65
					"</condition>";
65 66
        	    }
66 67
    		} else {
67 68
	        	for (var i=0; i < submitFormObj.activeCharacteristicsValue.length; i++) {
68 69
	        		var searchClass = submitFormObj.activeCharacteristicsClass[i].value;
69 70
	        	    var searchValue = submitFormObj.activeCharacteristicsValue[i].value;
71
	        	    var dataValue = submitFormObj.dataValue[i].value;
72
	        	    var dataOperator = submitFormObj.dataOperator[i].value;
70 73
	        	    if (searchValue!="") {
71
		        	    submitFormObj.query.value += 
74
	        	    	submitFormObj.query.value += 
72 75
		        	    	"<condition " +
73
			        		"concept='" + searchClass + "' " +
74
							"operator='EQUALS'>" +
75
							searchValue +
76
			        		"type='" + searchClass + "' " +
77
			        		"concept='" + searchValue + "' " +
78
							"operator='" + dataOperator + "'>" +
79
							dataValue +
76 80
						"</condition>";
77 81
	        	    }
78 82
	        	}
......
82 86
    			var searchClass = submitFormObj.activeProtocolsClass.value;
83 87
        	    var searchValue = submitFormObj.activeProtocolsValue.value;
84 88
        	    if (searchValue!="") {
85
	        	    submitFormObj.query.value += 
89
        	    	submitFormObj.query.value += 
86 90
	        	    	"<condition " +
87
		        		"concept='" + searchClass + "' " +
88
						"operator='EQUALS'>" +
89
						searchValue +
90
					"</condition>";
91
		        		"type='" + searchClass + "' " +
92
		        		"concept='" + searchValue + "' " +
93
					"/>";
91 94
        	    }
92 95
    		} else {
93 96
	        	for (var i=0; i < submitFormObj.activeProtocolsValue.length; i++) {
94 97
	        		var searchClass = submitFormObj.activeProtocolsClass[i].value;
95 98
	        	    var searchValue = submitFormObj.activeProtocolsValue[i].value;
96 99
	        	    if (searchValue!="") {
97
		        	    submitFormObj.query.value += 
100
	        	    	submitFormObj.query.value += 
98 101
		        	    	"<condition " +
99
			        		"concept='" + searchClass + "' " +
100
							"operator='EQUALS'>" +
101
							searchValue +
102
						"</condition>";
102
			        		"type='" + searchClass + "' " +
103
			        		"concept='" + searchValue + "' " +
104
						"/>";
103 105
	        	    }
104 106
	        	}
105 107
    		}	
......
108 110
    			var searchClass = submitFormObj.activeMeasurementsClass.value;
109 111
        	    var searchValue = submitFormObj.activeMeasurementsValue.value;
110 112
        	    if (searchValue!="") {
111
	        	    submitFormObj.query.value += 
113
        	    	submitFormObj.query.value += 
112 114
	        	    	"<condition " +
113
		        		"concept='" + searchClass + "' " +
114
						"operator='EQUALS'>" +
115
						searchValue +
116
					"</condition>";
115
		        		"type='" + searchClass + "' " +
116
		        		"concept='" + searchValue + "' " +
117
					"/>";
117 118
        	    }
118 119
    		} else {
119 120
	        	for (var i=0; i < submitFormObj.activeMeasurementsValue.length; i++) {
120 121
	        		var searchClass = submitFormObj.activeMeasurementsClass[i].value;
121 122
	        	    var searchValue = submitFormObj.activeMeasurementsValue[i].value;
122 123
	        	    if (searchValue!="") {
123
		        	    submitFormObj.query.value += 
124
	        	    	submitFormObj.query.value += 
124 125
		        	    	"<condition " +
125
			        		"concept='" + searchClass + "' " +
126
							"operator='EQUALS'>" +
127
							searchValue +
128
						"</condition>";
126
			        		"type='" + searchClass + "' " +
127
			        		"concept='" + searchValue + "' " +
128
						"/>";
129 129
	        	    }
130 130
	        	}
131 131
    		}
lib/style/skins/semtools/index.jsp
451 451
		$("#" + containerId).append(clone);
452 452
	});
453 453
	
454
	// get the current data values (and operator)
455
	$("#" + containerId).append("(");
456
	$(".dataClass").each(function(index) {
457
		var clone = $(this).clone();
458
		var value = $(this).val();
459
		var name = $(this).attr("name");
460
		var id = $(this).attr("id");
461
		
462
		// put the data conditions in as hidden params
463
		$("#" + containerId).append("<input type='hidden' name='" + name + "' id='" + id + "' value='" + value + "'");
464
		// with a text representation
465
		if (index > 0) {
466
			$("#" + containerId).append(" ");
467
		}
468
		$("#" + containerId).append(value);
469
		
470
	});
471
	$("#" + containerId).append(")");
472
	
454 473
	// add the remove button
455 474
	var removeButtonId = containerId + "_remove";
456 475
	$("#" + containerId).append("<input type='button' value='Remove' id='" + removeButtonId + "'/>");
......
570 589
										<input type="hidden" class="conceptValue" name="activeCharacteristicsValue" id="activeCharacteristicsValue" title="Characteristic"/>
571 590
										<input type="hidden" class="conceptClass" name="activeCharacteristicsClass" id="activeCharacteristicsClass" value="http://ecoinformatics.org/oboe/oboe.1.0/oboe-core.owl#Characteristic"/>
572 591
									</div>
592
									
573 593
								</td>
574 594
							</tr>
595
							<tr>
596
								<th>
597
									<p>and data values</p>
598
								</th>
599
							</tr>
600
							<tr>
601
								<td>
602
									<div id="characteristicData">
603
										<select id="dataOperator" name="dataOperator" class="dataClass">
604
											<option value="EQUALS">=</option>
605
											<option value="NOT EQUALS">!=</option>
606

  
607
											<option value="LESS THAN OR EQUALS">&lt;=</option>
608
											<option value="LESS THAN">&lt;</option>
609
											<option value="GREATER THAN OR EQUALS">&gt;=</option>
610
											<option value="GREATER THAN OR EQUALS">&gt;</option>
611

  
612
											<option value="LIKE">like</option>
613
											<option value="NOT LIKE">not like</option>
614
										</select>
615
										<input type="text" id="dataValue" name="dataValue" class="dataClass"/>
616
									</div>
617
								</td>
618
							</tr>
575 619
						</table>
576 620
					</td>
577 621
					<td>

Also available in: Unified diff