<%-- superSimpInstrSearch.jsp ------------------------ A very simple search form for Instruments in the OERL relational database. Only has instrument type, project content area, and project organization. Submitted to doInstrSearch.jsp. Javscript Includes: focusWindow.js Dynamic Includes: uncheck.js submitToURL.js inc_tblHdrBGColor.html inc_tblIndentWidth.html inc_searchIntro.html inc_buttonsForm.html dinc_searchTitle.jsp Static Includes: sinc_checkEmptyProjectParams.jsp sinc_emptyFieldMessage.jsp sinc_formVars.jsp sinc_instrConstants.jsp sinc_oerlWebViewCon.jsp sinc_printEmptyProjectFields.jsp (forms) sinc_simpContentAreaForm.jsp sinc_organizationForm.jsp Created by zaz@sri.com. Last modified by zaz@sri.com, 3/10/03. --%> <%@ page errorPage="error.jsp" %> <%@ page import="java.sql.*" %> <%@ include file="../jspcode/sinc_instrConstants.jsp" %> <%@ include file="codefragments/sinc_formVars.jsp" %> <%-- Make connection to database using oerl_webview login --%> <%@ include file="../jspcode/sinc_oerlWebViewCon.jsp" %> <% boolean hasEmptyFields = false, hasEmptyInstrumentType = false; // Check to see if there are any unspecified search parameters // described in the HTTP request parameters if (request.getParameter("hasEmptyFields") != null) hasEmptyFields = true; if (request.getParameter("hasEmptyInstrumentType") != null) hasEmptyInstrumentType = true; // Check for empty project field parameters %><%@ include file="codefragments/sinc_checkEmptyProjectParams.jsp" %> OERL: Instruments: Search
home
  : Instruments : Search





























home reports instruments plans
search

<% // If there are empty parameters, print a message to that effect if (hasEmptyFields) { %> <% if (hasEmptyInstrumentType) { %> <% } %> <%@ include file="codefragments/sinc_printEmptyProjectFields.jsp" %> <% } %> <% String listAllQuery = "?ListAll=true"; listAllQuery += "&noProjectTypeField=true"; listAllQuery += "&noFundingSourceField=true"; listAllQuery += "&noContentAreaField=true"; listAllQuery += "&noOrganizationField=true"; listAllQuery += "&noInstrumentTypeField=true"; listAllQuery += "&noInstrumentTopicField=true"; listAllQuery += "&noFormatField=true"; %>

An advanced search for instruments is available, allowing you to also search by instrument topic, instrument format, project type, project funding source, and do a more refined search by project content area and instrument type. You can also view a list of all instruments.

> <% } else { %>><% } %> > <% } else { %>><% } %> > <% } else { %>><% } %>
For these Types of Instruments:
  checked <% } %> onClick="radioCheck('searchForm',this,'InstrumentTypeID')" > Choose All Instrument Types:
<% final int NUM_COLS_IT = 2; int it_id = -1, js_it_id = 1; values = request.getParameterValues("InstrumentTypeID"); // Make query and result set String itQuery = "SELECT InstrumentTypeID, InstrumentTypeName"; itQuery += " FROM InstrumentTypes"; itQuery += " ORDER BY InstrumentTypeName"; stmt = con.createStatement(); rs = stmt.executeQuery(itQuery); // How many rows per column? rs.last(); final int NUM_ROWS_IT = (int) Math.ceil(rs.getRow() / (double) NUM_COLS_IT); rs.beforeFirst(); %> <% // Generate InstrumentType/InstrumentSubType select elements from database while (rs.next()) { int cur_it_id = rs.getInt("InstrumentTypeID"); // If there is a new instrument type id, make the header if (it_id != cur_it_id) { if (!rs.isFirst() && (js_it_id - 1) % NUM_ROWS_IT == 0) { %> <% } %> checked <% } %> onClick="radioCheck('searchForm',this,'InstrumentTypesAll')" > <%= rs.getString("InstrumentTypeName") %>
<% it_id = cur_it_id; js_it_id++; } // closes if (it_id != rs.getInt("InstrumentTypeID")) clause } // closes while loop rs.close(); stmt.close(); %>
From Projects in these Content Areas:
<%@ include file="forms/sinc_simpContentAreaForm.jsp" %>
From Projects contributed by these Organizations:
<%@ include file="forms/sinc_organizationForm.jsp" %>
<% con.close(); %>