![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
pressgang-rest
Advanced tools
A high level library for REST communication with a PressGang Component Content Management System (CCMS) Server
#node-pressgang-rest
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.
##Installation
npm install pressgang-rest
var pressgang = require('pressgang-rest);
Get a topic:
pressgang.getTopic('http://127.0.0.1:8080', 4324, {revision: 2343, expand: tags},
function (err, topic) {
if (err) return console.log(err);
console.log('Got Topic %s at revision %s', topic.id, topic.revision);
console.log('XML is %s', topic.xml);
});
revision
and expand
are optional. expand
can take any of the root expandable entities, which include:
tags
incomingRelationships
outgoingRelationships
sourceUrls_OTM
bugzillaBugs_OTM
properties
logDetails
revisions
Get a Content Spec:
pressgang.getSpec('http://127.0.0.1:8080', 7069, function (err, spec) {
if (err) return console.log(err);
console.log('Got Spec ID %s at revision %s', spec.id, spec.revision);
console.log('The spec contents: %s', spec.content);
console.log('The spec metadata: %s', JSON.stringify(spec.metadata));
});
First, require pressgang-rest
:
var PressGangCCMS = require('pressgang-rest').PressGangCCMS;
Next, create a new PressGangCCMS object:
var pressgang = new PressGangCCMS('http://127.0.0.1:8080/TopicIndex');
Now, you can get the XML of a topic:
pressgang.getTopicData('xml', 8445,
function(err, result){
console.log('The topic xml content is:' + result);
});
To get the JSON representation of a topic:
pressgang.getTopicData('json', 8445,
function(err, result){
console.log('The JSON representation of the topic is:'
+ JSON.stringify(result);
});
To get a specific revision of a topic:
pressgang.getTopicData('json', 8445, 10405,
function(err, result){
console.log('The XML of revision 10405 is:'
+ result.xml;
});
isContentSpec
will return true if an ID is a Content Specification:
pressgang.isContentSpec(456,
function(err, is){
if (is) console.log('Topic 456 is a Content Specification')
});
getContentSpec
returns a Content Spec object, which has the plain text content of the Content Spec, and a metadata record.
pressgang.getContentSpec(456,
function(err, result){
console.log(result.spec); // Plain-text of the spec
console.log(result.metadata); // All the spec metadata in an object
});
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:
pressgang.loglevel = 2;
You can also do quick and dirty topic operations, like this:
getTopic
returns a JSON representation of a topic.
PressGangCCMS.getTopic('http://localhost:8080', 3445, function(topic) { console.log(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:
PressGangCCMS.getTopic('http://localhost:8080', 3445, 23433, function(topic) { console.log(topic); });
##Source Code The source is hosted on github at https://github.com/jwulf/node-pressgang-rest.
Up to 0.0.13 it was written using Microsoft TypeScript, and compiled to JavaScript using the node typescript module. There is a TypeScript declaration file in the module.
From 0.1.0 I made it straight-forward JavaScript. Tests have not been updated yet.
FAQs
A high level library for REST communication with a PressGang Component Content Management System (CCMS) Server
The npm package pressgang-rest receives a total of 5 weekly downloads. As such, pressgang-rest popularity was classified as not popular.
We found that pressgang-rest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.