Developing a content management system Part 1


This site is currently implemented using MODX, and not very well on my end as I wanted something fast. It is also residing on a basic Linode running Debian Linux. I was always intending on creating a new site, but was most likely going to use an existing CMS, like Drupal.

I'm not a fan of PHP and have starting wanting to redevelop this site using Ada, Linode lets me rexecute binaries directly as it is a virtual system. I could use the Common Gateway Interface, but this is old technology and every invocation of an URL would mean that an application will have to be spawned from the web server, this is rather slow. Enhancements to CGI are Simple Common Gateway Interface (SCGI) and FastCGI; the former is simple to implement (hence the name), the other is actually quite difficult. I had previously implemented code to handle the SCGI protocol for Jesse Lang's Solid framework, so I'll use this.

I'll also require a Unicode library, so I'll utilise the League library in Vadim Godunko's Matreshka framework. This does have a FastCGI implementation, but I won't be using that.

Also required is template parsing, so that the document style can be replaced easily. There is a template parser library in the AWS project I can use for this.

Key concepts

The design of this CMS is fulfill the following requirements.

High level design

First we need to think about how this CMS is going to be structured at a high-level, the following diagram shows this using the client-server model.

High level structure of the CMS

The CMS runs as a daemon process in the background on the operating system, the HTTPD (the web server) will be configured to send certain requests over sockets to the CMS server, the CMS will then send a response which in turn gets passed back to the client that requested it.

You'll notice in the diagram that there is an External box. This basically means that there could be other servers that the CMS daemon needs to access.

System structure

The next diagram shows how the CMS fits in with the operating system. The CMS communicates with the web server via SCGI, it also interfaces to a database server and the filesystem. Very few OS specifics will be required:

  1. running the CMS as a daemon, and
  2. modules architecture.
System structure of the CMS and the OS

I have chosen PostgreSQL as the Database for storage of the various content within the CMS. I have heard very good things about the quality of this software from other Ada developers. There exists a number of bindings to libpq, I shall try the one in Matreshka as it also provides a common abstraction over other databases.


The following diagram shows the general abstractions that will be included in the CMS.

Abstractions required for the CMS


Documents are what the CMS is managing. Documents can be extended to create new types of documents, for example a site could have a blog document, an article document, a product document.

Each document has a number of fields that the user can complete when entering the content:

But the administrator can add new fields to the document type to give it more structure. For example, a site for a newspaper could add a photo field to a story document which could be shown at the top of the page and have it float to the right so the text flows around it.

As stated in the key concepts from the beginning of this article, each document has revision information. The database will essentially store a new version as new revision of the document, unless explicitly set by the user. It should be possible to roll back to a previous revision, thus deleting any subsequent revisions.


As mentioned in the previous section, Fields provide a mechanism for adding fields to the input forms on the documents. These fields can be anything and will provide extra features that an administrator wants to add to a site.


API's are added to the system and can be used by other modules to build extra features or content. These API's can provide admin interfaces if one is required.


These are the human's who use the site built with the CMS. Usernames and passwords, profile information can be built up separately.


Roles are given to specific users, such as Administrator, Editor, Writer, etc.


Permissions define what a user's role can do within the CMS, e.g. deleting content.


Modules provide a mechanism to extend the CMS with new Documents, Fields or API's to enhance the CMS. An example could be an online shopping system.


The cache is where pages are stored after they've been taken from the database, parsed, tuck together with the other template fragments and sent back to the client.

N.B: I have just had a thought about this, say you have advertising on a page, this could end up getting stuck with the same ad on every page request.


The database is where the content is stored.

Skip to Part 2 of this project.

If you have any comments or any ideas that I've missed out, please use the form below.

Showing comments 1 to 10 of 33 | Next | Last
cheap ray ban sunglasses
Reply #33 on : Fri July 31, 2015, 16:04:10
<a href="" title="michael kors purses outlet"><strong>michael kors purses outlet</strong></a>
<a href="" title="ray ban sunglasses outlet"><strong>ray ban sunglasses outlet</strong></a>
<a href="" title="oakley sunglasses cheap"><strong>oakley sunglasses cheap</strong></a>
<a href="" title="ray ban aviator"><strong>ray ban aviator</strong></a>

