The PIA, an XML-based platform for Web Applications

TOC Start here >>

Automatically generated 2000-02-29 18:34 by steve


   0 >>
contents
start
  

 

The PIA
an XML-based platform for Web Applications

Stephen Savitzky
Chief Software Scientist
Ricoh Silicon Valley
<steve@rsv.ricoh.com>
R I C O H
RICOH SILICON VALLEY
The PIA, an XML-based platform for Web Applications  


<< 1 >>
contents
start
  Outline

 

  1. Introduction: The need for cross-platform web applications
  2. How the PIA Works: using XML in a unique way
  3. Additional PIA features
The PIA, an XML-based platform for Web Applications  


<< 2 >>
contents
start
  Major Trends in Web Applications

 

Web Applications
  • Increasing Interactivity and Customizability
  • Proliferation of Clients
Infrastructure:
  • Proliferation of Platforms = ( server, OS, language )
  • Proliferation of Development Environments
  • Increasing use of Collaborative Development
  • Increasing use of Open source
  • Increasing use of XML
The PIA, an XML-based platform for Web Applications  


<< 3 >>
contents
start
  Challenges for Web Application Developers
  • Which platform?
  • Which development environment?
  • How do programmers and content authors collaborate?
  • How to maintain / customize applications?
The PIA, an XML-based platform for Web Applications  


<< 4 >>
contents
start
  The Typical Web Application

HTML documents for content, ``code'' for actions.

The PIA, an XML-based platform for Web Applications  


<< 5 >>
contents
start
  PIA: an XML-Based Web Application Framework

XML documents for both content and actions.

The PIA, an XML-based platform for Web Applications  


<< 6 >>
contents
start
  A new design approach
  • Uses a single XML-based language for :
    • document markup (content) and data
    • -- the ``conventional'' use for XML
    • behavior -- very unconventional
  • XML is a representation for parse trees
  • The unique part is specifying behavior as well as style
    by assigning actions to tags.
    • Can design an application-specific tag set
    • Can process same document in multiple ways
  • in effect, we've extended a stylesheet processor
    to interpret a complete scripting language.
    • ... no !~+-*^%$#@ operators, no ( parentheses )
  • We also use document elements as data structures.
    what one might call document-oriented,
    as opposed to object-oriented, programming.
The PIA, an XML-based platform for Web Applications  


<< 7 >>
contents
start
  Let's see how we develop a typical page

 

Day of the week

A Simple Form

year:
month:
day:
Tuesday
The PIA, an XML-based platform for Web Applications  


<< 8 >>
contents
start
  Here's the XML for that page
<h3>Day of the week</h3>
<form action="&DOC:url;">
  <heading>A Simple Form</heading> 
  <numeric-input name="year" default="&year;"/>
  <numeric-input name="month" default="&month;"/>
  <numeric-input name="day" default="&day;"/>
  <form-submit name="day of week" />
  <if-form-submitted>
     <weekday>
       <year>&FORM:year;</year>
       <month>&FORM:month;</month>
       <day>&FORM:day;</day>
     </weekday>
  </if-form-submitted>
</form>
parts look like plain HTML...
The PIA, an XML-based platform for Web Applications  


<< 9 >>
contents
start
  Here's the XML for that page
<h3>Day of the week</h3>
<form action="&DOC:url;">
  <heading>A Simple Form</heading> 
  <numeric-input name="year" default="&year;"/>
  <numeric-input name="month" default="&month;"/>
  <numeric-input name="day" default="&day;"/>
  <form-submit name="day of week" />
  <if-form-submitted>
     <weekday>
       <year>&FORM:year;</year>
       <month>&FORM:month;</month>
       <day>&FORM:day;</day>
     </weekday>
  </if-form-submitted>
</form>
other parts are application-specific...
The PIA, an XML-based platform for Web Applications  


<< 10 >>
contents
start
  Here's the XML for that page
<h3>Day of the week</h3>
<form action="&DOC:url;">
  <heading>A Simple Form</heading> 
  <numeric-input name="year" default="&year;"/>
  <numeric-input name="month" default="&month;"/>
  <numeric-input name="day" default="&day;"/>
  <form-submit name="day of week" />
  <if-form-submitted>
     <weekday>
       <year>&FORM:year;</year>
       <month>&FORM:month;</month>
       <day>&FORM:day;</day>
     </weekday>
  </if-form-submitted>
</form>
some tags perform processing...
The PIA, an XML-based platform for Web Applications  


<< 11 >>
contents
start
  Processing is controlled by a tagset

... that contains definitions for all the tags

The PIA, an XML-based platform for Web Applications  


<< 12 >>
contents
start
  The tagset specifies what each tag does

