Content of this page:
Before you start -read this FIRST!
PersonalSearch 1.0 -> 4.0:
Upgrading
from previous versions of PersonalSearch
Major
changes since PersonalSearch 1.0
Step by step:
FirstStep:
Creating a search file
SecondStep:
Adding Applet-code to the client-page
Third Step: Upload
Advanced features:
READ
THIS FIRST: Inserting parameters in a html document - a crash course
Changingthe
Colors
Label to display
Changing the
language
Disabling
fast / parse search
Other:
Limitations of the programs
Problems?
Credits
Before you start - read thisFIRST!
The search applet, "PSearch.jar", which your visitors use, will only work in browsers supporting java 1.1and higher (That means : Netscape Communicator 4.06 and above and Internet Explorer 4.0 and above!). The applet will not load if your visitor uses another browser (as far as I know). It might also run in the HotJava Browser- I haven't testet it.
All programming by Ulrik Magnusson, November 1998 - Mai 1999.NoRights
Reserved!!
Upgrading from a previous versionof PersonalSearch
If the old version is less than 3.0:
Download "Formatter.zip" from : http://www.geocities.com/SunsetStrip/Palladium/1303/java/SearchSite/Formatter.zip
(It's less than 2 kb).
Unzip it and follow the instructions in "README.txt".
Replace the old "search.jar" with the new "PSearch.jar" at your
site and upload "help.txt".
Also replace the old "search.txt" with the "search.txt" generated
by the formatter.
You will need to change the applet reference in your searchpage
to:
<applet CODE='SearchInterface.class' ARCHIVE='PSearch_4.0.jar'
WIDTH='520' HEIGHT='334' ALT="Your browserdoes
not support Java 1.1">
Your browser does not support Java 1.1!!
</applet>
You can uninstall the old version (if it's less than version 3.0)-
this one does not need to be set up.
Major Changes since PersonalSearch1.0
The applet:
First Step: Creating a searchfile:
BE CAREFUL!!! The search file is not checked by the applet.
NB! If you don't use "Notepad" to edit, please save the file as "textfile"
- this will leave out any additional formatting.
This information is also provided in the "search.txt" provided withthe distribution.
Here is the syntax of a search file:
<line><newline><line><newline>.....<line><newline>
<line> = <keywords> "|" <URL> "|"<Title>
<URL> must end with ".html","htm", ".asp"
or ".txt"
An example:
These are keywords|http://www.bogus.com/index.htm|Bogus site
Here the title of the page is "Bogus site",
its URL "http://www.bogus.com/index.htm" and
the keywords associated with this URL "These arekeywords"
Here is an example of a "search.txt" file (in a texteditor - word, wordpad,Notepad) with three entries:
Ulrik Magnusson Menu|http://www.geocities.com/SunsetStrip/Palladium/1303/index.htm|MainPage
info|http://www.geocities.com/SunsetStrip/Palladium/1303/about.htm|Aboutthis
Site
|http://www.geocities.com/SunsetStrip/Palladium/1303/java/SearchSite/manual.htm|PersonalSearchmanual
Notice that the last one has no keywords - insert 2 "spaces" in stead.
Remember that "parse search" will fail if you list links to other serversor
have files that do not end on ".htm", ".html", ".asp" or ".txt".
NB! If you disable "fast search" you don't need to provide keywords
and title, just
put a space instead.
Comments:
In this version you can add comments by starting a line with *, e.g.:
You can add as many as you like and whereever you like - they willbe
ignored.
Ulrik Magnusson Menu|http://www.geocities.com/SunsetStrip/Palladium/1303/index.htm|MainPage
* This is a comment
* The next entry is the info page for the site
info|http://www.geocities.com/SunsetStrip/Palladium/1303/about.htm|Aboutthis
Site
* The next entry is the manual for PersonalSearch
|http://www.geocities.com/SunsetStrip/Palladium/1303/java/SearchSite/manual.htm|PersonalSearchmanual
Notice that the applet will return the results in the order they areentered
in "search.txt". If you have a main
page, it would probably to make sense to put this as the first entryetc.
Second Step: Adding Applet-code to the client-page:
I have created a hypertext document you can use as the search-page foryour
site - "searchpage.htm" - feel
free to edit the page.
The essential code in the document is the applet-code:
<center><table BORDER ><tr><td WIDTH="508"><center>
<applet CODE='SearchInterface.class' ARCHIVE='PSearch_4.0.jar'
WIDTH='520' HEIGHT='334' ALT="Your browserdoes
not support Java 1.1"
<b><font color="#FF0000"><font size=+2>
Your browser does not support Java 1.1!!
</font></font>
</applet></center></td></tr></table></center>
You are on your own if you edit this!
Third Step : Upload
In the Directory "C:\UMsoft\PSearch\" you will find 4 files you needto upload: "PSearch.jar", "help.txt", "search.txt"and "searchpage.htm". You will need to upload all of these to yoursite, and they must be placed in the same directory!
You also need to upload a language file - the language files are "english.txt","spanish.txt", "italian.txt" and "french.txt"- The applet will use the language you upload. You will also need to set the LANGUAGE_FILE parameter if you dont upload "english.txt".
NB! "help.txt" contains the text displayed when pressing "help" - you
can edit this if you like.
NB! "PSearch_4.0.jar" is the compressed applet.
On the 2nd time you upload, you only need to upload the "search.txt" file!.
Load "searchpage.htm" in your browser - you need to load the "searchpage.htm"that
resides
on a server - testing the local version will fail.
Click "Help" in the applet for instructions on how to search.
"fast search" only loads "search.txt" and searches through this.
"parse search" loads all files specified by their url in "search.txt".It
searches through all files.
If you have less than 100 pages:
Try setting the maximum results to 100 and click "Search!"
This should produce a list of all files you specified in "search.txt".
If a file is missing, open the Java console. It should say "Error:unable
to read....". If that is the case you
have probably included a non-existing file or a file that does
not have the extension ".html",".htm",".txt" or ".asp".
"fast search" should not fail if "search.txt" is correctly formatted as specified above.
If you have more than 100 pages: You need to make a test plan that will
return hits on all pages.
Inserting parameters in a html document- a crash course
You can control how the applet works from the html document. If youopen "searchpage.htm" in a texteditor (e.g. Notepad), you will findthe following code somewhere in the file:
<center><table BORDER ><tr><td WIDTH="520"><center>
<applet CODE='SearchInterface.class' ARCHIVE='PSearch_4.0.jar'
WIDTH='520' HEIGHT='334' ALT="Your browserdoes
not support Java 1.1"
<b><font color="#FF0000"><font size=+2>
Your browser does not support Java 1.1!!
</font></font>
</applet></center></td></tr></table></center>
If you change this code the right way, you can communicate with theSearch
applet. You need to insert parameters.
A parameter has a name and a value, and the code looks like this:
<PARAM NAME=A_NAME VALUE="A VALUE">
In order to set the A_NAME parameter to "A VALUE",you add the code just before the </applet> tag :
<center><table BORDER ><tr><td WIDTH="520"><center>
<applet CODE='SearchInterface.class' ARCHIVE='PSearch_4.0.jar'
WIDTH='520' HEIGHT='334' ALT="Your browserdoes
not support Java 1.1"
<b><font color="#FF0000"><font size=+2>
Your browser does not support Java 1.1!!
</font></font>
<PARAM NAME=A_NAME VALUE="A VALUE">
</applet></center></td></tr></table></center>
You can add as many parameters as you like - here I have added 2 parameters:A_NAMEand ANOTHER_NAME
<center><table BORDER ><tr><td WIDTH="520"><center>
<applet CODE='SearchInterface.class' ARCHIVE='PSearch_4.0.jar'
WIDTH='520' HEIGHT='334' ALT="Your browserdoes
not support Java 1.1"
<b><font color="#FF0000"><font size=+2>
Your browser does not support Java 1.1!!
</font></font>
<PARAM NAME=A_NAME VALUE="A VALUE">
<PARAM NAME=ANOTHER_NAME VALUE="ANOTHER VALUE">
</applet></center></td></tr></table></center>
Label to display:
As a default the "logo" displayed says "Personal Search x.x".
You can change this with the LABEL_TEXT parameter sothat
it says e.g. "Search my site":
<PARAM NAME=LABEL_TEXT VALUE="Search my site">
There are 4 different colors in PersonalSearch 4.0:
BACKGROUND - the Background
FOREGROUND - the Foreground
LIST_BACKGROUND - the background of the box where the results are displayed
LIST_FOREGROUND - the foreground of the box where the results are displayed
The value of these must be 3 numbers determining the red, green andblue
values of a color.
White is 255,255,255 and black is 0,0,0.
You can get these values from almost any image editor - e.g. MSPaint-
just open the "options menu" and
select "edit colors" and "define custom colors".
Here is an example:
<PARAM NAME="BACKGROUND" VALUE="100,200,100">
<PARAM NAME="FOREGROUND" VALUE="200,100,100">
<PARAM NAME="LIST_BACKGROUND" VALUE="255,200,100">
<PARAM NAME="LIST_FOREGROUND" VALUE="0,50,100">
This version has support for 3 languages: English (default), Spanishand Italian.
To change the language you need to set the LANGUAGE_FILE parameter:
<PARAM NAME="LANGUAGE_FILE" VALUE="spanish.txt">
or
<PARAM NAME="LANGUAGE_FILE" VALUE="italian.txt">
Also remember to upload the appropriate language file.
NB! If you change the language you might consider rewriting the "help.txt"file
- I have not
provided translations of that text (will be soon, I hope)..
If you only want one of the search types to be available you can use these parameters:
<PARAM NAME="DISABLE_PARSESEARCH" VALUE="TRUE">
or
<PARAM NAME="DISABLE_FASTSEARCH" VALUE="TRUE">
NB! If you disable "fast search" you don't need to provide keywords
and title in search.txt,
just put a space instead.
Limitations of the programs
Problems?
If you have problems using the product, please mail me at [email protected],
and I will try to
help you. The newest info about the product can be found here,
where you can also find the newest
version of this manual. I hope you enjoy the product!
Credits:
Thanks to everybody who has mailed suggestions and bug reports to me.