TaNaKh XML to XHTML Conversion Demonstration

From the Open Siddur Project Development Wiki

(Redirected from Demos)
Jump to: navigation, search

Contents

Description

The backend technology we are developing to support our vision for an Open Siddur application is in an early-alpha stage. Adhering to the "release early, release often" mantra, we are demonstrating the significant ways in which our backend code functions. These demonstrations in no way whatsoever reflect the final user interface we are designing for our web application.

The content of any given Siddur is more than 50% derived from text in the TaNaKh so it is important to show that we can directly reference and extract formatted text from a database and display it in a web browser. Our first demonstration is thus a java based web applet that can generate and display XHTML in a web browser from any part of TaNaKh. The applet generates XHTML from archived texts formatted according to our XML schema, JLPTEI. While the source text used in this demonstration is the full text of the TaNaKh, the text could easily be any text from the Siddur, or other contributed texts.

The java applet is a compiler application. This basic application is needed to convert textual content from our storage format to a form that can be displayed in a browser window.

The compiler applet contains:

  1. a simple front end to choosing sample texts
  2. a client-side compiler that accesses data from the database and converts it into XHTML that web browsers can display. It also stores a simple CSS stylesheet to control the display of the XHTML.

The applet should take a good amount of time to load as it is loading the entire TaNaKh. Performing processor-intensive activities on the client-side reduces the processing power and memory requirements on the server side, reducing the overall cost of the project.

We also have a demonstration of our automated transliteration engine.

Latest Version

Version 0.3.1 (r494, April 2010)

The Open Siddur Project XML to XHTML java web applet.

To run the applet, simply click this link.

(An alternate way to start the applet is via Java Web Start (JNLP).)

New in Demo v0.3.1

  • Output a license statement at the bottom of the generated page
  • Output bibliographic information of sources if the source is included
  • Output names of contributors in a contributor list

Unchanged from version 0.3

Known Issues/Bugs
  • Compiler applet loads slowly. This is partly due to the fact that it is compiling the entire Open Siddur database -- currently the entire TaNaKh, rather than a small portion of the database. Compilation speed will also depend to a degree on the speed of your computer's processor, operating system, and version of Java installed.
  • Interface is barebone and minimally styled.
  • @font-face not supported in Google Chrome. Relies on locally installed Ezra SIL font.

Please report any bugs, issues, or feature requests at our issue tracker or send an email to the mailing list.


Completed work

  • Cross-browser support, Mac Support
    • @font-face enabled for HTML 5.0 supporting browsers (tested on Firefox and IE)
  • HTML Validation
    • Transforming JLPTEI to muXHTML
    • Minimal CSS styling of muXHTML
    • The compiler web interface validates as XHTML 1.0 Transitional
    • Generated muXHTML validates as XHTML 1.0 Transitional
  • Code Documentation and Logging

Further development

  • Optimization
    • Optimize compilation times
    • Optimize for parallel compilation
  • Features
    • Integrate siddur recipe support
    • Provide other output options besides HTML. (Open Document Format and PDF)
    • Create an application programming interface (API) to the eXist database for updating content
  • Styling
    • Spruce up the web interface with jQuery/CSS
    • Style muXHTML better
    • Test more complex layouts and JLPTEI features
  • Platform Testing
    • Test on Mac OS X (particularly Snow Leopard)


Next release goals

Looking forward to our version 0.4, we are aiming to demonstrate the following features.

  • Displaying simple siddur recipes: build a new, valid, JLPTEI file with a selection that references data in existing files in order
    • Save locally
    • Save to database (may wait until 0.5)
  • Automated transliterations, using SBL or Modern Israeli Hebrew pronunciations in Latin characters
    • Backend support (almost complete)
    • Front-end support (UI can be as simple as a checkbox and/or a drop down list)
    • CSS support for parallel texts

Hacking the Demonstration Code

This demo code, like everything else we do at the Open Siddur, is open source. If you're interested in modifying or adapting this code for your project or for simply learning more, read on. A more comprehensive introduction to hacking Open Siddur Project code is located on our intro to hacking page.

Getting Started

  • Checkout the trunk
  • The source: /trunk/code/JLPDemo/
  • Building the project with Ant:
  • Developing with Eclipse:
    • Classpath (most of these can be found at /trunk/lib/:
      • saxon9he.jar
      • xmldb.jar
      • exist.jar
      • resolver-1.2.jar
      • log4j-1.2.15.jar
      • ws-commons-util-1.0.2.jar
      • xmlrpc-client-3.1.2.jar
      • xmlrpc-common-3.1.2.jar
      • jetty-6.1.22.jar
      • servlet-api-2.5-20081211.jar
      • jetty-util-6.1.22.jar
      • plugin.jar located at ${java.home}/lib/plugin.jar (java.home being the JRE home directory)
  • The project uses many libs, but is itself released under the LGPL license

A Closer Look

  • Main things to look at
    • JLPDemo.htm: The HTML entry point; it embeds the applet in the page and provides JS callbacks so that the applet can interface properly with it.
    • Demo.java: The applet entry point and driver. I think its a bit over commented, and if you have any questions feel free to shoot an email to the ML. The applet does something mighty queer: it runs a web server. Thats right. It runs a web server. Jetty to be exact. The reason it runs a web server is that the purpose of the applet is to produce XHTML, which is best served in the browser. In the future, there might be an option to use JS-Java communication to not require a web server running on the client.
      • To open a browser window to the correct location (the port is chosen by the system to avoid conflict), the applet tries many different fallbacks, some of which depend on the manner of launch (JNLP, Applet, application), some of them the browser (eg. support for netscape.javascript), some the version of Java, and perhaps the system.
        • Using a JS-Java bridge (netscape.javascript) and using an iframe provided on the calling web page (in our case, JLPDemo.htm)
        • Using a JS-Java bridge (netscape.javascript) and simply calling window.open() (sometimes gets blocked by popup blocker, but at least opens in the same browser as the applet itself, though sometimes in another window instead of tab, like in IE)
        • Using the AppletContext TODO: use the JNLP BasicService API
        • Using the Desktop API to open a page in the default browser (Recent JDK)
        • Simply printing the localhost URL to the Jetty server on the console
    • src/index.htm: The main page that Jetty serves. Provides links to the license, and the menu.
    • src/menu.htm: Displays the entry points that are available in our eXist database.
    • src/menu.xql: This XQuery script is sent to the database, to retrieve the entry points that are available. TODO: can use some tinkering and tweaking.
    • MenuServlet.java: This serves menu.htm, running menu.xql to get the list of entry points TODO: see above.
    • CompilerServlet.java: Once an entry point is requested, the CompilerServlet retrieves the entry point and the XSLT stylesheets, and begins the transform. When it is complete (some time later), it caches and displays it to the client.
    • src/xhtmlcompat.xsl: After the muXHTML is generated, this transform is performed to put in any ugly XHTML that might be needed for browser insanity.
    • src/style.css: This styles the generated muXHTML in the user's browser. The muXHTML is heavily classed to allow for styling every aspect. TODO: Make this nicer!, request more classes as necessary.
    • ExistQuery.java: This class is a helper class that executes an XQuery against our database and handles the result. TODO: this can be tweaked, and will additionally become more complex as our queries do.
  • Other stuff

Earlier Releases

Version 0.3 (r418, January 2010)


Personal tools
NAVIGATION