Difference between revisions of "XmlWiki"

From Organic Design wiki
Line 19: Line 19:
 
The eneral structure of the xmlwiki.php script is as follows:
 
The eneral structure of the xmlwiki.php script is as follows:
  
'''INIT''' (called after main-misc-setup)
+
Current script [[xmlwiki.php|here]]
*get wiki/request env
+
<pre>
*get article
+
# INIT
*permissions
+
# - get wiki/request env
'''INPUT''' (called before processing $action)
+
# - get article
*if valid xml posted, update article-dom
+
# - permissions
*put into POST as text for MediaWiki
+
# INPUT
'''OUTPUT''' (called instead of $wgOut->output)
+
# - validate xml and report error or,
*trap MediaWiki output
+
# - process form-input (backslashes etc if necessary)
*extract content and links
+
# OUTPUT
*add xml link (action=xwXML)
+
# - trap MediaWiki output
*render transformed article if view/preview
+
# - extract content and links
*render description-textarea if editing
+
# - if view/preview, do trsnaform:
*render xml-textarea(xw.xml) if $action=xwXML
+
- if docType is an xwArticle, see above
*render wiki content if special
+
#  - replace view/preview with transformed article
*publish transformed article if saving
+
# - render output
'''FUNCTION''' (common functions)
+
# - if saving, foreach in publish-list,
*get article as dom
+
#  - do transform but with specified env
*extract hrefs from text
+
#  - publish
*message
+
# FUNCTION
'''ADMIN''' (executed when xmlwiki.php requested directly)
+
# - get article as dom
*enable patch
+
# - process dom-article (pass PT,XSLT list and DOM-article, returns DOM-result)
*disable patch
+
# - etxract hrefs from text
 +
# - message
 +
# ADMIN
 +
# - enable/disable patch
 +
</pre>

Revision as of 05:51, 30 May 2005

File:Xmlwiki old.jpg        Old logo: File:Xmlwiki wht.jpg

A Wiki of Objects

xmlWiki is a modification of the index.php page offering new features which are all maintained from editing normal wiki articles.

  • All articles are objects stored in XML
  • An additional xml page allows editing the data aspect of an article as a tree.
  • A permissions structure offering basic read/write control over articles with users and groups.
  • PHP Functions can be created and maintained by developers and can be dynamically applied to articles before rendering.
  • Articles can made to automatically publish remotely over HTTP or FTP when edits are saved.

If the browser is fully XML-capable, then requested articles can be returned as XML for the client to transform with an XSLT and render. If not, xmlWiki can transform the document before returning it to the client.

The structure of xmlWiki

The xmlWiki layer is composed of a single PHP script called xmlwiki.php which, when called directly hooks or unhooks itself from three places in the MediaWiki index.php script.

The eneral structure of the xmlwiki.php script is as follows:

Current script here

# INIT
# - get wiki/request env
# - get article
# - permissions
# INPUT
# - validate xml and report error or,
# - process form-input (backslashes etc if necessary)
# OUTPUT
# - trap MediaWiki output
# - extract content and links
# - if view/preview, do trsnaform:
#   - if docType is an xwArticle, see above
#   - replace view/preview with transformed article
# - render output
# - if saving, foreach in publish-list,
#   - do transform but with specified env
#   - publish
# FUNCTION
# - get article as dom
# - process dom-article (pass PT,XSLT list and DOM-article, returns DOM-result)
# - etxract hrefs from text
# - message
# ADMIN
# - enable/disable patch