here's a typical tag definition

<define element="if-form-submitted"
        syntax="quoted">
  <doc> expand the content if responding
	to a form submission (query)
  </doc>
  <action>
    <if><get name="queryString"/>
        <then>
	  <expand><get name="content"/>
          </expand>
	</then>
    </if>
  </action>
</define>

A tagset is simply another XML document

The PIA, an XML-based platform for Web Applications  


<< 13 >>
contents
start
  Some tags are ``primitives''
(A primitive is a tag defined by implementation code rather than defined in terms of XML.)
<define element="if"
        class="ifHandler">
  <doc> Expand the "then" sub-element
	if the condition is true
	(i.e. expands to something
	other than whitespace).
  </doc>
</define>

class attribute specifies the Java ``handler'' class for this primitive.

The PIA, an XML-based platform for Web Applications  


<< 14 >>
contents
start
  The set of primitives is small

 

  • <define> (<action> <value> <doc> )
  • <if> ( <test> <then> <else> )
  • <repeat> ( <for> <foreach> <while> <until> <first> <finally> )
  • <extract> ( <from> <child> <name> ... )
  • <make> / <do> / <namespace> / <properties> / <tagset>
  • <get> / <set> / <let> / <bind>
  • <include> / <write> / <status> / <connect>
  • <numeric> / <logical> / <text>
  • <protect> / <expand> / <hide>
  • <sql> / <sign> / <sendmail>
  • <date> / <url>

About 30 primitive operations, comprising a complete language.

The PIA, an XML-based platform for Web Applications  


<< 15 >>
contents
start
  Many domain-specific vocabularies
For office forms
<numeric-input> / <text-input> / <selection> / <signature> / <forms-pending> <notify>
<numeric-input name="month" 
               default="&month;"
               min="1" "max="12" />       
For a datebook
<weekday> / <calendar-row> / <show-month> / <show-one-day> / <get-appointments>
<get-appointments
             day="&day;" 
             month="&month;" 
             year="&year;"
The PIA, an XML-based platform for Web Applications  


<< 16 >>
contents
start
  Now let's look at data

 

  • An application is more than just a single page
  • We have to define the site structure
    http://risource.org/Calendar/month
    http://risource.org/Calendar/1999
  • ... and define which tag definitions to use for each document
  • The PIA also does this using XML
The PIA, an XML-based platform for Web Applications  


<< 17 >>
contents
start
  Site Structure may get complicated
The PIA, an XML-based platform for Web Applications  


<< 18 >>
contents
start
  Site structure defined by XML
Where to find the files
<Container file="~/Calendar"
	   virtual="/PIA/Apps/Calendar">

  <Ext name="xh"	
       type="text/html"
       tagset="Calendar-xhtml" />

  <AGENT name="Calendar" time="0042">
     <initialize>
        <user-message>  Calendar initialized
	</user-message>
     </initialize>
     <daily-action>
  </AGENT>
</Container>
The PIA, an XML-based platform for Web Applications  


<< 19 >>
contents
start
  Site structure defined by XML
how to map file types to tagsets
<Container file="~/Calendar"
	   virtual="~/PIA/Apps/Calendar">

  <Ext name="xh"	
       type="text/html"
       tagset="Calendar-xhtml"/>

  <AGENT name="Calendar" hour="00">
     <initialize>
        <user-message>  Calendar initialized
	</user-message>
     </initialize>
     <daily-action>
  </AGENT>
</Container>
The PIA, an XML-based platform for Web Applications  


<< 20 >>
contents
start
  Site structure defined by XML
Agent runs at midnight
<Container file="~/Calendar"
	   virtual="~/PIA/Apps/Calendar">

  <Ext name="xh"	
       type="text/html"
       tagset="Calendar-xhtml"	/>

  <AGENT name="Calendar" hour="00">
     <initialize>
        <user-message>  Calendar initialized
	</user-message>
     </initialize>
     <daily-action>
  </AGENT>
</Container>

Not using a DTD or PI's in the document.

The PIA, an XML-based platform for Web Applications  


<< 21 >>
contents
start
  Tree-Structured Data Guarantees Well-formedness

 

The PIA's internal representation is parse trees

  • W3C's DOM (Document Object Model) -- widely available.
  • All operations preserve structure
    • Impossible to produce ill-formed output
    • Most other platforms use strings:
      <h1><em>...</h1>(oops!) </em>
    • Like the difference between ``GOTO's'' and structured programming.
  • XML documents have a natural tree structure
    that is exactly what the author intended
    and that the PIA's operations understand.
The PIA, an XML-based platform for Web Applications  


