Skip to Main Content

Security Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Create new entry, while keeping CoS and nsRoles in tact...

807573May 2 2006
Hi,
Here's the short version:
How can one create a new entry/context in DS, copy the attributes from an existing entry (using JNDI) and save them in the new entry/context WITHOUT duplicating CoS or nsRole/DN info.

Long version of the question:
We are using DS 5.2 and Portal 6 (and messenger/calendar etc). We have our employees saved in DS. What I want to do is change a user's name/uid by copying the user's attributes (in JNDI) and create a New entry with the New uid, with all the other attributes the same. Then deleting the original entry.
This is what I have done...
1. Get all the employee's attributes... (abriviated)(ctx is the DirContext)
NamingEnumeration answer = ctx.search(searchBase, filter, ctls);
SearchResult sr = (SearchResult)answer.next();
Attributes attrs = sr.getAttributes();
2. Create a new employee with the same attributes (assume I use a different uid in the dn)
ctx.createSubcontext(dn, attrs);

This works...it copies all the attributes to the new entry -BUT- when you look at the LDIF file, it ADDS several more attributes to the new entry.
Example: it adds the following...
sunPortalNetletRules
sunPortalGatewayEnableSSO
sunPortalDesktopDpDocument
sunPortalDesktopDpLastModifiedUser
iplanet-am-user-auth-modules
And about 20 others...

Now if I am not mistaken, these are the CoS and roles that the DS uses and propagates down to the entry. But when I copy the attributes over, (using JNDI) I get these attributes too but I want to copy only the attributes that are unique and have DS handle the roles and CoS like it does for the original entry.

Is there a way to tell the DS to just use the CoS or roles instead of duplicating all these attributes in this individual entry??? (and do it using JNDI)
(sorry this question is sooooo long.)
Thanks!
Eric
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details