Klipfolio Dashboard API

Object Engines.LDAP

Object
   |
   +--Klip
         |
         +--Engines
               |
               +--Engines.LDAP

Advanced Feature This object is an advanced feature that is only available in the licensed, commercial version of Klipfolio Dashboard. Contact Klipfolio for further details.

The Engines.LDAP object provides you with a method to search for and retrieve information from your LDAP directory server. It is especially useful for those developers who are interested in writing a Klip that displays content from Active Directory.

Note that Klipfolio Dashboard makes use of RFC 2254 to define LDAP queries against Active Directory. This RFC fully defines the syntax required to create successful queries but not the schema and attributes to be queried.

As with Klips that display data from other types of data sources, a Klip using this object will display the data according to the stylesheet definitions in its <style> block. For information about how to write a Klip, see our how-to article, Klip Development Fundamentals.

Example:
The following example Klip demonstrates how to write a Klip that retrieves and lists the employee names, their titles and their phone numbers from Active Directory. Note that there is no code for authentication, as Klipfolio Dashboard automatically authenticates using the credentials of the user who is currently logged into Windows.

<?xml version="1.0" encoding="UTF-8" ?>
<klip>
   	<identity>
      		<title>
         		API - Engines.LDAP 
      		</title>
      		<description>
      			Search your employee database via LDAP.  
      		</description>
   	</identity>
   	<locations>
      		<icon>
         		http://www.klipfolio.com/static/klips/klipfolio/sample_icon.png
      		</icon>
      		<banner>
         		http://www.klipfolio.com/static/klips/klipfolio/sample_banner.png
      		</banner>
   	</locations>
   	<setup>
   		<sort>
   			EmployeeName
   		</sort>
   	</setup>

	<style>
		row 
		{
			type: item; 
			definition: all;
		}
		cn 
		{
			itemcol: 1; 
			noterow: 1; 
			emphasis: strong; 
			notelabel: false; 
			label: "Name";
			name: "EmployeeName";
			wrap: false;
		} 
		title 
		{
			noterow: 2; 
			notelabel: false;
		} 
		telephoneNumber 
		{
			itemcol: 3; 
			noterow: 3; 
			label: "Phone";
			wrap: false;
		} 
	</style>
	<klipscript>
		<![CDATA[

function onLoad () {
	query = "(&(objectClass=organizationalPerson)(|(|(|(givenName=*)(SN=*))(mail=*))(telephoneNumber=*)))";

	// Send the LDAP query
	var ar = Engines.LDAP.search (
		query,
		"distinguishedName,cn,title,mail,telephoneNumber,ipPhone,wWWHomePage"
	);

	// Process the response from the LDAP query
	Items.clear (true);
	Engines.Data.process (ar);
}

function onRefresh () {
	return true;

}
		]]>
	</klipscript>
</klip>
     	

   

Since:
5.4

See also:

How-to article, Displaying data from the LDAP directory server

LDAP Query Basics

RFC 2254 — The String Representation of LDAP Search Filters for attribute types and object classes for LDAP.

Directory, Identity and Access Services for additional information from Microsoft about Active Directory vs. the X.500 series/LDAP.

For common practices and a superset of what Active Directory supports:
RFC 2256 — A Summary of the X.500(96) User Schema for use with LDAPv3
RFC 2252 — Lightweight Directory Access Protocol (v3): Attribute Syntax Definitions



 
Function Summary
 function search( <String> query[, <String> attributes[, <String> server ]] )
           Runs a query against the default Active Directory provider based on your domain controller.

Function Detail

search

function search( <String> query[, <String> attributes[, <String> server ]] )

Klipfolio Dashboard API

© 2011 Klipfolio Inc. All Rights Reserved.