Get canvas name

Hi,
How to get the canvas name at runtime...For eg, I am in tab page canvas.
if <some condition>
SET_CANVAS_PROPERTY('CAN_C032A', TOPMOST_TAB_PAGE, :System.Tab_Previous_Page);
end if;
If I am not in tab canvas, [I am in the header canvas which is a content one], the above set_canvas_property would throw an error ? If so, how to avoid this?
Regards
Priya

Hello,
:SYSTEM.TAB_PREVIOUS_PAGE must be used within a When-Tab-Page-Changed trigger. So, this value is maybe NULL when you call the buit-in.
You can get the current canvas that support the current item with the Get_Item_Property( 'item_name', ITEM_CANVAS )
Francois

Similar Messages

  • Change Canvas Name of a field dynamically

    Hi i want to know can we change a Canvas Name of a field dynamically ?
    My requirement is that  i have "Street Name"  fields in many forms. Now i need to introduce a button next to "Street Name" field so that if "Street Name" values are available in LOV, then user can click on the Button and it will go the Street Master. Now problem is that "Street Name" Field is available in many forms. It would be too difficult to create a each field in each form. So instead of it i want to do it dynamically. If we can change a Field's (Item) canvas name dynamically then i think we achieve it.
    Thanks

    From my knowledge, we cant change a canvas name dynamically.. Below are the possible properties we can change. You can get these from forms online help
    property
        The property you want to set for the given item. Possible properties are:
    ALIGNMENT The text alignment (text and display items only). Valid values are ALIGNMENT_START, ALIGNMENT_END, ALIGNMENT_LEFT, ALIGNMENT_ CENTER, ALIGNMENT_RIGHT. See the Justification Property for more information.
    AUTO_HINT Determines if Oracle Forms will display help hints on the status line automatically when input focus is in the specified item. Valid values are PROPERTY_TRUE and PROPERTY_FALSE. See Display Hint Automatically Property.
    AUTO_SKIP Specifies whether the cursor should skip to the next item automatically when the end user enters the last character in a text item. Valid only for a text item. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
    BACKGROUND_COLOR The color of the object's background region. The property value is a reference to an RGB value such as r191g223b191.
    BORDER_BEVEL Specifies the item border bevel for the specified item instance. Valid values are RAISED, LOWERED, or PLAIN (unbeveled).
    Note: You cannot set BORDER_BEVEL if the item's Bevel property is set to None in Oracle Forms.
    CASE_INSENSITIVE_QUERY Specifies whether query conditions entered in the item should be case-sensitive. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
    CASE_RESTRICTION Specifies the case restriction applied to any text entered in the indicated text item. Valid values are UPPERCASE, LOWERCASE, or NONE.
    CONCEAL_DATA Specify the constant PROPERTY_TRUE if you want the item to remain blank or otherwise obscured when the end user enters a value. Specify the constant PROPERTY_FALSE if you want any value that is typed into the text item to be visible.
    CURRENT_RECORD_ATTRIBUTE Specifies VARCHAR2 name of the named visual attribute used when an item is part of the current record. If the named visual attribute does not exist, you will get an error message.
    CURRENT_ROW_BACKGROUND_COLOR The color of the current record's background region.
    CURRENT_ROW_FILL_PATTERN The pattern to be used for the current record's fill region. Patterns are rendered in the two colors specified by Background Color and Foreground Color.
    CURRENT_ROW_FONT_NAME The font family, or typeface, that should be used for text in the current record. The list of fonts available is system-dependent.
    CURRENT_ROW_FONT_SIZE The size of the font, specified in points.
    CURRENT_ROW_FONT_SPACING The width of the font, that is, the amount of space between characters (kerning).
    CURRENT_ROW_FONT_STYLE The style of the font.
    CURRENT_ROW_FONT_WEIGHT The weight of the font.
    CURRENT_ROW_FOREGROUND_COLOR The color of the current record's foreground region. For items, the Foreground Color attribute defines the color of text displayed in the item.
    DIRECTION Specifies the layout direction for bidirectional objects. Valid values are DIRECTION_DEFAULT, RIGHT_TO_LEFT, LEFT_TO_RIGHT.
    DISPLAYED Specifies whether the item will be displayed/enabled or hidden/disabled.
    ECHO Specifies whether characters an end user types into a text item should be visible. When Echo is false, the characters typed are hidden. Used for password protection. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
    ENABLED Specifies whether end users should be able to manipulate an item. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
    Note: Setting Enabled to false will cause other item property settings to change.
    FILL_PATTERN The pattern to be used for the object's fill region. Patterns are rendered in the two colors specified by Background Color and Foreground Color.
    FONT_NAME The font family, or typeface, that should be used for text in the object. The list of fonts available is system-dependent.
    FONT_SIZE The size of the font, specified in hundredths of a point (i.e., for a font size of 8 points, the value should be set to 800).
    FONT_SPACING The width of the font, that is, the amount of space between characters (kerning).
    FONT_STYLE The style of the font.
    FONT_WEIGHT The weight of the font.
    FOREGROUND_COLOR The color of the object's foreground region. For items, the Foreground Color attribute defines the color of text displayed in the item. The property value is a reference to an RGB value such as r191g223b191. Foreground color is always ignored for scrollbars.
    FORMAT_MASK Specifies the display format and input accepted for data in text items.
    HEIGHT Specifies the height of the item.
    HINT_TEXT Specifies the item-specific help text displayed on the message line at runtime. If the text specified is NULL, the original hint text, specified in Oracle Forms, will be restored.
    ICON_NAME Specifies the file name of the icon resource associated with a button item having the Iconic property set to YES.
    IMAGE_DEPTH Specifies the depth of color to be applied to an image item.
    INSERT_ALLOWED In a new record, allows end user to insert items normally when set to PROPERTY_TRUE. Specify PROPERTY_FALSE to specify that the item does not accept modification, but is displayed normally (not grayed out). (Insert_Allowed does not propagate changes to the Enabled property.)
    ITEM_IS_VALID Specifies whether the current item should be considered valid. Set to PROPERTY_TRUE or PROPERTY_FALSE.
    ITEM_SIZE Specifies a width and height for the item as two numbers separated by a comma. Use the syntax that includes x, y.
    KEEP_POSITION Specifies whether the Keep Cursor Position property should be true or false. When Keep Cursor Position is true, the cursor returns to the same position it was in when it left the text item. When Keep Cursor Position is false, the cursor returns to the default position in the text item. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
    LABEL Specifies the VARCHAR2 string that you want displayed as the label of the item. This property is only valid for items that have labels, such as buttons.
    LOCK_RECORD_ON_CHANGE Specify the constant PROPERTY_TRUE if you want the record to be locked when this item is changed. Specify the constant PROPERTY_FALSE if you do not want the record locked when this item is changed. Use primarily when connecting to a non-ORACLE data source that does not have row-level locking.
    LOV_NAME Specify the VARCHAR2 name of an LOV to be associated with the given item. If the LOV name does not exist, you will get an error message.
    MERGE_CURRENT_RECORD_ATTRIBUTE Merges the contents of the specified visual attribute with the current row's visual attribute (rather than replacing it).
    MERGE_TOOLTIP_ATTRIBUTE Merges the contents of the specified visual attribute with the tooltip's current visual attribute (rather than replacing it).
    MERGE_PROMPT_VISUAL_ATTRIBUTE Specifies the named visual attribute that should be applied to the prompt at runtime.
    MERGE_VISUAL_ATTRIBUTE Merges the contents of the specified visual attribute with the object's current visual attribute (rather than replacing it).
    MOUSE_NAVIGATE Specifies whether Oracle Forms should navigate and set focus to the item when the end user activates the item with the mouse. Specify the constant PROPERTY_TRUE if you want the end user to be able to navigate to the item using the mouse. Specify the constant PROPERTY_FALSE if you want a mouse click to keep the input focus in the current item.
    NAVIGABLE Specify the constant PROPERTY_TRUE if you want the end user to be able to navigate to the item using default keyboard navigation. Specify the constant PROPERTY_FALSE if you want to disable default keyboard navigation to the item. (Keyboard Navigable does not propagate changes to the Enabled property.)
    NEXT_NAVIGATION_ITEM Specifies the name of the item that is defined as the "next navigation item" with respect to this current item.
    POSITION Specify the x, y coordinates for the item as NUMBERs separated by a comma. Use the syntax that includes x, y.
    PREVIOUS_NAVIGATION_ITEM Specifies the name of the item that is defined as the "previous navigation item" with respect to this current item.
    PRIMARY_KEY Specify the constant PROPERTY_TRUE to indicate that any record inserted or updated in the block must have a unique characteristic in order to be committed to the database. Otherwise, specify the constant PROPERTY_FALSE.
    PROMPT_ALIGNMENT_OFFSET Determines the distance between the item and its prompt in the current record.
    PROMPT_DISPLAY_STYLE Determines the prompt's display style in the current record, either PROMPT_FIRST_RECORD, PROMPT_HIDDEN, or PROMPT_ALL_RECORDS.
    PROMPT_EDGE Determines which edge the item's prompt is attached to in the current record, either START_EDGE, END_EDGE, TOP_EDGE, or BOTTOM_EDGE.
    PROMPT_EDGE_ALIGNMENT Determines which edge the item's prompt is aligned to in the current record, either ALIGNMENT_START, ALIGNMENT_END, or ALIGNMENT_CENTER.
    PROMPT_EDGE_OFFSET Determines the distance between the item and its prompt in the current record as a VARCHAR2 value.
    PROMPT_FILL_PATTERN The pattern to be used for the prompt's fill region in the current record. Patterns are rendered in the two colors specified by Background Color and Foreground Color.
    PROMPT_FONT_NAME The font family, or typeface, that should be used for text in the prompt in the current record. The list of fonts available is system-dependent.
    PROMPT_FONT_SIZE The size of the font, specified in points in the current record.
    PROMPT_FONT_SPACING The width of the font, that is, the amount of space between characters (kerning) in the current record.
    PROMPT_FONT_STYLE The style of the font in the current record.
    PROMPT_FONT_WEIGHT The weight of the font in the current record.
    PROMPT_FOREGROUND_COLOR The color of the prompt's foreground region in the current record. For items, the Foreground Color attribute defines the color of text displayed in the item.
    PROMPT_TEXT Determines the text label that displays for an item in the current record.
    PROMPT_TEXT_ALIGNMENT Determines how the prompt is justified in the current record, either ALIGNMENT_START, ALIGNMENT_LEFT, ALIGNMENT_RIGHT, ALIGNMENT_CENTER, or ALIGNMENT_END.
    PROMPT_VISUAL_ATTRIBUTE Specifies the named visual attribute that should be applied to the prompt at runtime in the current record.
    QUERYABLE Specify the constant PROPERTY_TRUE if you want the end user to be able to initiate a query against the item. Specify the constant PROPERTY_FALSE if you want to disallow the use of the item in a query.
    QUERY_ONLY Specify an item to be queried, preventing that item from becoming part of insert or update statements. QUERY_ONLY is applicable to text items, radio groups, and check boxes. Enclose the fully-qualified item name in single quotes.
    REQUIRED Specify the constant PROPERTY_TRUE if you want to force the end user to enter a value for the item. Specify the constant PROPERTY_FALSE if the item is not to be required.
    TOOLTIP_BACKGROUND_COLOR The color of the tooltip's background region in the current record.
    TOOLTIP_FILL_PATTERN The pattern to be used for the tooltip's fill region in the current record. Patterns are rendered in the two colors specified by Background Color and Foreground Color.
    TOOLTIP_FONT_NAME The font family, or typeface, that should be used for text in the tooltip in the current record. The list of fonts available is system-dependent.
    TOOLTIP_FONT_SIZE The size of the font, specified in points of the tooltip in the current record.
    TOOLTIP_FONT_SPACING The width of the font, that is, the amount of space between characters (kerning) of the tooltip in the current record.
    TOOLTIP_FONT_STYLE The style of the font of the tooltip in the current record.
    TOOLTIP_FONT_WEIGHT The weight of the font of the tooltip in the current record.
    TOOLTIP_FOREGROUND_COLOR The color of the tooltip's foreground region in the current record. For items, the Foreground Color attribute defines the color of text displayed in the item.
    TOOLTIP_TEXT Determines the item's tooltip text in all records.
    UPDATE_ALLOWED Specify the constant PROPERTY_TRUE if you want the end user to be able to update the item. Specify the constant PROPERTY_FALSE if you want the item protected from update.
    UPDATE_COLUMN Specify the constant PROPERTY_TRUE if this column should be treated as updated, and included in the columns to be written to the database. Specify the constant PROPERTY_FALSE if this column should be treated as not updated, and not be included in the columns to be written to the database.
    UPDATE_NULL Specify the constant PROPERTY_TRUE if you want the end user to be able to update the item only if its value is NULL. Specify the constant PROPERTY_FALSE if you want the end user to be able to update the value of the item regardless of whether the value is NULL.
    UPDATE_PERMISSION Use UPDATE_ ALLOWED when you run against non-ORACLE data sources. Specify the constant PROPERTY_TRUE to turn on the item's UPDATEABLE and UPDATE_NULL properties. Specify the constant PROPERTY_FALSE to turn off the item's UPDATEABLE and UPDATE_NULL properties.
    VALIDATE_FROM_LIST Specifies that Oracle Forms should validate the value of the text item against the values in the attached LOV when set to PROPERTY_TRUE. Specify PROPERTY_FALSE to specify that Oracle Forms should not use the LOV for validation.
    VISIBLE Specifies whether the indicated item should be visible or hidden. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
    Note: Setting Visible to false will cause other item property settings to change.
    VISUAL_ATTRIBUTE Specify a valid named visual attribute that exists in the current form.
    Note: You cannot set the visual attribute for an image item, nor use a logical attribute from a resource
    file as a Visual Attribute.
    WIDTH Specify the width of the item as a NUMBER. The size of the units depends on how you set the Coordinate System property and default font scaling for the form.
    X_POS
    Specify the x coordinate as a NUMBER.
    Y_POS
        Specify the y coordinate as a NUMBER.

  • Get Machine Name and IP Address from Air Flex App

    New to Air..... Is there a way to get the name of the machine
    and the ip address for the client running the Air application? Not
    that this matters, but the applcation would be a Flex 3 application
    built specifically to be deployed to the Air runtime. I need to be
    able to have the Air/Flex application know what the client's
    machine name and ip address is. Can this be done?
    Thanks

    Hi Frank,
    Well I am using Developer Suite 10g Release (10.1.2.0.2) ..I've gone thru the link what you have sent me and noticed that whatever updations of conf file or classpath its already there so i guess needn't to modify cause I think my release 10.1.2.0.2 has did already as webutils been bundled with it.
    Well What i did is to double click on ATTACH LIBRARY and browse the location to find webutil.pll and finally attached it...even though its showing me all the procedures like clientinfo and others...
    on my block's canvas I've put a button and used this trigger to get client info function like this.
    when-button-pressed trigger of INFOBUTTON
    DECLARE
    o_clientinfo varchar2(50) := Webutil_clientinfo.GET_HOST_NAME ;
    begin
    message(o_clientinfo);
    end;
    but when I am trying to open this form its simply not showing up..strange thing is that there is no error as well...so plz kindly guide me how to get clientinfo hostname or ipaddress using that library function.
    thanks

  • GET FILE NAME C:\temp\ADIBO.txt

    Hi,
    How to get file name?
    I used Get_File_NAME, but I'am getting an error.
    lv_lfilename is not the type LOGICAL_FILENAME
    C:\temp\ADIBO.txt
    I need to get  ADIBO ??
    tnh, Adibo..:)
    I am using this code to download file and after that I need to get FILE_NAME:
    DATA:  lv_lfilename TYPE string.
    PARAMETERS:
      pa_lfile TYPE zlocalfile
               DEFAULT 'C:temp'.
        CONCATENATE pa_lfile ''INTO lv_lfilename.
        CALL FUNCTION 'GUI_DOWNLOAD'
             EXPORTING
                  filename = lv_lfilename
                  filetype = 'ASC'
             TABLES
                  data_tab = it_billit_down.
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.

    Hii..
    You have to Maintain the Logical filenames and their Physical Paths in Tcode FILE.
    Then create a program like this..
    REPORT  ZSEL_FILES1.
    DATA : V_LOGFILE TYPE STRING.
    DATA :V_PHYFILE TYPE STRING.
    DATA : ITAB TYPE TABLE OF SCARR.
    START-OF-SELECTION.
    SELECT * FROM SCARR INTO TABLE ITAB.
    **To get the Physical file based on the Logical file names - Maintained in Tcode FILE
    CALL FUNCTION 'FILE_GET_NAME'
      EXPORTING
       CLIENT                        = SY-MANDT
        LOGICAL_FILENAME              = VlOGFILE
      OPERATING_SYSTEM              = SY-OPSYS
      PARAMETER_1                   = ' '
      PARAMETER_2                   = ' '
      PARAMETER_3                   = ' '
      USE_PRESENTATION_SERVER       = ' '
      WITH_FILE_EXTENSION           = ' '
      USE_BUFFER                    = ' '
      ELEMINATE_BLANKS              = 'X'
    IMPORTING
      EMERGENCY_FLAG                =
      FILE_FORMAT                   =
       FILE_NAME                     = V_PHYFILE
    EXCEPTIONS
      FILE_NOT_FOUND                = 1
      OTHERS                        = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    **To download the file to PC.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = V_PHYFILE
       FILETYPE                        = 'ASC'
      APPEND                          = ' '
       WRITE_FIELD_SEPARATOR           = 'X'
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        = ITAB
      FIELDNAMES                      =
    EXCEPTIONS
      FILE_WRITE_ERROR                = 1
      NO_BATCH                        = 2
      GUI_REFUSE_FILETRANSFER         = 3
      INVALID_TYPE                    = 4
      NO_AUTHORITY                    = 5
      UNKNOWN_ERROR                   = 6
      HEADER_NOT_ALLOWED              = 7
      SEPARATOR_NOT_ALLOWED           = 8
      FILESIZE_NOT_ALLOWED            = 9
      HEADER_TOO_LONG                 = 10
      DP_ERROR_CREATE                 = 11
      DP_ERROR_SEND                   = 12
      DP_ERROR_WRITE                  = 13
      UNKNOWN_DP_ERROR                = 14
      ACCESS_DENIED                   = 15
      DP_OUT_OF_MEMORY                = 16
      DISK_FULL                       = 17
      DP_TIMEOUT                      = 18
      FILE_NOT_FOUND                  = 19
      DATAPROVIDER_EXCEPTION          = 20
      CONTROL_FLUSH_ERROR             = 21
      OTHERS                          = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    <b>reward if helpful</b>

  • 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.

  • Cisco Unity 7: Voice mail cann't get the name or Number phone of the caller

    Hi,
    I have installed Cisco Unity Messaging Unified version 7 and integrated with Exchange 2010.
    I have two scenario, and I want to know if are normal or not:
    1.       If the 2 IP phones are subscribed with Cisco Unity: the first IP phone call the other IP phone and let a voice mail. When the second IP phone check his message vocal it can get the name of the caller or his number phone (the message is: You have One message from XXXX) and he get e-mail as objet: Voice Mail from XXXX.
    2.       If one IP phone is not subscriber with cisco unity call other Ip phone subscribed with cisco unity and let him a voice mail. The second IP phone when check his message vocal it can’t get the name of the caller or his number phone: The message is: You have one voice mail xxxx; without indicate from!! and he get a e-mail as object: Voice mail from Unknown.
    Please, I want to know if the second scenario is normal ? if not, who to resolve this problem? I want that he indicate the number of caller same he isn't subscriber with cisco unity?
    Thanks a lot,
    Best regards,
    Omar YUNSI

    So for the 2nd scenerio you would want to check what your Message Subjects were set to.  For Unity 7 open Web SA, click Configuration and then Message Subjects.  Make sure that the Outside Caller Message has %CALLERID% in it somewhere.  The value %CALLERNAME% will return unknown if we do not receive a name from the PSTN.
    Try setting the Outside Caller Message to:
    %U% %P% Voice Message from %CALLERID%
    and that should get you your desired results.
    The default Message subject is:
    %U% %P% Voice Message from %CALLERNAME% (%CALLERID%).  So with that it would say Voice Message fom Unknown (xxxx) if it was not able to determine the name of the user which is usually normal from a PSTN call.
    Just to note, the From address is always going to say from Unity Messaging System, it will only be the subject that has the extension in it.
    Bryan

  • 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.

  • Why do I get a class conflict between the Prepare SQL.vi and the Get Column Name.vi with the SQL Toolkit compatibility vis from the Database Connectivity Toolkit?

    I have done extensive programming with the SQL Toolkit with LabVIEW versions through 6.1. My customer now wants to upgrade to Windows 7, so I am trying to upgrade to LabVIEW 2009 (my latest purchased version) using the Database Connectivity Toolkit, and the SQL Toolkit Compatibility vis. Everything seemed to be going okay with the higher level SQL operations, but I ran into trouble with the Get Column Name.vi. 
    The pictures below show the problem. The original SQL Toolkit connected the Prepare SQL.vi with the Get Column Name.vi with a cluster of two references, one for connection, and one for sql. The new compatibility vis have a class conflict in the wire because the Prepare SQL.vi contains a cluster with connection, and command references, but the Get Column Name.vi expects a cluster with connection and recordset references. 
    How do I resolve this conflict?
    Thank You.
    Dan

    I've never worked with the old version of the toolkit, so I don't know how it did things, but looking inside the SQL prep VI, it only generates a command, and the the column name VI wants a recordset. I'm not super familiar with all the internals of ADO, but my understanding is that is standard - you only have the columns after you execute the command and get the recordset back. What you can apparently do here is insert the Execute Prepared SQL VI in the middle and that will return what you need.
    I'm not sure why it worked before. Maybe the execute was hidden inside the prep VI or maybe you can get the column names out of the command object before execution. In general, I would recommend considering switching to the newer VIs.
    Try to take over the world!

  • 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 the name and value of an attribute on a node/element that is not a child

    Hello,
    Can someone shed some wisdom on how I can compare 2 xml nodes for differences.
    My main challenge is I need to use the attributes/values of 'ProductDescription' and 'Features' as 'key' to identify the same node in
    another doc with the same layout, but different content.
    I am having trouble getting the name of the attribute on the node, 'ProductDescription' and 'Features'.  I can only seem to get the node names, but not the attributes on the node.  I need the name, because it can be different from doc to doc, so
    I can't hardcode this.
    Can someone please help with how to retrieve an attribute name/value on a node that is not a child.  Here's an example of what
    my xml looks like:
    DECLARE
    @myDoc1 xml
    ,@mydoc2 xml
    DECLARE
    @ProdID int
    SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
    <Features  featureID  = "1" featureName = "body">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    <features featureID = "2" featureName = "seat">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    </ProductDescription>
    SET @myDoc2 ='<ProductDescription ProductID="1" ProductName="Road Bike">
    <Features  featureID  = "1" featureName = "body">
      <Warranty>2 year parts and labor</Warranty>
      <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    <features featureID = "2" featureName = "wheel">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    </ProductDescription>
    I need to compare the attributes of 'ProductDescription' and 'Features' from @mydoc1 against @mydoc2 to see if they are the same based on those 2 nodes first.  If they are, then i want to show the difference in the child elements. 
    This will eventually be an outer join to give me the differences betw the 2 docs based on those key values (node attributes).
    I used node('//*') for the path, and value('local-name(../.)', 'varchar(50)') as element
    ,value('.[not(@xsi:nil = "true")]','VARCHAR(255)') AS new_value
    ...etc...
    but that only gives me the node names, and the child elements.  It does not give me back the attribute names and values from the node itself.
    Thanks in advance for your help.
    cee

    Are you looking for something like this:
    DECLARE @myDoc1 xml
    SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
    <Features  featureID  = "1" featureName = "body">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    <Features featureID = "2" featureName = "seat">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    </ProductDescription>'
    SELECT T.c.value('local-name(.)', 'nvarchar(50)') AS name,
           T.c.value('.', 'nvarchar(50)')  AS value
    FROM   @myDoc1.nodes('ProductDescription/@*') AS T(c)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • I name each photo buy replacing the jpeg number with the name. when I burn to disk and open disk the name is not shown. how do I get the name given to show on the burn disk?.

    after I burn the files to dvd and load to view the name does not appear. How do I get the name listed to appear on the burn disk instead of the file number?

    Naming the Photo - or giving it a title - is not the same as naming  file.
    How are you burning to dvd? With iPhoto? If so then the Title will be available in any app that understands basic metadata.
    If you want the title available in the Finder - which does not understand photo metadata  - then you'll need to export the file
    File -> Export
    In the resulting dialogue you'll see a heading for 'File Name'. Choose 'Use Title' from the drop down.
    Regards
    TD

  • 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 can i get my name on the finder bar?

    How do i get my name on the top right corner next to the search bar? I have OS X Mountain Lion 10.8.5

    System Preferences > Users & Groups
    Click the lock to unlock it, if you have to.
    Click "Login Options".
    Enable " Show fast user switching menu as" and select "Full Name".
    Best.

  • How can i get my name to appear under devices in itunes. It got deleted, and I can't get it back on.

    I'm trying to get my name to appear under devices in itunes for my iphone. It got deleted, and I can't get it back on.

    You need iTunes version 11+.
    iPad not appearing in iTunes
    http://www.apple.com/support/ipad/assistant/itunes/
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/TS1591
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    How to restart the Apple Mobile Device Service (AMDS) on Windows
    http://support.apple.com/kb/TS1567
    IOS: Syncing with iTunes
    http://support.apple.com/kb/HT1386
    Apple - Support - iPad - Syncing
    http://www.apple.com/support/ipad/syncing/
     Cheers, Tom

  • How get controls name from a class private data?

    How can i get the names of the controls inside a class private data?
    I am using Actor Framework and trying to create a method tha will be executed when launch the actor. This method need a list o all the control names inside the class data to search for the initial value inside a configuration file (config.ini), the key on the configuration file will be the name of the control.
    Thanks.
    Solved!
    Go to Solution.

    You are already making the overriding method just because you have to write to the Bundle By Name.  And then how are you going to handle all of the data types the keys could be.  You are making things more difficult than it should be for really very little benefit.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • Submitting job in background with lock mechanism

    Hi, I'm obtaining a lock before submitting the job and releasing it after submitting...as explained below I want to know whether the lock will get released immediately after submitting the job or it will be released only after the finish of the job.

  • How can I get my phone to ring every 2 seconds?

       I've looked and looked all over the internet and I have seen people with this problem but so far no solutions. I would like my bb8520 to function as any $20dollar phone would, which is to ring  every 2 seconds instead of every 10 seconds.    My ph

  • Qosmio G50 No sound over HDMI

    *Qosmio G50 No sound over HDMI* Hi all, Hopefully anyone recognises the following and would be so kind to help me. I have searched the forum and tried severall of the offered solutions mainly applicable to Vista, but still. I hooked up my Qosmio G50

  • Class with objects compile error in Java 1.5.0 and 1.4.2.05

    Hi, I have some problems with creating objects to my java program. See below: JAVA, creating new class object. class AccountTest {      public static void main(String[]args) {      Account olesAccount = new Account(123456676756L, "Ole Olsen", 2300.50

  • Taglib problem : can't parse DTD ?

    Hi, I'm running Tomcat 4.0.1. I'm trying to use the custom tags, but the tomcat server outputs an XML parsing error : 'Element type "tlibversion" must be declared'. It looks like tomcat is unable to read the DTD of my tld file (if I change the DTD ur