0.0.40 • Published 6 years ago

xceling-page v0.0.40

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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 '17.

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

NOTE: This module sets a default content security policy header, and you will need to change this to allow for offsite accesss of various resources such as scripts, AJAX requests, images and CSS.

EXCELING-PAGE NOTES:

This module is made up of a primary function that contains the excel-page class definition along with hidden methods. The function returns a pointer to the class definition. When the envelope function is called there is a required input object containing a storage type (see xceling-page.js and ./stores/README.txt).

usage: var Page = require('xceling-page')({store: 'mongo'}); var pg; Page.getSingleObject({Flags:Page.FLAG_ROOTPAGE}, function(err, page) { if(!err) pg = page; else util.log(err); }); -- or -- pg = new (require('xceling-page'))({see Page definition for options});

Public class methods

  • Page.getSingleObject(args, fn)
  • Returns a single Page instance.
  • args = object of items to search by (see instance properties below) using name:value - such as {URL:'/'}
  • fn = a callback function(error_message, page_instance) where error_message will be null if the Page instance was successfully created.

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

  • pg.Configuration = getter only, this is the configuration data for this Page instance. This will reflect any changes made internally or by the instance setters.
  • pg.ID = getter only, this id is set internally and is unique to Page definition used to create the class.
  • pg.Title = getter and setter, this is an arbitrary value usually a string, this is the displayed entry title
  • pg.Description = getter and setter, this is an arbitrary value usually a string, this is a description used for internal purposes.
  • pg.URL = getter and setter, this is the url that this page is accessed by; this string may reflect parent pages.
  • pg.Flags = getter and setter, an array of strings reflecting the appropriate Page flags.
  • pg.Layout = getter and setter, this is an arbitrary value usually a string, this is the public display for a particular page instance.
  • pg.HTTPStatusCode = getter and setter, this is an arbitrary value usually a string, this is the returned html status code
  • pg.SEOPageTitle = getter and setter, this is an arbitrary value usually a string, this is the html header page title
  • pg.SEOPageDescription = getter and setter, this is an arbitrary value usually a string, this is the html header meta tag page description
  • pg.SEOPageKeywords = getter and setter, this is an arbitrary value usually a string, this is the html header meta tag page keywords
  • pg.TemplateID = getter and setter, this is a unique value representing the database or other _id for the associated template
  • pg.Template = getter and setter, this is PageTemplate instance associated with this Page instance.

Public instance methods

  • pg.doLayout(req, res, fn)
  • Method that directs page_instance to create it's public layout.
  • req = an express.request object
  • res = an express.response object
  • fn = a callback function(error_message, page_instance) where error_message will be null if the layout was successfully created.
  • page_instance.deleteLayout(req, res, fn)
  • Method that directs page_instance to delete it's public layout.
  • req = an express.request object
  • res = an express.response object
  • fn = a callback function(error_message, page_instance) where error_message will be null if the layout was successfully deleted.
  • page_instance.saveAndDoLayout(req, res, fn)
  • Method that directs page_instance to save in the database and then recreate public layout.
  • req = an express.request object
  • res = an express.response object
  • fn = a callback function(error_message, page_instance) where error_message will be null if the layout was successfully saved and created.
  • page_instance.send(res)
  • Method that directs page_instance to send it's final layout.
  • res = the express.response object to send the layout to
0.0.40

6 years ago

0.0.37

7 years ago

0.0.36

7 years ago

0.0.35

7 years ago

0.0.30

7 years ago

0.0.22

7 years ago

0.0.21

7 years ago

0.0.15

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago