The XPDL Validation Web App.docx - GoogleCode

looneyvillestaticΛογισμικό & κατασκευή λογ/κού

15 Αυγ 2012 (πριν από 4 χρόνια και 8 μήνες)

332 εμφανίσεις

The XPDL Validation Web Application

1.

Introduction

The XPDL Validation Web Application provides a way for members of the XPDL
community to check XPDL files against the XPDL schema. It hoped that this will
advance the development of tools that generate correct XPDL that can be exchanged
and used by tools m
y multiple vendors.

Andy Adler developed
the

validator under
the direction of Robert Shapiro. Tom
Laverty provided
crucial technical
advice

and

also authored

and maintains

the

schemata and

transform used by
the validator.

2.

Implementation

The validator is

implemented using Java Server Pages that access the Java based
XML pa
rsing and validation packages found in javax.xml, org.w3c.dom, and
org.xml.sax.

a.

Netbeans

The validator was developed using version 6.5 of the open source development
environment Netbeans
, which can be found at
http://www.netbeans.org/
.
Netbeans is available on several platforms. The bulk of the development of the
validator was done on a Macintosh running OS X 10.5.

b.

Tomcat

The validator was tested

using version 6.0 of the Tomcat JSP
container; however,
there should be nothing to prevent using a different container
.

c.

Deployment

The Netbeans project generates
a hierarchy that is rooted in
…/XPDLValidator/build/web. This file
structure
is also
stored
in
a WAR archive.
Most hosts using Tomcat use the WAR, but the public test site uses the raw file
hierarchy.

3.

Deploying to XPDL.org

An XPDL user can find the validator on the XPDL.org web site at
http://xpdl.org/Va
lidate/
. Currently, no attempt has been made to fit the validator
web pages are into the look and feel of this site.

The validator
file
s

are copied to the XPDL.org host by using FTP.

Connect using host
name
xpdl.org

with
wfmcxpdl

as the user name.

The password is
workflow
.
Once connected, change the working directory to

appservers/apache
-
tomcat
-
6x/webapps/Validate

As noted

above, this host does not use WAR archives, so to deploy the validator copy
all the files and directories, excluding the CVS

directory, from the
build/web

directory on your development host.

Note: The built site and its archive are saved
under source control so that the validator can be deployed by someone who does
not have a development environment.

Tomcat loads the applicati
on on start up. So, Tomcat needs to be cycled to tell it to
load a new version. Access to Tomcat is through the
control panel provided by the
hosting company, Moca
H
ost.

Browse to
http://cpanel.xpdl/org

and
log in u
sing the
same username and password mentioned above. Ignore the icon in the Software /
Services section labeled Tomcat Restart. I am told that it does not do the correct
thing. Instead,
scroll to the bottom of the page where you will find a section labe
led
Advanced. Click on the icon for NGASI
-
AppServer
-
Manager and you will see a new
control screen.

On this control page, titled Java Automation and Load
-
Balancing for Cloud
Computing, you will see stack of tabs on the left.
Click on the Start / Stop ta
b. It
should

be the second tab. You will now see three buttons across the top Start, Stop,
and Restart. Once again, ignore the Restart button and instead press Stop. It takes a
bit for this to complete and you will be entertained by a progress dialog b
ox. Once
the server is off, turn it back on by pressing Start.

This action also takes a bit to
complete. Once the progress dialog disappears, the new version of the validator
should be ready to use.

4.

Use

The validator web application consists of two
pages: an introductory page that
documents some details about preparing an XPDL file for validator and the validator
page. The validator page is divided into two sections. The top area is a form used to
upload the XPDL file and to specify what changes, i
f any, the validator should apply
to XPPD file before it is validated.

The bottom area is used to display the results of
the validator’s work.

The validator applies two tests to the XPDL file. First, the file is validated against the
XPDL schemata

and ch
ecks for compliance to the schemata such as missing or
extraneous elements
. Second, a diagnostic transform is applied to the XPDL file.

It
reports on more subtle errors. For example it notices when a connector’s end node
is missing.

5.

Components

This
section describes the files that together make the validator.

a.

web/
Index.jsp

This is the introductory page that explains how the validator works. This page links
to ValidateXPDL
, the validator page itself
.

b.

web/
XpdlValidatorStyles.css

This is the style shee
t used to style all the html displayed by the Validation Web
Application. When the web application is incorporated into another web site, for
example the WfMC web site, the application will need to fit in to the containing site
and these s
t
yles will need
to be updated or removed

and the styles in the html will
have to be changed
.

c.

src/java/g360/WebXpdlValidation/
ValidateXPDL.java

ValidateXPDL implements the servlet that presents the user interface of the
validator. It extends HttpServlet and has two displa
y states. The top of the page
contains a form that lets the user specify the file to be validated and what if any
changes to the file the validator should make. Since the validator takes its cue from
the XPDL file, the values of
the namespace declaration
s on the Package element and
the content of the ConformanceClass element are set from the values in the form.

d.

web/data/formText.txt

e.

web/data/*.xsd

f.

web/data/*.xslt

g.

src/java/g360/WebXpdlValidation/
ValidatorWrapper.java

h.

src/java/g360/WebXpdlValidation/
Transfo
rmWrapper.java

i.

src/java/g360/WebXpdlValidation/
DomDocument.java

DomDocument wraps a document represented by org.w3c.dom.Document and
provides easy access to functions that parse, access elements, insert elements, and
dump values.

j.

src/java/g360/WebXpdlValid
ation/
XpdlDomDocument.java

XpdlDomDocument
extends DomDocument to provide an easy way to examine and
change the XPDL element attributes and values required by the validation process.

k.

src/java/g360/WebXpdlValidation/
DomSerializer.java

6.

CVS Archive