Description

CMSed provides common components for Vibe. Designed to work as a CMS out of box.

Package Information

Version0.2.0 (2014-Feb-09)
Repositoryhttps://github.com/rikkimax/Cmsed
LicenseMIT
CopyrightCopyright © 2014, Richard Andrew Cattermole
AuthorsRichard Andrew Cattermole
Registered byRichard Andrew Cattermole
Sub packages
cmsed:base
cmsed:rebuildTools
cmsed:user
cmsed:test
Dependencies

cmsed:base

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

Cmsed

A component library for Vibe that functions as a CMS.

Features:

  • Router based upon classes.
  • Caches (pulls all values from a database reguarly for a model), with thanks to update mechanism.
  • Support for Dvorm as ORM.
  • Install / normal running modes.
  • Node vs all node install configuration differentiation (node in file includes e.g. database vs in database as a cache)
  • Session storage resides in database.
  • Widget registration and usage support. Contains list of all widgets with routes accessible at runtime.
  • Logging of all routes, widgets, data models, access.
  • Can be executed in automatic reload mode. Utilising a command argument. For use in production environement where having it able to be reconfigured and rebooted on error is required.

Examples:

Routes

import cmsed.base;

class Home : OORoute {
    @RouteFunction(RouteType.Get, "/", "index")
    bool index() {return true;}
}

shared static this() {
  registerRoute!Home;
}

You can utilise RouteGroups to append e.g. path values on.

class Home : OORoute {
  @RouteGroup(null, "/myhome") {
    @RouteFunction(RouteType.Get, "", "index")
    bool index() {return true;}
  }
}

Note UDAs (or attributes) are stackable. This means you can have quite a lot of those RouteGroups!

There are more check out routing.d.

The current request and response is located in routing.d as well. As httprequest and httpresponse respectively.

Models

Data models are pretty much as described by Dvorm.

Except a simple registration is required.

shared static this() {
  registerModel!Book;
}

Don't worry about the logMe method on these models! Thats handled and called automatically upon registration.

Note shared is a required part of this. Without it you'll get 8+ registrations of said model (one for each thread). Same goes for routing. But here it's more important as it is executed and grabbed for values e.g. widgets (route and position/name being requested).

Available versions

0.2.0 ~master ~dakka_dev ~cmsed_livereload