Changeset 594
- Timestamp:
- Jun 21, 2010, 8:42:50 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/query/SimpleQueryController.groovy
r555 r594 33 33 onStart { 34 34 println "Starting webflow simpleQuery" 35 flow. term= null35 flow.search_term = null 36 36 flow.page = 0 37 37 flow.pages = [ … … 49 49 flow.page = 1 50 50 } 51 on("addCompound") {52 println "addCompound"53 }.to "query"54 55 on("addTransciptome") {56 println "addTransciptome"57 }.to "query"58 51 59 52 on("search") { 60 53 println "Search!" 61 println params 62 if (!params.term.trim()) { 54 if (!params.search_term.trim()) { 63 55 return [:] 64 56 } 65 66 flow.term = params.term67 57 }.to "searching" 68 58 … … 74 64 searching { 75 65 action { 66 67 println "Searching" 68 println params 69 70 flow.search_term = params.search_term 71 flow.search_sa_compounds = params.sa_compound 72 flow.search_sa_values = params.sa_value 73 flow.search_tt_genepaths = params.sa_genepath 74 flow.search_tt_regulations = params.sa_regulation 75 76 76 // Searchable plugin not yielding results yet 77 77 /* … … 85 85 86 86 // Search for the term in Terms 87 // results = searchableService.search(flow. term, type:"Term")87 // results = searchableService.search(flow.search_term, type:"Term") 88 88 89 89 // Map the Terms to Studies … … 112 112 println "Rendering resultPage" 113 113 flow.page = 2 114 println flow.term 114 115 if (flow.search_sa_compounds) { 116 if (flow.search_sa_compounds.class.getName() == "java.lang.String") { 117 flow.resultString = true 118 } else { 119 flow.resultString = false 120 } 121 } 122 123 println flow.search_sa_compounds.getClass() 115 124 } 116 125 117 126 on("reset") { 118 flow.term = null 119 flow.studies = null 127 flow.search_term = null 128 flow.studies = null 129 flow.search_sa_compounds = null 130 flow.search_sa_values = null 131 flow.search_tt_genepaths = null 132 flow.search_tt_regulations = null 120 133 println "Resetting query flow" 121 134 }.to "query" … … 126 139 127 140 } 128 129 130 131 132 133 141 } -
trunk/grails-app/views/simpleQuery/common/_query.gsp
r570 r594 10 10 11 11 <g:form action="pages" name="simpleQueryForm" id="simpleQueryForm"> 12 <g:if test="${ term}"><g:set var="preterm" value="${term}" /></g:if>12 <g:if test="${search_term}"><g:set var="preterm" value="${search_term}" /></g:if> 13 13 <div class="content"> 14 14 <div class="element"> 15 15 <div class="description">Search term (e.g. 'paracetamol')</div> 16 <div class="input"><g:textField name=" term" value="${preterm}" /></div>16 <div class="input"><g:textField name="search_term" value="${preterm}" /></div> 17 17 </div> 18 18 <div class="element"> … … 25 25 </div> 26 26 </div> 27 <g:submitButton name="search" value="Search" /> <g:if test="${ term}"><g:submitButton name="reset" value="Clear" /></g:if>27 <g:submitButton name="search" value="Search" /> <g:if test="${search_term}"><g:submitButton name="reset" value="Clear" /></g:if> 28 28 29 29 <br><br> … … 33 33 <div class="element"> 34 34 <div id="compoundGroup"> 35 <g:if test="${resultString}"> 35 36 <div id="compoundRow1"> 36 37 <div class="description">Compound (e.g. 'glucose')</div> 37 <div class="input"><g:textField name=" compound" value="" id="compound1"/></div>38 <div class="input"><g:textField name="sa_compound" value="${search_sa_compounds}"/></div> 38 39 <div class="description">Value</div> 39 <div class="input"><g:textField name=" compound_value" value="" id="compoundValue1"/></div>40 <div class="input"><g:textField name="sa_value" value="${search_sa_values}"/></div> 40 41 </div> 42 </g:if> 43 <g:else> 44 <g:each status="i" in="${search_sa_compounds}" var="compound"> 45 <div id="compoundRow${i}"> 46 <div class="description">Compound (e.g. 'glucose')</div> 47 <div class="input"><g:textField name="sa_compound" value="${compound}"/></div> 48 <div class="description">Value</div> 49 <div class="input"><g:textField name="sa_value" value="${search_sa_values[i]}"/></div> 50 </div> 51 </g:each> 52 </g:else> 41 53 </div> 42 54 <div id="addCompound">Add compound</div> … … 51 63 <div class="input"><g:textField name="genepath" value="" /></div> 52 64 <div class="description">Type of regulations</div> 53 <div class="input" ><g:select name="regulation" from="" value="${regulation}" noSelection="['':'--- select regulation ---']"/></div>65 <div class="input" id="regulationInput"><g:select name="regulation" from="" value="${regulation}" noSelection="['':'--- select regulation ---']"/></div> 54 66 </div> 55 67 </div> … … 61 73 <br><br> 62 74 63 <g:if test="${ term}">64 <h1><g:message code="Search results for term ${ term}"/></h1>75 <g:if test="${search_term}"> 76 <h1><g:message code="Search results for term ${search_term}"/></h1> 65 77 66 78 <g:if test="${listStudies}"> -
trunk/web-app/js/simpleQuery.js
r570 r594 23 23 $('#addCompound').click(function() { 24 24 var compoundGroup = document.getElementById('compoundGroup'); 25 26 25 var newCompoundDiv = document.createElement('div'); 27 26 newCompoundDiv.setAttribute('id', 'compoundRow' + compoundCounter); 28 27 29 newCompoundDiv.innerHTML = '<div class="description">Compound</div> <div class="input"><input type="text" name="compound" value=""></div> <div class="description">Value</div> <div class="input"><input id="compoundValue' + compoundCounter + '" type="text"></div>'; 28 var newCompoundRowDiv1 = document.createElement('div'); 29 newCompoundRowDiv1.setAttribute('class', 'description'); 30 newCompoundRowDiv1.innerHTML = "Compound"; 31 newCompoundDiv.appendChild(newCompoundRowDiv1); 32 33 var newCompoundRowDiv2 = document.createElement('div'); 34 newCompoundRowDiv2.setAttribute('class', 'input'); 35 newCompoundRowDiv2.innerHTML = '<input type="text" name="sa_compound" value="">'; 36 newCompoundDiv.appendChild(newCompoundRowDiv2); 37 38 var newCompoundRowDiv3 = document.createElement('div'); 39 newCompoundRowDiv3.setAttribute('class', 'description'); 40 newCompoundRowDiv3.innerHTML = "Value"; 41 newCompoundDiv.appendChild(newCompoundRowDiv3); 42 43 var newCompoundRowDiv4 = document.createElement('div'); 44 newCompoundRowDiv4.setAttribute('class', 'input'); 45 newCompoundRowDiv4.innerHTML = "<input type='text' name='sa_value' value=''>"; 46 newCompoundDiv.appendChild(newCompoundRowDiv4); 30 47 31 48 compoundGroup.appendChild(newCompoundDiv); … … 39 56 var transcriptomeGroup = document.getElementById('transcriptomeGroup'); 40 57 var newTranscriptomeDiv = document.createElement('div'); 41 42 58 newTranscriptomeDiv.setAttribute('id', 'transcriptomeRow' + transcriptomeCounter); 43 59 … … 59 75 var newTranscriptomeRowDiv4 = document.createElement('div'); 60 76 newTranscriptomeRowDiv4.setAttribute('class', 'input'); 61 var newSelectBox = document.getElementById('regulation ');77 var newSelectBox = document.getElementById('regulationInput'); 62 78 newTranscriptomeRowDiv4 = newSelectBox.cloneNode(true); 63 79 newTranscriptomeRowDiv4.setAttribute('id', 'regulation' + transcriptomeCounter);
Note: See TracChangeset
for help on using the changeset viewer.