<< 22 >>
contents
start
  Platform-Neutral Processing

 

  • Easy to merge two PIA-based applications
  • ... or to mix with an existing application on any platform
  • Standard API's for server-based platforms
    • Apache module
    • Java Servlet
    • Cocoon Processor
The PIA, an XML-based platform for Web Applications  


<< 23 >>
contents
start
  Portable Implementation

 

  • Reference version written in Java for portability
  • simple processing core
    • Small number of primitive tag handlers
    • Easy re-implemented in other languages
    • (C port already in progress)
  • Standard API's for non-server applications
    • SAX (Simple API for XML)
    • DOM (Document Object Model)
The PIA, an XML-based platform for Web Applications  


<< 24 >>
contents
start
  Other PIA Components

 

(You can read about these on the web site)

  • Pluggable parsers and formatters
    • HTML as well as XML
    • Coexists well with other platforms
  • Versatile site structure definition package
    • Includes XML (WebDAV-ready) metadata
    • Provides ``symbolic links'' or aliases
    • Allows read-only directories with local overrides
    • Hides file extensions (foo, not foo.html)
  • Server / proxy with XML ``agents''
    • Useful for prototyping and testing
    • Good platform for single user/small group applications
    • Written in Java for portability
  • Offline document processor
The PIA, an XML-based platform for Web Applications  


<< 25 >>
contents
start
  Summary: Answering the Challenges
  • Which platform?
    • Whichever one you prefer: PIA applications are portable.
    • Open Source processing engine
      • eliminates dependence on proprietary technology
      • can be integrated with any server engine
      • or other XML applications
  • How to collaborate?
    • Shared editing of XML documents
    • using domain-specific tags provided by programmers
    • Integrating applications by merging documents
    • Open source developer community at RiSource.org
  • Which development environment?
    • Whichever one makes sense for each collaborator.
  • How to maintain / customize applications?
    • Modify, extend the XML documents
    • supported by mainstream editors and specialized clients
The PIA, an XML-based platform for Web Applications  


<< 26 >>
contents
start
  Status and Resources

 

The PIA, an XML-based platform for Web Applications  


<< 27 >>
contents
start
  Appendix: PIA Features

 

  • Uses a single XML-based language for :
    • document markup (content)
    • data -- the ``conventional'' use for XML
    • behavior -- very unconventional
      in a way, we are abusing a stylesheet language to make it interpret scripts
  • Applications consist entirely of XML documents
    • Makes applications portable
    • Supports collaborative (open source) development
  • Small, simple document-processing engine
    Versatile site-description package
    • easily integrated into many platforms
    • Open source code available on the net
The PIA, an XML-based platform for Web Applications  


<< 28 >>
contents
start
  Comparison to PHP3

and other platforms that embed code in web pages

PIA PHP3
data representation parse trees strings
can serve invalid pages no yes
domain-specific tags yes no
syntax XML C-like
semantics macro expansions procedural
separate actions from documents optional
(design decision)
no
secure imported documents yes: restrict tags no
The PIA, an XML-based platform for Web Applications  


<< 29 >>
contents
start
  Comparison to XSLT

and other stylesheet-based publishing systems

PIA XSLT
complete scripting language yes no
numeric expressions yes no
text processing yes no
variables yes no
local substitutions yes no (XPointer is
non- local)
embed actions in documents optional
(design decision)
no
supports legacy (HTML) docs yes no
The PIA, an XML-based platform for Web Applications  


<< 30 >>
contents
start
  Table of Contents
  1. Outline
  2. Major Trends in Web Applications
  3. Challenges for Web Application Developers
  4. The Typical Web Application
  5. PIA: an XML-Based Web Application Framework
  6. A new design approach
  7. Let's see how we develop a typical page
  8. Here's the XML for that page
  9. Here's the XML for that page
  10. Here's the XML for that page
  11. Processing is controlled by a tagset
  12. The tagset specifies what each tag does
  13. Some tags are ``primitives''
  14. The set of primitives is small
  15. Many domain-specific vocabularies
  16. Now let's look at data
  17. Site Structure may get complicated
  18. Site structure defined by XML
  19. Site structure defined by XML
  20. Site structure defined by XML
  21. Tree-Structured Data Guarantees Well-formedness
  22. Platform-Neutral Processing
  23. Portable Implementation
  24. Other PIA Components
  25. Summary: Answering the Challenges
  26. Status and Resources
  27. Appendix: PIA Features
  28. Comparison to PHP3
  29. Comparison to XSLT
The PIA, an XML-based platform for Web Applications  


Copyright © 2000 Ricoh Silicon Valley
$Id: xtech.html,v 1.1 2000/03/01 02:37:24 steve Exp $
Stephen R. Savitzky <steve@rsv.ricoh.com>