Picky DN attribute strings

Just installed 5.0 SP1 and searches with filters that are user defined
attributes of type DN are treated strangely.
Server defined attributes of type DN work fine.
Spaces in the DN somtimes cause problems.........
This is difficult to relay, so bear with me:
Search with filter.....
1)
owner=bankid=12345, ou=traders, o=bank of chicago
OK - get expected return
2)
owner=bankid=12345, ou=traders, o =bank of chicago
OK - get expected return
We have similar cases with uniquemember...both strings return what we
expect.
However
3)
company=vendorid=12345, ou=externalcompany, o=bank of chicago
OK - get expected return
4)
company=vendorid=12345, ou=externalcompany, o =bank of chicago
BAD - no returns
Same situation with other user defined attributes of type DN in a filter.
Hope this problem is clear. Any help?
TIA,
Joe

Hi Joe,
I don't think that you can put a space between the attribute type and the equality sign. So, if the search returns nothing in that case, that should be normal.
Bertold

Similar Messages

  • How to add attributed string to JTextPane

    Hi all,
    Could you tell me how to add an attributed string into a Textpane.
    Textpane only takes a styledDocument. Is there any way to convert attributed string into a styled document.
    Are there any components , which we can include attributed string , instead of simple string. Becoz i want my text to have variable fonts.

    Hello,
    check this short course about [url http://developer.java.sun.com/developer/onlineTraining/GUI/Swing2/shortcourse.html#JFCStyled]JTextPane and StyledDocument.
    Heres a small example:import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.event.*;
    public class AttributedStringTest extends JFrame
         public static void main(String[] args)
              new AttributedStringTest();
         private JTextPane textPane = null;
         private StyledDocument doc = null;
         AttributedStringTest()
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              initMenuBar();
              initTextPane();
              setSize(500, 300);
              setLocationRelativeTo(null);
              setVisible(true);
         private void initMenuBar()
              JMenuBar mbar = new JMenuBar();
              JMenu menu = new JMenu("StyleConstants");
              JMenuItem item = new JMenuItem("Color");
              item.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        Color color =
                             JColorChooser.showDialog(
                                  AttributedStringTest.this,
                                  "Color Chooser",
                                  Color.cyan);
                        if (color != null)
                             MutableAttributeSet attr = new SimpleAttributeSet();
                             StyleConstants.setForeground(attr, color);
                             textPane.setCharacterAttributes(attr, false);
              menu.add(item);
              JMenu font = new JMenu("Font");
              font.add(item = new JMenuItem("12"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-12", 12));
              font.add(item = new JMenuItem("24"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-24", 24));
              font.add(item = new JMenuItem("36"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-36", 36));
              font.addSeparator();
              font.add(item = new JMenuItem("Serif"));
              item.setFont(new Font("Serif", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-Serif", "Serif"));
              font.add(item = new JMenuItem("SansSerif"));
              item.setFont(new Font("SansSerif", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-SansSerif", "SansSerif"));
              font.add(item = new JMenuItem("Monospaced"));
              item.setFont(new Font("Monospaced", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-Monospaced", "Monospaced"));
              font.addSeparator();
              menu.add(font);
              mbar.add(menu);
              setJMenuBar(mbar);
         private void initTextPane()
              doc = new DefaultStyledDocument();
              textPane = new JTextPane(doc);
              JScrollPane scroll = new JScrollPane(textPane);
              getContentPane().add(scroll);
              final JTextField text = new JTextField();
              text.setToolTipText("Please enter something");
              text.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        try
                             doc.insertString(doc.getLength(), text.getText(), textPane.getInputAttributes());
                        } catch (BadLocationException bad)
              getContentPane().add(text, BorderLayout.SOUTH);
    //not formatted version:import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.event.*;
    public class AttributedStringTest extends JFrame
         public static void main(String[] args)
              new AttributedStringTest();
         private JTextPane textPane = null;
         private StyledDocument doc = null;
         AttributedStringTest()
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              initMenuBar();
              initTextPane();
              setSize(500, 300);
              setLocationRelativeTo(null);
              setVisible(true);
         private void initMenuBar()
              JMenuBar mbar = new JMenuBar();
              JMenu menu = new JMenu("StyleConstants");
              JMenuItem item = new JMenuItem("Color");
              item.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        Color color =
                             JColorChooser.showDialog(
                                  AttributedStringTest.this,
                                  "Color Chooser",
                                  Color.cyan);
                        if (color != null)
                             MutableAttributeSet attr = new SimpleAttributeSet();
                             StyleConstants.setForeground(attr, color);
                             textPane.setCharacterAttributes(attr, false);
              menu.add(item);
              JMenu font = new JMenu("Font");
              font.add(item = new JMenuItem("12"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-12", 12));
              font.add(item = new JMenuItem("24"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-24", 24));
              font.add(item = new JMenuItem("36"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-36", 36));
              font.addSeparator();
              font.add(item = new JMenuItem("Serif"));
              item.setFont(new Font("Serif", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-Serif", "Serif"));
              font.add(item = new JMenuItem("SansSerif"));
              item.setFont(new Font("SansSerif", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-SansSerif", "SansSerif"));
              font.add(item = new JMenuItem("Monospaced"));
              item.setFont(new Font("Monospaced", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-Monospaced", "Monospaced"));
              font.addSeparator();
              menu.add(font);
              mbar.add(menu);
              setJMenuBar(mbar);
         private void initTextPane()
              doc = new DefaultStyledDocument();
              textPane = new JTextPane(doc);
              JScrollPane scroll = new JScrollPane(textPane);
              getContentPane().add(scroll);
              final JTextField text = new JTextField();
              text.setToolTipText("Please enter something");
              text.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        try
                             doc.insertString(doc.getLength(), text.getText(), textPane.getInputAttributes());
                        } catch (BadLocationException bad)
              getContentPane().add(text, BorderLayout.SOUTH);
    regards
    Tim

  • Attributed String

    I have a attributed string in unicode character which i have to print in JTextArea using SetText() method.
    It doesnt accept attributed string.
    Please help solve the query.

    If you mean the class AttributedString,then it can only be displayed in JTextPane.
    So use JTextPane instead of JTextArea.

  • Need help with attributed string in NSMenuItem

    I'm trying to implement a contextual menu for a view in one of my applications. I want it to be dynamic, based on where you click in the view. It works fine if I don't try to mess with the font size of the menu. If I try to make the menu font smaller, the menu will appear blank, and its action won't get triggered, but only if there's only one menu item. If there are two or more, they'll all show up.
    I've done a bunch of searching, and found some code examples where they put in a dummy item, then remove it later, but so far, that hasn't helped me, either. I've posted an example project (~44KB) on my web site that illustrates this, if you'd like to see it in action (the example doesn't include the "dummy fix", by the way, but it's easy enough to add).
    Here's the code where I customize the menu:
    <pre class="command">-(NSMenu *)menuForEvent:(NSEvent *)theEvent
    NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil];
    NSLog(@"Raw Mouse Location: %2.1f, %2.1f", mouseLoc.x, mouseLoc.y);
    // Get my blank menu:
    NSMenu *tzMenu = [self defaultMenu];
    // Set up my string attributes:
    NSMutableDictionary *menuAttributes = [[NSMutableDictionary alloc] init];
    [menuAttributes setObject:[NSFont fontWithName:@"Lucida Grande" size:11] forKey:NSFontAttributeName];
    if (mouseLoc.x < 220) // Make just one menu item.
    int i;
    for (i=0; i<1; i++)
    [tzMenu addItemWithTitle:@"Item" action:@selector(changeMapDot:) keyEquivalent:@""];
    NSMenuItem *lastItem = [tzMenu itemAtIndex:[tzMenu numberOfItems] - 1];
    NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:@"Item" attributes:menuAttributes];
    // Comment out this next line and the menu item appears in the default font:
    [lastItem setAttributedTitle:attrString];
    [attrString release];
    else
    int i;
    for (i=0; i<3; i++) //Make three items. These always appear.
    [tzMenu addItemWithTitle:@"Item" action:@selector(changeMapDot:) keyEquivalent:@""];
    NSMenuItem *lastItem = [tzMenu itemAtIndex:[tzMenu numberOfItems] - 1];
    NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:@"Item" attributes:menuAttributes];
    [lastItem setAttributedTitle:attrString];
    [attrString release];
    [menuAttributes release];
    return tzMenu;
    }</pre>Any tips that anyone has would be most apprecitated.
    I'm not unalterably opposed to the regular system menu font if there's no way around this (the menus are pretty short: usually less then a dozen items), but aesthetically it looks nicer with a smaller font.
    charlie

    Hi,
    You can use SUBSTR and INSTR
    This should work in Oracle 9:
    WITH     cntr     AS
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL <= 3
    ,     got_pos          AS
         SELECT     x.txt
         ,     c.n
         ,     INSTR (x.txt, '[', 1, c.n)     AS l_pos
         ,     INSTR (x.txt, ']', 1, c.n)     AS r_pos
         FROM           table_x  x
         CROSS JOIN    cntr     c
    SELECT        txt
    ,        n
    ,        SUBSTR ( txt
                   , l_pos + 1
                , r_pos - (l_pos + 1)
                   )     AS sub_txt
    FROM        got_pos
    ORDER BY   txt
    ,             n
    ;Sorry, I don't have an Oracle 9 database available now; I had to test this in Oracle 10.
    jimmy437 wrote:
    ... I have tried the "REGEXP_SUBSTR" but my database version is 9i, and it is available only from 10g.That's true. Regular expressions are very useful, but they're not available in Oracle 9 (or earlier).
    Oracle 9 does have an Oracle-supplied package, OWA_PATTERN, that provides some regular expression functionality:
    http://docs.oracle.com/cd/B12037_01/appdev.101/b10802/w_patt.htm
    I know that's the Oracle 10, documentation, but it exists in Oracle 9, too.
    Oracle 9 is very old. You should consider upgrading.

  • Saving a textarea list from a form to attribute string in SAP resource

    Hi,
    I am trying to save a text area from a form defined as this:
    <Field name='accounts[$(RESOURCE_NAME)].assignedProfiles'>
    <Display class='TextArea'>
    <Property name='title' value='$(RESOURCE_NAME) Profiles'/>
    <Property name='rows' value='6'/>
    <Property name='columns' value='32'/>
    <Property name='format' value='list'/>
    <Property name='sorted' value='true'/>
    </Display>
    <Derivation>
    <ref>accounts[$(RESOURCE_NAME)].assignedProfiles</ref>
    </Derivation>
    </Field>
    Into an SAP Resource to the attribute assignedProfiles which is mapped to PROFILES->BAPIPROF
    This text area actually outputs a list and saves without error from IDM however, when I check in SAP, it's not reflected, what is happening here, I tried many approaches already, and it's maddening that it doesn't work!
    Please help!

    So here is a solution I came up with
    <cfoutput>
    <cfset Servers="#StripCR(Form.ServerList)#">
    <cfset Servers2="'#Replace(Servers, "
    ", " ", "All")#'">
    <cfset Servers3="#ToString(Servers2)#">
    <cfset Servers4="#Replace(Servers3, " ", "', '", "All")#">
    </cfoutput>
    Then in the cfquery SQL I used
    WHERE Server IN (#PreserveSingleQuotes(Servers4)#)
    Right now this is working but it seems very cumbersome.  If anyone can come up with a way to simplify this please let me know.

  • Font metrics of an attributed string

    The Graphics.drawString(AttributedCharacterIterator, int, int) can paint a rich text, but how could I get its width without the TextLayout?

    In PP 1.0 you can't even draw it! The only class which uses it is AttributedString, and nothing uses that.
    Short answer: yes, it's a design failure.
    Long answer: in theory, you should be able to get the attributes and work it out yourself.

  • More than one attribute in Attributed String

    I want to write a text in an applet with a specific font and making some characters of the text be written in superscript
    If I don't specify the font, the superscript appears right. If I specify the font, it also appears accordingly
    But if I specify both, only the font is used and there is no superscript in the lay out
    This is the code I'm using
         AttributedString as1 = new AttributedString(info);
         as1.addAttribute(TextAttribute.FONT,ff);
         as1.addAttribute(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUPER, posbase+igual.length(), posbase+igual.length()+sp.length());
         g.drawString(as1.getIterator(), x+d[0], y+d[1]);
    If I comment out any of the addAttribute calls, it gets rendered as expected
    Any idea?
    Thanks in advance

    I thought it might, as I vaguely recall having a similar problem with Font that was solved by using the form of deriveFont that takes a Map.
    db

  • How to find out which object has a specific attribute value

    Hi all,
    which is the easiest way to check in a collection of objects which object has an attribute with a specific value?
    i.e. I have n objects of classA and they all have an attribute "String value;".
    How can I check which object has that attribute set to "myvalue"?
    Thanks,
    A.

    hi,
    i don't know if this would be the best way to do it, but i would add all the instances of the objects to a hashtable with the key as the attribute with which you want to search them. You would then retrieve the object using the value.
    Cath

  • Writing multiple rows in one line, mysql statement. No strings are saved

    Hi, I dont know how to make multiple rows inputs into the table in one sentence. Ive got an error: "java.sql.SQLException: Statement parameter 2 not set" provided by code below. It works fine for one Date row (saves in the db corectly) however when I use for two different date types two single statements it will write databes two times putting 2x Null in the every other row. I dont want that, I need it to be written in one connection and statement.
    try{
         String userName = "user";
              String password = "pass";
              String url = "jdbc:mysql://dbadress/dbname";
              Class.forName ("com.mysql.jdbc.Driver").newInstance();
              Connection con = DriverManager.getConnection (url, userName, password);
              Statement  st1=con.createStatement();
           Date BirthDate = wdContext.currentPeopleElement().getBirthDate();  //People - context node, BirthDate - context attribute
           Date FillDate = wdContext.currentContextElement().getFillDate();
           String sql1 = "INSERT INTO table1 (BirthDate1,FillDate1) VALUES (?,?)"; //BirthDate1,FillDate1 - rows in the "table1" table
           PreparedStatement stmt1 = con.prepareStatement(sql1);
           stmt1.setDate(1, BirthDate);
           stmt1.setDate(1, FillDate);
           stmt1.executeUpdate();
           stmt1.close();
         catch(Exception e) {
         wdComponentAPI.getMessageManager() .reportWarning( e.toString() ); }
    I would like to know how to fix it.
    Other issue is that code below:
    try{
         String userName = "user";
              String password = "pass";
              String url = "jdbc:mysql://dbadress/dbname";
              Class.forName ("com.mysql.jdbc.Driver").newInstance();
              Connection con = DriverManager.getConnection (url, userName, password);
              Statement  st1=con.createStatement();
           Date BirthDate = wdContext.currentPeopleElement().getBirthDate();  //People - context node, BirthDate - context attribute
           String sql1 = "INSERT INTO table1 (BirthDate1) VALUES (?)"; //BirthDate1 row in the "table1" table
           PreparedStatement stmt1 = con.prepareStatement(sql1);
           stmt1.setDate(1, BirthDate);
              stmt1.executeUpdate();
           stmt1.close();
         catch(Exception e) {
         wdComponentAPI.getMessageManager() .reportWarning( e.toString() ); }
    works perfectly fine. It does write date in the database as shown on the monitor hoever it doesnt work if we change Date type with String. Of course context nodes are String type as well. Code below will write "Null" value in the db. Dont know why. Of course I write some string down in the input field and save after, just like do it with Date type which works fine. Please advice.
    try{
         String userName = "user";
              String password = "pass";
              String url = "jdbc:mysql://dbadress/dbname";
              Class.forName ("com.mysql.jdbc.Driver").newInstance();
              Connection con = DriverManager.getConnection (url, userName, password);
            Statement  st2=con.createStatement();
         String signature = wdContext.currentContextElement().getsignature(); //signature - context
         String sql2 = "INSERT INTO table1 (signature1) VALUES (?)"; //signature1 - name of row in the table1
         PreparedStatement stmt2 = con.prepareStatement(sql2);
         stmt2.setString(1, signature);
         stmt2.executeUpdate();
         stmt2.close();
         catch(Exception e) {
         wdComponentAPI.getMessageManager() .reportWarning( e.toString() ); }
    Regards, Blamer.

    Hi,
    Fix for your first issue
    I dont know how to make multiple rows inputs into the table in one sentence. Ive got an error: "java.sql.SQLException: Statement parameter 2 not set" provided by code below. It works fine for one Date row (saves in the db corectly) however when I use for two different date types two single statements it will write databes two times putting 2x Null in the every other row. I dont want that, I need it to be written in one connection and statement.
    try{
         String userName = "user";
              String password = "pass";
              String url = "jdbc:mysql://dbadress/dbname";
              Class.forName ("com.mysql.jdbc.Driver").newInstance();
              Connection con = DriverManager.getConnection (url, userName, password);
              Statement  st1=con.createStatement();
           Date BirthDate = wdContext.currentPeopleElement().getBirthDate();  //People - context node, BirthDate - context attribute
           Date FillDate = wdContext.currentContextElement().getFillDate();
           String sql1 = "INSERT INTO table1 (BirthDate1,FillDate1) VALUES (?,?)"; //BirthDate1,FillDate1 - rows in the "table1" table
           PreparedStatement stmt1 = con.prepareStatement(sql1);
           stmt1.setDate(1, BirthDate);
           stmt1.setDate(1, FillDate);
           stmt1.executeUpdate();
           stmt1.close();
         catch(Exception e) {
         wdComponentAPI.getMessageManager() .reportWarning( e.toString() ); }
    I would like to know how to fix it.
    Change the line  stmt1.setDate(1, FillDate); to stmt1.setDate(2, FillDate);
    As a workarond for your following issue
    works perfectly fine. It does write date in the database as shown on the monitor hoever it doesnt work if we change Date type with String. Of course context nodes are String type as well. Code below will write "Null" value in the db. Dont know why. Of course I write some string down in the input field and save after, just like do it with Date type which works fine. Please advice.
    try{
         String userName = "user";
              String password = "pass";
              String url = "jdbc:mysql://dbadress/dbname";
              Class.forName ("com.mysql.jdbc.Driver").newInstance();
              Connection con = DriverManager.getConnection (url, userName, password);
            Statement  st2=con.createStatement();
         String signature = wdContext.currentContextElement().getsignature(); //signature - context
         String sql2 = "INSERT INTO table1 (signature1) VALUES (?)"; //signature1 - name of row in the table1
         PreparedStatement stmt2 = con.prepareStatement(sql2);
         stmt2.setString(1, signature);
         stmt2.executeUpdate();
         stmt2.close();
         catch(Exception e) {
         wdComponentAPI.getMessageManager() .reportWarning( e.toString() ); }
    Try as follows
    PreparedStatement stmt2 = con.prepareStatement(sql2);
         stmt2.setString(1, (signature == null ? "Value missing" : signature));
         stmt2.executeUpdate();
         stmt2.close();
    If the context attribute is null it will enter the text "Value Missing",
    Regards
    Ayyapparaj

  • How to typecast the given attribute.

    Hi all,
    I am getting an error.
    I am using dropdownbyindex and using following code.
        Iprivate<ur view name>.IEt_Fragen_output obj = wdcontect.nodeET_Fragen_output.creatEt_Fragen_outputelement();
                   List list1=new ArrayList();
                   for(int i=0;i<obj.length;i++)
                        IPrivateCompView.Idropdownnode data=wdContext.nodedropdown.createdropdownElement();
                        data.setvalue
    ->->->(wdcontext.currentcontextelment.getelementat(i).getfrange);
                        list1.add(data);
                   wdContext.nodedropdown.bind(list1);
    now in this when i try to put (see arrows)currentcontextelment. then i do not get "getelementat(i)." method. Now how to typecast this. I need this method to use "getfrage".
    plz help!!...Its urgent!!!
    Cheers,
    Darshna.

    Hi,
    here is your code. I am using the same structure as you said.
    ValueCollection (value node)
    Values  (value node)
    frage  (value attribute)
         String[] Names = new String []
            "Monthly","Weekly"};
         List monthsOrWeek = new ArrayList();
    IPublic<Component Name>.IValuesElement valuesElement = null;
         for (int i =  0; i < Names.length; i++)
              valuesElement = wdContext.createValuesElement();
              valuesElement.setFrage(Names<i>);  
              monthsOrWeek.add(valuesElement);
         wdContext.nodeValues().bind(monthsOrWeek);
    Hope it helps. Please reward points if it helps....
    Thanks and Regards
    Avijit

  • Updating custom boolean attribute in Active Directory via OIM

    The adapters delivered with the AD connector support updating standard attributes (string) and multi-value attributes, but I can't seem to figure out how to update a custom Boolean attribute in AD via OIM. The delivered Boolean fields all appear to have custom adapters (ie Account Locked, Password Never Expires, etc.)
    I've tried using the delievered adpADCSCHANGEATTRIBUTE adapter, but it fails (as expected) with:
    +com.thortech.xl.integration.ActiveDirectory.tcUtilADTasks : updateDetails : Attributes cannot update:[LDAP: error code 21 - 00000057: LdapErr: DSID-0C090B73, comment: Error in attribute conversion operation, data 0, v1772 ]+
    Suggestions?

    No I don't have custom boolean attributes in AD. But I added custom attributes of other types.
    When you say custom, do you mean it did not come with the out of the box AD connector, but exists in the Active Directory of your organization?
    There are a few attributes in AD which look like they are boolean when you see the AD console but are actually different. Look at the link for details.
    [http://support.microsoft.com/kb/305144]
    Look at this post for context.
    AD Provisioning - Password never expires & User must chg pwd at next logon
    Thanks,
    M

  • UME Custom Attributes

    hi folks,
    i have defined some custom attributes in the UME. i wish to retreive those values at runtime and need to perform some decision based on those attributes....
    is there any method of accessing those properties

    Hi Glenn,
    Quoted from:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/91f0cd90-0201-0010-a190-c4d7cbd5b463
    Once the XML file has been configured and uploaded, the developer has access to any of the attributes configured in the file. You can use the getAttribute() method on the user object to access the special attributes. The method requires two parameters: a Namespace, and the Attribute Name. The namespace is used provide additional flexibility in complex user management configurations. The standard namespace is “com.sap.security.core.usermanagement”. However, you can obtain a list of namespaces associated with the user by calling getAttributeNamespaces() on the user object.
    response.write("<br>Attributes: ");
    String namespaces[] = user.getAttributeNamespaces();
    String ns = null;
    for (int i = 0; i < namespaces.length; i++) {
        if (i > 0)
            ns = namespaces[ i ];
        String attrNames[] = user.getAttributeNames(ns);
        if (ns != null)
            response.write("<br>NS: " + ns);
        for (int j = 0; j < attrNames.length; j++) {
            Object attr[] = user.getAttribute(ns, attrNames[j]);
            response.write("<br>" + attrNames[j] + " = ");
            for (int k = 0; k < attr.length; k++)
                response.write(attr[0].toString() + ", ");
    Hope that helps,
    Yoav.

  • Reg: Retreiving Custom UME attributes

    How to retrieve custom UME attributes in webdynpro. Should i add any imports or jar files for that.

    Hi,
    add the com.sap.security.api.jar in build path.
    try {
         wdComponentAPI.getMessageManager().reportSuccess("** user attributes***");
         IWDClientUser wdUser = WDClientUser.getCurrentUser();
        IUserFactory fact=UMFactory.getUserFactory();
        IUser user=wdUser.getSAPUser();
        IUserAccount acc=user.getUserAccounts()[0];
       //user attribute
       String[] attNamesapces=user.getAttributeNamespaces();
       for(int i=0;i<attNamesapces.length;i++){
           String attrib[]=user.getAttributeNames(attNamesapces<i>);
           for(int j=0;j<attrib.length;j++){
               String h[]=user.getAttribute(attNamesapces<i>,attrib[j]);
                if(h!=null)
                  for(int k=0;k<h.length;k++)
          wdComponentAPI.getMessageManager().reportSuccess(attNamesapces<i>+"."+attrib[j]
    +"="+h[k]);
    //user account attributes
    wdComponentAPI.getMessageManager().reportSuccess("** user account attributes***");
    attNamesapces=acc.getAttributeNamespaces();
    for(int i=0;i<attNamesapces.length;i++){
       String attrib[]=acc.getAttributeNames(attNamesapces<i>);
       for(int j=0;j<attrib.length;j++){
           String h[]=acc.getAttribute(attNamesapces<i>,attrib[j]);
           if(h!=null)
              for(int k=0;k<h.length;k++)
             wdComponentAPI.getMessageManager().reportSuccess(attNamesapces<i>+"."+attrib[j]+"="+h[k]);
    } catch (Exception e) {}
    Regards,
    Naga

  • Problem selecting node by position attribute

    1) The following xpath does not return any node:
    /lgbl/hauptteil[1]/art[@position="art:17"]/abs[@position="abs:1"]/ziff[@position="ziff:3.1"]
    Reading the whole xmltype field reveals that this node exists at the selected path
    2) Alternatively xpath does return a node: /lgbl/hauptteil[1]/art[@position="art:17"]/abs[@position="abs:1"]/ziff[@position="ziff:3"]
    Reading the whole xmltype field reveals that this node exists at the selected path
    Question) Are dots in the position attribute string treated any special. If so, how should the xpath be formed to find the node in the query 1)

    Hi Joan,
    If you got the NullPointerException at the second line it means that the attribute with the name "DynamicNode.""str"c.getCounter() doesn't exists. So I would suggest to check for null value before doing the second line:
    attributeInfo = wdContext.getNodeInfo().getAttribute("DynamicNode."+"str"+c.getCounter());
    if (null != attributeInfo){
         ISimpleTypeModifiable stm=attributeInfo.getModifiableSimpleType();
         IModifiableSimpleValueSet svs=stm.getSVServices().getModifiableSimpleValueSet();
         theRadioGroup.setSelectedKey(svs.getText(""+c.getRating().intValue()));
    ... and again the code on the forth line is not correct, it should be like this (assuming c.getRating().intValue() is equals to j):
         theRadioGroup.setSelectedKey(""+c.getRating().intValue());
    because svs.getText() will return you the text and not the key. To get the key use svs.getKey(c.getRating()). The point is that the value stored in the appropriate context attribute is the key, but the value displayed on view is the text.
    Good luck
    Ivan

  • Using Colored Strings

    Well, we want to use colored strings for our network application (client-server).
    Now, the server should send colored strings to the client, which should display them onto the screen.
    The old way we have been doing this is using "color codes" and parsing the strings when printing them.
    For example, a colored string could look something like:
    &x100100100This is a colored string!&n
    the &x100100100 means that the text after it should use RGB value of 100,100,100. &n meant that the colors should stop and return to default.
    Well... this makes the client need to parse strings and set colors etc, the color codes are also fairly long, and used alot, making strings very long if they have much color.
    What im wondering about is if we should use something like AttributedString to represent the colored strings? And let the server send the attributed string over the net instead of just a normal string. The client could just print it out then, without any parsing...
    Also, would it take more bandwidth to send an attributed string with same colors, as a string using these color codes?
    Thanks for answers.

    We are currently using AtrributedStrings and TextLayout to produce the colored text.
    The text uses the color codes in normal strings and is sent to the client, where it parses the string and creates an AttributedString from it, and prints it to the screen.
    My original question was wether it perhaps would be better to send an AttributedString directly over the net, instead of the normal string, and skip all the parsing on the client side and directly print out the received AttributedString.
    However, i tried writing two strings to a file using ObjectOutputStream that would represent the exact same string and colors. One with our usual color codes (which took up 1 kb) and one using AttributedString (which took up 62 kb).
    I guess sending attributed strings rather than normal strings containg color codes to be parsed, would eat up way more bandwith...
    We will probobly use our old system, and let the client parse the string, which is fast compared to sending extra data over the Internet.

Maybe you are looking for

  • MSI 275 GTX Lightning, overcklocking procedure

    Hi, I will be very happy if you can help me with my problem. I bought MSI GTX 275 Lightning, especially for games and easy overclock, but i have problem with these. First I tried to use Utility from CD MSI Lightning Afterburn, but when is programm st

  • Newbie question!  open URL

    How do I open a pdf url from my java servlet application? This is what I got but it aint working any other methods? URL yahoo = new URL("http://www.sourceforge.com"); BufferedReader in = new BufferedReader( new InputStreamReader( yahoo.openStream()))

  • Problem moving iTunes library between users on MacBook Pro / OS Lion

    Hey guys, I can't figure this one out. I bought a new MacBook Pro, and since I didn't have the firewire cable, I just made my account on the new one. I got the firewire cable, and used migration assistant to transfer my old MacBook Pro over (photos,

  • Custom Password Policy

    Hi xperts, I want to create a custom password policy which shoud fulfil the following requirements. 1Allow additional alpha characters more other than A-Z and a-z. i.e the ones in Start button--->Programs>Accessories>System Tools>Character Map. 2.Exp

  • WebLogic on WinME

    Am requesting help, can't seem to get it to install or run. I have been able to run through the install program "successfully", but can't run the 'console' or start the application server. pls help could the problem be related to my platform - if so