DBPrism/Laszlo presentation server integration
Laszlo presentation server is a new technology for building RIA applications. It works generating rich internet application in flash and leveraging the logic and data on the web server or database side. Laszlo runs in two different modes, as server mode using Apache Tomcat 5 or in stand-alone mode (SOLO). This guide cover how to configure Laszlo Server (Tomcat) to use DBPrism mod_plsql emulation as source for his dataset.
- Dowload DBPrism distribution dbprism-2.1.1.zip file and unpack it on any directory, we call this directory PRISM_HOME.
- Dowload Open Laszlo presentation server OpenLaszlo 3.0.2 and unpack it on any directory, for example /usr/local, we call this directory LPS_HOME
- build dpls.war , executing the Ant task ant dpls-war
- unpack dpls.war file generated into $PRISM_HOME/bin into a tempoary directory /tmp/dpls
- Copy Prism's jar , from /tmp/dpls/WEB-INF/lib directory to $LPS_HOME/Server/lps-3.0/WEB-INF/lib . There are three jars on DBPrism dpls.war Prism.jar, jconfig.jar and log4j-1.2.8.jar
- Copy classes12.jar , from $ORACLE_HOME/jdbc/lib to $LPS_HOME/Server/tomcat-5.0.24/common/lib
- Copy prism.xconf configuration file, from /tmp/dpls/WEB-INF directory to $LPS_HOME/Server/lps-3.0/WEB-INF . This file can be conigured using PRISM_HOME/common.xml file to point to your target database before build the dpls.war file.
-
Edit web.xml
file located on the directory $LPS_HOME/Server/lps-3.0/WEB-INF, add
these lines:
... <servlet> <servlet-name>dpls</servlet-name> <display-name>DBPrism DAD dpls</display-name> <description>DBPrism Servlet Engine</description> <servlet-class>com.prism.ServletWrapper</servlet-class> <init-param> <param-name>properties</param-name> <param-value>/WEB-INF/prism.xconf</param-value> </init-param> <load-on-startup> 2 </load-on-startup> </servlet> ... <servlet-mapping> <!-- Servlet mappimg for DAD sample --> <servlet-name> dpls </servlet-name> <url-pattern> /sample/* </url-pattern> </servlet-mapping> ... -
Edit weather.lzx
example file located on the directory
$LPS_HOME/Server/lps-3.0/demos/weather, the DATASOURCE definition with:
<!-- DATA SOURCE --> <dataset name="weatherdata" type="http" src="/lps-3.0/sample/weather"/> -
Create a weather
PLSQL stored procedure logged as SCOTT
CREATE OR REPLACE PROCEDURE WEATHER(zip VARCHAR2) AS BEGIN htp.p('<weather sourceurl="http://www.srh.noaa.gov/zipcity.php?inputstring=94110"> <forecast> <day label="TODAY" imageurl="http://www.laszlosystems.com/lz_weather/img/fcicons/fg.jpg" desc="Foggy" temp="Hi 62° F"/> <day label="TONIGHT" imageurl="http://www.laszlosystems.com/lz_weather/img/fcicons/nbknfg.jpg" desc="Patchy Fog" temp="Lo 55° F"/> <day label="FRIDAY" imageurl="http://www.laszlosystems.com/lz_weather/img/fcicons/sct.jpg" desc="Partly Cloudy" temp="Hi 62° F"/> <day label="FRIDAY" imageurl="http://www.laszlosystems.com/lz_weather/img/fcicons/nsct.jpg" desc="Partly Cloudy" temp="Lo 60° F"/> <day label="SATURDAY" imageurl="http://www.laszlosystems.com/lz_weather/img/fcicons/hi_shwrs.jpg" desc="T-storms Possible" temp="Hi 58° F"/> </forecast> <current> <where>San Francisco, CA</where> <station>San Francisco Intl Airport</station> <when>Jul 17, 10:56 am PDT</when> <desc>Fair</desc> <temp>70°F</temp> <humidity>64 %</humidity> <windspeed>N 5 MPH</windspeed> <barometer>29.93" (1013.6 mb)</barometer> <dewpoint>57°F (14°C)</dewpoint> <heatindex>75°F (24°C)</heatindex> </current> <radar src="http://www.laszlosystems.com/lz_weather/img/radar/kmux.jpg"/> <satellite src="http://www.laszlosystems.com/lz_weather/img/radar/WCI8.JPG"/> </weather>'); END; - start Open Laszlo , excecuting bin/catalina.sh run
- enjoy DBPrism/Open Laszlo integration , loading the demo page at http://localhost:8080/lps-3.0/demos/weather/weather.html you can use any zip code because as you can see on WEATHER stored procedure the XML data returned is fixed on this example.
This work is licensed under a
Creative Commons License
.


