The pseudo-code in this section illustrates the following operations:
Note: Comments using <> notation represent code omitted for ease of understanding. Return code checking is omitted for ease of understanding.
# 1. Initialize the API use Netegrity::PolicyMgtAPI; $policyapi = Netegrity::PolicyMgtAPI‑>New(); $session = $policyapi‑>CreateSession("adminid", "adminpwd"); # 2. Add an affiliate domain $affdomain = $session‑>CreateAffDomain("name", "description"); # 3. Add a previously obtained user directory to the affiliate domain # <Obtain $userdir via $session‑>GetAllUserDirs> $affdomain‑>AddUserDir($userdir); # 4. Create an affiliate in the affiliate domain $affiliate = $affdomain‑>CreateAffiliate("affname", "password", http://authurl, 60, 30); # 5. Add users from a previously obtained user table to the affiliate # <Obtain $user via $userdir‑>GetContents> $affdomain‑>AddUser($user); # 6. Add an attribute for the affiliate $affdomain‑>AddAttribute(1, "staticAttrName=StaticAttrValue"); # 7. Get an existing affiliate domain $affiliate = $affdomain‑>GetAffiliate("affname"); # 8. Get all the affiliates in an affiliate domain @affiliates = $affdomain‑>GetAllAffiliate(); # 9. Get all the attributes in an affiliate @affiliateAttrs = $affiliate‑>GetAllAttributes(); # 10. Remove an affiliate domain $session‑>DeleteAffDomain($affiliate);
Copyright © 2010 CA. All rights reserved. | Email CA about this topic |