Novell is now a part of Micro Focus

I've just upgraded my beans to the latest...

Articles and Tips: qna

01 Sep 2003


Q.

I've just upgraded my beans to the latest version (Sept. 2002) to counter the setPassword() bug, but now I can't seem to add a "Group Membership" attribute to a User object. Using the NWDir bean, I can add the other three attributes that are associated with making a user join a group, but for some reason the "Group Membership" attribute won't work now, even though it did before I upgraded the beans. I'm setting it using the following call:

addFieldValue(userNWEntry, "Group Membership",
contextFromFullName(groupString));
// groupString being in full name format

Has the name of the attribute changed or something since the last release? And while on the subject of attribute names--what is the URL for the definitive list of attribute names? I've been using the NDS Schema reference that is in the C libraries documentation. I just wondered if this was the correct list for Java APIs too. Here is my code (neither the add nor remove group object works).

package authsys.testing;
import com.novell.beans.util.*;
import com.novell.beans.NWDir.*;
import com.novell.service.file.nw.*;
import java.util.Vector;

public class GroupTest {
   public static void main(String [] args){
      NWDir dirBean;
      NWEntry entry;
      NWValue value;
      NWValues values;
      
      try{
         // Get a user
         dirBean = new NWDir();
         String resource= "NDS:\\admin\admin\ajtest\0\W\0wises24";
         entry = dirBean.findEntry(resource);
         
         // Get his group
         values = entry.getFieldValues("Group Membership");
         value = values.next();
         
         // Remove the group and then add it back
         System.err.println("remove : " + entry.removeFieldValue("Group
                                Membership", value));
         System.err.println("add : " + entry.addFieldValue("Group
                             Membership", value));
      }
      catch(NWBeanException e){
         System.out.println(e.getMessage());
      }
   }
}

A.

This is a bug that has been fixed by Engineering. Use the latest Directory bean that you can download from Novell's Web site and this problem should go away.

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates