Programming in Sitellite
Chapter 1: The Sitellite Development Model
What is Sitellite?
Sitellite is a website content management system (CMS), which provides features for creating, publishing and managing content on a website. A CMS provides the system for the various roles involved in the website lifecycle to come together, including the programmers, designers, administrators and content creators.
Main Components
Sitellite Application Framework
At the core of Sitellite is a standard library of over 100 PHP classes that provide generic, reusable components for building any type of web application. This includes a database abstraction layer, template libraries, a class loader, form handling, and more.
The Content Server
The content server is the publishing component of Sitellite, which controls access to content such as web pages or news stories, as well as to applications (apps) written on top of the Sitellite framework, and their components (boxes, forms, libraries, collections). The content server is in charge of parsing a visitor request, determining what they are requesting, and how to display it (design or output templates).
The Content Manager
The content manager is the GUI used b editors and administrators to update the web site content, as well as to access additional apps written on top of the framework.
Model-View-Controller, Sitellite style
Sitellite was designed as a platform for deploying multiple web-based applications with a high degree of compatibility and integration between each of them. We realized that you can look at any website as a collection of applications, from its news section, to user comments, to a discussion forum, search, blog, contact forms, or anything else. But each of these has to come together to make up a consistent visitor experience.
This is where many pure development frameworks fall short, and provides the central distinction of the Sitellite development model, or what we call extended MVC (MVC2). At its core, a CMS is an implementation of the MVC usage pattern. The content server is the controller, the output templates are the view, and the apps and content are the model.
Where we extend this is that each application also implements the MVC pattern on top of this, allowing the same models, views, and controller to be shared among multiple apps, while still allowing for maintainable, organized code within each app.
MVC inside a Sitellite application
There are several different components that make up a complete application. In terms of the actual source code, Sitellite splits this into 3 different areas:
- Libraries – These go in the 'lib' folder. They make up the abstraction layer between the database and the controller code. In MVC terms, these are the Model.
- Boxes – These go in the 'boxes' folder. A box is essentially just a PHP script that takes the visitor request parameters, calls the appropriate methods from the Model, and compiles the results using a template. While Sitellite's content server acts as the central Controller, each box acts as a mini Controller itself.
- Forms – Forms go in the 'forms' folder. They act very much like boxes, but are limited to form handling (display, validation, results processing). Sitellite automatically includes the necessary form classes from SAF to make coding them a bit faster. Forms can be considered nother form of a Controller, like the boxes.
After the source code itself, an app also consists of a few additional components:
- Templates – These go in the 'html' folder. In Sitellite there are global templates for the site design, and application-specific templates for rendering the generic output of the application (independent of display style/CSS). The app-specific templates use the .spt file extension and use a template language called SimpleTemplate which is better suited to app development. Global templates use an XML-based template format called XT, which are better suited to design output.
- Configurations – These go in the 'conf' folder. Configuration info includes instructions for how Sitellite should handle the app, as well as settings that customize the app for a particular site.
- Data – These go in the 'data' folder. Data would include file uploads associated with usage of the app. Each app may maintain its own storage folder, or can integrate with Sitellite's built-in Web Files document repository or the Image Manager feature in Sitellite. This depends on the needs of each particular app.
- Translations – These go in the 'lang' folder. Sitellite stores translations of content separately, but individual text strings in an app also need translating and Sitellite provides a means of doing that as well, and these are stored in the 'lang' folder. It's easy to make applications multilingual in Sitellite.
- Install data – These go in the 'install' folder. This would include any custom content types defined in the app, the database schema for the app, scheduled tasks to be installed in the scheduler, etc.
As you can see, there's a lot more than just a model, view and controller to a real-world application. But Sitellite takes care of each of these in a standardized way across each app, which makes it easier for everything to work together nicely.
But enough with the theory, let's get into some practical examples.
Sitellite Installation Guides
Chapter 2: Hello World: A first Sitellite application »
Comments
You must be logged in and registered for this course to comment.



