GetNodes

Description

Get Nodes

Signature
SurveySchema GetNodes(string key, string projectId, Node parent, PoetReadFilter poetReadFilter)

Parameters

Name Data Type Description

key

string required

The authentication key

projectId

string required

ID of the project

parent

Node optional

The parent node

poetReadFilter

PoetReadFilter required

Filter used to specify the target

Response

Data Type Description

ObjectStructure containing Nodes

Example

// Create instance of the webservice
var authoring = new AuthoringSoapClient();

//***************************************************
//
// Get Nodes
// Get ConditionBranch
// Update
//
//***************************************************

// Make a new poetReadFilter
PoetReadFilter poetReadFilter =
	AuthoringUtil.NewPoetReadFilter(false,false,true,true,false);

// Only conditions
ArrayList nodeTypes = new ArrayList();
nodeTypes.Add(NodeType.Condition);
poetReadFilter.NodeTypes = (NodeType[])nodeTypes.ToArray(typeof(NodeType));

// Get all conditions in the project
SurveySchema def = authoring.GetNodes(key,projectID,null,poetReadFilter);

// Pick the first condition
Condition condition = (Condition)def.Root.Nodes.GetValue(0);

// Set the readfilter to include all nodetypes
poetReadFilter.IncludeAllNodeTypes = true;

// Get All Truenodes (nodes under the 'IF THEN'-part) of the condition
def = authoring.GetConditionBranch(key,projectID,condition,poetReadFilter,true);

// Add new node to place under the THEN-part
SingleForm single = AuthoringUtil.NewSingleForm("newSingle");

ArrayList nodes = new ArrayList((Array)def.Root.Nodes);
nodes.Add(single);
def.Root.Nodes = (Node[])nodes.ToArray(typeof(Node));

// Update
authoring.Update(key,projectID,def);