How to retrieve null-valued attributes from a LDAP server?

(I posted this in the ES board but then thought this is more of a programmer's question, sorry for the duplication).
I am using JNDI api to do search operations on a Java Directory Server( part of SunOne).
However, I found all the attributes that do not have values are automatically filtered out from the search result.
NamingEnumeration answer = ctx.search(ctxName, filterExpr, cons);
               while(answer.hasMore()){
                    SearchResult sr = (SearchResult)answer.next();
                    Attributes attrs = sr.getAttributes();
                    for(NamingEnumeration ne = attrs.getIDs();ne.hasMore();){
                         System.out.println("ids:"+ne.next());
                    System.out.println("-------------------------------------------------------");
                   for (NamingEnumeration ae = sr.getAttributes().getAll(); ae.hasMore();) {
                       Attribute attr = (Attribute)ae.next();
                       System.out.println("attrName:"+attr.getID());
                       //System.out.println("attribute: " + attr.getID());
                       NamingEnumeration e = attr.getAll();
                       while(e.hasMore()){
                             System.out.println("  attrVal:"+e.next());
                   }Is there anything I did wrong here?
Here are a couple of things I noticed,
1. in a Softerra LDAP browser, those no-valued attributes are not present either. But in JXplorer, I can see the full list that includes the attributes that do not have a value.
2. I had Schema disabled in the server console.
Thank you in advance.

There are only two ways to read data from Directory Server:
1. a. just fetch the entry
b. display the content
2. a. fetch the entry
b. parse the entry and figure what object classes it is of
c. lookup each object class definition in the schema and retrieve the attribute list
d. combine the attributes of the entry with all the "possible" attributes of its object classe(s)
e. display the content
Here's for an easy example we can relate to:
I have the following entry in my DS
  cn=the_duuuuuude,dc=forum,dc=sun,dc=com
  objectClass: person
  cn: the_duuuuuude
  sn: arnaudIf you use method 1, you will get just what is stored in the db. That is:
  cn=the_duuuuuude,dc=forum,dc=sun,dc=com
  objectClass: person
  cn: the_duuuuuude
  sn: arnaudif you use method 2, you will get:
  cn=the_duuuuuude,dc=forum,dc=sun,dc=com
  objectClass: person
  cn: the_duuuuuude
  sn: arnaud
  description:
  seeAlso:
  telephoneNumber:
  userPassword:because when you looked up the 'person' object class you got this:
objectClasses: ( 2.5.6.6 NAME 'person' DESC 'Standard LDAP objectclass' SUP top MUST ( sn $ cn ) MAY ( description $ seeAlso $ telephoneNumber $ userPassword ) X-ORIGIN 'RFC 2256' )Now the important thing to note is that physically in the database, the attributes description, seeAlso, telephoneNumber and userPassword are NOT stored. It's not that they have a 'null' value. They're just not there. It doesn't stop you from looking up the schema.
Optimally, in your client, you would fetch the whole server schema and cache it so you have to do the extra round trip for every entry you process.
The difference you observe with various LDAP browsers might simply be that one uses method 1 and the other method 2.
Hope this helps wrap your mind around this.
-=arnaud=-

Similar Messages

  • How to retrieve null-valued attributes from LDAP server.

    I am using JNDI api to do search operations on a Java Directory Server( part of SunOne).
    However, I found all the attributes that do not have values are automatically filtered out from the search result.
                   NamingEnumeration answer = ctx.search(ctxName, filterExpr, cons);
                   while(answer.hasMore()){
                        SearchResult sr = (SearchResult)answer.next();
                        Attributes attrs = sr.getAttributes();
                        for(NamingEnumeration ne = attrs.getIDs();ne.hasMore();){
                             System.out.println("ids:"+ne.next());
                        System.out.println("-------------------------------------------------------");
                       for (NamingEnumeration ae = sr.getAttributes().getAll(); ae.hasMore();) {
                           Attribute attr = (Attribute)ae.next();
                           System.out.println("attrName:"+attr.getID());
                           //System.out.println("attribute: " + attr.getID());
                           NamingEnumeration e = attr.getAll();
                           while(e.hasMore()){
                                 System.out.println("  attrVal:"+e.next());
                       }Is there anything I did wrong here?
    Here are a couple of things I noticed,
    1. in a Softerra LDAP browser, those no-valued attributes are not present either. But in JXplorer, I can see the full list that includes the attributes that do not have a value.
    2. I had Schema disabled in the server console.
    Thank you in advance.

    There are only two ways to read data from Directory Server:
    1. a. just fetch the entry
    b. display the content
    2. a. fetch the entry
    b. parse the entry and figure what object classes it is of
    c. lookup each object class definition in the schema and retrieve the attribute list
    d. combine the attributes of the entry with all the "possible" attributes of its object classe(s)
    e. display the content
    Here's for an easy example we can relate to:
    I have the following entry in my DS
      cn=the_duuuuuude,dc=forum,dc=sun,dc=com
      objectClass: person
      cn: the_duuuuuude
      sn: arnaudIf you use method 1, you will get just what is stored in the db. That is:
      cn=the_duuuuuude,dc=forum,dc=sun,dc=com
      objectClass: person
      cn: the_duuuuuude
      sn: arnaudif you use method 2, you will get:
      cn=the_duuuuuude,dc=forum,dc=sun,dc=com
      objectClass: person
      cn: the_duuuuuude
      sn: arnaud
      description:
      seeAlso:
      telephoneNumber:
      userPassword:because when you looked up the 'person' object class you got this:
    objectClasses: ( 2.5.6.6 NAME 'person' DESC 'Standard LDAP objectclass' SUP top MUST ( sn $ cn ) MAY ( description $ seeAlso $ telephoneNumber $ userPassword ) X-ORIGIN 'RFC 2256' )Now the important thing to note is that physically in the database, the attributes description, seeAlso, telephoneNumber and userPassword are NOT stored. It's not that they have a 'null' value. They're just not there. It doesn't stop you from looking up the schema.
    Optimally, in your client, you would fetch the whole server schema and cache it so you have to do the extra round trip for every entry you process.
    The difference you observe with various LDAP browsers might simply be that one uses method 1 and the other method 2.
    Hope this helps wrap your mind around this.
    -=arnaud=-

  • How to enable security with users from an LDAP server

    Hello all
    My company is using a 10.1.3 Oracle LDAP server and I would like to authenticate users of my application against it.
    Can anyone point to the correct documentation?
    Thanks in advance
    Thanassis

    Thanks for your reply
    I 've gone through "Introduction to ADF Security in JDeveloper 10.1.3.2" and also Chapter 30 of "Application Development Framework Developer's Guide For Forms/4GL Developers"
    There still one thing I cannot understand : Where do I define the mapping between LDAP users and security roles?
    THanassis

  • How to retrieve the values from a table if they differ in Unit of Measure

    How to retrieve the values from a table if they differ in Unit of Measure?

    If no data is read
    - Insure that you use internal code in SELECT statement, check via SE16 desactivating conversion exit on table T006A. ([ref|http://help.sap.com/saphelp_nw70/helpdata/en/2a/fa0122493111d182b70000e829fbfe/frameset.htm])
    If no quanity in result internal table
    - There is no adqntp field in the internal table, so no quantity is copied in itab ([ref|http://help.sap.com /abapdocu_70/en/ABAPINTO_CLAUSE.htm#&ABAP_ALTERNATIVE_1@1@]).
    - - Remove the CORRESPONDING, so quantity will fill the first field adqntp1.  ([ref|http://help.sap.com/abapdocu_70/en/ABENOPEN_SQL_WA.htm])
    - - Then loop at the internal table and move the quantity when necessary to the 2 other fields.
    * Fill the internal table
    SELECT msehi adqntp
      INTO TABLE internal table
      FROM lipso2
      WHERE vbeln = wrk_doc1
        AND msehi IN ('KL','K15','MT').
    * If required move the read quantity in the appropriate column.
    LOOP AT internal_table ASSIGNING <fs>.
      CASE <fs>-msehi.
        WHEN 'K15'.
          <fs>-adqnt2 = <fs>-adqnt1.
          CLEAR <fs>-adqnt1.
        WHEN 'MT'.
          <fs>-adqnt3 = <fs>-adqnt1.
          CLEAR <fs>-adqnt1.
      ENDCASE.
    ENDLOOP.
    - You could also create another table with only fields msehi and adqntp and then collect ([ref|http://help.sap.com/abapdocu_70/en/ABAPCOLLECT.htm]) the data to another table.
    Regards,
    Raymond

  • How to retrieve the value of last identity has been updated in a database?

    how to retrieve the value of last identity has been updated in a database

    Hi,
    Oracle 10g, FGA - Fine grained auditing, supports DML statements (9i only select).
    Set up FGA using the DBMS_FGA.ADD_POLICY procudure:
    sql> BEGIN
    DBMS_FGA.ADD_POLICY (
    policy_name => 'AUD_EMPLOYEE_SAL',
    object_schema => 'HR',
    object_name => 'EMPLOYEE',
    audit_column => SALARY',
    audit_condition => '',
    statement_type => 'UPDATE');
    END;
    NEXT:
    sql> SELECT dbuid, lsqltesxt FROM sys.fga_logs$;
    The database inserts the audit record into the FGA_LOG$ table using an autonomous transaction; even if you roll back the update statement, the update action will still be logged in this table. The fga_log$ tracks the session, machine id, timestamp, schema, scn, etc:
    SQL> desc fga_log$
    Name Null? Type
    SESSIONID NOT NULL NUMBER
    TIMESTAMP# DATE
    DBUID VARCHAR2(30)
    OSUID VARCHAR2(255)
    OSHST VARCHAR2(128)
    CLIENTID VARCHAR2(64)
    EXTID VARCHAR2(4000)
    OBJ$SCHEMA VARCHAR2(30)
    OBJ$NAME VARCHAR2(128)
    POLICYNAME VARCHAR2(30)
    SCN NUMBER
    SQLTEXT VARCHAR2(4000)
    LSQLTEXT CLOB
    SQLBIND VARCHAR2(4000)
    COMMENT$TEXT VARCHAR2(4000)
    PLHOL LONG
    STMT_TYPE NUMBER
    NTIMESTAMP# TIMESTAMP(6)
    PROXY$SID NUMBER
    USER$GUID VARCHAR2(32)
    INSTANCE# NUMBER
    PROCESS# VARCHAR2(16)
    XID RAW(8)
    AUDITID VARCHAR2(64)
    STATEMENT NUMBER
    ENTRYID NUMBER
    DBID NUMBER
    LSQLBIND CLOB
    SQL> spool off

  • How to delete null values in a table

    hi all,
    tell me please any one how to delete null values in a table
    example:
    in emp table is there
    empno ename job mgr sal deptno
    7900 scott 7902 2000 10
    7499 clerk 7900 20
    7834 james manager 3000 30
    like this in the above emp table there are some null values are there
    so how to delete the null values in emp table
    thanks,
    regards.
    Edited by: user9195968 on Feb 25, 2010 6:30 AM

    not too sure what you mean, perhaps you could supply a table description and some sample data
    but, consider
    delete from table_1 where column_1 is null
    commit
    /

  • How to retrieve the parameter names from a JSP page ? Urgent Please

    Hello,
    Can anybody tell me how to retrieve the parameter names from the JSP
    page. (without using getParameterNames() method.)
    The problem with the getParameterNames() method is I get the Jumbled output.
    I need it very badly
    With regards
    Ananth R
    email:[email protected]
    [email protected]

    Dear duffymo,
    My primary intention is to convert the JSP form information into a XML file.
    If I do not get the Parameter names in the correct order how can I maintain
    tag order in XML file.
    For ex: (JSP PAGE VIEW)
    Name--
    FirstName
    MiddleName
    LastName
    Address--
    Street1
    Street2
    City
    Country
    &so on
    (XML File to be generated)
    <Name>
    <FirstName>Value</FirstName>
    </Name>
    <Address>
    <street1>value</street1>
    </Address>
    & so on
    If I use getParameterNames() to get all the parameter names(Which form the tag names in the XML file ) the Enumeration object it returns will not be in the same order as the text fields in JSP.From this I can not construct a meaningful XML file.
    order means: Order of entry on the page, from top to bottom
    That's it
    Waiting for your responses

  • How to retrieve user custom attributes in OID programmatically

    Hi,
    I created a custom attribute named "location" in OID. Could someone give indication/portion of code showing how to retrieve this custom attribute "location" of a user programmatically?
    For the moment, I just found sample code (using oracle.ldap.*) showing how to retrieve "uid" attribute of a user programmatically. I tried to get me inspired of this portion of code, but never succeed.
    Thanks a lot for any help.
    Jeff

    Use below code to get all attributes in user profile including UDF.
    OIMInternalClient objOimInternalClient = null;
    User user = null;
              UserManager usrService = null;
    objOimInternalClient = new OIMInternalClient();
              if (objOimInternalClient != null) {
                        try {
                             objOimInternalClient.loginAsAdmin();
                             usrService = objOimInternalClient
                                       .getService(UserManager.class);
                             user = usrService.getDetails("usr_key", strUserKey, null);
                             endDate = (Date) user.getAttribute("End Date");
                        } catch (Exception e) {
                             e.printStackTrace();
                        } finally {
                             if (objOimInternalClient != null)
                                  objOimInternalClient.logout();
                             if (user != null)
                                  user = null;
                             if (usrService != null)
                                  usrService = null;
    In order to see all UDF's in User profile, please create Authorization Policy.

  • How to  extract  master data  attribute from  r/3 to bw give steps details

    how to  extract  master data  attribute from  r/3 to bw give steps details screenshots

    Hi
    Go through the below process to extract Master Data Attribute from R/3
    Hi,
    Maintaining Generic DataSources
    Use
    Regardless of the application, you can create and maintain generic DataSources for transaction data, master data attributes or texts from any transparent table, database view or SAP Query InfoSet, or using a function module. This allows you to extract data generically.
    Procedure
    Creating Generic DataSources
    1. Select the DataSource type and specify a technical name.
    2. Choose Create.
    The screen for creating a generic DataSource appears.
    3. Choose the application component to which you want to assign the DataSource.
    4. Enter the descriptive texts. You can choose any text.
    5. Select the datasets from which you want to fill the generic DataSource.
    a. Choose Extraction from View if you want to extract data from a transparent table or a database view. Enter the name of the table or the database view.
    After you generate the DataSource, you have a DataSource with an extraction structure that corresponds to the database view or transparent table.
    For more information about creating and maintaining database views and tables, see the ABAP Dictionary Documentation.
    b. Choose Extraction from Query if you want to use a SAP Query InfoSet as the data source. Select the required InfoSet from the InfoSet catalog.
    Notes on Extraction Using SAP Query
    After you generate the DataSource, you have a DataSource with an extraction structure that corresponds to the InfoSet.
    For more information about maintaining the InfoSet, see the System Administration documentation.
    c. Choose Extraction Using FM if you want to extract data using a function module. Enter the function module and extraction structure.
    The data must be transferred by the function module in an interface table E_T_DATA.
    Interface Description and Extraction Process
    For information about the function library, see the ABAP Workbench: Tools documentation.
    d. With texts you also have the option of extracting from fixed values for domains.
    6. Maintain the settings for delta transfer, as required.
    7. Choose Save.
    When performing extraction, note SAP Query: Assigning to a User Group.
    Note when extracting from a transparent table or view:
    If the extraction structure contains a key figure field that references a unit of measure or a currency unit field, this unit field has to be included in the same extraction structure as the key figure field.
    A screen appears on which you can edit the fields of the extraction structure.
    8. Edit the DataSource:
    &#9675; Selection
    When you schedule a data request in the BI scheduler, you can enter the selection criteria for the data transfer. For example, you can determine that data requests are only to apply to data from the previous month.
    If you set the Selection indicator for a field within the extraction structure, the data for this field is transferred in correspondence with the selection criteria in the scheduler.
    &#9675; Hide field
    You set this indicator to exclude an extraction structure field from the data transfer. The field is no longer available in BI when you set the transfer rules or generate the transfer structure.
    &#9675; Inversion
    Reverse postings are possible for customer-defined key figures. Therefore inversion is only active for certain transaction data DataSources. These include DataSources that have a field that is marked as an inversion field, for example, the update mode field in DataSource 0FI_AP_3. If this field has a value, the data records are interpreted as reverse records in BI.
    If you want to carry out a reverse posting for a customer-defined field (key figure), set the Inversion indicator. The value of the key figure is transferred to BI in inverted form (multiplied by –1).
    &#9675; Field only known in exit
    You can enhance data by extending the extraction structure for a DataSource by adding fields in append structures.
    The Field Only Known in Exit indicator is set for the fields of an append structure; by default these fields are not passed to the extractor from the field list and selection table.
    Deselect the Field Only Known in Exit indicator to enable the Service API to pass on the append structure field to the extractor together with the fields of the delivered extract structures in the field list and in the selection table.
    9. Choose DataSource ® Generate.
    The DataSource is saved in the source system.
    Maintaining Generic DataSources
    &#9679; Change DataSource
    To change a generic DataSource, in the initial screen of DataSource maintenance, enter the name of the DataSource and choose Change.
    You can change the assignment of a DataSource to an application component or change the texts of a DataSource. Double-click on the name of the table, view, InfoSet or extraction structure to get to the appropriate maintenance screen. Here you make the changes to add new fields. You can also completely swap transparent tables and database views, though this is not possible with InfoSets. Return to DataSource maintenance and choose Create. The screen for editing a DataSource appears. To save the DataSource in the SAP source system, choose DataSource ® Generate.
    If you want to test extraction in the source system independently of a BI system, choose DataSource ® Test Extraction.
    &#9679; Delta DataSource
    On the Change Generic DataSource screen, you can delete any DataSources that are no longer relevant. If you are extracting data from an InfoSet, delete the corresponding query. If you want to delete a DataSource, make sure it is not connected to a BI system.
    NR

  • How to retrieve modeinfo[n].context_id_uuid from inside an ABAP program ?

    If you login to an SAP session and then create another session via the system menu option (not a second login), transaction SM04 will show two different values for the parameter:
    modeinfo[n].context_id_uuid
    I need to know how to retrieve the value of this parameter from inside an ABAP program.
    This question is related to the one Rich and Naren and I were discussing - about how to create a unique shared buffer memory id that will distinugish between a two sesssions of a single user who happens to be "MIGO'ng" twice.
    Thanks for whatever answer anyone can provide ...
    djh
    Note: also posted in ABAP General ...

    Rich answered in ABAP general:
    REPORT ZRICH_0001 .
    type-pools: thfb.
    data: context_id type THFB_CONTEXT_ID.
    CALL FUNCTION 'TH_GET_CONTEXT_ID'
    IMPORTING
       CONTEXT_ID       = context_id .
    write:/ context_id .

  • How to Replace Null Value as 0 in an OBIEE11g Pivot Table? it's working 10g

    Hi,
    How to Replace Null Value as 0 in an OBIEE11g Pivot Table? it's working in obiee10g version.
    We have tried below methods
    1) criteria tab and edit the ‘column properties’ associated with your fact measure. Choose the ‘Data Format’ tab, tick to override the default format and choose ‘Custom’.
    It seems that the syntax for this custom format is positive-value-mask (semi colon) negative-value-mask (semi colon) null-mask. So this means we have a few options.
    E.g. if you want zeros (0) instead of null then enter:
    #,##0;-#,##0;0
    2) in that formula columns we have put it below case condition also ,
    Measure Column: Nom_amt --> edit formulas
    CASE WHEN Nom_amt IS NULL THEN 0 ELSE Nom_amt END
    3) we have uncheked IS NULL check box in the admin tool also
    I tried above formats still it's not working for me..kindly help me on this..
    thanks to do the needfull
    Best Regards,
    R.Devarasu

    Hi,
    Null value in database displaying as 0 in report, I need to keep value as in database, and I have one calculated row which is based on null values should also null in report.
    but it showing 0 for null values also so, my calculated row showing wrong result.
    my report is like
    col1 col2
    ABC 0
    BCD 12
    DEF -12 --this is calculated row.
    I require result like:
    col1 col2
    ABC null
    BCD 12
    DEF null --this is calculated row.
    Please let me know how I can achieve this.
    Thanks,
    Rahul

  • How to Replace Null Value as 0 in an OBIEE11g Pivot Table?

    Hi,
    How to Replace Null Value as 0 in an OBIEE11g Pivot Table? it's working in obiee10g version.
    We have tried below methods
    1) criteria tab and edit the ‘column properties’ associated with your fact measure. Choose the ‘Data Format’ tab, tick to override the default format and choose ‘Custom’.
    It seems that the syntax for this custom format is positive-value-mask (semi colon) negative-value-mask (semi colon) null-mask. So this means we have a few options.
    E.g. if you want zeros (0) instead of null then enter:
    #,##0;-#,##0;0
    2) in that formula columns we have put it below case condition also ,
    Measure Column: Nom_amt --> edit formulas
    CASE WHEN Nom_amt IS NULL THEN 0 ELSE Nom_amt END
    3) we have uncheked IS NULL check box in the admin tool also
    I tried above formats still it's not working for me..kindly help me on this..
    thanks in advance...
    Best Regards,
    R.Devarasu

    Hi Amith,
    I have update your suggested one,but it's working few of the rows only..remainings rows some of cells still NULL only
    Measure colmns is : Nom_SGD
    IFNULL(Nom_SGD,0.00)
    Movment : dynamic date calc by using $2-$1 oracle formula's
    Actually i am doing below things only,
    31/12/2011 31/03/2011 Movment
    Country
    India 100 -50 -150
    Singapore 200 200
    UK 1200 -1200
    USA 0.00 0.00 0.00 (here changed null as 0)
    Helpmeon this...

  • How to make visible value attributes of a Search Node

    Hi All,
    We have a requirement to enhance the search context node SEARCH ( Dynamic Query Object SVYQ ) of component SVY_S.
    But the enhancement category of Attribute Structure CRMST_QUERY_SVYIL is 'Can't be enhanced'.
    So we are adding value attributes to this context node. How to make this value attributes available in view configuration tab?
    Please suggest a better approach if there is any.
    Thanks in adv.

    Hi  Suchindra,
       You assign these  enhanced  attributes to design layer. so you can see these fields in Config tab.
    How to do:
    IMG->Customer Relationship Management -> UI Framework -> UI Framework definition -> Maintain
    design layer
    Here include the enhanced attributes and then go to component work bench and in context attributes right click assign the desing layer, selct your attribute and  in the bottom click on SAVE button.
    Then check it in configuration tab your attributes will available in show available fields.
    I hope this will solve your problem
    Regards,
    Sagar

  • How to assign NULL value to an ITEM in Forms Personalization?

    Hi,
    how to assign NULL value to an ITEM in Forms Personalization?
    please suggest me.
    Thanks

    I don't know what your form personalization does and maybe I misunderstand you ...
    Try
    :item_name := null;

  • How can we transfer product attributes from an already existing site?  We have thousands of items and it would be tedious to do them one at a time.  Is this possible through a CSV?

    How can we transfer product attributes from an already existing site?  We have thousands of items and it would be tedious to do them one at a time.  Is this possible through a CSV?

    There are two parts to this:
    1) It may be that you should have an Apple Education Support person helping you with this. If you have enough computers for this to be a problem, you may benefit from a Server, a site license, and an occasional visit from an Education Support Specialist.
    2) The brief answer, if you want Individual Apple_IDs to control each computer, is to buy new copies of Mac OS X under those new Apple_IDs and re-download and re-Install. Mac OS X is customized to the Apple_ID before it is downloaded.

Maybe you are looking for