Backwards Compatibility of Akara

This is meant to provide an overview of the major categories of functionality currently supported by the legacy 4Suite Repository that are in heavy use and thus a decent starting point for assessing what kind of a migration path (if any) would be needed by existing applications that are currently built on the 4Suite repository.

Users, Groups, and ACLs

The old repository had a particular approach to account management and access control that involved users and groups as first class 'resources' whose structure captured the way users are arranged under specific groups (each of which have unique identifiers) and use of ACL that referred to these unique identifiers to allow/deny specific kinds of access to groups, users, and 'built-in' roles such as world, guest, etc.. The types of access controlled were:

There will be a pluggable user/auth system. Basic built-in support will approximate 4Suite 1.x

RESTFul XSLT Services

Much of the general idea here is covered on the old Wiki and overlaps significantly with WSGI components. However, below is a legacy example to serve as a reference point in determining if there is a clear, isomorphic migration path to WSGI URI templates, XSLT services components, Apache configuration etc. Below is an example of a Server object:

<Server xmlns="http://xmlns.4suite.org/reserved" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink">
    <dc:Description>Semantic DB HTTP Server</dc:Description>
    <Status running="1"/>
    <Module>Http</Module>
    <Handler>http_basic</Handler>
    <Port>8820</Port>
    <!-- contact information -->
    <ServerAdmin>ogbujic@nospam.com</ServerAdmin>
    <ServerName>localhost</ServerName>
    <!-- logging-->
    <LogLevel>debug</LogLevel>
    <DocumentRoot>/</DocumentRoot>
    <AuthName>..</AuthName>
    <Redirect src="/">/Root</Redirect>
    <!-- URL Patterns for XML services -->
    <Rule pattern="/services/xpath$" xslt-transform="/services/xpath-service.xslt"/>
    <Rule pattern="/services/fetchEvent$" xslt-transform="/services/fetch-ptrec-event.xslt"/>  
    <!-- Data Entry URL Patterns -->
    <Rule pattern="/screen/(\S*)/(\d{8})$" xslt-transform="/xslt/FormBuilder.xslt" extra-args="screenName=\1&amp;instancePath=/\2.xml&amp;screenTemplatePath=/formSkeleton/\1.xml&amp;id=\2" xslt-source="/formTemplate/\1.xml"/>
    <!-- Windowed data entry -->
    <Rule
      pattern="/screen/(\S*)/(\d{8})/(\S*)$"
      xslt-transform="/xslt/FormPreProcess.xslt"
      extra-args="screenName=\1&amp;screenPath=/screens/\1.xml&amp;id=\2&amp;section=\3"
      xslt-source="/editViews/\1/\3.html"/>
  
    <!--
    session support options follow.
    
    the server will initiate a new session when a SessionMethod exists
    and when one of the following is true:
    
    - the request contains the following form data / query args:
    action-name=login
    user-name=<a valid server username>
    password=<the corresponding password>
    (note that the names of the 'user-name' and 'password' fields
    can be changed below)
    
    - the request contains the following form data / query arg:
    action-name=anonymous-login
    (note that the value can be changed below)
  -->
    <!-- type of session: [ Cookie | URLRewrite ] (URLRewrite not yet supported) -->
    <SessionMethod>Cookie</SessionMethod>
    <!-- enables session support -->
    <!-- request form data / query arg names for the user name and password -->
    <SessionUserName>user-name</SessionUserName>
    <SessionPassword>password</SessionPassword>
    <!-- value of 'action-name' form data / query arg if signalling an anonymous session -->
    <SessionAnonymousFlag>anonymous-login</SessionAnonymousFlag>
    <!-- URI to redirect to when an expired session is requested -->
    <SessionInvalidUri>/?xslt=/Portal/index.xslt&amp;expired=1</SessionInvalidUri>
    <!-- request form data / query arg name for the URI to redirect to if the login is valid -->
    <SessionLoginUri>post-login</SessionLoginUri>
    <!-- request form data / query arg name for the URI to redirect to if the login is invalid -->
    <SessionInvalidLoginUri>invalid-login</SessionInvalidLoginUri>
    <!-- Session TTL (Time to Live) -->
    <SessionTtl>72000</SessionTtl>
</Server>

The above capability will be continued, but probably expressed via ConfigParser using common WSGI config conventions.

Application-level Caching Extensions / Services

Akara 1.0 used to have a 'cache' extension which used the underlying persistence layer as a way to facilitate application specific caching

There will be pluggable caching services. Basic built-in support will approximate 4Suite 1.x

Extension Registration

In the old repository, XSLT extensions are registered to specific XSLT documents via a specific document definition in addition to a centralized mechanism for identifying XSLT extensions (which relied on environment variables as well as other 'hooks'). How will this look in Akara 2.0?

