Sun Java System Portal Server 7.1 Developer Sample Guide

ProcedureTo Add a New Field to Advanced Search

  1. Uncomment the keywords section in advancedSearch.jsp file.


    <!--     -->
    <!-- To Include the "Keywords" row, unremark the following section -->
    <!--
    <TR>
    <td valign=middle align=right height=40><FONT color=<%=tFontColor%> face=<%=tFontFace%>><nobr> <LABEL FOR="advKeywords">Keywords</LABEL>
    <SELECT NAME="keywordsOp">
    <OPTION VALUE=<%=SearchContext.CONTAIN%> <%=formbean.keywordsOpSelection(SearchContext.CONTAIN)%>>does</OPTION>
    <OPTION VALUE=<%=SearchContext.NOTCONTAIN%> <%=formbean.keywordsOpSelection(SearchContext.NOTCONTAIN)%>>does not</OPTION>
    </SELECT>contain&nbsp;</FONT></nobr></TD>
    <td valign=middle align=left height=40><INPUT TYPE="text" NAME="keywordsVal" id="advKeywords" VALUE= "<%=SearchContext.htmlEncode(formbean.getKeywordsVal())%>"></TD>
    </TR>
    -->

    Remove the <!-- and --> comment marks from this section.

  2. Add the keywords to advQuery.jsp file.


    if (!formbean.getKeywordsVal().equals("")) {
      h = new HashMap();
      h.put(SearchContext.OPERAND, "Keywords");
      h.put(SearchContext.OPERATION,formbean.getKeywordsOp());
      h.put(SearchContext.VALUE, formbean.getKeywordsVal());
      l.add(h);
    }
  3. Run the touch command.

    For example, type touch *.jsp.

  4. Reload the Desktop to verify the change.