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

link()

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

See Also

rb.contact.unlink
rb.contact.remove

Syntax

number = rb.contact.link(target, container, force)

Parameters

The 'link' method takes 3 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)
containernumber  Required. The ID of the community or OU to associate target with.
forcebool  Optional, default = 0
If this is true then the parent is changed regardless of the current parent setting (no need to call 'unlink' first.

Results

The 'link' method returns number:

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

Remarks

link() is used to associate individuals with both parent OUs or communities.

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)

Example

The following links the user "fred" with the OU "mega", it then links "mega" to the community "friends" which has the effect of making all children of mega, including fred, members of friends

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

	  if(rb.contact.link(fred.ID, mega.ID) < 0))
	  rb.page.write("link returned error");
	  else
	  rb.contact.link(mega.ID, friends.ID);

	
Whitebeam release 1.3.36
(loadtime : 187ms)