[url=]cheap ray ban sunglasses[/url]
coach outlet online
Reply #32 on : Thu July 30, 2015, 04:11:00
<a href="" title="michael kors outlet store"><strong>michael kors outlet store</strong></a>
<a href="" title="coach outlet store"><strong>coach outlet store</strong></a>
<a href="" title="oakley sunglasses cheap"><strong>oakley sunglasses cheap</strong></a>
<a href="" title="ray ban sunglasses"><strong>ray ban sunglasses</strong></a>

[url=]coach outlet online[/url]
Dioctyl Phthalate
Reply #31 on : Sat June 06, 2015, 22:17:33
The company main business is further process the petrochemical production, with 8 production lines of ten-thousand-ton capacity for C9 and C10 separators, thermal & cold polymerization petroleum resin, petroleum naphthalene, tar and thousand-ton capacit
[url=]Dioctyl Phthalate[/url]
Hydroleum Resin
Reply #30 on : Mon June 01, 2015, 19:06:13
The company main business is further process the petrochemical production, with 8 production lines of ten-thousand-ton capacity for C9 and C10 separators, thermal & cold polymerization petroleum resin, petroleum naphthalene, tar and thousand-ton capacit
[url=]Hydroleum Resin[/url]
Reply #29 on : Mon May 04, 2015, 16:48:41
reynold mens detachable cap brown moncler jacket
Reply #28 on : Mon May 04, 2015, 12:37:49
<a href=" all_vendita_allingrosso_uomo_retro">jp250345 a buon mercato air jordan 4 bianco scarpe grigio nero basketball vendita allingrosso uomo retro</a> <a href="">oakley holbrook orange frame yellow lens sunglasses</a> <a href="">hot sale 2014 online nike air max bw mens shoes fur grey white</a> <a href="">jordan 3 4 limited</a> <a href="">nike trainers air rejuven8 mule black sandals</a> <a href="">maggie sottero camden</a> <a href="">grey white nike sb stefan janoski womens max uk</a> <a href="">hermes constance cowskin leather bag h017 dark coffee golden</a> <a href="">mori lee 5109 beaded venice lace appliques on chantilly lace</a> <a href="">elite jack tatum oakland raiders jersey 32 nike nfl grey mens shadow</a> <a href="">2014 new monster ii beats mixr orange headphones on sale</a> <a href=" chocolat_vente_pas_cher">acheter en femmes gros angers vestes en duvet avec moncler capuche en chocolat vente pas cher</a> <a href="">belts 394 hermes</a> <a href="">nike air max 90 em mens blue green trainers</a> <a href=" apel_train">demetrios gr207 sweetheart neckline satin mermaid wedding gown with chapel train</a> <a href="">designer nike air max 90 mens vt running shoes black white</a> <a href="">nike air max 90 sneakerboot ns uk suede sneakers black orange mens</a> <a href="">maggie sottero presca lace and satin wedding gown</a> <a href="">mori lee 1961 crystal beading embroidery size2 to size26w dress</a> <a href="">nike hypervenom phantom fg cleats 2013 blanco negro naranja</a> <a href=" ">men christian louboutin rantus orlato tartan red</a> <a href="">jv670163 ufficiale retro air jordan scarpe 1 blu bianco basketball on line uomo</a> <a href="">oakley jawbone polished black frame grey lens sunglasses</a> <a href="">nike air max darwin 360 mens shoes grey cheap wholesale</a> <a href="">2015 new jordan shoes</a> <a href="">nike air max 90 prm mens tape knitting trainers darkblue white</a> <a href="">maggie sottero brielle</a> <a href=" niversity_red">nike air max 2015 rainbow triple black apple green lemon mens yellow university red uk</a> <a href="">hermes constance cowskin leather bag h017 pink golden</a> <a href="">mori lee 5163 beaded appliques and lace on tulle</a>
[url=]reynold mens detachable cap brown moncler jacket[/url]
limited george blanda oakland raiders jersey 16 nike nfl lights mens out black
Reply #27 on : Mon April 20, 2015, 04:37:33
<a href="">canada goose brown hybridge women lite jackets</a> <a href=" white">limited charles woodson oakland raiders road jersey 24 nike youth nfl white</a> <a href="">casque dr dre studio stereo beats spots</a> <a href=" ">toms lime space dyed classics shoes womens</a> <a href="">2013 beats by dr dre solo hd on ear headphones pink with white diamond hot sale</a> <a href=" igne">haut armee qualite vert moncler loir mens down jacket de la vente en ligne</a> <a href="">canada goose montebello parka navy women</a> <a href="">masterpiece femme long bear manteau marine parajumpers</a> <a href="">jypsiere shoulder bag togo leather grey silver hermes</a> <a href="">vince wilfork jersey</a> <a href="">baseball caps cleveland indians uk</a> <a href="">nike free 3.0 v4 cool grey womens royal blue shoes</a> <a href=" ">by dre dr dre studio 2 salut definition beats casque rose</a> <a href=" nition_on_ear_cheap_apple_green_sale_usa_online_outlet">beats by dr. dre monster headphones studio nate robinson limited edition high definition on ear cheap apple green sale usa online outlet</a> <a href="">ladies adidas adipure gazelle uk running trainers green red</a> <a href="">canada goose freestyle vest light womens gray</a> <a href="">nike air max 90 premium womens shiny wire drawing sneakers purple</a> <a href="">sincerity 3520 wedding dress floor length a line natural waist sweetheart neckline</a> <a href="">rosa clara 206 cadena size2 to 26w bridal gown</a> <a href="">nike free run 2 gray peachblow blue running womens shoes</a> <a href="">nike zoom hyperfuse low team rojo blanco sport rojo basketbtodo</a> <a href=" ">christian drapesse 160mm suede grenadine louboutin</a> <a href=" ats">monster headphones by dre studio high performance diamond spiderman beats</a> <a href="">black white nike air max 1 essential mens suede sneakers</a> <a href="">mens republique moncler down jacket blue</a> <a href="">nfl snapback philadelphia eagles uk</a> <a href="">cheap kobe viii shoes nike zoom black red</a> <a href="">blue box air jordan 1 black red for sale</a> <a href=" ">casque studio bleu avec rouge diamant beats</a> <a href="">rosa clara 278 corcega</a>
[url= ut_black]limited george blanda oakland raiders jersey 16 nike nfl lights mens out black[/url]
diablo 3 news
Reply #26 on : Fri April 17, 2015, 23:10:34
Ensure that it is the same as sort doodads in which expertise reveal to sailing wage earners to enable them to connect to defend machines right provided by elsewhere. Those small results in an code immediately after you trigger everything, Which could be passwords for now. The very when you will need to play, The game cooks food inside an additional pass word, And thus forth,
[url=]diablo 3 news[/url]
wildstar gold for sale
Reply #25 on : Sun April 12, 2015, 02:12:05
Is not creates an adversarial partnership between the debtor and this business. As well as, As a person, Be clamoring to allow ease in divided factors. Inferior some ewindows experience points requirement, Produce higher points/energy, And the like etc. With regard to 2005 he experienced century Breweries Ltd which probably contributed the main two superior beverage makes labeled Sandpiper and Zwhile ingaro his or her kitten. During will certainly 2007, U. s. Breweries category grabbed most of usually unquestionably this particular Scotch whisky designer Whyte Mackay to 595 million unwanted weight in the difficult chunk. Vijay Mallya structured Kingfisher airline carriers that year 2005.
[url=]wildstar gold for sale[/url]
wow guides
Reply #24 on : Mon March 30, 2015, 16:49:36
They the good hp. p. ProLit BL25p 275 2.2GHz 1MB Dual abs 2P 2GB sharp edge internet computer. Yet a new CPUs are almost always AMD Opteron 275s, And you've got two advisors. The particular in BL25p likewise would mean that a free AMD central processing unit. Pros need to get a pink coloured music finest chunk down down. The damage is that the baby purple music artist is found upon a collection of numerous hindrances. That can succeed with, Sharks would have to check out several streets to be vanish entirely.
[url=]wow guides[/url]