Getting group names for a list of IDs

I've got the list of group IDs of which the user is a member, and I'm trying to get the group names in a single query. I've got it working where I get each name in a loop, but I'm concerned about performance if a user is a member of a large number of groups.
This is the Java code I've been fooling with:
Object qFilter[][] = new Object[3][1];Integer ids[] = new Integer[iGroupIDs.length];for (i = 0; i < iGroupIDs.length; i++) { ids[i] = (Integer)iGroupIDs; }
qFilter[0][0] = new Integer(PT_PROPIDS.PT_PROPID_USERGROUP_GROUPID); qFilter[1][0] = new Integer(PT_FILTEROPS.PT_FILTEROP_IN);qFilter[2][0] = ids;ptQueryResult = objMgrGroups.Query(PT_PROPIDS.PT_PROPID_USERGROUP_SIMPLENAME, -1, PT_PROPIDS.PT_PROPID_USERGROUP_SIMPLENAME, 0,-1,qFilter);
I keep getting an exception:
Native exception: The parameter is incorrect. (0x80070057): [ParseQueryFilter error on clause #0
(0x80070057) Invalid property ID specified (0x10000)] (612,PTDispatch.cpp)
I'm new to PT programming so I'm a bit stumped as to what is the issue. Any hints anyone can offer is appreciated. Thanks!

Thanks to everyone - responded.
This is group set up when creating user. This is standard functionality.
What we do:
Step 1.
Using "Administer" tab in portal, then using "Create new groups" link, We have created various groups. We assigned six digit numeric value to group name. We have several groups, such as 001234, 002235, 003348. These group's have different privilege.
Step 2.
Using "Administer" tab, we create new user on a regular basis using "Create new users" link. Later on, we assign these new user to a group created in step 1.
We have a custom table, where we store, user and their corresponding group information, such as:
record user name group name date created
1 aaa 001234 01-02-04
2 bbb 001234 01-04-04
3 ccc 002235 01-05-04
Key in the table is based on both user and group name.
What I need to find out is, when user 'aaa' logged in, to find out who is the user and what portal group this user belong to.
Then join these two value to our custom table to make sure to match the user and his group name, and get other value from other table and display in the LOV.
But I am not sure what API need to use in my query in LOV. Or is there any other way?
Thanks

