xceling-pagetemplate

0.0.40 • Public • Published

The xceling-* suite is a work new to nodejs, and as such should not be relied on. I am actively working on this, however, and hope to see a useful version available before spring of '15.

This code is based on PHP based CMS I developed and is currently in production use on a good number (the only number I can give is more then 30) websites. These websites include the small personal and some large commercial ones.

If you are interested in helping move this nodejs project forward or would like to see the PHP version contact me at rama@ramabahama.net

DYNASITE-PAGETEMPLATE NOTES

This module contains the 'class' that encapsulates a dynamic page template definition that is stored in the database (see README.txt in ./stores).

The 'class' is required with an object that specifies the storage type to use (see below). The storage module must be located in the stores subdirectory and follow this naming convention: [storage type]-store.js. See stores/README.txt for storage module requirements.

usage:
var PageTemplate = require('xceling-pagetemplate')({store: 'mongo'});
var pgt;
PageTemplate.getSingleObject({ID:2, Flags:PageTemplate.FLAG_ACTIVE}, function(err, paget) {
if(!err) pgt = paget;
else util.log(err);
});
-- or --
pgt = new PageTemplate({see PageTemplate definition for options});

Public 'class' methods

- PageTemplate.getSingleObject(args, fn)
* Method that returns a single PageTemplate instance.
* args = object of items to search by (see instance properties below) using name:value - such as {ID:5}
* fn = a callback function(error_message, page_instance) where error_message will be null if the PageTemplate instance was successfully created.

The internal instance properties structure is not referenced directly - instead all outside references are
through the getters and setters:

- page_instance.ID = getter only, this id is set internally and is an integer unique to this entry in the table.
- page_instance.Title = getter and setter, this is an arbitrary value usually a string, this is the displayed entry title
- page_instance.URL = getter and setter, this is an arbitrary value usually a string, this is a url friendly representation of the title
- page_instance.Description = getter and setter, this is an arbitrary value usually a string, this is a description used for internal purposes.
- page_instance.Flags = getter and setter, an integer reflecting the or'd values of the appropriate Page flags.
- page_instance.TimeStamp = getter only, this is a Linux timestamp used for internal purposes.

Public instance methods

Package Sidebar

Install

npm i xceling-pagetemplate

Weekly Downloads

4

Version

0.0.40

License

MIT

Last publish

Collaborators

  • ramaschneider