This section describes how to perform some common customizations on the Search provider.
Modify searchOnly.jsp file by adding last-modified to the list of viewAttributes.
For example:
<search:setViewAttributes viewAttributes="hl-url,hl-title,hl-description,score,content-length,hl-classification,last-modified"/> |
Modify results.jsp file to display the last-modified date for document results using the SOIF getValue tag.
For example:
<% if (formbean.getDescription().equals("full")) { %>
<FONT color=<%=tFontColor%> face=<%=tFontFace%>><search:getValue soifAttribute="description" escape="false"/></FONT><BR>
<FONT color=#707070 face=<%=tFontFace%>><search:getURL escape="true"/><BR>
<search:getValue soifAttribute="content-length" id="sz"/>
<search:getValue soifAttribute="last-modified"/><BR>
<% } %>
|
Run the touch command.
For example, type touch *.jsp.
Reload the Desktop to verify the change.
(Optional) Modify searchOnly.jsp file by removing content-length from the list of viewAttributes.
The line to modify is the following:
<search:setViewAttributes viewAttributes="hl-url,hl-title,hl-description,score,content-length,classification hl-classification"/> |
Remove content-length from this line.
Modify results.jsp file by removing the line that displays the content-length.
Comment the lines as shown here:
<%--
<search:getValue attribute="content-length" id="sz"/>
<jx:declare id="sz" type="java.lang.String"/>
<%
int sizek = 1;
try {
sizek = Math.max(1, (Integer.parseInt(sz) + 512)/1024 );
} catch (Exception e) {
}
%>
<i18n:message key="size" bundle="searchjsp"/>
<%= sizek %>k
--%>"
|
Run the touch command.
For example, type touch *.jsp.
Reload the Desktop to verify the change.
Comment out or remove the author related HTML from the advancedSearch.jsp file.
For example:
<!-- -->
<!-- To disclude the "author" row, remark out the following section -->
<!-- -->
<TR>
<td valign=middle align=right height=40><FONT color=<%=tFontColor%> face=<%=tFontFace%>><nobr> <LABEL FOR="advAuthor">Author</LABEL>
<SELECT NAME="authorOp">
<OPTION VALUE=<%=SearchContext.CONTAIN%> <%=formbean.authorOpSelection(SearchContext.CONTAIN)%>>does</OPTION>
<OPTION VALUE=<%=SearchContext.NOTCONTAIN%> <%=formbean.authorOpSelection(SearchContext.NOTCONTAIN)%>>does not</OPTION>
</SELECT>contain </FONT></nobr></TD>
<td valign=middle align=left height=40><INPUT TYPE="text" NAME="authorVal" id="advAuthor" VALUE= "<%=SearchContext.htmlEncode(formbean.getAuthorVal())%>"></TD>
</TR>
|
Comment out author- related lines in advQuery.jsp file.
if (!formbean.getAuthorVal().equals("")) {
h = new HashMap();
h.put(SearchContext.OPERAND, "author");
h.put(SearchContext.OPERATION, formbean.getAuthorOp());
h.put(SearchContext.VALUE, formbean.getAuthorVal());
l.add(h);
}
|
Run the touch command.
For example, type touch *.jsp.
Reload the Desktop to verify the change.
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 </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.
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);
}
|
Run the touch command.
For example, type touch *.jsp.
Reload the Desktop to verify the change.