Sconesite is an XML-based content management plugin that works alongside sconeserver's http module. Its main purpose is to enable sconeserver to host websites with dynamic content that can be edited online, allowing Wiki or Blog style sites to be built using various modern "Web 2.0" features such as AJAX and RSS.
Sconesite is loosely based on wmg, a static XHTML template compiler witten in Perl. One of the major differences between Sconesite and wmg is that with Sconesite, content is generated whenever pages are accessed, making it possible to generate dynamic sites.
The fundamental principals of SconeSite are:
SconeSite pages are composed using templates and article text stored in XML format, including XHTML. Invalid XML cannot be parsed and will generate an error, prompting you to fix the offending XML. This ensure that all pages served on your site will consist of valid XML.
URLs to pages within a site should be meaningful, concise, and easily representable.
A meaningful URL should give some indication of what the page is about and its position in the hierarchy of pages on the site. Concise and easily representable URLs are easier to write down, easier to remember, and easier to pass around.
For example, compare this:
People viewing your site don't care what content management system or scripting language you're using, so they shouldn't have to see all this meaningless junk in the URL.
The basic elements that go towards making a SconeSite web site are:
SconeSite web sites consist of a number of articles, with each article having its own directory - containing the article text and metadata, possibly other files, and directories containing sub-articles. This allows a hierarchical structure of articles to be constructed. The article text is usually stored in an XML format containing the XHTML code for the article body text, though it will soon be possible to have articles stored in any format (e.g. WikiText or similar) by defining new article processing plugins. In addition to the article text, metadata is also stored with each article, and can consist of additional information such as the title, publication date and author.
Templates are used to build XHTML web pages to serve up to site visitors via HTTP. Templates are also written in XML format, and can call in other templates as well as article text in order to build a complete web page.
Both articles and templates can contain SconeScript - an object orientated scripting language built into SconeServer. SconeScript can be used to build dynamic web pages, as it has access to the current article, the user and session information, as well as the entire hierarchy of articles available on the site.
SconeScript can be embedded into XHTML article and template files using the <?scx ... ?> syntax, similar to other server-side scripting languages. For example, the following code:
<?scx print( "The date is " + Date().string ); ?>
... is embedded below ...
The date is Wed, 12 May 2021 16:53:05 +0000
Embedded SconeScript runs within a unique Context object for each page request, which provides a set of properties and methods to enable the web page to be rendered.
The following Sconesite sub-modules are available, which are designed to provide extra functionality for sconesite-powered sites:
Maniplates images, e.g to generate thumbnails.
In addition to the standard module interface, it also has the following:
|profile-name||Profile object||Access SconeSite profile by name|
- add ( name : String, path : String )
- Add a SconeSite profile identified by name. The path parameter gives the root directory for the profile.