FindinSite-JS: Search engine for a Java server website   .
  search
Powered by FindinSite-JS
. Home | Installation | Indexing | Configuration | Advanced | Purchasing .
. .
  Init parameters | Look and Feel | Languages | Word highlighting | Runtime parameters | Rules | Subsets | Meta-data fields

 

findinsite-js look and feel


Introduction

This page describes how to customise the look and feel of the findinsite-js web pages:
  • Template files customise all the basic HTML for returned pages, with template variables updated depending on the results
  • The language support can be changed or enhanced.
  • The results can be reordered in various ways.
  • If you want word counts on each hit page, you have to enable this.
  • Alter the hits per results page from the default of 10.

Character Sets:
It is very important that the page header (and other template files) use the %META_CHARSET% variable to specify the page charset. If this is not set then findinsite-js may interpret typed characters incorrectly. Currently findinsite-js always uses "UTF-8" for %META_CHARSET%, so your templates should be encoded using the UTF-8 charset.

Here is a full list of the available options:

  Supplied file Description
Initial search page index.html This is the static findinsite-js welcome page.  Alternatively, you can get findinsite-js to generate a localised search page for you. See below.
Page header findhead.htt See below for more details.

These template files can also include other pages, including JSP pages that can refer to findinsite-js session variables.

Results top findtop.htt
Results line detail findline.htt
Results bottom findbot.htt
Page footer findfoot.htt
Languages   Languages can be added or altered - see the languages page.
Get word count   If you want word counts on each hit page, you have to enable this - see the look and feel page.
Results order   The results can be reordered in various ways - see the look and feel page.
Pages per results sheet   Alter the ResultsPerSheet form runtime parameter in a search page if you do not wish to use the default of 10 pages per results sheet.


Initial search page

  • You can use the findinsite-js welcome page to show to your users if you want.  The URL for this page varies from case to case, but might be http://localhost/findinsitejs/ which usually actually shows the file index.html in the findinsitejs directory.

    If you use the welcome page, you will almost certainly want to alter its HTML.  Note that this is a static HTML page.

  • Most people will probably want to display the findinsite-js generated search page, because this is localised for each user.  The look and feel of this search page can be changed using configurable template files as described below.

    Again, the URL for the findinsite-js search page will vary, but might be http://localhost/findinsitejs/search.  This search page is dynamically generated by findinsite-js.

  • Alternatively, add a search form to an existing page to call findinsite-js.


Template files

These configurable template files determine the appearance of the pages produced by findinsite-js, as follows:

Configuration screen box Init parameter Description
Heading file heading The heading at the top of every findinsite-js page
Top file top The extra heading at the top of search results
Line file line Each findinsite-js results line
Bottom file bot The extra footer at the bottom of search results
Footer file footer The footer at the bottom of every findinsite-js page
The Free version always inserts an additional findinsite-js footer.

findinsite-js gets the name of each file from the values set in the configuration screen Look and Feel section.  However, if any file is not available then findinsite-js supplies a basic default value.

Each template file can contain any HTML.  However, each file is a template, so any instance of a findinsite-js variable is replaced with a suitable value at runtime.  The heading and footer template files may contain Heading and Footer Variables.  The top and bottom template files may contain Top and Bottom Variables.  The results line template file should contain Result Line Variables.

Each template file may use %INCLUDE=...% directives to include other pages in the output, as described below. The included pages may be static files or dynamically generated. An included JSP page may refer to various findinsite-js session variables.


Heading and Footer Variables

Heading and Footer variables are replaced at runtime by findinsite-js in the heading and footer template files.

As well as ordinary HTML (of any sort), findinsite-js replaces any instances of the following variable names with the described text.  If the description says that the text is localised then the text is taken from the language file for the user's preferred language.  See the findhead.htt and findfoot.htt files in the findinsite-js Web Application directory for examples of these variables in use.

