swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
function  

ldap.reader

 
 

Library: Interfaces, LDAP support (OMLDAP)
Import: omldap.xmd
Return type: String
Returns: 

A stream.


Declaration

  define external stream function ldap.reader
      of       value ldap.attribute attribute
      item     value integer        index      optional
      null     value stream         null       optional
      using    value integer        datatype   optional

Argument definitions

attribute
An ldap.attribute containing the current entry.
item
The position number of the requested item. The default is 1.
null
A string to represent a NULL value for the return value. (This could be set to "NO VALUE", for example.) The default is "".
datatype
The type of the requested attribute value. The default is ldap.text-type; the other option is ldap.binary-type.


Purpose

This function returns the value of a specified attribute. If an index is not specified, it returns the first value, otherwise it returns the specified one.

The following example outputs the telephone number for each entry satisfying the search. Each entry is assumed to have a single telephone number.

  import "omldap.xmd" prefixed by ldap.

  process
     local ldap.connection my-ldap
     local ldap.attribute  my-entry variable

     set my-ldap to ldap.open 'www.stilo.com'
     ldap.search my-ldap
        base  "o=stilo.com"
        where  "(Department=rd)"
        into   my-entry
        select "phonenumber"

     repeat
        exit unless ldap.entry-exists my-entry
        output ldap.entry-name of my-entry || ": "
            || ldap.reader of my-entry{"phonenumber"}
            || "%n"
        ldap.advance-entry my-entry
     again

ldap.retrieve-values can be used when an attribute contains an unknown number of values.

        Other Library Functions
   ldap.add-entry
   ldap.advance-entry
   ldap.attribute
   ldap.close
   ldap.connection
   ldap.create-attribute
   ldap.delete-entry
   ldap.entry-exists
   ldap.entry-name
   ldap.modify-entry
   ldap.name
   ldap.omldap-version
   ldap.open
   ldap.reader
   ldap.rename-entry
   ldap.retrieve-values
   ldap.search
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:26 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.