Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript help in ITIM

Status
Not open for further replies.

frito1981

MIS
May 11, 2005
4
US
hey everyone i am having a hard time figuring this out, just seeing if anyone has any ideas..
the process.auditEvent are just like Print outs..so i can see where the data is getting lost..i am losing the data on the second container search right after the SearchByFilter..i know this cause the length of array RoleResult is 0..I even tried replacing rolefilt with what should i exactly be there and still cant get the requester..What i am trying to do with this code is take a person based on where sits in tree is going to be who approves him for certain role..so role is not dynamic just where they could be in tree. and i have all that working just some how that second search doenst seem to be working...thanks for your help ahead of time

process.auditEvent(person.get()):

//gets ther user's organization from self enroling
var thisPerson = person.get();
var locationName = thisPerson.getProperty("l");
if (locationName.length < 1)
{
process.setResults("SF" , "Location attribute was not passed correctly.");
}

//find user's organization
var filt = "(erglobalid =" + locationName[0] + ")";
process.auditEvent(filt);

var locationSearch = new ContainerSearch();
//find user's organization in the tree
var orgResult = locationSearch.searchByFilter("OrganizationalUnit", filt, 2);
var org = orgResult[0];

process.auditEvent(org);
process.auditEvent(orgResult.length);

//find the role appropriate and fwd the request
var rolefilt = "(erparent=erglobalid=" + org.getProperty("erglobalid")[0] + "*);
process.auditEvent(rolefilt);

var roleSearch = new ContainerSearch();
var roleResult = rolesearch.searchByFilter("Role", rolefilt, 2);

process.auditEvent(roleResult.length);

return new Participant(ParticipanyType.ROLE, roleResult[0]);
 
Posting a URL to an online version would be handy - debugging with the amount of code (and thus information) we've got wouldn't be easy.

For example, we have no code to the searchByFilter method (or any methods of, or the constructor for, the ContainerSearch object). We also have no idea what "rolefilt" contains. You gte the idea ;o)

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
containerSearch.searchByFilter(profileName, filter, scope)

profileName the name of the organizational container profile to use
filter LDAP search filter that defines the criteria for returned containers to meet. the filter must be in the format defined by RFC2254
scope optional search scope. 1 use for one level scope and 2 for sub tree scope..
returns an array of directoryObjects representing the results of the search..
let me know if this will help more
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top