Parameter
name
Description Example
%APPNAME% The findinsite-js application name FindinSite-JS
%CONTAINS% The total number of pages and words in all the search database subsets
Localised
7 pages and 1327 words
%COPYRIGHT% The findinsite-js copyright message Copyright © 1998-2011 PHD Computer Consultants Ltd
%DB_CREATION_DATE% The first subset search database creation date 12/4/2006
%DB_DESCRIPTION% The first subset search database description FindinSite-JS: Site Search engine
%DB_FILENAME% The filenames of all the search database subsets index1
%INCLUDE=..% Includes another page in the output - see below %INCLUDE=/jsp/head.jsp%
%INDEX_DESCRIPTION% The index description, set in the Searching section of the online configuration screen
%INSTRUCTIONS% Localised basic instructions for using findinsite-js
%L_APPNAME_SERVER% Localised description for findinsite-js FindinSite-JS Site Search Tool
%L_CONTAINS% Localised phrase for Contains Contains
%L_INDEX% Localised phrase for Index Index
%L_LANGUAGE% Localised phrase for Language Language
%L_SEARCH% Localised phrase for Search Search
%L_SEARCH_FOR% Localised phrase for Search for: Search for:
%L_SERVER_ERROR% Localised phrase for FindinSite-JS error FindinSite-JS error
%L_SERVER_RESULT% Localised phrase for FindinSite-JS Results FindinSite-JS Results
%LANGUAGE_NAME% The localised name of the language file for the current user Deutsch (German)
%LANGUAGES% A list of links to set the user interface language used by findinsite-js
%META_CHARSET% The charset used by findinsite-js to encode its output characters UTF-8
%PAGES% The total number of pages in all the search database subsets 7
%SEARCH_TEXT% The last search entered CD and Search
%FIELDS_TEXT% The last field search terms entered [keywords:search] [lang:en]
%SERVER% The server details ApacheJServ/1.1.2 (JSDK 0.0)
Apache Tomcat/4.0.1 (JSDK 2.3)
Apache Tomcat/4.1.12 (JSDK 2.3)
Apache Tomcat/5.0.28 (JSDK 2.4)
Apache Tomcat/5.5.9 (JSDK 2.4)
Borland-Apache Tomcat/4.0.3 (JSDK 2.3)
WebLogic WebLogic Server 7.0 SP1 Mon Sep 9 22:46:58 PDT 2002 206753 (JSDK 2.3)
EzWebTools Lightweight Servlet Engine/1.0 (JSDK 2.2)
IBM WebSphere Application Server/4.0 (JSDK 2.2)
iMatix Servlet Runner (JSDK 0.0)
iPlanet-WebServer-Enterprise/6.0 (JSDK 2.2)
JRun 3.1 3.1.15506 (JSDK 2.2)
JRun 3.0 3.01.5870 (JSDK 2.2)
JRun 3.0 3.00.3694 (JSDK 2.2)
Sun ONE Application Server (JSDK 2.3)
Tomcat/2.1 (Java 1.3.0; Windows 2000 5.1 x86; java.vendor=Sun Microsystems Inc.) (JSDK 2.1)
Tomcat Web Server/3.1 (JSP 1.1; Servlet 2.2; Java 1.3.0; Windows 2000 5.1 x86; java.vendor=Sun Microsystems Inc.) (JSDK 2.2)
%SUPPORTEMAIL% The PHDCC support email address support@phdcc.com
%THIS_URL% The URL to get back to findinsite-js with no GET query appended http://www.findinsite.info/findinsitejs/search
%VERSION% The findinsite-js version number 6.05
%VERSION_DATE% The findinsite-js version date 19 October 2009
%WORDS% The total number of different words in all the search database subsets 1327


Top and Bottom Results Variables

Top and Bottom variables are replaced at runtime by findinsite-js in the top and bottom results template files.

As well as ordinary HTML (of any sort), findinsite-js replaces any instances of the following variable names with the described text.  If the description says that the text is localised then the text is taken from the language file for the user's preferred language.  See the findtop.htt and findbot.htt files in the findinsite-js Web Application directory for examples of these variables in use.

Parameter
name
Description Example
%HITS% The number of hits 15
%INCLUDE=..% Includes another page in the output - see below %INCLUDE=/jsp/top.jsp%
%L_HITS_TEXT% Localised phrase for 1 page found 15 pages found
%L_NEXT_SHEET% Localised phrase for Next as a link.
Empty if no next sheet
Próximo
%L_PREV_SHEET% Localised phrase for Previous as a link.
Empty if no previous sheet
Vorherige Suchergebnisse
%L_SEARCH_RESULTS_FOR% Localised phrase for Search results for: Résultats de la recherche pour:
%L_STOP_WORDS% Localised list of ignored common words in the search text Ignored common words: the a
%SEARCH_TEXT% The search text brown car
%FIELDS_TEXT% The last field search terms entered [keywords:search] [lang:en]
%SHEET_DECADE% A set of approx 12 sheet number links near the current sheet 9 10 11 12 13 14 15 16 17 18 19 20 21
%SHEET_FIRST% First sheet number as a link. 1
%SHEET_FIRST_DOTS% First sheet number as a link followed by  .. 
Empty if first sheet in %SHEET_DECADE%
1 .. 
%SHEET_LAST% Last sheet number as a link. 1
%SHEET_LAST_DOTS% Last sheet number as a link preceded by  .. 
Empty if last sheet in %SHEET_DECADE%.
 .. 25
