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-rest
var pressgang =
Get a topic:
expand are optional.
expand can take any of the root expandable entities, which include:
Get a Content Spec:
var PressGangCCMS = PressGangCCMS;
Next, create a new PressGangCCMS object:
var pressgang = '';
Now, you can get the XML of a topic:
To get the JSON representation of a topic:
To get a specific revision of a topic:
isContentSpec will return true if an ID is a Content Specification:
getContentSpec returns a Content Spec object, which has the plain text content of the Content Spec, and a metadata record.
You can change the logging level of the PressGangCCMS Object to get details for debugging. The
loglevel defaults to 0. Higher levels produce more trace output on the console:
pressgangloglevel = 2;
You can also do quick and dirty topic operations, like this:
getTopic returns a JSON representation of a topic.
getTopic takes an optional revision parameter between the topic ID and the callback. Here 3445 is the topic id, and 23433 is the revision:
The source is hosted on github at https://github.com/jwulf/node-pressgang-rest.