Table of Contents
Integrate focuseek searchbox with the Tomcat application server, using the Eclipse IDE
1 2 3 4 5
Requires creating a JSP page and a small set of support classes using the Eclipse IDE and some Eclipse plugins.
A working install of focuseek searchbox
A working install of java jdk, version 1.4.2 or later.
A working install of the Eclipse plugin "lomboz". You must install a version compatible with your Eclipse IDE
A working install of the Eclipse plugin "SoapClipse" version 1.1.2 or later and its accompaining AXIS library. Please note you must download and install (unpack) the AXIS library coming with the plugin. See the documentation contained in the plugin download for more details.
Jakarta Tomcat version 4.1.x or later
Launch the Eclipse GUI, create a new workspace with
File, Switch workspace...
and then choosing a new directory. Click on the button labeled
. Now you must configure Eclipse
perspectives to work with Lomboz; follow the instructions detailed in
the Lomboz
installation guide.
The last configuration step requires adding a classpath variable
to the workspace. Choose the menu, then the
menu item. The
Preferences dialog will appear. In the left
treeview choose Java, Build
Path, Classpath Variables. Click
and type AXIS as
the name and the choose the folder you placed the AXIS files you
installed along with the SoapClipse plugin as the path. Do the same
steps again to add a JDK_TOOLS variable pointing
to the tools.jar file of your jdk.
Click . You may need to restart Eclipse in order to use the new settings.
Right click in the Package Explorer pane and
choose , . Type SBSearch as project
name, then click ; then make sure that
SBSearch/src is marked as the source
folder and that SBSearch/bin is the
default output folder.
Now select the Libraries pane to add some
extra libraries to the project. Click on and choose AXIS, then click
on and choose the following JARs:
axis.jar,
commons-discovery.jar,
commons-logging.jar,
jaxrpc.jar,
log4j-1.2.8.jar[1], saaj.jar,
wsdl4j.jar. Click
.

The J2EE Creation Wizard while configuring source and output folders
In the Web Modules tab click on
. Type searchpage as
the module name. Click on the Targeted Servers tab,
choose Apache Tomcat v4.1.0 (or another later
version matching your server) from the Type
combobox then click . Finally click on
, click on
and then on

The J2EE Creation Wizard while configuring the target server
The last step consists in informing Eclipse that the Axis
libraries must be shipped along with our web application. In the Package
explorer open the searchpage (WEB) folder, then the
WEB-INF folder and right click on the
lib folder; choose
from the popup menu. Choose
File System as the import source, then insert in
the From directory text field the folder where your
Axis JARs reside (it's the same folder you set the AXIS variable a few
minutes ago). Choose the following JARs for import:
axis.jar,
commons-discovery.jar,
commons-logging.jar,
jaxrpc.jar,
log4j-1.2.8.jar[2], saaj.jar,
wsdl4j.jar. Click on .
Now you have successfully created your Eclipse project and you are ready to go on interfacing Java and searchbox.
searchbox describes its SOAP interface using the WSDL standard.
WSDL information is exposed by searchbox alongside the SOAP access
point. In the following we'll assume that your searchbox installation is
on localhost, port
2200.
Using your browser get the file
http://localhost:2200/wsdl containing the WSDL
description for searchbox[3]. Save it somewhere as searchbox.wsdl,
then import searchbox.wsdl into Eclipse workspace:
choose the menu, then the
entry. Select File
system as the import source, then click
and specify the
searchbox.wsdl file you saved earlier. Import it
directly in the SBSearch folder in the workspace.
searchbox.wsdl should appear in the Package
Explorer.
Righ-click on searchbox.wsdl and choose
,
from the popup menu. A dialog
will appear. In the File container field type
/SBSearch/j2src, then click on the
button.
Eclipse should now be back to the Java perspective. First we have
to create a new package. Righ-click on the folder
j2src in the Package Explorer and choose
, . Type
com.focuseek.cookbook as the package name.
Again right-click on com.focuseek.cookbook
and choose ,
. Type SearchboxSearch as the class Name
and click . Then cut and paste the contents
of the file SearchboxSearch.java from the
examples/cookbook/eclipse-search-page directory
found in your searchbox installation folder into the newly created
class.
Look at the Package Explorer: two jsp pages
has been created. Double click on index.jsp, remove
the whole file content and replace it with the content of the file
index.jsp from the
examples/cookbook/eclipse-search-page directory
found in your searchbox installation folder.

Package Explorer showing jsp pages
If the searchbox engine is not deployed on your local computer or if you changed the default administrator user or password you must specify the SOAP endpoint for the engine in the jsp. Change the
null
parameter in the initialization
SearchboxSearch src = new SearchboxSearch(null);
to a string containing the URL of the endpoint, inclusive of username and password. For example the default endpoint is
"http://admin:password@localhost:2200/soap"
Click on , , , then choose the subitem Lomboz J2EE View in the Lomboz J2EE group. Go to the newly created view, expand the SBSearch node and the searchpage node. Right click on the searchpage node and choose . Then right click on the Apache Tomcat vx.y.z item and choose . Your application is now running in Tomcat.
To access it open your browser, go back to the Package Explorer,
right click on searchpage (WEB) and choose
, .
You are done: the jsp page will show all the collections available to the user you are using in the page itself and will allow you to query the collection with the usual searchbox syntax.