Show TOC

Displaying GroupsLocate this document in the navigation structure

Prerequisites

You have imported the required interfaces and gotten the required factories.

More information: User Management Functions for Groups .

Context

This procedure describes how you can get a group and read an attribute of that group. Use this procedure when you need to display group data and no existing application suits your needs. Once your custom application has read the data, you must decide how to display it.

Procedure

  1. Use the IGroupFactory to the group object.
  2. Read the required attributes.
    • For some attributes there are dedicated methods to read them, such as the getDescription() method.

    • For other attributes, determine the attribute type and then use the getAttribute() method to read them.

Results

With this procedure you have read the contents of the role attributes. You must determine the best way to display this data and modify your custom application to do so.

Example

This example gets the group demo_group, reads the description, then reads the value of the attribute myAttributeName in the namespace com.example.

            public static void showGroup(String groupUniqueName, String nameSpace,
                String attributeName) {

        try {
                // Get the group by unique name.

                


                // Show basic data. 
                                        
                


                // Check the attribute type and read the attribute content with the
                // corresponding method.

                


                

                                                
                        // Read the content of a multi-value string attribute.
                                                
                        

                                        

                

                                        
                        // Read the content of a single-value binary attribute.
                                                
                        

                                        

                } else {
                        // TODO: Handle attribute not available or does not exist.
                }
        } catch (NoSuchGroupException nsgex) {
                // TODO: Handle NoSuchGroupException.
        } catch (UMException umex) {
                // TODO: Handle UMException.
        } catch (UMRuntimeException umrex) {
                // TODO: Handle UMRuntimeException.
        }
}