The extension system will be similar to that of 4Suite 1.x, with some key improvements

Legacy Extension Suite (for SCore)

See: Repository XSLT Extensions

We'll at least have equivalent functionality for these, but some migration will probably be necessary

System Administration

System-specific locations, environment variables, etc:

Will be addressed based on updated cross-platform conventions

FtRPC Commands and Scripts

The FtRPC commands (and their OS-specific scrips) are critical for building and deployment of content. Specifically the repository administration commands and the repository user commands (and their supporting infrastructure - such as the setup.xml build scripts) are heavily used.

Support for 4ss install or some equivalent is crucial.

The same capabilities will be exposed through Python, which will support such scripting, though scripts will probably need to be ported

Repository Configuration

A Configuration Syntax

The repository configuration format is currently an RDF/XML document. Going forward, what is more appropriate: XML, Python, Paste Deployment, etc..

ConfigParser

Configuration Options

What are the knobs and switches that such a configuration format would export? Below are the general categories from legacy applications (examples of each are below):

Legacy Example

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://xmlns.4suite.org/4ss/properties#" xml:base="">
  <Core rdf:ID="Core">
    <SystemContainer>ftss</SystemContainer>
    <DbMaintenanceTime>02:45</DbMaintenanceTime>
    <Driver rdf:parseType='Resource'>
      <rdf:type resource='http://xmlns.4suite.org/4ss/properties#RdflibFS'/>
      <Root>.. Filesystem prefix ..</Root>
      <RdflibConnection>.. rdflib connection string ..</RdflibConnection>
      <RdflibStore>..rdflib connection adaptor..</RdflibStore>
    </Driver>
    <PidFile>/tmp/4ss.pid</PidFile>
    <LogFile>/tmp/4ss.log</LogFile>
    <!-- Controller log level (optional; default: notice) -->
    <!-- one of emerg|crit|error|warning|notice|info|debug -->
    <LogLevel>debug</LogLevel>
    <XsltStrobeInterval>3600</XsltStrobeInterval>
    <XsltExtensionModule>ExtensionModules.RDFExtensions</XsltExtensionModule>
  </Core>
</rdf:RDF>

A scenario from the article "4ss - Web Applications with XML"

The article "4ss - Web Applications with XML" included a nice overview of how a user might play around with 4SS, and we should maintain at least the substance of the represented functionality.

From the article:

>>> import sha
>>> from Ft.Server.Client import Core
>>> pw_hash = sha.new("uo").hexdigest()
>>> repo = Core.GetRepository("uo", pw_hash, "localhost", 8803)  #user name/password uo/uo; requesting from localhost
>>> repo.keys() #the keys are the names of the child resources and the values are the proxy objects for each child resource
[u'web', u'ftss', u'home']  
>>> obj = repo['ftss']
>>> obj
<Ft.Server.Client.Core.ContainerClient.ContainerClient instance at 0x81c90c4>
>>> obj.keys()
[u'servers', u'docs', u'dashboard', u'commands', u'demos', u'data', u'docdefs',
u'groups', u'users'] 
>>> obj = repo['ftss']['data']['null']
>>> obj.getContent()
'<null/>\n'  
>>> obj = repo.fetchResource('ftss/data/null')
>>> obj.getContent()
'<null/>\n'  
>>> c1 = repo.fetchResource('ftss/data')
>>> c1.getAbsolutePath()
u'/ftss/data'
>>> c2 = c1.fetchResource('..')
>>> c2.getAbsolutePath()
u'/ftss'  
>>> DOC = u"""<?xml version="1.0" encoding="UTF-8"?>
... <verse>
...   <attribution>Wole Soyinka</attribution>
...   <line>Traveller, you must set out</line>
...   <line>At dawn.  And wipe your feet upon</line>
...   <line>The dog-nose wetness of the earth</line>
... </verse>
... """
>>> home_folder = repo.fetchResource('home/uo')
>>> new_doc = home_folder.createDocument('dawn.xml', DOC, imt='text/xml') 
>>> xslt_obj = repo.fetchResource('ftss/data/decorated-xml.xslt')
>>> transform_result = new_doc.applyXslt([xslt_obj])  
>>> import urllib
>>> url = urllib.urlopen('http://4suite.org/include/4Suite-org.png')
>>> image_data = url.read()
>>> home_folder.createRawFile('4Suite-org.png', 'image/png', image_data)
<Ft.Server.Client.Core.RawFileClient.RawFileClient instance at 0x85bcbec>
>>> repo.txCommit()  

There will be similar capability

Akara/Architecture/BackwardsCompatibility (last edited 2008-11-24 18:46:31 by localhost)