%SHEET_NO% The results sheet number 2

The default text for both the top and bottom template is: <p>%L_SEARCH_RESULTS_FOR% <span style='background-color:#FFDDFF;'><code>%SEARCH_TEXT%%FIELDS_TEXT%</code></span>
%L_STOP_WORDS%
&nbsp;&nbsp;%L_HITS_TEXT%&nbsp;&nbsp;
%L_PREV_SHEET% %SHEET_NO% %L_NEXT_SHEET%&nbsp; %SHEET_FIRST_DOTS% %SHEET_DECADE% %SHEET_LAST_DOTS%</p>


Result Line Variables

When findinsite-js lists the hit pages that it has found, it uses the contents of the line file as its display template.  See the file findline.htt in the findinsite-js Web Application directory for examples of these variables in use.

The line file can contain any HTML.  However, it will mainly contain result variables, described in this list:

Tag name Description
%ABSTRACT% An abstract for the found file
%FILENAME% The filename of the found file
%FILENAME_LINK% The filename of the found file, as an HTML link
%INCLUDE=..% Includes another page in the output - see below
%RESULTNO% The result number
%TITLE% The title of the found file
%TITLE_LINK% The title of the found file, as an HTML link
%URL% The full URL of the found file
%URL_LINK% The full URL of the found file, as an HTML link
%WORDCOUNT% The total count of all search words in the found file


Example line template

The default text for the line template is:
<dl><dt><b>%RESULTNO%. %TITLE_LINK%</b> %FILENAME%</dt><dd>%ABSTRACT%</dd></dl>

Here is an example of what this result will look like, in the middle of a results list:

3. findinsite-js Configuration Screen config.htm
How to use the online configuration screen of findinsite-js
4. findinsite-cd rules for Word stemming and Synonyms rules.htm
findinsite-cd rules for Word stemming and Synonyms


Template Include Directives

This feature will not work in older (JSK2.0) servlet engines such as Apache JServ.

Any of the template files may use a directive %INCLUDE=...% to include another file or page in the findinsite-js output. The page name must start with /, and must not be in quotes. The actual page must be in the findinsite-js application context directory (or one of its sub-directories).

The following examples assume a directory and file structure similar to the following, where header.htt and the jsp directory have been added to the standard findinsite-js runtime.

D:\Tomcat5.5\WebApps\findinsitejs\ WEB-INF\ ..
header.htt
jsp\ top.jsp
line.jsp

Use the following in a findinsite-js template file (eg findhead.htt) to include the contents of file header.htt in the findinsite-js output.

%INCLUDE=/header.htt%

A template file can refer to a JSP file if you want, eg:

%INCLUDE=/jsp/top.jsp%


JSP Template include session variables

Although you cannot directly pass parameters to an included JSP page, a JSP page can access various findinsite-js session variables. This lets you manipulate the findinsite-js output in a JSP program.

Use the JSP session.getAttribute() function to access the various findinsite-js variable objects. This example shows a JSP page that simply outputs three of the findinsite-js session variables:

SearchText <%=session.getAttribute("SearchText")%>
SheetNo <%=session.getAttribute("SheetNo")%>
ResultsPerSheet <%=session.getAttribute("ResultsPerSheet")%>

The following session variables are available, and valid as indicated. The type of each variable objects is also given. All the objects used have implicit toString() methods that allow them to be printed out simply as shown above. The "SearchText", "Title" and "Abstract" strings are made HTML-safe for printing out in a browser.

Header, Footer, Top, Bottom and Line
SearchText String
SheetNo Integer
ResultsPerSheet Integer
Top, Bottom and Line
hits Integer
SHEET_LAST Integer
Line
ResultNo Integer
Title String
Filename String
URL String
Abstract String
WordCount Integer
  All site Copyright © 1996-2011 PHD Computer Consultants Ltd, PHDCC   Privacy  

Last modified: 21 October 2009.

Valid HTML 4.01 Transitional Valid CSS!