Similar Messages

  • Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group.

    Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group. Through this memberof class I am trying to find full qualified name(DN) of my group.
    code I have used:
    //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "";
    Also I have used,
                 String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "ou=ibmgroups,o=ibm.com";
    But in both cases I am getting value for Total groups as 0.
    Code Reference:
    * memberof.java
    * December 2004
    * Sample JNDI application to determine what groups a user belongs to
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    public class memberof     {
         public static void main (String[] args)     {
              Hashtable env = new Hashtable();
              String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
              String adminPassword = "XXXXXXX";
              String ldapURL = "ldap://mydc.antipodes.com:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   //Create the initial directory context
                   LdapContext ctx = new InitialLdapContext(env,null);
                   //Create the search controls          
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Andrew Anderson))";
                   //Specify the Base for the search
                   String searchBase = "DC=antipodes,DC=com";
                   //initialize counter to total the group members
                   int totalResults = 0;
                   //Specify the attributes to return
                   String returnedAtts[]={"memberOf"};
                   searchCtls.setReturningAttributes(returnedAtts);
                   //Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        System.out.println(">>>" + sr.getName());
                        //Print out the groups
                        Attributes attrs = sr.getAttributes();
                        if (attrs != null) {
                             try {
                                  for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
                                       Attribute attr = (Attribute)ae.next();
                                       System.out.println("Attribute: " + attr.getID());
                                       for (NamingEnumeration e = attr.getAll();e.hasMore();totalResults++) {
                                            System.out.println(" " +  totalResults + ". " +  e.next());
                             catch (NamingException e)     {
                                  System.err.println("Problem listing membership: " + e);
                   System.out.println("Total groups: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                   System.err.println("Problem searching directory: " + e);
    Any help will be highly appreciated.

    Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group. Through this memberof class I am trying to find full qualified name(DN) of my group.
    code I have used:
    //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "";
    Also I have used,
                 String searchFilter = "(&(objectClass=user)(CN=Username))";
                   //Specify the Base for the search
                   String searchBase = "ou=ibmgroups,o=ibm.com";
    But in both cases I am getting value for Total groups as 0.
    Code Reference:
    * memberof.java
    * December 2004
    * Sample JNDI application to determine what groups a user belongs to
    import java.util.Hashtable;
    import javax.naming.*;
    import javax.naming.ldap.*;
    import javax.naming.directory.*;
    public class memberof     {
         public static void main (String[] args)     {
              Hashtable env = new Hashtable();
              String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
              String adminPassword = "XXXXXXX";
              String ldapURL = "ldap://mydc.antipodes.com:389";
              env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
              //set security credentials, note using simple cleartext authentication
              env.put(Context.SECURITY_AUTHENTICATION,"simple");
              env.put(Context.SECURITY_PRINCIPAL,adminName);
              env.put(Context.SECURITY_CREDENTIALS,adminPassword);
              //connect to my domain controller
              env.put(Context.PROVIDER_URL,ldapURL);
              try {
                   //Create the initial directory context
                   LdapContext ctx = new InitialLdapContext(env,null);
                   //Create the search controls          
                   SearchControls searchCtls = new SearchControls();
                   //Specify the search scope
                   searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
                   //specify the LDAP search filter
                   String searchFilter = "(&(objectClass=user)(CN=Andrew Anderson))";
                   //Specify the Base for the search
                   String searchBase = "DC=antipodes,DC=com";
                   //initialize counter to total the group members
                   int totalResults = 0;
                   //Specify the attributes to return
                   String returnedAtts[]={"memberOf"};
                   searchCtls.setReturningAttributes(returnedAtts);
                   //Search for objects using the filter
                   NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
                   //Loop through the search results
                   while (answer.hasMoreElements()) {
                        SearchResult sr = (SearchResult)answer.next();
                        System.out.println(">>>" + sr.getName());
                        //Print out the groups
                        Attributes attrs = sr.getAttributes();
                        if (attrs != null) {
                             try {
                                  for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
                                       Attribute attr = (Attribute)ae.next();
                                       System.out.println("Attribute: " + attr.getID());
                                       for (NamingEnumeration e = attr.getAll();e.hasMore();totalResults++) {
                                            System.out.println(" " +  totalResults + ". " +  e.next());
                             catch (NamingException e)     {
                                  System.err.println("Problem listing membership: " + e);
                   System.out.println("Total groups: " + totalResults);
                   ctx.close();
              catch (NamingException e) {
                   System.err.println("Problem searching directory: " + e);
    Any help will be highly appreciated.

  • Mail adopts group name for "To" & "From"

    My wife's Mail app (on MBA running Yosemite) adopts one of her Contacts group names  for the "To" with incoming mail and for the "From" with outgoing mail i.e., her name or email address don't display, the group name displays. I looked at her contacts and the group and saw that she had herself in the group so I took her out but to no avail. I then clicked on the drop down of the group name displayed in the "To" and selected the "Remove from ..." Option. But to no avail.
    Any ideas as to what is causing this would be appreciated.

    Does the Previous Recipients List have anything to do with this? If she sends an email to a group (her book group) in which she is also listed, would Mail then display the group name in the "TO" instead of my wife's name? Or if the email is from someone on the group list, display the group name instead of the sender's name?
    I'm just apply some possible logic as to how this app might be wired wrong...I've seen the posting on grouping unrelated emails in "conversations" which seems to me to be a coding bug.
    Manage email addresses in the Previous Recipients list
    Mail keeps a list of the email addresses you send messages to, and uses the list to suggest or complete addresses for you when you send email. You can delete obsolete or incorrect addresses from the list so Mail stops suggesting them, and use the list to quickly see or add people in the Contacts app.
    Choose Window > Previous Recipients.
    Do any of the following:
    Sort the list: Click a column header.
    Search for a name: Enter the name in the search field.
    Show recipients in Contacts: Double-click a name. A card icon precedes names that are already in Contacts.
    Add recipients to Contacts: Select a name, then click Add to Contacts.
    Remove recipients from the list: Select one or more names, then click Remove From List.

  • I keep getting ' user not register for online ' when trying to get track names for my CD imports for Windows 7

    I keep getting ' user not register for online ' when trying to get track names for my CD imports for Windows 7 and I'm unable to find a solution.

    I can't be certain exactly which steps are going to be needed in each case, but if you work through this in sequence hopefully one of the steps will prove effective.
    First try this:
    With iTunes closed.
    Press the WinLogoKey+R
    Type in %appdata% and press return
    Double click on Apple Computer
    Double click on iTunes
    Delete the file CD Info.cidb
    Start iTunes and try again.
    If that doesn't work close iTunes and try deleting com.apple.iTunes.Gracenote.plist in the same folder.
    If that doesn't work close iTunes and try deleting iTunesPrefs.xml. This will reset your some of your preferences in iTunes so be sure to check them and reset as required.
    If that still hasn't resolved things close iTunes and try deleting the entire %appdata%\Apple Computer folder or look for parallel files/folders in the C:\Users\<User>\AppData\Local or C:\Users\<User>\AppData\LocalLow in case a corrupt file is persisting there.
    Note that any iOS device backups are stored in the MobileSync folder within Apple Computer. Once things are working you should backup your devices again as soon as possible.
    Or it might not be the preference files after all...
    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • Retrieving user detail, group name for all users

    Hi,
    How can I retrieve User name, email, authentication, user group name
    for all users using SDK.
    It is possible to create this report in webi or CR?
    Thank you for reply,
    Gregor

    Use the following code to retrieve this information:
    IInfoObjects users = oInfoStore.query("select * from ci_systemobjects where si_kind='user'");
    for (int i=0; i<users.size(); i++)
             IUser user = (IUser)users.get(i);
             // user.getTitle(); for user name
             // user.getFullName(); for user's full name
             //  user.getEmailAddress(); for user's email address
             //  for authentication type:
             IUserAliases alises = user.getAliases();
             for(int j=0; j<aliases.size();j++)
                       IUserAlias alias = alises.get(j);
                       // alias.getAuthentication() for authentication associated with this alias, since same user can have more than 1 authentication. e.g. Enterprise and Ldap.
             // for user group memberships:
             java.util.Set groups = user.getGroups();        
             // the groups Set object will contain SI_ID of all the user groups that this uses is member of. You need to query by the SI_ID of the usergroup to get the group names.
    //  e.g.
    //    oInfoStore.query("select si_id, si_name from ci_systemobjects where si_kind='usergroup' and si_id in (a,b,c....)");
    where a,b,c are the SI_IDs of the usergroups.
    To create a report based on the above fetched data, there are several methods such as:
    you can use Java resultset where in you create the report structure in designer and push the data at runtime using java result set objects. Another way is to push this info in Excel or Access and design your report based on that excel\access.

  • HP ePrint from excel add-in: Error while getting driver name for printer

    Trying to use add-in for ePrint from excel/word I get, "error while getting driver name for printer \\...HP DesignJet 800PS 42 by HP," with an option to select "OK" and that same message repeats with each printer in our network, and then it doesn't allow me to print using the add-in. However, I can print normally to HP Go Web, open up Print and Share,  then print it from there. This happens with excel and word. I have Office Suite 2007.

    Hello modameister,
    Sorry you are having issues with this printer and the ePrint add-on.  There are a couple of questions I would like you to answer please.
    1.  What operating system are you using? (XP,VISTA,7,MAC OS X)
    2.  What and how much data are you trying to print?
    3.  Have you tried to copy and paste the data into a different application or tried using the snip it tool?
    4.  Are you receiving any .dll errors (mscms.dll)
    Thanks
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

  • Any Function module or BAPIs are available to get scheme name for the inter

    I have internal order no value in table  AUFK-AUFNR ,  and the internal order corresponding Scheme value is available in IMPR-PRNAM . Now I want to inner join both the tables to extract the data , but there is no common field . Is there any Function module or BAPIs are available to get scheme name for the internal orders?

    look at DB-VIEW  "V_IVP_OR".
    Regards,
    Laurent

  • How to get column names for a specific view in the scheme?

    how to get column names for a specific view in the scheme?
    TIA
    Don't have DD on the wall anymore....

    or this?
    SQL> select text from ALL_VIEWS
      2  where VIEW_NAME
      3  ='EMP_VIEW';
    TEXT
    SELECT empno,ename FROM EMP
    WHERE empno=10

  • How to get Group Name of current Group Portal session?

    How do I obtain the Group Name associated with the Group Portal of the current user session?

    Michel,
    Thank you that worked. I have a follow up question that I am hoping you can answer.
    I am trying to build a drop menu for all the Portal Pages that appear in the nav
    bar. The drop down menu items should correspond to the users visible portlets for
    each Portal Page.
    The following code works if the ProfileIdentity is created for the Group, but does
    not return any results if the ProfileIdentity is created with the User.
    PagePersonalization pagePersonalization = portalPersonalization.getPagePersonalization(pageState.getPageIdentifier());
    if (pagePersonalization != null) {
         Iterator menuItr = pagePersonalization.getPortletPersonalizations();
         while (menuItr.hasNext()) {
              PortletPersonalization portletPersonalization = (PortletPersonalization)menuItr.next();
              String portletName = portletPersonalization.getDisplayName();
    Is there another way to obtain the information I am looking for?
    Thanks,
    Diana
    "Michel Bisson" <[email protected]> wrote:
    >
    Diana,
    You can retrieve the group name for the current session as follows:
    // Sample code... (disclaimer: not compiled!)
    import com.bea.portal.appflow.PortalAppflowFactory;
    import com.bea.portal.appflow.PortalSession;
    import com.bea.p13n,usermgmt.profile.ProfileIdentity;
    PortalSession portalSession = PortalAppflowFactory.createPortalSession(request,
    false);
    ProfileIdentity profileIdentity = portalSession.getIdentity();
    String groupName = profileIdentity.getGroupname();
    You can read the Javadoc online http://edocs.bea.com/wlp/docs40/javadoc/wlp/index.html
    for the classes used above.
    Hope this helps.
    Michel.
    "Diana" <[email protected]> wrote in message news:3ce1ac7c$[email protected]..
    How do I obtain the Group Name associated with the Group Portal of thecurrent user session?

  • [svn:fx-trunk] 12982: Fix for issue with exposing accessible names for combobox list items

    Revision: 12982
    Revision: 12982
    Author:   [email protected]
    Date:     2009-12-15 20:44:23 -0800 (Tue, 15 Dec 2009)
    Log Message:
    Fix for issue with exposing accessible names for combobox list items
    QE notes: none
    Doc notes: none
    Bugs: n/a
    Reviewer: Gordon
    Tests run: checkintests
    Is noteworthy for integration: no
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/ComboBoxAccImpl.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/ListBaseAccImpl.as

    Add this to the end of your nav p CSS selector at Line 209 of your HTML file, after 'background-repeat...':
    margin-bottom: -2px;
    Your nav p will then look like this:
    nav p {
              font-size: 90%;
              font-weight: bold;
              color: #FFC;
              background-color: #090;
              text-align: right;
              padding-top: 5px;
              padding-right: 20px;
              padding-bottom: 5px;
              border-bottom-width: 2px;
              border-bottom-style: solid;
              border-bottom-color: #060;
              background-image: url(images/background.png);
              background-repeat: repeat-x;
              margin-bottom: -2px;

  • Possible to hide Grouping name for certain tracks only?

    I am organising my classical music library and using the Grouping column with good success.
    However, it would be visually better to be able to hide the Grouping name for the subsequent movements of a piece. For example in a Dvorak album:
    ..Grouping*.............................*Name
    1.Cello Concerto in B minor.1.Allegro
    2...........................................2.Adagio
    3...........................................3.Allegro moderato - Finale
    4.New World Symphony........1.Adagio
    5...........................................2.Largo
    6...........................................3.Scherzo
    7...........................................4.Allegro con fuoco

    I have never used the shuffle by groupings feature, but I would think it would be affected.
    You need to experiment and decide how important shuffle by grouping is compared to the appearance in the iTunes Library.
    iTunes is not good at dealing with classical music and you will find a lot of discussion of the problem with Google.
    Here is an example:
    http://www.till.com/blog/archives/2008/09/classical_itune.html

  • How to find the group name for a section programatically?

    I have these display formulas that are being repeated in each group footer.  The only thing that changes are the group names.
    How can I find the group name for the current section?
    The bolded(or starred) items are what I'm trying to create a generic function for.
    Ontario
         Bob
                   1000     Sales     Other
                   2000     Random     Billing
                   200     Phone     Billing
         *Total for Bob*      3200
         Sally
                   2000     Sales     Client
                   1000     Random     Billing
                    300     Cell     Billing
         *Total for Sally* 3300
    *Total for Ontario*       6500
    Thanks in advance,
    J

    I'm not sure if the GroupingLevel or GroupNumber fuctions will help.  (There description in the on-line help leaves much to be desired, IMHO...)
    If not, you could try adding formula fields to each level that sets a global variable to tell your other formula fields what level it is on.  If you only have one or two other formulas, and only one or two groups, this really wouldn't be a whole lot easier.  But if you had a lot of groups or a lot of formula fields that you want to make "group independent" it could help.
    So for each footer, create a formula field like (basic syntax):
    WhilePrintingRecords
    global geoupLevel as String
    groupLevel = "Province"
    formula = ""
    (changing the name given to groupLevel for each footer).  Then in your "generic" formula you could put something like:
    WhilePrintingRecords
    global groupLevel as string
    select case groupLevel
      case "Province"
        formula = "Total for " + {Province}
      case "Name"
        formula = "Total for " + {Name}
      else
        Formula = "Totals"
    end select
    HTH,
    Carl

  • Changing MS Cluster Group name for ECC 5

    Hi,
    Is it safe to change the MS Cluster Group name for ECC 5 cluster after installed?
    If not is there a safe way to do it?
    Thanks in advance,
    Roey

    Hi Roey,
    There must be no problem in renaming th cluster group
    Please refer to follwoing link:
    http://www.eggheadcafe.com/software/aspnet/32064632/rename-exchange-cluster-g.aspx
    The procedure of doing is mentioned here
    http://technet.microsoft.com/en-us/library/cc757533.aspx
    Make sure you keep following points in mind:
    1. Make sure you have a full backup of SAP
    2. Bring cluster groups offline and then rename them and then bring up the cluster group
    I hope there will be no issue
    Rohit

  • I cant get the names for music on mediasource for my zen to

    I cant seem to get any names for my music on mediasource. I went and did the Gracenote CDDB thing but all that I can seem to get is a a thing that says Socket open failed. Does anybody know what that means and how can I fix it's
    Thanks!

    You can try reregistering the Gracenote DLLs, as described in the Zen FAQ at Nomadness.net.
    Alternati'vely try installing a program that also uses Gracenote to see if that works.

  • When I enter a group name into the Bcc field and try to send the message, I get "[group name] is not a valid e-mail address..."

    Been using the same template to send a weekly newsletter for a year or two but now with a recent update to Thunderbird the group name is rejected when I try to send the message:
    With a group name in Bcc field, when I press "Send" and try to send the message, I get this alert: "[group name] is not a valid e-mail address because it is not of the form user@host. You must correct it before sending the e-mail."

    This has been reported as [https://bugzilla.mozilla.org/show_bug.cgi?id=1060901 Bug #1060901]. If you have an account on Bugzilla, please consider voting for that issue.
    Several other people have sent in the same support request as you, noting this happened after they upgraded to version 31.1.
    The exact error message is: XXXX is not a valid e-mail address because it is not of the form user@host. You must correct it before sending the e-mail.
    '''This happens in Thunderbird 31.1.0 when your mailing list description includes several words separated by spaces.'''
    Although not ideal, these workarounds should let you use your mailing lists until a proper fix is implemented:
    * While composing an email open the address book and select the list you are trying to send to, highlight all the names in the list and drag them to the To: box. This uses your existing data without modifying it.
    * Replacing the blanks " " between the words in such lists' descriptions with an underscore "_". This requires modifying your mailing list(s) description(s).
    * Downgrade to a previous version and disable automatic updates (Windows)

Maybe you are looking for

  • Used to have printable annotations to PDFs in Preview

    In Preview in 10.4 when you used Add Note to a PDF, your annotation was embedded into the file and would print, though you couldn't edit it again. Now in 10.5 it seems that the Notes only leave a little bubble icon but you can't get the note itself t

  • Schedule the Report

    Hi friends,     I want to schedule the report.I set the filter in the web intellignce report like this, Enetr the Region Name: Txn Date From: Txn date To: is it possible to take the current date as a Txn date to and one month minus from the current d

  • Netboot and DHCP Issue - Setting up AST Diagnostic Gateway

    Hi everyone, I recently set up a new Mac Mini as a stand-alone server for the Apple Service Toolkit Diagnostic Gateway. Here are the specs of the Mini, if needed by anyone: Mac OS X 10.6 Server (patched to 10.6.8) 2.66GHz Core 2 Duo 8 GB DDR3 RAM I h

  • 1 set of bookmarks on all devices?

    Got iMac, iPahon Macbook Air, and iPad. Each has a set of bookmarks with more or less the same things but many things with different names. Now I get dozens of duplicates in all bookmarks as iCloud "syncs" Any way to get just 1 set across all three?

  • OAM OIM OID OVD ?

    I always hear these things from Oracle, OAM, OIM, OID and OVD. are they the same thing? if not, I belive they are related since people always mention them together, then, what's relationship? please clarify I'm new to Oracle identity management produ