Whitebeam Template Reference Documentation

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Whitebeam Template Reference Documentation

Contact Template

linkList()

Associates an entity (OU or individual) with a different parent OU or a community.

See Also

rb.contact.unlink
rb.contact.remove

Syntax

numberArray = rb.contact.linkList(target, containers)

Parameters

The 'linkList' method takes 2 parameters:

Name Type/Value Range/Length Description
targetnumberinteger, valid ID Required. The ID of the OU or individual to be attached to a new parent (higher up the organisational heirarchy).
containersarray of numbers  Required. An array of IDs of communities (and up to 1 OU) to associate with the target.

Results

The 'linkList' method returns an array of number:

Type/Value Range/Length Description
number  ID of the container entity, or -1 if the link failed

Remarks

linkList() is very similar to 'link' and 'unlink' in that it is used to associate an individual or OU with both parent OUs and/or communities. This method differs from those others in that it takes as a second parameter a list of IDs. Each entry in the list make be either the ID or a community or OU, or the the 0-(the ID), that is the negative of an ID

Where the ID is positive, the individual or OU is linked with that OU or community.

Where the ID is negaitve, the individual or OU is unlinked from that OU or community

Although the list could contain more than one OU, there isn't much value. The result will be the target being linked to the last OU in the list.

Allowable combinations are:

  • An individual may be linked to a parent OU (in which case it inherits membership of that OU, its parents and community memberships).
  • An individual may be linked directly to a community
  • An OU may be linked to a parent OU (in which case all direct and indirect children become indirect members of the parent OU, its parents and any communities of which it is a member).
  • An OU may be linked to a community (in which case all direct and indirect children become members of the community by inheritance as long as they remain linked to the OU)

Note this method returns no error if the target is not currently linked or unlinked from a requested ID. An error is however raised if one of the IDs is illegal (does not exist or is of the wrong type).

Example

The following links the user "fred" with the OU "mega" and with communities 'admins' and 'members', but removes them from 'editors'

	  fred = rb.contact.individualInfo(-1, "fred");
	  mega = rb.contact.OUInfo(-1, "mega")
	  admins = rb.contact.communityInfo(-1, "admins");
	  members = rb.contact.communityInfo(-1, "admins");
	  editors = rb.contact.communityInfo(-1, "admins");

	  rb.contact.linkList(fred.ID, [mega.ID, admins.ID, members.ID, -editors.ID);

	
Whitebeam release 1.3.36
(loadtime : 189ms)