Developing Web Applications for Daycart
Ragu Bharadwaj,
Daylight CIS Inc
Several ways to create applications for Oracle.
- Oracle forms
- Using Excel & Access
- Using ActiveX Controls available in Integrated
Development Environments like Visual C++
- Using Java & JDBC (Java DataBase Connectivity)
As the Oracle Daycart cartridge uses standard SQL
all these methods can be used for Daycart
application development.
We discuss one such methodology for web application
development. Our method uses
- XML(eXtensible Meta Language)
- JSP(Java Server Pages) technology
- XSLT (eXtensible Stylesheet
Language).
In the process we'd like to
- show the tools available for such a process
- display the ease of application development with Daycart
- point out the separation of content from display achieved
by these methods
XML
XML is a way to present information in a containerized form.
Information is presented just as in HTML, between tags. However
only data & no presentation information is present. For
example an address in XML is stored as
<PERSONAL_INFO>
<NAME>John Doe</NAME>
<ADDRESS>
<STREET>
221, Pinehurst Ave.
</STREET>
<CITY>
San Diego
</CITY>
<STATE>
CA
</STATE>
<ZIP>
94210
</ZIP>
</ADDRESS>
</PERSONAL_INFO>
The above information may be presented as:
John Doe
221, Pinehurst Ave.
San Diego, CA 94210
when printed on top of an envelope. Or it could be represented
as a bar code suitable for digital scanning. Or it could be
represented as a LDAP record when inserted in an address database.
Such conversion could be facilitated via:
XSLT
- XSLT is a subset of XML
- XSLT is a language with special constructs for converting
an input XML file to HTML or other output.
- Using XSLT requires an XSLT processor.
- An XSLT processor
reads in an XML file and an XSLT file and alters the input
XML using conversion instructions from the input XSLT file to
present the input XML file. XSLT processors are available
in C, C++, Java and many other languages
- We use the Xalan XSLT processor for our conversions. The
processor is written in Java and is freely available from
the Apache group.
So the idea is
- to access a database for content
- format its content into XML
- Use XSLT stylesheets to convert that content to HTML, PDF or
whatever format of output is expected
Accessing the database
- Express the chemical query on a web page
- Direct the query to the web server.
- The web server invokes a CGI or server side application
that
- queries the
database
- formats its output into XML in preparation to
pass the XML onto the XSLT processor.
Our server side application for this purpose resides in a JSP
engine.
Pic
A JSP engine plugs into any standard web server such as
- Apache
- Microsoft IIS
- Netscape Server
It uses JDBC (the Java DataCase Connectivity API) to access
the database. The JDBC API is a widely accepted and easy to use
API
to access SQL compliant databases.
A demo finally.
Expressing a chemical query on the web page
-
Daylight's languages like SMILES & SMARTS are a powerful way of
expressing chemical structure and selection
- The syntax for these languages leads to
- extremely compact strings that represent chemical structure
- extremely powerful ways to select chemical functionality
The languages themselves are easy to use by UNIX users
familiar with regular expressions
- However this isn't applicable to most chemists as they think
in terms of chemical groups and are averse to non-graphical
methods of chemical query.
Grins is a chemical editor family we have developed for such users.
Grins occurs in the following flavors:
- XVGrins, a XView-based app.
- JavaGrins, a Java based app. Available forms:
- Currently available as a Netscape-only app that can do
both SMILES & SMARTS.
- It is also in beta development as an
IE capable
app. This form requires the Java Plugin, a freely
available plugin for Internet Explorer, made & distributed
by Sun Microsystems
- In either case, integrating the editor into a web page is
very easy & takes about 3 lines of JavaScript code in the
web page.
- PCGrins, a PC-based app which runs on Microsoft NT, &
Windows 2000
While multiple technologies are used,
generating a new app is fairly
easy. This is because:
- developing apps can be clearly separated into
- data generation and
- conversion of data into presentation
- The data generation code is very simple in Java.
e.g. the source code for the TCM JSP
- The presentation is very easy to manipulate and change.
This is because altering presentation involves
altering the XSLT stylesheet only. This process
- doesn't need a recompile
- doesn't affect data retrieval
and therefore doesn't create new bugs