sconemad

technology, scones, nonsense

Loading...

Profiles

Twitter

GitHub

Launchpad

Subscribe to my RSS Feed

Admin

sconesite

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.

Principals

The fundamental principals of SconeSite are:

Valid XML

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.

Meaningful URLs

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:

http://www.sconemad.com/sconeserver/

with this:

http://www.sconemad.com/blah/whatsit_doing.php?strange_value=237837849348934734&meaningles=junk

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.

Elements

The basic elements that go towards making a SconeSite web site are:

Articles

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

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.

Embedded SconeScript

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 Sun, 20 Jan 2019 17:40:10 +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.

Sconesite Sub-Modules

The following Sconesite sub-modules are available, which are designed to provide extra functionality for sconesite-powered sites:

image

Maniplates images, e.g to generate thumbnails.

SconeScript Interface

In addition to the standard module interface, it also has the following:

Properties

Name Type Descripion
profile-name Profile object Access SconeSite profile by name

Methods

add ( name : String, path : String )
Add a SconeSite profile identified by name. The path parameter gives the root directory for the profile.
Updated on 2011-10-19 13:32:37 +0000 | Requested on 2019-01-20 17:40:10 +0000