A high level library for REST communication with a PressGang Component Content Management System (CCMS) Server


A node module that provides a REST client library for the PressGang CCMS. It provides a more semantic interface for application development than the raw PressGang REST interface. Uses restler for the REST interface.


npm install pressgang-ccms-rest-node

First, require pressgang-ccms-rest-node:

var PressGangCCMS = require('pressgang-ccms-rest-node').PressGangCCMS;

Next, create a new PressGangCCMS object:

var pressgang = new PressGangCCMS('');

Now, you can get the XML of a topic:

pressgang.getTopicData('xml', 8445, 
        console.log('The topic xml content is:' + result);

To get the JSON representation of a topic:

pressgang.getTopicData('json', 8445, 
        console.log('The JSON representation of the topic is:' 
        + JSON.Stringify(result);

isContentSpec is an example of a more semantic interface to PressGang:

        if (is) console.log('Topic 456 is a Content Specification')