Home

Awesome

Cmsed

A component library for Vibe that functions as a CMS.<br/> There is currently a getting started guide in the wiki link little incomplete at the moment. But will help a lot if you are new.

Features:

Build status:

Cmsed:base Build Status<br/> Cmsed:test Build Status

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/defs.d.

The current request and response is located in defs.d as well. As http_request and http_response respectively.

You can utilise arguments to route functions to specify parameters. This includes from form (post ext.) and query string for get.

class Test : OORoute {
	@RouteFunction(RouteType.Get, "/someargs")
	void someArgs(string a, string b) {
		http_response.writeBody(a ~ ", " ~ b);
	}
}

Forces errors and checks against e.g. string/integer/float/boolean arguments. Enables calling it via: http://example.com/someargs?a=text1&b=text2<br/> You can further do validation from the arguments.

Javascript generation

Javascript is automatically generated to represent the data models and routes. This enables you to not need to write any ajax code.<br/> Configuration of these features is in the apropriete defs files under cmsed/base/internal/generators/js

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).