Revision 4971
Added by daigle almost 15 years ago
searchWorkflow.js | ||
---|---|---|
1 |
/* |
|
2 |
* '$RCSfile$' |
|
3 |
* Purpose: Basic funtions to support searching workflows |
|
4 |
* Copyright: 2009 Regents of the University of California and the |
|
5 |
* National Center for Ecological Analysis and Synthesis |
|
6 |
* Authors: Michael Daigle |
|
7 |
* |
|
8 |
* '$Author: leinfelder $' |
|
9 |
* '$Date: 2008-06-17 13:16:32 -0700 (Tue, 17 Jun 2008) $' |
|
10 |
* '$Revision: 4006 $' |
|
11 |
* |
|
12 |
* This program is free software; you can redistribute it and/or modify |
|
13 |
* it under the terms of the GNU General Public License as published by |
|
14 |
* the Free Software Foundation; either version 2 of the License, or |
|
15 |
* (at your option) any later version. |
|
16 |
* |
|
17 |
* This program is distributed in the hope that it will be useful, |
|
18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
20 |
* GNU General Public License for more details. |
|
21 |
* |
|
22 |
* You should have received a copy of the GNU General Public License |
|
23 |
* along with this program; if not, write to the Free Software |
|
24 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
25 |
*/ |
|
26 |
|
|
1 | 27 |
/* |
2 | 28 |
* Generate a workflow query string. this assumes that search fields meet the |
3 | 29 |
* following criteria in the web page: |
4 |
* -- search input fields have an ID that starts with sf_ |
|
5 |
* -- the search input field name is the xpath of the value to search |
|
30 |
* -- search input fields have an ID that starts with sf- |
|
6 | 31 |
* -- if there is a search mode dropdown for an input field in the form, it's ID |
7 |
* should use the same convention as the input field, but start with sm_ |
|
8 |
* (i.e. the search mode input for the sf_firstname input would be sm_firstname) |
|
9 |
* -- the value |
|
32 |
* should use the same convention as the input field, but start with sm- |
|
33 |
* (i.e. the search mode input for the sf-firstname input would be sm-firstname) |
|
10 | 34 |
*/ |
11 |
|
|
12 | 35 |
function setWorkflowQueryFormField(formId) { |
13 | 36 |
var queryString = ""; |
14 | 37 |
queryString += "<pathquery version='1.2'>"; |
... | ... | |
46 | 69 |
queryField.value = queryString; |
47 | 70 |
} |
48 | 71 |
|
72 |
/* |
|
73 |
* Generate individual query terms for all the search input fields in a search |
|
74 |
* form. There must be a case for each search field handle explicitly below. |
|
75 |
* This assumes: |
|
76 |
* -- search input fields have an ID that starts with sf- |
|
77 |
* -- if there is a search mode dropdown for an input field in the form, it's ID |
|
78 |
* should use the same convention as the input field, but start with sm- |
|
79 |
* (i.e. the search mode input for the sf-firstname input would be sm-firstname) |
|
80 |
*/ |
|
49 | 81 |
function getQueryTerm(sfElement) { |
50 | 82 |
var baseId = sfElement.id.substring(3, sfElement.id.length); |
51 | 83 |
var searchMode = "contains"; |
... | ... | |
115 | 147 |
return pathExpr; |
116 | 148 |
} |
117 | 149 |
|
118 |
function getResultsSection(url, formId, divId) { |
|
119 |
var submitResults = submitFormIntoDiv(url, formId, divId); |
|
120 |
} |
|
121 |
|
|
122 |
function showWorkflowRuns(workflowId, workflowRunPage) { |
|
123 |
url = document.URL + '/../' + workflowRunPage + '?workflowid=' + workflowId; |
|
124 |
//alert('new url: ' + url); |
|
125 |
window.location = url; |
|
126 |
} |
|
127 |
|
|
128 | 150 |
|
Also available in: Unified diff
Beef up comments