SMWP - Installation II
 

Index

Introduction
Differences
Installation I
Installation II
Installation III
Uninstall

Working with SMWP

Parameter
Fragement Class
Page Class
XML Document (Page)



3.3 Installation Steps

Following process is suggested for installation:

3.3.1 Extract SMWP-Files

Extract the program files into following directory: c:\smwp which creates following folder structure:

c:\smwp\console Resources for SMWP Console and SMWP Serializer (for deployment in Oracle Database as Java Stored Procedure)
c:\smwp\servlets Servlets used to fetch XML documents from database
(deploy in Apache Tomcat)
c:\smwp\sqlscripts SQL script files to create the necessary data structure
c:\smwp\cocoon required XML documents (for deployment in Apache Cocoon)


3.3.2 Create Database Objects

Database objects have to be created prior using the SMWP Prototype. The SMWP database objects are stored in the same schema as the application relations, which can be used for fragmentation.

In order to create the database objects following scripts are to be executed. These scripts are located in c:\smwp\sqlscripts. The database user which executes these scripts must have the according rights to create constraints, tables and trigger. Execute these scripts by login on the database using SQLPlus and entering @scriptname in the SQL-prompt:

  1. Script build_smwp_types.sql:
    Defines datatypes required by SMWP: TColumn, TcolumnTable
  2. Script build_smwp_sequence.sql:
    Defines sequential numbers.
  3. Script build_smwp_package.sql:
    Defines the PL/SQL package smwp, which defines the mapping for Java Stored Procedures.
  4. Script build_smwp_tables.sql:
    Creates all tables where SMWP metadata is stored. Including the table smwp_xml_document which contains the pre-generated XML documents (pages).
  5. Script build_example_tables.sql (Optional):
    Creates the exsample tables which are used for the examples in this document.

3.3.3 Configure SMWP Console

Following entries in properties file c:\smwp\application\smwp.properties have to be adjusted:

  • database schema
    oracle_schema = dbSchema
  • database driver
    oracle_connectString = jdbc:oracle:thin:@hostname:1521:smwp
    oracle_driverName = oracle.jdbc.driver.OracleDriver

  • database username and password
    oracle_username = dbUsername
    oracle_pasword = dbPassword

  • smwp namespaces (for XML documents)
    nsuri_smwp = http://dke.uni-linz.ac.at/smwp/1.0
    nsuri_xmlsn = http://www.w3.org/TR/REC-xml-names

3.3.4 Prepare SMWP-Java Stored Procedures for deployment

Permissions for deploying java packages have to be granted. Login on the database as system administrator using SQLPlus and execute following commands:
call dbms_java.grant_permission('dbUsername', 'SYS:oracle.aurora.security.JServerPermission', 'loadClassInPackage.*', null);

call dbms_java.grant_permission('dbUsername', 'SYS:oracle.aurora.security.JServerPermission', 'loadClassInPackage.oracle.jdbc.*', null);

Create a Java jar-archive smwp.jar which contains the SMWP package using following command:
jar cf smwp.jar *

Alternatively jar files can also be created by creating an zip Archive (e.g. using the Program WinZip on Windows) which contains the class files in directory c:\smwp\console\bin. Rename the created zip Archive to smwp.jar.
Copy smwp.jar into following directory: c:\smwp\console\lib

3.3.5 Deploy SMWP-Java Stored Procedures

Several Java packages are needed among the SMWP package itself. These packages are located in c:\smwp\console\lib along with the create smwp.jar file. Deploy them into the database by using following commands from the command console:

loadjava -force -user dbUsername/dbPassword@dbSchema apache/xalan2.2.D6.jar
loadjava -force -user dbUsername/dbPassword@dbSchema oracle9i/xmlparserv2.jar
loadjava -force -user dbUsername/dbPassword@dbSchema oracle9i/classes12.jar
loadjava -force -resolve -user dbUsername/dbPassword@dbSchema smwp.jar

Replace dbUsername, dbPassword and dbSchema with the real values for username, password and schema.

3.3.6 Configure SMWP-Servlets

Following entries in properties file c:\smwp\servlet\smwpServlet.properties have to be adjusted:

  • database schema
    oracle_schema = dbSchema
  • database driver
    oracle_connectString = jdbc:oracle:thin:@hostname:1521:smwp
    oracle_driverName = oracle.jdbc.driver.OracleDriver

  • database username and password
    oracle_username = dbUsername
    oracle_paswort = dbPassword

3.3.7 Deploy SMWP-Servlets

Create the Java war-archive DB_Wrapper.war which contains the SMWP Servlets located in c:\smwp\servlets. The war archive contains following folder structure:

  • meta-inf
    • manifest.mf
  • web-inf
    • classes
      • " Java Package dke.smwp
    • lib
      • classes12.jar
      • servlet.jar
    • web.xml

Creating war-archives requires a build tools like Apache Ant. It can also be done manually, which is described in the following steps:

  1. Copy the modified properties file c:\smwp\servlet\smwpServlet.properties into the directory c:\smwp\servlets\DB_Wrapper\WEB-INF\classes\dke\smwp
  2. If the SMWP package was modified copy the class files into the directory c:\smwp\servlets\DB_Wrapper\WEB-INF\classes
  3. Create an zip Archive (e.g. using the Programm WinZip for Windows) using the contents of the prepared directory in c:\smwp\servlets\DB_Wrapper.
  4. Rename the zip archive into DB_Wrapper.war.
    Deploy the war-archive into Apache Cocoon:
    1. Copy the WAR-archive DB_Wrapper.war into the folder c:\programme\tomcat\webapps
    2. (Re-)start the web server

To check if the deployment was successful simply check if the folder c:\programme\tomcat\webapps\DB_Wrapper was created.

3.3.8 Configure Web Server

Open the file c:\programme\tomcat\webapps\cocoon\sitemap.xmap and insert following marked lines:

<map:pipelines>
<map:pipeline>
<map:match pattern="smwp/**">
<map:mount
check-reload="yes"
src="smwp/sitemap.xmap"
uri-prefix="smwp"/>
</map:match>

<map:match ... <map:pipeline> <map:pipelines>

Create folder smwp in c:\programme\tomcat\webapps\cocoon and copy the contents of c:\smwp\cocoon into the created folder. Adjust hostname and port of the Apache Tomcat web server in configuration file c:\programme\tomcat\webapps\cocoon\smwp\sitemap.xmap. The default port used by Apache Tomcat is 8080:

<map:match pattern="smwp_systemid">
<map:generate src="http://hostname:8080/DB_Wrapper/show_systemid"/>
<map:transform src="stylesheets/style-systemid.xsl"/>
<map:serialize/>
</map:match> <map:match pattern="page_*">
<map:generate src="http://hostname:8080/DB_Wrapper/show_content?id={1}"/>
<map:transform src="http://hostname:8080/DB_Wrapper/show_xsl?id={1}"/>
<map:serialize/> </map:match> <map:match pattern="pagename_*">
<map:generate src="http://hostname:8080/DB_Wrapper/show_content?systemID={1}"/>
<map:transform src="http://hostname:8080/DB_Wrapper/show_xsl?systemID={1}"/>
<map:serialize/>
</map:match>

3.3.9 Restart Web Server

Restart the web server. Enter following commands on Windows NT/2000/XP operating systems in DOS-command line:

C:\>net stop tomcat
C:\>net start tomcat