node

Functions to get, query and manipulate nodes.

Example
var nodeLib = require('/lib/xp/node');

Classes

RepoConnection

Methods

(static) connect(params) → {RepoConnection}

Creates a connection to a repository with a given branch and authentication info.

Parameters:
Name Type Description
params object

JSON with the parameters.

Properties
Name Type Attributes Description
repoId object

repository id

branch object

branch id

user object <optional>

User to execute the callback with. Default is the current user.

Properties
Name Type Attributes Description
login string

Login of the user.

userStore string <optional>

User store containing the user. By default, all the user stores will be used.

principals Array.<string> <optional>

Additional principals to execute the callback with.

Returns:

Returns a new repo-connection.

Type
RepoConnection
Example
// Connect to repo 'myRepo', branch 'master'.
var myRepo = nodeLib.connect({
    repoId: 'my-repo',
    branch: 'master',
    principals: ["role:system.admin"]
});

myRepo.create({
    _name: "myName",
    displayName: "This is brand new node"
});