Installation: Instructions
1. Unarchive Morphis
Morphis comes in either a Unix gzip tar, or a Windows zip
archive. You must first unarchive Morphis into a directory which we'll call
the Morphis home directory. This home directory will need to be entered in the
morphis.properties file below.
2. Ensure morphis.properties can be found
Morphis uses the morphis.properties file to initialize.
If this file cannot be located, the Morphis home directory cannot be determined
and Morphis will not operate. Morphis uses a few different ways to locate the
file:
- System Property: you may specify the location of the file by setting
the
org.morphis.properties system property. Usually you can do
this by setting the -D parameter of the java application. You may need to
edit you application's startup scripts, or configuration files to add this
property.
- Classpath: the morphis.properties file may be inside the application's
Java CLASSPATH. It may also be in the application server's
CLASSPATH as defined by your application server's configuration.
- Java start directory: Morphis will look in the working directory
in which Java was started. This is the same as the
user.dir System
property.
3. Set your home directory in the morphis.properties file
The morphis-home environment variable needs to be set the morphis.properties
file to the directory in which morphis was unarchived in step 1. For Windows,
don't forget to escape your backslashes as in: c:\\morphis .
4. Add Jars to CLASSPATH
The following Jar files must be added to the application server's CLASSPATH.
- morphis.jar - Contains the core Morphis classes
- samples.jar - Contains Morphis sample applications (optional)
- xalan.jar - Contains Apache's XSLT processor
- xerces.jar - Contains Xerces XML processor
- bsf.jar - IBM's Bean Scripting Framework used for dynamic XSLT stylesheets
- jakarta-regexp-1.1.jar - Apache's regular expression classes
- Tidy.jar - JTidy a HTML syntax checker and pretty printer (Note: this jar should appear after xalan and xerces jars)
The easiest way to do this is to put them into the WEB-INF/lib
directory. However, some application servers (like Apache's Tomcat) may have
conflicting classes in the CLASSPATH. In these instances you're required to
alter the application server's classpath directly. In the case of Tomcat, you
will need to add these classes to the tomcat.bat or tomcat.sh
file so they appear first in the CLASSPATH.
5. Ensure your application server knows about the Morphis web.xml file
Your application server will need to know in what instances to execute Morphis.
The web.xml file located in the config directory of your Morphis installation
contains these rules. This file states that the Morphis DispatchServlet will
be invoked whenever URL's beginning with /morphis are found. The best place for
this file is in your webapps WEB-INF directory.
You may need to restart your web and application servers at this point.
6. Test some Morphis samples
Morphis has a few samples that demonstrate its features. Source to the samples
is located in the samples directory of your Morphis installation. The dispatch
rules are located in the config/dispatch.xml file.
- http://yourserver/morphis/slashdot/index
Illustrates how content can be obtained from other application servers. In
this case, the articles at Slashdot.org are fetched, translated into Morphis
WAX, and then translated into a format suitable for your browser. Try this
with a regular web browser, with your WAP emulator, your wireless web phone,
or your AvantGo device.
- http://yourserver/morphis/filelisting
Show how Java code can be called from an XSLT stylesheet, and converted
into Morphis WAX. The directory contents of the application server's home
directory are listed so any device can read it.
- http://yourserver/morphis/reverse
Given a URL, this sample will obtain the contents of the web site, and
reverse the words. This demonstrates how Morphis can be used as a content
filter.
- http://yourserver/morphis/quotes
This sample shows how different views of an XML file can be displayed using
XSLT, and converted into Morphis WAX.
|