Difference between revisions of "XmlWiki"

From Organic Design wiki
Line 3: Line 3:
 
[[Image:xmlwiki_wht.jpg]]
 
[[Image:xmlwiki_wht.jpg]]
  
==A Wiki of Objects==
+
==What is xmlWiki?==
xmlWiki is a modification of the index.php page offering new features which are all maintained from editing normal wiki articles.
+
Articles in xmlWiki work just like the normal MediaWiki articles except, when their contents is xml. In this case it will be represented as a DOM object at runtime, and the content will be validated against any referenced DTD or xml-schema. If any XSLT's are referenced, xmlWiki will attempt to apply them to the article. If the XSLT-output-method is "html" then it will be reduced to a string.
 +
 
 +
==How does it tie in with MediaWiki?==
 +
Two pseudo-namespaces have been added "xml" and "sys". These are both XML articles, and their contents affects the article they're associated with. Any sys:article is readable and writable only by users in the "admin" group.
 +
*The sys:article holds security information: owner, read-groups, write-groups
 +
*An xml:article is an XML article of docType "xmlwiki.dtd"
 +
*The xml:article contains the transform-list, publish-list and base-class-list
  
*Objects can be objects stored in XML
+
==More Specifically==
*A permissions structure offering basic read/write control over articles with users and groups.
+
It hooks itself into the MediaWiki index.php file in three places and also creates a new compulsory skin called xwSkin.php in /skins. The index.php hooks are INIT, which is called on entry to require_once it, then INPUT, which is called before the POST-data is processed for saving, and finally OUTPUT, which is called instead of the wiki-page-render. The xwSkin skin builds the output as a DOM-object which is then transformed with the users (or default) XSLT-skin by the OUTPUT hook.
*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 [[xmlwiki.php|here]], templates and transforms [[Templates & Transforms|here]].
 
Current script [[xmlwiki.php|here]], templates and transforms [[Templates & Transforms|here]].
 
 
'''INIT'''
 
*do admin and exit if running directly
 
*include geshi
 
*get wiki & request environment
 
*get article (as an object if possible)
 
*get user-info
 
*get object-specific info (perms, doc-root, doc-type)
 
*build env (if action=raw, env is empty)
 
 
 
'''INPUT'''
 
*deny access if !writable
 
*currently not doing anything else
 
 
 
'''OUTPUT'''
 
*trap MediaWiki output
 
*extract links (not used yet)
 
*apply security
 
*transform for raw, view, preview
 
*if saving, do publishing
 
*render output & messages
 
 
 
'''ARTICLE FUNCTIONS'''
 
*get article content
 
*get article type
 
*domificate article
 
*transform article
 
 
 
'''TRANSFORMS''' (Temp - will be separare articles)
 
*document transforms
 
*image transforms
 
*layout transforms
 
*database table transforms
 
*transform object to php-nav-tree
 
*geshi syntax highlighting
 
 
 
'''FUNCTIONS'''
 
*etxract hrefs from text
 
*message/log
 

Revision as of 00:15, 10 June 2005

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

What is xmlWiki?

Articles in xmlWiki work just like the normal MediaWiki articles except, when their contents is xml. In this case it will be represented as a DOM object at runtime, and the content will be validated against any referenced DTD or xml-schema. If any XSLT's are referenced, xmlWiki will attempt to apply them to the article. If the XSLT-output-method is "html" then it will be reduced to a string.

How does it tie in with MediaWiki?

Two pseudo-namespaces have been added "xml" and "sys". These are both XML articles, and their contents affects the article they're associated with. Any sys:article is readable and writable only by users in the "admin" group.

  • The sys:article holds security information: owner, read-groups, write-groups
  • An xml:article is an XML article of docType "xmlwiki.dtd"
  • The xml:article contains the transform-list, publish-list and base-class-list

More Specifically

It hooks itself into the MediaWiki index.php file in three places and also creates a new compulsory skin called xwSkin.php in /skins. The index.php hooks are INIT, which is called on entry to require_once it, then INPUT, which is called before the POST-data is processed for saving, and finally OUTPUT, which is called instead of the wiki-page-render. The xwSkin skin builds the output as a DOM-object which is then transformed with the users (or default) XSLT-skin by the OUTPUT hook.

Current script here, templates and transforms here.