Sei sulla pagina 1di 168

TemaImpExpPdf.

book Page 1 Wednesday, April 14, 2010 10:09 AM

Enterprise Buildings Integrator


Import and Export Guide

Release 410
TemaImpExpPdf.book Page 2 Wednesday, April 14, 2010 10:09 AM

Release Issue Date


R410 1 April 2010

Notice
This document contains Honeywell proprietary information. Information
contained herein is to be used solely for the purpose submitted, and no part of this
document or its contents shall be reproduced, published, or disclosed to a third
party without the express permission of Honeywell Europe.
While this information is presented in good faith and believed to be accurate,
Honeywell disclaims the implied warranties of merchantability and fitness for a
purpose and makes no express warranties except as may be stated in its written
agreement with and for its customer.
In no event is Honeywell liable to anyone for any direct, special, or consequential
damages. The information and specifications in this document are subject to
change without notice.
Copyright 2010 – Honeywell International Inc.

Honeywell trademarks
Honeywell Enterprise Buildings Integrator™ is a trademark of Honeywell
International Inc, and SafeBrowse® is a U.S. registered trademark of Honeywell
International Inc.

Other trademarks
Microsoft, Windows, Windows NT and XP, SQL Server, Office,Word, Excel and
PowerPoint are either registered trademarks or trademarks of Microsoft
Corporation in the United States and/or other countries.
LonWorks is a registered trademark of Echelon Corporation in the Unites States
and/or other coutntries.
SAP R/3 and HR-PDC are registered trademarks of SAP AG in Germany.
Trademarks that appear in this document are used only to the benefit of the
trademark owner, with no intention of trademark infringement.

Support and other contacts


For technical assistance, call your nearest Honeywell office.

2 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 3 Wednesday, April 14, 2010 10:09 AM

Training classes
Honeywell holds technical training classes on Enterprise Buildings Integrator.
These classes are taught by experts in the field of building control systems. For
more information about these classes, contact your Honeywell representative.

3
TemaImpExpPdf.book Page 4 Wednesday, April 14, 2010 10:09 AM

4 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 5 Wednesday, April 14, 2010 10:09 AM

Contents

1 Getting started 7
Related documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2 Importing data using Cardholder Data Import 9


About Cardholder Data Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Using Cardholder Data Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Accessing Cardholder Data Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Configuring the import settings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Preparing the source files before you import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Reusing import settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Using VB.Net scripts (Custom code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Importing data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Error messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

3 Importing data using Cardholder LDAP 37


About Cardholder LDAP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
What is LDAP? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Vendor platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Overview of the LDAP-based Cardholder Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Limits of the current solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Using the LDAP Configuration Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Accessing Cardholder LDAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Creating an LDAP specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Using code procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Importing data using Cardholder LDAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
LDAP import wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Configuring the Web login . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Trace activities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

4 Exporting data using Flexible Cardholder and Temaline Data Export 67


About Flexible Cardholder and Temaline Data Export. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Using Flexible Cardholder and Temaline Data Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
About export specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Creating an export specification for exporting data to an ASCII file . . . . . . . . . . . . . . . 73
Creating an export specification for exporting data to an ODBC data source . . . . . . . . 82
Creating an export specification for exporting data to an XML file . . . . . . . . . . . . . . . . 90
Using existing specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Export specifications and scripts provided by default. . . . . . . . . . . . . . . . . . . . . . . . . . . 96

5
TemaImpExpPdf.book Page 6 Wednesday, April 14, 2010 10:09 AM

CONTENTS

Creating and using custom code (Vb.Net scripts). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97


Exporting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Tracing and diagnostic features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

5 Scripting and code procedure reference 107


Scripting reference for Cardholder Data Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Reference information for the scripting language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Examples of scripts for import operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113
Scripting reference for Flexible Cardholder and Temaline Data Export. . . . . . . . . . . . . . . . . . .116
Accessing and managing source and destination fields . . . . . . . . . . . . . . . . . . . . . . . . .117
Functions for coercing the obj variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118
Managing strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119
Managing dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
IF statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
SELECT CASE statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Examples of scripts for export operations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Scripting reference information for Cardholder LDAP Import. . . . . . . . . . . . . . . . . . . . . . . . . 130
Reference information for the scripting language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Examples of scripts for LDAP import operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Return values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Declarations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Custom controls reference assembly. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
The TemaLDAPSynchroBaseObj object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Accessing the CMS database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Accessing the LDAP repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

6 Database reference 155


CARD objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
CH EMPLOYEE objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
CH EXTERNAL REGULAR objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
REASON objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
ENQUIRY DATA objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

6 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 7 Wednesday, April 14, 2010 10:09 AM

Getting started
1
This guide is designed for operators who will be using the following tools for
performing import and export operations on data.
• Cardholder Data Import for importing data.
• Cardholder LDAP for storing/retrieving data from LDAP-based directories. This
tool is an optional module.
• Flexible Cardholder and Temaline Data Export for exporting data.
These tools are provided with EBI Enterprise Building Integrator. This guide
describes various methods of importing and exporting data using these tools.

To learn about Go to
Importing data by using Cardholder Data Import page 9
Importing data by using the LDAP-based Cardholder's Manager module page 37
Exporting data by using Flexible Cardholder and Temaline Data Export page 67
Scripting and code reference page 107
Database Reference page 155

7
TemaImpExpPdf.book Page 8 Wednesday, April 14, 2010 10:09 AM

1 – GETTING STARTED

Related documentation
In addition to this guide, for further information on the Temaline Interface
subsystem, you may consult the following manuals:
• Temaline Access Control Configuration Guide - A guide for plant
configuration and maintenance, with practical examples and tutorials for
configuring and managing the features of Access Control, Time and
Attendance, and Security.
• EBI Installation Guide - Explains procedures for subsystem installation.

8 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 9 Wednesday, April 14, 2010 10:09 AM

Importing data using


Cardholder Data Import 2
This chapter provides information for operators who use the Cardholder Data
Import application that is supplied with EBI Enterprise Buildings Integrator.

To learn about Go to
About Cardholder Data Import page 10
Using Cardholder Data Import page 11
Error messages page 35

Note:
For further information on objects and data fields that can be used to import data, please
refer to section “Database reference” on page 155.

9
TemaImpExpPdf.book Page 10 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

About Cardholder Data Import


The Cardholder Data Import application enables you to set and run data
importations from external sources (configured as an ODBC data source) into the
CMS database tables by creating and managing import specifications.

What you can do using Cardholder Data Import


• You can define all the criteria for the import operation, specify how the fields
in the source data map to fields in the EBI CMS database, as well as filter
data.
• You can customize your import operations by using script files.
• You can specify certain import modes and other criteria to suit your needs.

You can import the following data


• data related to the CMS cardholders (employees, external regular, and
vehicles), with or without the relevant cards data
• data related to cards only
• data related to reasons
• data related to enquiries
• SAP-related objects
For information about the structure of the EBI CMS database, see “Database
reference” on page 155.
To learn how to use Cardholder Data Import, see “Using Cardholder Data Import”
on page 11.

10 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 11 Wednesday, April 14, 2010 10:09 AM

USING CARDHOLDER DATA IMPORT

Using Cardholder Data Import


This section covers the following topics:

Topic See
Accessing the application page 12
Configuring the import settings page 13
Reusing import settings page 28
Creating and using custom code (VB.Net scripts) page 29
Importing data page 32

See Also:
• “Database reference” on page 155

11
TemaImpExpPdf.book Page 12 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

Accessing Cardholder Data Import


To access the application:
1 From the Windows taskbar, click Start > Programs > Enterprise Buildings
Integrator > Cardholder Data Import.
2 In the TEMA Import Configurator Login window that will appear, enter the
Password to access the application (default scat) and click OK.
3 In the TEMA Import Configurator main screen that is displayed, use the
menu bar to select the desired function.

The table below summarizes the function of each menu. The right-hand
column provides a link to the relevant topic in the guide.

Menu It allows you to See


Specification Create a new import specification by selecting a page 13
destination object from the menu items, as well
as manage an existing specification.
Custom code Create or manage VB.Net scripts that allow page 29
customizing and increasing the flexibility of your
import operations.
Window Arrange the opened windows on your screen.
Help Access the Help system for the application.

Note:
The Execution menu will also be displayed after opening an import specification, which
allows running the import operation. See “Importing data” on page 32.

12 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 13 Wednesday, April 14, 2010 10:09 AM

USING CARDHOLDER DATA IMPORT

Configuring the import settings

Overview
The import configuration settings are stored in an import specification file, which
is a file with the extension .imp.
The import specification allows you to define all the criteria for the import
activity. In particular, you will define the associations between the destination
fields in the CMS tables and the fields in the source repository, as well as many
other options.
The specifications you create can be stored and re-used for running the import
operations.

Prerequisites
• You have available the customer-supplied repository with the data to be
imported with the necessary unique keys. The repository can be Access, SQL
Server, or Oracle database tables; Excel worksheets; or ASCII text files.
• The source repository must be ODBC-compliant, and, if the file to be
imported is in ASCII format or in Microsoft Excel format, please refer to
“Preparing the source files before you import” on page 25.
• You have activated the Cardholder Data Import server task by using the
Temaline Configuration tool.

To activate the Cardholder Data Import server task:


1 Click Start > Programs > Enterprise Buildings Integrator > Temaline
Interface > Temaline Configuration.
2 Type the password (default: scat) to access the tool and click Login.
3 Leave the Server option selected in the Group selection area.
4 Scroll to select the STARTERGoImport parameter, then click Edit.
5 In the Parameter Value box, enter 1 and click Update. Exit the application.
6 Restart the Temaline Service to put your changes into effect.

To create a new import specification:


1 In the first screen of the Cardholder Data Import application, click
Specification > New on the menu bar, and then select the object (that is, the
database table) you want from the list.
The Specification menu lists the available objects. For further information on
these, see “Database reference” on page 155.

13
TemaImpExpPdf.book Page 14 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

2 Depending on the object that you have selected, the import specification
window will be displayed. All the fields present in the selected table will be
listed in the left pane. The example below shows the window that is displayed
after selecting Specification > New > Employee.

Figure 1 Creation of an Import Specification for the Employee object

Note that all the fields present in the EMPLOYEE table are listed in the left
pane.
3 Enter the unique identifier of the import specification to be created into the
Acronym field, then type the description of the import activity into the
Description field.
4 Connect to the Source ODBC, that is, to the ODBC data source that must be
used to access the external source. There are two possible scenarios:

14 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 15 Wednesday, April 14, 2010 10:09 AM

USING CARDHOLDER DATA IMPORT

Scenario Steps
ODBC data source already exists 1. From the Source ODBC drop-down list, select the
desired ODBC data source.
2. If necessary, type in the access Login and
Password.
3. Click Connect to access the database.
The system produces an error message if you attempt
to access a protected database without entering the
Login and Password.
ODBC data source needs to be 1. Click the Configure ODBC button. The ODBC
configured Data Source Administrator window is displayed,
allowing you to configure the data sources. (For
further information about use and configuration of
the Windows ODBC Data Sources, consult the
Online Help for the application.)
2. Select the System DSN tab, then click Add to
access the Create New Data Source window.
3. Select the driver from the list, for which you want
to configure the data source, according to the
source file format.
4. Click End to access the configuration window,
which varies depending on the driver selected.
5. Indicate the name for the ODBC data source and
select the source file from which the records are to
be imported.
Note that if you are using a Microsoft Excel file, in
the ODBC configuration window, click Options
>>, then deselect the Read Only check box.
6. Specify any other option for your ODBC, as
required (such as, for example, a Login name and a
Password).
7. The newly configured data source is now
accessible from the Source ODBC list in the
import specification window. Select it, and then
enter the Login and the Password, if any.
8. Click Connect.

Attention:
If your source file is in ASCII format or in Microsoft Excel format, please refer to
“Preparing the source files before you import” on page 25.

15
TemaImpExpPdf.book Page 16 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

5 Select the source table (or file) you want from the drop-down list that is
located in the right-hand pane. The source fields present in the file are
displayed in the area below.
6 Create the associations between the source fields you want to import and the
destination fields: Select a source field and a destination field, then click Add
Field. The two fields are displayed at the center of the window, indicating
their association, as illustrated in the following figure:

The source field will be imported into the destination table, within the field to
which it is associated.
7 You may use the Add const. button to force a default value in a particular
destination field:
a. Select the desired destination field in the left-hand pane, then click Add
Const. In the central area of the window, the value <CONSTANT> will be
inserted as the source field.
b. The Is constant check box in the Association Details area will be selected
automatically allowing you to enter the desired value in the text box next
to it, which will become editable. The value you enter will be inserted in
the destination field when performing the import operation.
8 Continue until you have associated the desired fields. (Please, refer to chapter
“Database reference” on page 155, for the mandatory fields.) To remove a field,
select it, then click Remove.

16 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 17 Wednesday, April 14, 2010 10:09 AM

USING CARDHOLDER DATA IMPORT

9 Set the other Association Details for each association. These will be used
when importing the record. The following table describes each option:

Option Description
Current field It shows the destination field currently selected.
Set value only if null If this option is selected, the selected destination field will
be overwritten only if it is empty.
Is constant Read-only check box. It will be automatically checked (and
the text box next to it will become editable) after you press
the Add Const. button (see step 7 above). Used only for
association of a CMS field with a constant.
Use integrity constraint If this option is selected, the checks for referential integrity
during the import procedure are enabled. It only applies to
drop-down lists fields. (For further information, see the
“Using the Integrity constraint option” on page 22.)
Field content This text box becomes editable after you check the Use
integrity constraint option.
Field custom code It allows associating to the selected field a script file for
automatic execution of specific procedures, along with the
importation of the source field. There are two possible
scenarios:
If the script already exists:
1. Click Field custom code. The Select File window is
displayed.
2. Select the desired script, then click Open. The complete
name is displayed text box next to the button.
3. Click Enable to enable the execution. (If you do not
select this box, even though the script is still associated
with the field, it will not be executed).
If the script must be created:
1. To create a script, choose Custom code > New > Field
custom code from the menu bar.
2. The script editor window appears, into which you must
insert the code. Follow the procedures described in
section “Using VB.Net scripts (Custom code)” on
page 29.
Enabled If this option is selected the custom code that you have
associated to the field will be actually executed during the
import operation. Otherwise, it is only associated to the
field.

10 Set the Import modality you want, keeping in mind that:

17
TemaImpExpPdf.book Page 18 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

Option Description
Update target mode: This option allows you to specify the modes for updating the
destination table. The drop-down list contains the options as
described below:
• Insert or update The source record data are used to update an existing record
(having the same key) in the CMS database. If no record exists
with the key requested, one will be created in the destination
database. This is the default.
• Insert or update and The source record data are used to update an existing record
delete missing (having the same key) in the CMS database. If no record exists
with the requested key, one will be created in the destination
database. The records that are present in the destination
database, but which are no longer present in the source table,
get eliminated from the destination database.
• Delete The destination record having the key specified in the source
file will be eliminated from the CMS database.
• Delete missing The CMS database records are compared with the source table
records. The records that are present in the database, but which
are no longer present in the source table, get eliminated from
the destination database.
External source This field indicates the data source to which the Delete
missing mode will be applied.
Update source mode: Enables you to specify the modes for updating the source
table. The drop-down list contains the options described
below.
• No action Leaves the source table unchanged. This is the default.

• Delete record After a record is imported, it is eliminated from the source


table.
Note: This mode does not apply to all ODBC data sources. For
example, the ASCII ODBC data source is read-only so this
feature is not supported.
• Delete table After all records have been correctly imported from the source
table, the table is eliminated.
Note: This mode does not apply to all ODBC data sources. For
example, the ASCII ODBC data source is read-only so this
feature is not supported.

18 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 19 Wednesday, April 14, 2010 10:09 AM

USING CARDHOLDER DATA IMPORT

Option Description
• Rename table After all records have been correctly imported from the source
table, the table gets renamed. If this option is selected, the New
table name field will be enabled.
Note: This mode does not apply to all ODBC data sources. For
example, the ASCII ODBC data source is read-only so this
feature is not supported.
New table name Allows you to specify a new name for the source table if the
update option Rename table has been selected.
Note: This mode does not apply to all ODBC data sources. For
example, the ASCII ODBC data source is read-only so this
feature is not supported.

11 Click the Advanced button if you want to define more criteria, such as setting
a filter, specifying an application to run, or associating a script to the whole
import specification. The picture below shows the fields that are displayed
when you press this button:

The following table describes each option:

19
TemaImpExpPdf.book Page 20 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

Option Description
Source filter condition Enables you to associate a filter with a specification, so that
the source records alone that satisfy certain criteria are
imported. You can type the filter in this box. Keep in mind
that this text box acts as a WHERE clause, and the search
condition must be inserted using SQL ODBC syntax.
For example:
• If you need to include a Unicode string with a filter, you
must put an ‘N’ before the Unicode string, as follows:
.
• If you only want to export the data for two zones in the
plant (for example, ZONE1 and ZONE2), you must set
the filter as follows:
(ZONES=ZONE1) or (ZONES=ZONES2)
• In particular, since access to the source data occurs using
ODBC, if a date is being used in the condition, you must
use the ODBC date format, that is to say:
{ts 'yyyy-mm-dd hh:mm:ss'}—for time and date
{ts 'yyyy-mm-dd'}—for date alone
{ts 'hh:mm:ss'}—for time alone
Record custom code Allows you to associate a VB.Net script file to the import
specification for automatic execution of specific
procedures, along with the import activity. There are two
possible scenarios:
The script already exists:
1. Click Record custom code. The Select File window is
displayed.
2. Select the desired script, then click Open. The complete
name is displayed text box next to the button.
3. Click Enable to enable the execution. (If you do not
select this box, even though the script is still associated
with the specification, it will not be executed).
The script must be created:
1. To create a script, choose Custom code > New >
Record custom code from the menu bar.
2. The script editor window appears, into which you must
insert the code. Follow the procedures described in
section “Using VB.Net scripts (Custom code)” on
page 29

20 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 21 Wednesday, April 14, 2010 10:09 AM

USING CARDHOLDER DATA IMPORT

Option Description
Pre-process application Allows you to specify the execution of a specific
application before the import procedure. By pressing the
button you will be able to specify the path of the executable
file (.bat, .exe, or other) to be started. Consider the
following:
• Select Synchro if you want the import tool to wait for
the completion of the executable. (Do not set any
Timeout, in this case). If this option is not selected, both
the import procedure and the application will be
launched.
• Set a Timeout in seconds, if you want to specify a time
limit for the import tool to wait (for example, setting the
Timeout to 10 means that the import procedure will start
within 10 seconds, even though the preprocess has not
yet been completed).
• Select Enabled if you want the application to launch
before the import procedure.
Note: You must use the complete path, starting with the
directory (e.g., C:\honeywell\...) to execute the application.
Post-process application Allows you to specify the execution of a specific
application at the completion of the import procedure. By
pressing the button you will be able to specify the path of
the executable file (.bat, .exe, or other) to be started.
Consider the following:
• Select Synchro if you want the import tool to wait for
the completion of the executable before starting a new
import procedure, if any. (Do not set any Timeout, in
this case). If this option is not selected, both the post-
process and the new import procedure, if any, will be
launched.
• Set a Timeout in seconds, if you want to specify a time
limit for the post-process to complete (for example,
setting the Timeout to 10 means that the post-process
will be terminated within 10 seconds, even though it is
not completed yet).
• Select Enabled if you want the application to launch at
the completion of the import procedure.

12 When you are finished setting the import specification, you may:
• Save the specification for a later use: From the Cardholder Data Import
menu bar, choose Specification > Save or press F2 as a shortcut.
• Run the import: From the Cardholder Data Import menu bar, either choose
Execution > Start step-by-step (F10 as a shortcut) or Execution >

21
TemaImpExpPdf.book Page 22 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

Launch (F5 as a shortcut), depending on the import mode you want to


use. For further information, please refer to section “Importing data” on
page 32).
• Close the specification and exit the application: Choose Specification >
Close to close it or Specification > Exit to exit application (Ctrl+Q as a
shortcut).

Using the Integrity constraint option


This section describes how to use integrity constraint to perform the import of list
type fields. To identify this type of fields, please refer to “Database reference” on
page 155 (Data type: list)
It is possible to import list fields in three different ways:

Direct import of the specific list item


The imported data contain a specific list item already available in the list field.
For example:
• the User field UF50 is a list that includes the employees' bands to be used into
the plant.
• UF50 description: Employee band

Item Value
1 Band 1
2 Band 2
3 Band 3
4 Band 4
5 Band 5

• The imported data provide a specific field EmployeeBand that contains a


specific value.
Association: UF50 - EmployeeBand
Result: If the EmployeeBand = "3" the "Band 3" will be assigned to the Employee

Import of a specific list item using its external key


The imported data contain the external key of a specific list item (the item can or
cannot be already available in the list field). If the external key is not found in the
list, a new item with that external key is created and its value is set to the external
key value.
For example:

22 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 23 Wednesday, April 14, 2010 10:09 AM

USING CARDHOLDER DATA IMPORT

• the User field UF50 is a list that includes the employees' bands to be used into
the plant.
• UF50 description: Employee band

Item External Key Value


1 EK1 Band 1
2 EK2 Band 2
3 EK3 Band 3
4 EK4 Band 4

• The imported data provide a specific field EmployeeBandKey that contains a


specific key for the item.
Association: UF50 - EmployeeBandKey
The Use integrity constraint option has to be set for the association.
Result: If the EmployeeBandKey = "EK5" a new item will be created into the list
with the following characteristics:

Item External Key Value


5 EK5 Band 5

• For the Employee the field will be set to UF50 will be set to EK5
• If the value of the key it is not the real value of the field, a manual operation is
required to set the appropriate value to the item.

Import of a specific list item using its external key and value
The data imported contain the external key of a specific list item (the item can or
cannot be already available in the list field) and also a field with a specific value
for the item; the field with the value is specified in the Content field of the
association. If the external key is not found in the list a new item with that
imported external key is created and its value is set to the value found in the
Content field list.
For example:
• the User field UF50 is a list that includes the employees' bands to be used into
the plant.
• UF50 description: Employee band

Item External Key Value


1 EK1 Band 1

23
TemaImpExpPdf.book Page 24 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

Item External Key Value


2 EK2 Band 2
3 EK3 Band 3
4 EK4 Band 4

• The imported data provide a specific field EmployeeBandKey that specifies


key for the item and a field called EmployeeBandValue that specifies the value
for the band.
Association: UF50 - EmployeeBandKey
The Use integrity constraint option has to be set for the association.
From the Content field list the EmployeeBandValue field must be selected.
Result: If the EmployeeBandKey = "EK5" and the EmployeeBandValue = "Band 5"
a new item will be created into the list with the following characteristics:

Item External Key Value


5 EK5 Band 5

• For the Employee the field will be set to UF50 will be set to Band 5

See Also:
• “Preparing the source files before you import” on page 25
• “Reusing import settings” on page 28
• “Using VB.Net scripts (Custom code)” on page 29
• “Importing data” on page 32

24 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 25 Wednesday, April 14, 2010 10:09 AM

USING CARDHOLDER DATA IMPORT

Preparing the source files before you import

Attention:
This section only applies if you are using an ASCII file (.txt, .csv, and so on) or a
Microsoft Excel (.xls) file as a source file. See:
• “Preparing an ASCII source file” on page 25
• “Preparing a Microsoft Excel source file” on page 26

Preparing an ASCII source file


This section describes how to define the data format when the data source is an
ASCII file (.txt, .csv, and so on).
Assume that you need to configure the ODBC called PERSONAL_DATA that uses the
data source file in text format called data.txt.

To define the data format for an ASCII file:


1 From the Windows menu bar, click Start > Settings > Control Panel, then
double click Administrative Tools.
2 Double-click Data Sources (ODBC) then select the System DSN tab.
3 On the System DSN tab, press Add. The Create New Data Source window
is displayed.
4 From the Name list, select Microsoft Text Driver, then specify the data
source name (PERSONAL_DATA) in the Data Source Name box in the ODBC
Text Setup window.
5 In the Database area, click Select Directory (if this option is not activated,
deselect Use Current Directory), and then select the directory in which the
text data file with the source data is located.
6 To expand the window, click Options>>, then, in the Files area, click Define
Format. The window Define Text Format is displayed.
7 In the Tables area, select the text file (in our example, data.txt). If the top
line of your text file – as in this example – consists of a sequence of field
names, you must select the check box Column Name Header in the Tables
area.
8 From the Format drop-down list, select how data will be delimited. In this
case, select Custom Delimited, then type a comma in the Delimiter box.
9 In the Columns area click Guess. The data fields format is set automatically.
Note: The Data Type for all fields must be set on Char.

25
TemaImpExpPdf.book Page 26 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

10 Click OK to return to the ODBC Text Setup window; click OK again. This
returns you to the System DSN tab, where the new source, PERSONAL_
DATA, is displayed in the list of data sources. Click OK.

Preparing a Microsoft Excel source file


If you are importing data from a Microsoft Excel file (.xls), you must prepare the
file according to specific criteria.

To prepare an .xls file:


1 Rename each of the worksheets to be used for the importation. Worksheet
names MUST include a letter and a number (for example, B5). Keep in mind
that each of the worksheets that make up the Microsoft Excel workbook (one
or more worksheets) constitutes a table.

Tip:
To rename a worksheet in Microsoft Excel, double-click the sheet tab (this is the tab near
the bottom of the workbook that displays the name of a sheet), and then type a new name
over the current name.

2 On line 1 of each of the renamed worksheets, give a title to each of the


columns to be used for importing the records, for example Card_Number,
Terminal and so forth.
Note: Column headings must not contain any spaces. Use an underscore to
indicate spaces in headings of two or more words, for example CARD_NUMBER,
not CARD NUMBER.

The columns thus named make up the source data fields to be used to create
the association with the destination fields.
3 Once you have configured the ODBC data source (see “To create a new
import specification:” on page 13”, step 4), in the import specification
window you will be able to select the Microsoft Excel worksheet as the table
to use for the importation. The names of the columns in the worksheet will
appear as the source fields:

26 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 27 Wednesday, April 14, 2010 10:09 AM

USING CARDHOLDER DATA IMPORT

27
TemaImpExpPdf.book Page 28 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

Reusing import settings


You may access an existing specification (either a default specification provided
with the application, or a specification that you have previously created) in order
to modify the settings, save it with a new name, or run the import operation.

To use an existing specification:


1 Access Cardholder Data Import. (See “Accessing Cardholder Data Import” on
page 12).
2 From the menu bar, choose Specification > Open (Ctrl+O as a shortcut),
then open the desired specification (*.imp file). The import specification will
be displayed.
3 Edit the fields as required.

Note:
For further information on the available options, please refer to section
“Configuring the import settings” on page 13.

4 When you are finished editing the specification, you may:


• Save the specification: From the Cardholder Data Import menu bar, either
choose Specification > Save (F2 as a shortcut), or Specification > Save
As (Ctrl+F2 as a shortcut) to save it with a new name.
• Run the import operation: From the Cardholder Data Import menu bar,
either choose Execution > Start step-by-step (F10 as a shortcut) or
Execution > Launch (F5 as a shortcut), depending on the import mode
you want to use. For further information, please refer to section
“Importing data” on page 32.
• Close the specification and exit the application: Choose Specification >
Close to close it or Specification > Exit the exit application (Ctrl+Q as a
shortcut).

See Also:
• “Using VB.Net scripts (Custom code)” on page 29
• “Importing data” on page 32

28 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 29 Wednesday, April 14, 2010 10:09 AM

USING CARDHOLDER DATA IMPORT

Using VB.Net scripts (Custom code)


Cardholder Data Import allows you to associate custom code (VB.Net scripts
files) both to the import specification and to individual fields. VB.Net scripts are
files with a .vb extension that allow writing sequences of instructions, by which
you can execute specific operations automatically. After they are created, scripts
can be associated with import specifications and be performed simultaneously
with the importation of the records.
The function of creating scripts allows you to extend the possibilities involved in
managing source and destination fields during the importation of data, which is
useful for increasing the flexibility of your operations.
In particular, the application has a script editor in it, which is to be used for
creating, managing, and debugging scripts.

In this section:

Topic See
Creating a script page 29
Modifying an existing script page 31

Tip:
The section “Scripting and code procedure reference” on page 107 provides detailed
information on methods and properties to be used inside the VB.Net scripts, as well as
several examples of the most commonly used scripts.

See Also:
• “Database reference” on page 155 for information on the database fields that can be
used for the import operation.

To create a new script:


1 From the Cardholder Data Import menu bar, choose Custom Code > New and
then select either Field Custom Code or Record Custom Code, accordingly
to the script you want to create. (Field Custom Code applies to an individual
field, while Record Custom Code refers to the whole import specification).
2 The script editor will be displayed. The example below refers to the Field
Custom Code:

29
TemaImpExpPdf.book Page 30 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

Figure 2 VB.Net Script Editor

3 Locate the text Add here any extra Code. If necessary, use the vertical scroll
bar to locate the string.
4 Type in the code, then click Compile to debug the code you have entered.
5 Because it is the first time that the script is being saved, when you click
Compile, the Save Script File window appears. Give the script a name, then
click Save.
6 There are two possible scenarios:
• If there are no errors in the code you have typed in, the message Compile
terminated without errors appears at the bottom of the window. Click
Close to exit the script editor.
• If there were errors in the code, these are displayed at the bottom of the
window. Correct them, then run the compile again.

30 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 31 Wednesday, April 14, 2010 10:09 AM

USING CARDHOLDER DATA IMPORT

Note:
In order to associate the script to an individual field or to an import specification to have it
performed simultaneously with the import operation, select it by using the Field Custom
Code or the Record Custom Code buttons in the specification window. (See
“Configuring the import settings” on page 13).

To modify an existing script


You can modify existing scripts or the default scripts to use them as a basis for
creating new scripts.
1 From the Cardholder Data Import menu bar, choose Custom Code > Open,
and then locate the desired script file.
2 Make the desired changes in the editor window that appears.
3 Click Compile to debug the code you have entered. There are two possible
scenarios:
• If there are no errors in the code, the message Compile terminated
without errors appears at the bottom of the window, and the script is
automatically saved with the same name.
• If there are errors in the code, these are displayed at the bottom of the
window. Make any necessary corrections, then press Compile Script
again.
4 Click Close to exit the script editor.

See Also:
• “Scripting reference for Cardholder Data Import” on page 108

31
TemaImpExpPdf.book Page 32 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

Importing data
Once the parameters and criteria have been set for the importation (see
“Configuring the import settings” on page 13), you may execute the import of the
source records into the CMS tables.
Any script that is associated with the specification is run simultaneously with the
import activity.
There are two possible import modes:
• “Importing data manually” on page 32
• “Importing data in batch mode” on page 33

Importing data manually


When you are finished setting the import specification, you can start directly the
importation of the source data by using the Execution menu of Cardholder Data
Import.
There are two methods available:
• Start Step by Step—Performs the importation one record at a time, which is
useful for verifying the accuracy of the specification created.
• Launch—Begins the importation of all records.

To import data using the Start Step by Step method:


1 In the import specification window, choose Execution > Start Step by Step
from the menu bar.
2 In the summary window that will be displayed, click Next Step at the bottom
(or select Execution > Next Step from the menu bar) to continue the
importation.
3 If necessary, click Stop to interrupt execution.
4 When you are finished, the results of the import activity will be displayed in
the window. Click Close to return to the specification window.

Tip:
After having successfully verified a limited number of records, you can use the Execution
> Launch menu command to run the importation of all records or you may run the batch
import mode, as described in the following.

To import data using the Launch method:


1 In the import specification window, choose Execution > Launch from the
menu bar. The summary window will appear. If necessary, click Stop to
interrupt execution.

32 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 33 Wednesday, April 14, 2010 10:09 AM

USING CARDHOLDER DATA IMPORT

2 When you are finished, the results of the import activity will be displayed in
the window. Click Close to return to the specification window.
Any actions indicated within the specification (for example, the elimination of the
source record, the execution of a script, or the startup of an application at the end
of operations) will automatically be performed.

Importing data in batch mode


Use this mode to import data on the basis of specific times or intervals, which are
defined in the subsystem configuration. You must first have created the proper
import specification (see “Configuring the import settings” on page 13).
For this purpose, you will use the Batch Activity display of Temaline Interface.

To import personal data:


1 From the menu bar, click Configure > Temaline Configuration >
Administration > Batch Activity
OR
From the EBI System Menu:
a. Click Access Configuration.
b. On the resulting EBI Access Configuration display, click the All Temaline
Configuration Tasks link.
c. On the resulting Temaline Configuration screen, click the Administration
tab.
d. On the Administration tab, click Utility Tools > Batch Activities.
2 On the Batch Activities screen, choose Cardholder Data Import from the
Activity Type drop-down list box.
3 Enter a description of the operation (max. 35 characters), and select the
Enable control box.
4 In the Execution area set the execution of the data operations in terms of
specific times or time intervals. Refer to the following table for a description
of the fields:

Field Description
From The start time of the activity.
To The end time of the activity.
Timeslot The time (in minutes) that must elapse between
operations on the data during the period specified in
the From and To fields.

33
TemaImpExpPdf.book Page 34 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

Field Description
Execution Time (from 01 to 12) These fields indicate the exact time at which the data
operation must be executed. It is possible to configure
one or more execution times as well as a time slot.
The two modes are not mutually-exclusive.
Execute at system startup Enable/disable the activity's automatic execution
when the system starts up.
Parameter The fields displayed in this area of the display vary
according to the type of activity to be executed (as
selected in the Activity Type box).
The possible operations are described below, together
with the fields displayed and the related procedures.

5 In the File text box of the Parameter area, type the pathname of the import
specification that you created using Cardholder Data Import.
6 Click Save to implement the settings.

34 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 35 Wednesday, April 14, 2010 10:09 AM

ERROR MESSAGES

Error messages
This section describes some error messages that can be displayed during the
importation, along with the description and the possible solution.
Usually, the error message given by the tool consists of the following
information:
• the current object name and the login operation to the current destination
database
• the message type (ERROR or WARNING)
• the error type, the table and the field involved
• the recovering state of the record when it has not been imported correctly.

Error Message Meaning


Invalid column name A field name is misspelled.
The Microsoft Jet database engine could not The ASCII file to which refers the
find the object “filename.TXT” import specification it was not located.
Warning: You must select a specification (.IMP) No import specification has been
opened.
Import result -> (ERROR)(IMPORT ERROR)-> The ODBC data source has not been
(Microsoft ODBC Driver Manager) Data source created. For further information, refer to
name not found and no default driver specified section ““Configuring the import
DataSource=DSN_NAME; User ID=; settings” on page 13”, step 4.
Password=
Import result -> (ERROR)(IMPORT ERROR)-> The source file does not contain the
Either BOF or EOF is True, or the current record record to be imported.
has been deleted. Requested operation requires a
current record (source select string: SELECT
*FROM nomefile.TXT)
(ERROR) Integrity violation error (table: (ON You are attempting to insert an
INSERT) TABLE_NAME) -> () [Microsoft] employee referring a company that does
[ODBC SQL Server Driver][SQL Server] not exist in the system.
INSERT statement conflicted with COLUMN
FOREIGN KEY constraint 'TABLE_NAME_
F01'. The conflict occurred in database 'NAME',
table 'TABLE_NAME', column 'COLUMN_
NAME'.

35
TemaImpExpPdf.book Page 36 Wednesday, April 14, 2010 10:09 AM

2 – IMPORTING DATA USING CARDHOLDER DATA IMPORT

Error Message Meaning


(ERROR) General error (table: You did not create the table where the
eFILENAME.TXT) -> - while source record record incorrectly imported can be
recovering - (ERROR) General ADO error on inserted.
Data Base (table: (ON INSERT)
eFILENAME.TXT) -> () [Microsoft][ODBC
Text Driver] The Microsoft Jet database engine
could not find the object 'eFILENAME.TXT'.
Make sure the object exists and that you spell its
name and the path name correctly.

36 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 37 Wednesday, April 14, 2010 10:09 AM

Importing data using


Cardholder LDAP 3
This chapter provides procedures and information necessary to configure and use
the LDAP Cardholder module.

To learn about Go to
About Cardholder LDAP page 38
Using the LDAP Configuration Tool page 44
Configuring the Web login page 63
Trace and Log page 65

Note:
For further information on objects and data fields that can be used to import data, see
“Database reference” on page 155.

37
TemaImpExpPdf.book Page 38 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

About Cardholder LDAP


This section deals with the following topics:

Topic See
What is LDAP? page 39
Vendor platforms page 41
Overview of the LDAP-based Cardholder Manager page 42
Limits of the current solution page 43

See Also:
• “Using the LDAP Configuration Tool” on page 44

38 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 39 Wednesday, April 14, 2010 10:09 AM

ABOUT CARDHOLDER LDAP

What is LDAP?
In computer networking, LDAP (Lightweight Directory Access Protocol) is a
networking protocol, running over TCP/IP, for querying and modifying directory
services.
A directory service is a software application or a set of applications that stores
and organizes information about a computer network, users, and network shares.
A directory service should not be confused with the directory itself, which is the
database that holds the information about objects that are to be managed by the
directory service.

Architecture of an LDAP directory


An LDAP directory is a tree of entries, each of which consists of a set of named
attributes with values. The attributes are defined in a schema. The schema defines
object classes—that is, the kind of object the entry represents—for example, a
person, organization, or domain. The classes also identify which attributes are
optional and which ones are mandatory.
LDAP administrators can define customized schemas in addition to the standard
ones. In LDAP, directory entries are arranged in a hierarchical tree-like structure.
Traditionally, this structure reflects geographic and/or organizational boundaries.
Entries representing countries appear at the top of the tree. Below them are entries
representing states and national organizations. Below them might be entries
representing organizational units, people, printers, documents, etc.

The following figure illustrates a sample (provided by a third-party tool) LDAP


repository:

39
TemaImpExpPdf.book Page 40 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

In this illustration, DC=TQ is the root of the LDAP repository, and the selected
item is the entry to a specific user.
“LDAP-aware” client programs can ask LDAP servers to look up entries in a
wide variety of ways. LDAP servers index all the data in their entries; you can use
filters to specify the person or group you want, and return just the information
you want.
Permissions are set by the administrator to restrict access to the LDAP database to
only certain people, and optionally keep certain data private.

40 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 41 Wednesday, April 14, 2010 10:09 AM

ABOUT CARDHOLDER LDAP

Vendor platforms
Different vendors store data in their LDAP directories, like Windows Active
directory, Novell e-directory, Sun ONE, Linux directory services and others.
Applications that have to interact with LDAP directories have to be independent
from the vendor platforms.

Tip:
The name “LDAP directory” could be misleading because none of the specific directory
types are LDAP directories but all the directories that are accessible by LDAP are LDAP
directories.

41
TemaImpExpPdf.book Page 42 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

Overview of the LDAP-based Cardholder Manager


In general, in an Access Control system, the Cardholder Manager is the
application that manages the cardholder archive. The Cardholder Manager creates
and administers the cardholders, their cards, and their access rights.
Very often, in real scenarios, companies maintain data relating to their employees
that can populate the Cardholder Manager archive (for example, HR repository or
IT repository). Companies may want to use the data as a master copy of employee
data for the Access Control system. The Cardholder Manager integrates the data
with the specific Access Control information like cards, access rights, and other
data required by the application.
An LDAP-Based Cardholder Manager is an application that integrates Directory
service with the management cardholders' data.
The LDAP-based cardholder management allows access to data stored in generic
LDAP-based directories (LDAP repository) like Windows Active directory,
Novell e-directory, Sun ONE, Linux directory services and others that implement
the LDAP Protocol Version 3 (LDAPv3, RFC 2251).
The LDAP-Based Cardholder Manager is an optional licensed module of EBI -
Temaline Interface that integrates the Cardholder Manager and Directory service.

Batch import of cardholder data from LDAP repository


Usually in this scenario, the LDAP repository is the master of the cardholder data
Periodically (for example, every night) the CMS cardholder archives are updated
with the master copy stored in LDAP
The activity can be limited to import some relevant fields of the archives where
the Access Control data is entered by the Human Machine Interface (HMI) and
stored in a CMS repository.

42 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 43 Wednesday, April 14, 2010 10:09 AM

ABOUT CARDHOLDER LDAP

Limits of the current solution


The current solution has the following limits:
• It can manage only one LDAP server.
• It can import only a single card assigned to the cardholder per specification.
• It can import only a single site per specification.
• The creation of the LDAP custom attribute is the responsibility of the LDAP
administrator. CMS has no capability to add or modify the LDAP structure.

See Also:
• “Using the LDAP Configuration Tool” on page 44

43
TemaImpExpPdf.book Page 44 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

Using the LDAP Configuration Tool


This section covers the following topics:

Topic See
Accessing the application page 45
Creating the LDAP specification page 46
Creating and using code procedures page 54
Importing data using Cardholder LDAP page 56
Import wizard page 59

See Also:
• “Database reference” on page 155

44 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 45 Wednesday, April 14, 2010 10:09 AM

USING THE LDAP CONFIGURATION TOOL

Accessing Cardholder LDAP


To access the module:
1 From the Windows taskbar, click Start > Programs > Enterprise Buildings
Integrator > Cardholder LDAP.
2 In the login window, type in the database password (default scat) and click
OK.
3 In the Cardholder LDAP main screen that is displayed, use the menu bar to
select the desired function.

Menu functions
The table below summarizes the functions of each menu. The right-hand
column provides a link to the relevant topic in the guide.

Menu It allows you to See


Specification Select and manage an LDAP specification, as page 46
well as exit the application.
Custom code Use a specific code editor to create or manage page 54
code procedures in order to customize the
mapping between fields and the synchronization
process in general.
This menu is only available after opening a
specification.
Configure LDAP Set up the parameters for the LDAP page 63
Login authentication of the Web Reception login.
Window Arrange the opened windows on your screen.
Help Access the Help system for the application.

Note:
The Execution menu will also be displayed after opening an import specification, which
allows running the import operation. See “Importing data using Cardholder LDAP” on
page 56.

45
TemaImpExpPdf.book Page 46 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

Creating an LDAP specification


Overview
Any type of activity in the Cardholder LDAP module is based on the
configuration of the LDAP specification that defines the relationship between the
attributes of the LDAP repository and the CMS fields. The specifications are
managed using the LDAP Configuration Tool.
A LDAP specification includes:
• all information required for accessing the LDAP server
• the list of correspondences between CMS cardholder fields and LDAP
attributes
• all the rules required to execute that mapping
A specification can also include some code procedures used to customize the
fields' import process. (See “Using code procedures” on page 54).

Attention:
Bear in mind that, in order to define the associations between the CMS fields and the
LDAP attributes, it is required the support of the customer’s IT LDAP expert.

To create the specification:


1 In the first screen of the TEMA LDAP Import Configurator application, click
Specification > New on the menu bar and then select the specification type,
depending on the type of cardholder you need:

The available options are Employee or External Regular. Note that you can
only have one specification per type of cardholder.
2 Depending on the type of cardholder that you have selected, the import
specification window will be displayed. All the fields present in the selected
table will be listed in the left pane. The example below shows the window that
is displayed after selecting Specification > New > Employee:

46 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 47 Wednesday, April 14, 2010 10:09 AM

USING THE LDAP CONFIGURATION TOOL

3 Enter the unique identifier of the import specification to be created into the
Acronym field, then type the description of the import activity into the
Description field.
4 Under Source LDAP Server, click Configure LDAP Server to access the
dialog that allows configuring the connection with the LDAP server.
5 In the Server group box, use the following parameters to configure the server:

Parameter Definition
Name Host name or dotted string representing the IP address
of the host running an LDAP server.
Port The TCP port number. The default port is 389.
Search Base Distinguished name of the entry where the search
starts.
Search Filter Filter to apply to the search.
Search Scope Indicates the scope of the search. Levels include:
• Base Level: Searches the base entry only.
• One Level: Searches all entries in the first level
below the base entry, excluding the base entry.
• Subtree Level: Searches the base entry and all
entries in the tree below the base.

47
TemaImpExpPdf.book Page 48 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

Parameter Definition
Client SIZE limit The number of entries to return from a search. If there
is no limit, enter 0.
Client TIME limit (sec.) The number of seconds the server will wait to
complete an operation. If there is no limit, enter 0.

6 In the Connection group box, use the following parameters to configure the
connection:

Parameter Definition
Login The Distinguished Name (DN) of the user that
authenticates a client to a server LDAP using a clear
text password. LDAP Server uses the distinguished
names (DNs) as primary keys to entries in the
directory; it is made up of a list of attribute names and
values. For example:
cn=Peter Smith, ou=R&D, ou=Employee,
dc=Honeywell, dc=com
Password Password of the user specified in the login parameter.
SSL Enable/Disable the Secure Sockets Layer; this
functionality is used to encrypt data during the
transmission.

7 Click Save to return to the Specification window.


8 In the Association area, create the associations between the fields present in
the selected CMS object (these are listed in the left pane of the window) and
the classes present in the LDAP server:
a. Click on the drop-down list on the right side of the window to execute an
automatic connection to the LDAP server.

b. Wait while the connection is made and the list is populated with the LDAP
classes required.
c. Select a class from the drop-down list. Once selected, the attributes of the
class are listed underneath.
d. From the left pane, select a CMS field, then select the corresponding
LDAP attribute, and finally click Add field.
9 Alternatively, you may use the Add const. button to set a correspondence
between a CMS field and a constant value (for example, when there is no

48 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 49 Wednesday, April 14, 2010 10:09 AM

USING THE LDAP CONFIGURATION TOOL

correspondence for the field in the LDAP repository and you need a CMS
value):
a. Select the field in the left-hand pane, then click Add const. In the central
area of the window, the value <CONSTANT> will be inserted as the source
field.
b. The Is constant check box in the Association Details area will be selected
automatically allowing you to enter the desired value in the text box next
to it, which will become editable. The value you enter will be inserted in
the destination field when performing the import operation.
10 Continue until you have associated the desired fields. To remove a field, select
it, then click Remove.
11 In the Association Details area, set the details for the association currently
selected. These will be used when importing the record. The following table
describes each option:

Parameter Definition
Current field The CMS field currently selected.
Set value only if null If this option is selected, the selected destination field
will be overwritten only if it is empty.
Is constant Read-only check box. It will be automatically
checked (and the text box next to it will become
editable) after you press the Add Const. button (see
step 9 above). Used only for association of a CMS
field with a constant.
Use integrity constraint If this option is selected, the checks for referential
integrity during the import procedure are enabled. It
only applies to list type fields. (For further
information, see “Using the Integrity constraint
option” on page 22.)
Field content This text box becomes editable after you check the
Use integrity constraint option.

49
TemaImpExpPdf.book Page 50 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

Parameter Definition
Field custom code It allows associating a code procedure to the selected
association for automatic execution of specific
procedures, while importing the LDAP source field. It
is usually used to transform the LDAP data format to
the CMS format. There are two possible scenarios:
If the code procedure already exists:
1. Click Field custom code. The Select File window
is displayed.
2. Select the desired script, then click Open. The
complete name is displayed text box next to the
button.
3. Click Enable to enable the execution. (If you do
not select this box, even though the script is still
associated with the field, it will not be executed).
If the code procedure must be created:
1. To create a code procedure, choose Custom code
> New > Field custom code from the menu bar.
2. The code editor window appears, into which you
must insert the code. Follow the procedures
described in section “Using code procedures” on
page 54.
Enabled If this option is selected the custom code that you
have associated to the field will be actually executed
during the import operation. Otherwise, it is only
associated to the field.

12 Set the Import modality you want, keeping in mind that:

Option Description
Update target mode: This option allows you to specify the modes for updating the
destination table. The drop-down list contains the options as
described below:
• Insert or update The source data are used to update an existing record (having
the same key) in the CMS database. If no record exists with
the key requested, one will be created in the destination
database. This is the default.
• Insert or update and The source data are used to update an existing record (having
delete missing the same key) in the CMS database. If no record exists with
the requested key, one will be created in the destination
database. The records that are present in the destination
database, but which are no longer present in the source table,
get eliminated from the destination database.

50 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 51 Wednesday, April 14, 2010 10:09 AM

USING THE LDAP CONFIGURATION TOOL

Option Description
• Delete The destination record having the key specified in the source
file will be eliminated from the CMS database.
• Delete missing The CMS database records are compared with the source table
records. The records that are present in the database, but which
are no longer present in the source table, get eliminated from
the destination database.
External source This field indicates the data source to which the Delete
missing mode will be applied.

13 Click the Advanced button if you want to define more criteria, such as setting
a filter, specifying an application to run, or associating a script to the whole
import specification. The picture below shows the fields that are displayed
when you press this button:

The following table describes each option:

Option Description
Source filter condition Enables you to associate a filter with a specification, so that
the source records alone that satisfy certain criteria are
imported.You can type the filter in this box. Keep in mind
that this text box acts as a WHERE clause, and the search
condition must be inserted using the LDAP syntax.
For example:
• If you need to include a Unicode string with a filter, you
must put an ‘N’ before the Unicode string, as follows:
.
• If you only want to export the data for two zones in the
plant (for example, ZONE1 and ZONE2), you must set
the filter as follows:
(ZONES=ZONE1) or (ZONES=ZONES2)
• In particular, since access to the source data occurs using
ODBC, if a date is being used in the condition, you must
use the ODBC date format, that is to say:
{ts 'yyyy-mm-dd hh:mm:ss'}—for time and date
{ts 'yyyy-mm-dd'}—for date alone
{ts 'hh:mm:ss'}—for time alone

51
TemaImpExpPdf.book Page 52 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

Option Description
Record custom code Allows you to associate a code procedure to the import
specification for automatic execution of specific
procedures, along with the import activity. There are two
possible scenarios:
The code procedure already exists:
1. Click Record custom code. The Select File window is
displayed.
2. Select the desired script, then click Open. The complete
name is displayed text box next to the button.
3. Click Enable to enable the execution. (If you do not
select this box, even though the script is still associated
with the specification, it will not be executed).
The code procedure must be created:
1. To create a script, choose Custom code > New >
Record custom code from the menu bar.
2. The code editor window appears, into which you must
insert the code. Follow the procedures described in
section “Using code procedures” on page 54.
Pre-process application Allows you to specify the execution of a specific
application before the import procedure. By pressing the
button you will be able to specify the path of the executable
file (.bat, .exe, or other) to be started. Consider the
following:
• Select Synchro if you want the import tool to wait for
the completion of the executable. (Do not set any
Timeout, in this case). If this option is not selected, both
the import procedure and the application will be
launched.
• Set a Timeout in seconds, if you want to specify a time
limit for the import tool to wait (for example, setting the
Timeout to 10 means that the import procedure will start
within 10 seconds, even though the preprocess has not
yet been completed).
• Select Enabled if you want the application to launch
before the import procedure.
Note: You must use the complete path, starting with the
directory (e.g., C:\honeywell\...) to execute the application.

52 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 53 Wednesday, April 14, 2010 10:09 AM

USING THE LDAP CONFIGURATION TOOL

Option Description
Post-process application Allows you to specify the execution of a specific
application at the completion of the import procedure. By
pressing the button you will be able to specify the path of
the executable file (.bat, .exe, or other) to be started.
Consider the following:
• Select Synchro if you want the import tool to wait for
the completion of the executable before starting a new
import procedure, if any. (Do not set any Timeout, in
this case). If this option is not selected, both the post-
process and the new import procedure, if any, will be
launched.
• Set a Timeout in seconds, if you want to specify a time
limit for the post-process to complete (for example,
setting the Timeout to 10 means that the post-process
will be terminated within 10 seconds, even though it is
not completed yet).
• Select Enabled if you want the application to launch at
the completion of the import procedure.

14 When you are finished setting the LDAP specification, you may:
• Save the specification for a later use: From the menu bar, choose
Specification > Save.
• Run the import: From the Cardholder LDAP menu bar, either choose
Execution > Start step-by-step or Execution > Launch, depending on
the import mode you want to use.
• Close the specification and exit the application: Choose Specification >
Close to close it or Specification > Exit to exit application.

See Also:
• “Using code procedures” on page 54
• “Importing data using Cardholder LDAP” on page 56
• “LDAP import wizard” on page 59

53
TemaImpExpPdf.book Page 54 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

Using code procedures


See also:
• “Scripting reference information for Cardholder LDAP Import” on page 130

Overview
You can associate code procedures to the specification that allow customizing the
mapping between CMS fields and LDAP attributes and the synchronization
process in general.
Code procedures are useful in solving particular mapping problems or checking
peculiar conditions during the LDAP synchronization processes. Code
Procedures are VB.net programs executed on particular synchronization steps.
The LDAP Configuration Tool includes a code editor for creating, managing, and
debugging code procedures. Code procedure samples are also included.
It is possible to associate code procedures to fields and record import.

Tip:
See “Scripting reference information for Cardholder LDAP Import” on page 130
for technical details on developing code procedures.

Creating a new code procedure


To create a new script to be associated with an LDAP specification:
1 Open the LDAP specification. (See “Creating an LDAP specification” on
page 46).
2 From the menu bar, choose Custom Code > New and then select either Field
Custom Code or Record Custom Code, accordingly to the code you want to
create. (Field Custom Code applies to an individual field, while Record
Custom Code refers to the whole import specification).
3 Click Edit. The Code editor window appears.
4 Locate the text Add here any extra Code (if necessary, use the vertical scroll
bar to locate the string):
'Add here any extra code:
Try
MsgBox("My Code")
Catch ex As System.Exception
5 Enter your code, then set the description for the code in the Code description
text box.
6 Click Compile Code to debug the code you have entered.

54 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 55 Wednesday, April 14, 2010 10:09 AM

USING THE LDAP CONFIGURATION TOOL

7 There are two possible scenarios:


• If there are no errors in the code you have typed in, the message Compile
terminated without errors appears at the bottom of the window. Click
Close to exit the script editor.
• If there were errors in the code, a message appears and the errors are listed
at the bottom of the window. Correct them, then run the compile again.
8 Save the code procedure and close the code window. The Code procedure will
be automatically assigned.
9 Finally, save the LDAP specification.

See Also:
• “Scripting reference information for Cardholder LDAP Import” on page 130

Note:
To clear the code that you have entered so as to restore the script file template, choose
Code editor > Set to template code from the menu bar of the specification window.

55
TemaImpExpPdf.book Page 56 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

Importing data using Cardholder LDAP


Once the parameters and criteria have been set for the importation (see “Creating
an LDAP specification” on page 46), you may launch the specification manually
or schedule it as a batch activity.
Any script that is associated with the specification will be executed
simultaneously.
There are two possible import modes:
• “Importing data manually” on page 56
• “Importing data in batch mode” on page 57

Importing data manually


When you are finished setting the LDAP specification, you can launch it by using
the Execution menu of the specification window.
There are two methods available:
• Start Step by Step—Performs the importation one record at a time, which is
useful for verifying the accuracy of the specification created.
• Launch—Begins the importation of all records.

To import data using the Start Step by Step method:


1 In the LDAP specification window, choose Execution > Start Step by Step
from the menu bar.
2 In the summary window that will be displayed, click Next Step at the bottom
to continue the operations.
3 If necessary, click Stop to interrupt execution.
4 When you are finished, the results will be displayed in the window. Click
Close to return to the specification window.

Tip:
After having successfully verified a limited number of records, you can use the
Execution > Launch menu command to run the importation of all records or you may
run the batch import mode, as described in the following.

To import data using the Launch method:


1 In the LDAP specification window, choose Execution > Launch from the
menu bar. The summary window will appear. If necessary, click Stop to
interrupt execution.

56 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 57 Wednesday, April 14, 2010 10:09 AM

USING THE LDAP CONFIGURATION TOOL

2 When you are finished, the results of the import activity will be displayed in
the window. Click Close to return to the specification window.

Importing data in batch mode


This option allows you to schedule the execution of the synchronization between
the LDAP repository and the CMS database in accordance with the LDAP
specification.
You must first have created the proper LDAP specification (see “Creating an
LDAP specification” on page 46).
For this purpose, you will use the Batch Activity display of Temaline Interface.

To import personal data:


1 Launch Temaline Interface. (For further information, please refer to the
Temaline Access Control Configuration Guide, chapter “Launching Temaline
Interface.”)
2 In the Administration tab of the Temaline Configuration window, click
Batch Activities.
3 Choose Import LDAP from the Activity Type drop-down list box in the
Batch Activities display.
4 Enter a description of the operation (max. 35 characters), and select the
Enable control box.
5 In the Execution area set the execution of the data operations in terms of
specific times or time intervals. Refer to the following table for a description
of the fields:

Field Description
From The start time of the activity.
To The end time of the activity.
Timeslot The time (in minutes) that must elapse between
operations on the data during the period specified in
the From and To fields.
Execution Time (from 01 to 12) These fields indicate the exact time at which the data
operation must be executed. It is possible to configure
one or more execution times as well as a configuring a
time slot. The two modes are not mutually-exclusive.
Execute at system startup Enable/disable the activity's automatic execution
when the system starts up.

57
TemaImpExpPdf.book Page 58 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

Field Description
Parameter The fields displayed in this area of the display vary
according to the type of activity to be executed (as
selected in the Activity Type box).
The possible operations are described below, together
with the fields displayed and the related procedures.

6 From the LDAP specification combo list, select the specification that you
have created by using the LDAP Configuration Tool.
7 Click Save to implement the settings.

See Also:
• “LDAP import wizard” on page 59

58 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 59 Wednesday, April 14, 2010 10:09 AM

USING THE LDAP CONFIGURATION TOOL

LDAP import wizard


The purpose of this wizard is to guide you through the procedures for creating a
specification to import employees' data from a LDAP to the CMS repository.

Attention:
The creation of an LDAP specification must be coordinated with the customer’s IT LDAP
expert who is familiar with the LDAP repository structure and has access rights to the
LDAP server.

Preliminary operations
The Customer's IT LDAP expert should set up a Windows active directory server
called TESTQ5 that stores in cn=Users all the users of the system. The following
illustration shows a suggested structure for a repository.

User information can also be stored using the ObjectClass USER.

59
TemaImpExpPdf.book Page 60 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

The following table lists the attributes for the ObjectClass:

Item LDAP Attribute Notes


User’s last name sn
User’s first name givenName
User’s logon name (to userPrincipalName This attribute is expressed as
be used as identifier) account@domain.
Card number and employeeNumber The customer can use this attribute as
clear code a card number. Other options include:
• using an attribute of another class
• creating a new attribute in an
existing class
• creating a new class with new
attributes
External key employeeNumber Establishes a unique link between the
record in the CMS repository and the
entry in the LDAP one.

To create the import specification:


1 Use the LDAP Configuration Tool to open the specification for Cardholder
Employees and, if necessary, customize the acronym and the description of
the specification. (See “Creating an LDAP specification” on page 46.)
2 Under Source LDAP Server, click Configure LDAP Server. The dialog that
allows configuring the connection with the server LDAP is displayed.
3 Set the options as follows:

Option Description/Value
Name TESTQ5
Port 389 (default)
Search base cn=users
Search scope One level
Search filter <void>
Client size limit Maximum number of entries to return from a search.
Set to 0.
Client TIME limit The number of seconds the server waits to complete
an operation. Set to 0.
Login cn=administrator, cn=users, dc=TQ
Password TBD
SSL Unchecked

60 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 61 Wednesday, April 14, 2010 10:09 AM

USING THE LDAP CONFIGURATION TOOL

4 Click Save to return to the Specification window.


5 In the Association area, create the associations between the fields present in
the selected CMS object (these are listed in the left pane of the window) and
the classes present in the LDAP server:
a. Click on the drop-down list on the right side of the window to execute an
automatic connection to the LDAP server.

b. Wait while the connection is made and the list is populated with the LDAP
classes required.
c. Select the objectClass from the drop-down list. Once selected, the
attributes of the class are listed underneath.
d. From the left pane, select a CMS field, then select the corresponding
LDAP attribute, and finally click Add field.
6 Set the Associations Details using the parameters as shown in the table
below.

CMS field objectClass LDAP attribute Association Details


NAME User givenName
LAST_NAME User sn
IDENTIFIER User userPrincipalName
BEHAVIOR_ID - <Const> Value = 1
Set value only if it is null.
CLEAR_CODE User employeeNumber Set value only if it is null.
LAYOUT_ID - <Const> Value = 1
Set value only if it is null.
CARD_NUMBER User employeeNumber Set value only if it is null.
CATEGORY - <Const> Value = 0 (normal)
SITE - <Const> Value = 1 (default)
CARD_STATUS - <Const> Value = 1 (active)
CARD_TYPE - <Const> Value = 1 (employee)
EXTERNAL_KEY User employeeNumber

7 You must apply a script on the IDENTIFIER association because the


userPrincipalName attribute is expressed in the format: account@domain
and you are going to assign only the account part. To do this, create a code

61
TemaImpExpPdf.book Page 62 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

procedure called identifierAssociation that eliminates the part from “@”


(included) and the end on the string. (See below for details).
8 From the menu bar, click

To create and associate the code procedure:


a. From the Cardholder LDAP menu bar, click Custom code > New and then
select either Field Custom Code. The code editor window is displayed.
b. Locate the string Add here any extra code and then enter the following
code:
'<- - - - - - - - - -
Add here any extra code

Try
Dim InLdapStr As String = '
Dim idx As Int32 = 0
OutEbiValue="“
If (InLdapValue Is Nothing) Then
Return (True)
End If
InLdapStr = CType (InLdapValue, String)
idx = InLdapStr.IndexOf("@", 0)
If (idx <> - 1) Then
OutEbiValue = InLdapStr.Substring(0, idx)
Else
OutEbiValue = InLdapStr
End If
Catch ex As System.Exception
bRet = False
End Try
'- - - - - - - - - ->

c. Click Compile. In the Save Script File window that appears, specify
identifierAssociation as the name for the script, and then click Save.
d. In the specification window, select the IDENTIFIER association.
e. In the Association Details area, click Field custom code, and then select
the identifierAssociation code procedure you have just created to
have it performed simultaneously with the import operation.

Attention:
To keep the data consistent between the employee imported data and the CMS mandatory
fields, some additional associations have been created. (See “Database reference” on
page 155 for information on the CMS Employee and External Objects.)

62 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 63 Wednesday, April 14, 2010 10:09 AM

CONFIGURING THE WEB LOGIN

Configuring the Web login


In the Web Reception and Web Station applications, operators can be
authenticated by an LDAP server. Using the LDAP Configuration Tool, you can
configure the authentication parameters of the LDAP server in those applications.

Attention:
The configuration of these parameters must be coordinated with the customer’s IT LDAP
expert.

To configure the Web authentication parameters:


1 Access the LDAP Configurator (see “Accessing Cardholder LDAP” on
page 45).
2 From the menu bar of the of module, choose Configure Web login to display
the Configure Web Login screen.

3 In the Configuration area of the screen, specify the settings for the Web
login. The following table describes each field:

63
TemaImpExpPdf.book Page 64 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

Field Description
Acronym Acronym of the specification.
Description Description of the specification.
Server Host name or dotted string representing the IP address
of the host running an LDAP server.
Port The TCP port number. The default is 389.
Search Base Distinguished name of the entry where search starts.
Search Filter Filter to apply to the search.
Search scope Indicates the scope of the search. Options include:
• Base Level: Searches the base entry only.
• One Level: Searches all entries in the first level
below the base entry, excluding the base entry.
• Subtree Level: Searches the base entry and all
entries in the tree below the base.
Login attribute The LDAP attribute used as a unique identifier for the
login.
Client SIZE limit The number of entries to return from a search. Zero
indicates that there is no limit.
Client TIME limit The number of seconds the server will wait to
complete an operation. Zero indicates that there is no
limit (use server limit).
SSL Enables/disables the Secure Sockets Layer. This
functionality enables you to encrypt data during the
transmission. SSL must be available on the server.

4 Complete the Additional Bind on Login area of the screen. The following
table describes each field:

Field Description
Force anonymous Forces the anonymous login during the LDAP
authentication of the Web operator.
Login Login for the LDAP authentication of the Web
operator.
Password Password for the LDAP authentication of the Web
operator.

5 Select the Web Login in use option to enable the Web authentication. If this
option is deselected the Web authentication is disabled.

64 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 65 Wednesday, April 14, 2010 10:09 AM

TRACE ACTIVITIES

Trace activities
This chapter describes the trace files available for debugging the LDAP-based
cardholder manager and for system maintenance.
The Trace file is stored in the <drive>:\Program Files\Honeywell\EBI_Tema\
Trace\Net folder.

Name of the trace file Contents Activation


(extension *.trc)
SCAT_LDAP Include all the anomalies detected Automatic activation;
from the LDAP-based cardholder available only if the LDAP-
manager option: based cardholder manager
• Synchronization process errors option is licensed.
• Specification errors
• CMS DB connection errors
• LDAP server connection errors
• Process errors

To activate the trace files:


The System Registry Editor allows you to enable/disable the writing on trace
files. Furthermore, you can set the amount of information that you want your
trace files to store.
1 From the Windows taskbar, choose Start > Run then type Regedit to access
the Registry Editor.
2 Select HKEY_LOCAL_MACHINE\Software\Honeywell\EBI_TEMA\Trace. The
list of the trace files that are available appears on the right side of the Editor.
3 By default, the writing on trace files is enabled. Double-click the LDAP Enable
Trace to access the Edit DWORD Value window where you can change this
setting: 1 = Enable the trace, 0 = Disable the trace.
4 To set the amount of information, double-click on LDAP Trace Level, then set
the value as you wish. Keep in mind that the higher the value, the higher the
amount of information that will be entered in the file. Admitted values are: 5,
10, 20, 40 where 10 is the suggested value.

Note:
Whenever a trace file grows to 0.6 Mbytes, or after restarting the system, a backup copy
of the trace file is automatically created (.bak) and contents of the original trace file
(.trc) are reset. Deleting a trace file may damage the system life. If no trace file is found,
a new one is created automatically.

65
TemaImpExpPdf.book Page 66 Wednesday, April 14, 2010 10:09 AM

3 – IMPORTING DATA USING CARDHOLDER LDAP

66 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 67 Wednesday, April 14, 2010 10:09 AM

Exporting data using Flexible


Cardholder and Temaline Data
Export
4
This chapter provides information for operators who use the Flexible Cardholder
and Temaline Data Export application for exporting data that is provided with the
Temaline Interface subsystem.

To learn about Go to
About Flexible Cardholder and Temaline Data Export page 68
Using Flexible Cardholder and Temaline Data Export page 69
Tracing and diagnostic features page 104

67
TemaImpExpPdf.book Page 68 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

About Flexible Cardholder and Temaline Data Export


Flexible Cardholder and Temaline Data Export is an application that exports data from
the CMS database to external data containers.

What you can do with Flexible Cardholder and Temaline Data Export:
• You can manage the data export procedures in a totally flexible manner, in
terms of target containers.
• You can define your export settings and store them in an export specification.
• You can customize the export operation in terms of structure, format, and
contents of data records, as well as by using VB.net script files.
• You can export data in batch or manual modes.

Target containers
You can export data to the following target containers:
• ASCII format text files, delimited or not;
• external databases, spreadsheets, or text files that are accessible using ODBC
data sources;
• XML files.

68 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 69 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Using Flexible Cardholder and Temaline Data Export


This section covers the following topics:

Topic See
About export specifications page 70
Creating the export specification for exporting data to an ASCII page 73
file
Creating the export specification for exporting data to an ODBC page 82
data source
Creating the import specification for exporting to an XML file page 90
Exporting data page 101
Using existing specifications page 95
Creating and using custom code (VB.Net scripts) page 97

See Also:
• “Tracing and diagnostic features” on page 104
• “Database reference” on page 155

69
TemaImpExpPdf.book Page 70 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

About export specifications


The process of exporting data from the CMS databases toward external target
containers is controlled by running the export specifications, which are files with
extension .exp that store the export settings. The export settings define all the
criteria for the export activity.
The specifications you create can be stored and re-used for running the export
operations. Their characteristics depend on the type of target container into which
the data are to be exported.
You can use the default export specifications that are provided, or you can create
new specifications for yourself.
The table below summarizes the types of target containers that are compatibles
and, for each type of container, the operations that the export specification allows
you to manage:

Table 1 Configuring the export activity for various types of files

ASCII File XML file ODBC data source


Task Exporting to a text Exporting to an XML Exporting to a
file file (with the XSD database, a file, or an
scheme file) ODBC-compliant
worksheet
Destination file name Fixed name Fixed name --
Name with variable Name with variable
elements (date, elements (date,
progressive nr.) or progressive number)
with custom
extension
Scheme file creation -- Possibility of --
creating the XSD
scheme file
separately, or
together with the
XML
Delimiter Type Comma or Tab -- --
Separated Values
No delimiter
Custom delimiter
Selecting the source Access to all the Access to all the Access to all the
table CMS tables CMS tables CMS tables

70 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 71 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Table 1 Configuring the export activity for various types of files

ASCII File XML file ODBC data source


Task Exporting to a text Exporting to an XML Exporting to a
file file (with the XSD database, a file, or an
scheme file) ODBC-compliant
worksheet
Field selection modes Selection of fields to Selection of fields to Associating source
be exported from be exported from and target fields.
source tables source tables Inserting of
(multiple (multiple constants with
occurrences allowed occurrences allowed default values.
for each field). for each field).
Formatting field
Inserting of Using constants with contents.
constants with default values.
default values. Formatting field
Formatting field contents.
contents.
Modes of selecting See Destination file See Destination file Selecting the
destination files and name, above name, above destination file
fields associated with the
ODBC data source,
display and selection
of fields to be
associated.
Fields Formatting Definition of Definition of Definition of
dimensions and fill dimensions and fill dimensions and fill
characters, and characters, and characters, and
justification of justification of justification of
contents of contents of contents of
destination field. destination field. destination field.
Association of VBS Creation and Creation and Creation and
scripts management of management of management of
script files to be script files to be script files to be
associated to the associated to the associated to the
specification, for specification, for specification, for
automatic execution automatic execution automatic execution
of procedures. of procedures. of procedures.

71
TemaImpExpPdf.book Page 72 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Table 1 Configuring the export activity for various types of files

ASCII File XML file ODBC data source


Task Exporting to a text Exporting to an XML Exporting to a
file file (with the XSD database, a file, or an
scheme file) ODBC-compliant
worksheet
Other Execution of another Execution of another Execution of another
application at the application at the application at the
end of the end of the end of the
procedure. procedure. procedure.
Application of a Application of a Application of a
filter to source fields filter to source fields filter to source fields
for selective record for selective record for selective record
exportation. exportation. exportation.
Elimination of Elimination of Elimination of
source records after source records after source records after
exportation. exportation. exportation.

To learn more:
• “Creating an export specification for exporting data to an ASCII file” on
page 73
• “Creating an export specification for exporting data to an ODBC data source”
on page 82
• “Creating an export specification for exporting data to an XML file” on
page 90

72 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 73 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Creating an export specification for exporting data to an ASCII file


The diagram below illustrates the procedure for exporting from the CMS database
to a destination file in ASCII format:

To create an export specification for export to an ASCII file:


1 From the Windows taskbar, click Start > Programs > Enterprise Buildings
Integrator > Flexible Cardholder and Temaline Data Export.
2 In the login window, type in the database password (default scat). The
application startup window will be displayed.
3 From the application’s menu bar, select File >New > ASCII File Export. The
relevant export specification window appears:

73
TemaImpExpPdf.book Page 74 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

4 Type the unique identifier of the export specification to be created into the
Acronym field of the General area, then type the description of the export
activity into the Description field (for example, Export in ASCII Format).
5 In the Type of delimiter field of the Destination area, specify the type of
field delimiter that will be used in the export file:
• None—Records are exported without delimiters, meaning one field after
another.
• CSV—Records are exported into a Comma Separated Values file. The
adjacent box will display a comma.
• TAB—Records are exported into a Tab Separated Values file. The
adjacent box will display a tab sign.
• Custom—Allows you to set a customized delimiter. The adjacent box will
be enabled to allow you to type in the character that will be used as your
delimiter.

74 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 75 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

6 Specify the name, path, and characteristics of the destination file into which
the records will be exported. There are two possible scenarios:

75
TemaImpExpPdf.book Page 76 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Button Description
Destination file This button allows you to use a destination file with a
fixed name.
By clicking it, the Select output file window will
displayed. There are two possible scenarios:
• If the file into which the records are to be exported
already exists, select it, then click Open.
• If the file does not exist, create it by typing the name
into the File Name box, and then click Open.
In either case, the name of the file, with the complete path,
will be displayed in the export specification window next to
the Destination file button.i
i
You may type in the destination file name and path
directly, without using the Destination File button. In this
case, you must type in the absolute file path or a relative
path (for example, ..\Export\Transists002.xml),
keeping in mind that the current folder is, by default, that in
which the Flexible Cardholder and Temaline Data Export
executable can be found.
File Name Creator This button allows you to use a destination file whose name
is characterized by dynamic elements, such as the date, the
time, or a progressive number.
By clicking it, the File name creator window will be
displayed:
• Click Destination File Path and then select the
directory that will contain the destination file. The path
is displayed in the white box underneath.
• In the File Name area and the File Extension area,
select the desired options, keeping in mind that you can
utilize different combinations of elements to make up
the name. (See “File Name Creator for an ASCII target
file” on page 77).
• To confirm the file name and path, click OK. The
complete name of the destination file will be displayed
in the blue box. (To cancel the new settings and return to
the specification window without saving, click Cancel.)
• To cancel the current settings and remove the file name
from the specification window, click Clear in the File
Name Creator window.

76 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 77 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Figure 3 File Name Creator for an ASCII target file

7 From the Source table name drop-down list, select the database table from
which you want to export the records. The list of the data fields present in the
selected table will appear. Note that the drop-down list contains all the
available database tables, that is, the CMS tables and any table that the user
has created.
8 Select the data fields to export into the ASCII file, in one of the following
ways:
• Click the desired field, then click Add Field. The field is inserted into the
pane to the right.
• Use the mouse to drag the field into the right pane.
9 Specify the properties of the destination field into which the record will be
exported:

77
TemaImpExpPdf.book Page 78 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

For example, if the source record to be exported is (Terminal description): -


Dimension: 6 has the following Destination field values:
Size: 10
Filler: -
Just: Left
The Destination field will contain the value TS0010----
10 If necessary, use the Add Const. button to insert fields with a constant value
into the destination file:
a. Select the desired destination field, then click Add Const. to insert the
field <CONSTANT_1> (the number is progressive) into the right pane.
b. In the Default value text box, type in the value to be inserted into the
destination field.
11 Continue until you have inserted all the desired fields into the pane. To
remove a field, select it, then click Remove. To change the order of the fields,
use the Up and Down buttons.
12 Specify any of the following additional settings for your export specification
before saving it. The available options are described in the following table:

78 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 79 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Option Description
VB Script button This button enables you to associate to the export
specification a script file, for automatic contemporaneous
execution of specific procedures, along with the
exportation of each record. There are two possible
scenarios:
If the script already exists:
1. Click VB Script. The Select File window appears.
2. Select the desired script, then click Open. The complete
name will be displayed in the window of the
specification.
3. Click Enable to enable the execution.
If the script must be created or modified:
1. To create a script, choose Script > New from the menu
bar. The script editor window will appear, into which
you must insert the code. Follow the procedures
described in section “Creating and using custom code
(Vb.Net scripts)” on page 97.
2. To modify an existing script, choose Script > Open.
Select the script file you want to access the editor
window.
Along with Flexible Cardholder and Temaline Data Export,
some default scripts are provided for you.
Source Filter Condition Enables you to associate a filter with a specification, so that
the source records alone that satisfy certain criteria are
exported. You can type the filter in this box. Keep in mind
that this text box acts as a WHERE clause, and the search
condition must be inserted using SQL ODBC syntax.
For example:
• If you need to include a Unicode string with a filter, you
must put an ‘N’ before the Unicode string, as follows:
.
• If you only want to export the data for two zones in the
plant (for example, ZONE1 and ZONE2), you must set
the filter as follows:
(ZONES=ZONE1) or (ZONES=ZONES2)
• In particular, since access to the source data occurs
using ODBC, if a date is being used in the condition,
you must use the ODBC date format, that is to say:
{ts 'yyyy-mm-dd hh:mm:ss'}—for time and date
{ts 'yyyy-mm-dd'}—for date alone
{ts 'hh:mm:ss'}—for time alone

79
TemaImpExpPdf.book Page 80 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Option Description
Action on Source Record Allows you to set the deletion of the data source record
after it has been exported into the destination file.
Note: This mode does not apply to all ODBC data sources.
For example, the ASCII ODBC data source is read-only so
this feature is not supported.
Run After Execution Allows you to set up an application to run automatically
when the export procedure has completed. The button gives
access to the ..\exe folder, where you can find the
executables for the Temaline Interface package. After
specifying the executable, select the Enable check box.

13 Click File > Save to save the specification before performing the export
activity, or to store it for later use. The Save As Export Specification file
window appears, because this is the first time that the specification is being
saved.
14 Indicate the directory and the name of the specification just created, then click
Save. The specification just created can now be utilized for exporting in
manual mode, using the Execution menu, or in batch mode, using Temaline
Interface. For further information, see “Exporting data” on page 101.
15 To exit the application, choose File > Exit.

Attention:
Keep in mind that the way you name the destination file affects how the system manages
the data export activity. This prevents you from losing data exported during a preceding
export, for cases where the destination file has not yet been imported and canceled. The
following describes how the system behaves when the export is being performed:
• If the file does not exist, a new file is created, with the name specified.
• If the file exists, with fixed name (for example, Transits.xml), an error message is
generated, and the export is not performed. A new file must be created or the
preceding one must be renamed.
• If the file exists, with variable name, there are two possible scenarios:
Fixed part and progressive number (for example, Transits001.xml): A new
destination file is created, with the next higher progressive number after the last
appearing in the folder (for example, Transits002.xml), or, if this is the first export,
then with number 000.
Fixed part and date (for example, Transits041122.xml): If the date of the exportation
is the current date, the records are added into the same file, at the end. If the export is
to occur on another date, a new file is created with the current date.

80 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 81 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

See also
• “Using existing specifications” on page 95
• “Creating and using custom code (Vb.Net scripts)” on page 97
• “Tracing and diagnostic features” on page 104

81
TemaImpExpPdf.book Page 82 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Creating an export specification for exporting data to an ODBC data


source
This mode allows you to export data from the source database into destination
files of any format (database table, Microsoft Excel worksheets, etc.) using an
ODBC data source.
The schematic below illustrates this procedure:

See also:
• “Using a Microsoft Excel (.xls) source file” on page 88

To create an export specification for export to an ODBC data source:


1 From the Windows taskbar, click Start > Programs > Enterprise Buildings
Integrator > Temaline Interface > Flexible Cardholder and Temaline
Data Export.
2 In the login window, type in the database password (default scat). The
application startup window will be displayed.
3 From the application’s menu bar, select File > New > ODBC Data Source
Export, the export specification window appears:

82 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 83 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

4 Type the unique identifier of the export specification to be created into the
Acronym field of the General area, then type the description of the export
activity into the Description field (for example, Export to File xxxx).
5 Select the destination ODBC data source. There are two possible scenarios:
Scenario Steps
ODBC data source already exists 1. From the Destination ODBC drop-down list,
select the ODBC data source to be used for
accessing the destination container.
2. If necessary, type in the access Login and
Password, then click Connect to access the
database.
The system produces an error message if you attempt
to access a protected database without entering the
Login and Password.i
iThe default ODBC data source is SCAT. If you need
to use a different data source, click Disconnect in the
source ODBC frame to disconnect SCAT. (The button
name changes to Connect.) Then, click Connect to
select a different ODBC data source.

83
TemaImpExpPdf.book Page 84 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Scenario Steps
ODBC data source needs to be 1. Click the Configure ODBC button. The ODBC
configured Data Source Administrator window is displayed,
allowing you to configure the data sources. (For
further information about use and configuration of
the Windows ODBC Data Sources, consult the
Online Help for the application.)
2. Select the System DSN tab, then click Add to
access the Create New Data Source window.
3. Select the driver from the list, for which you want
to configure the data source, according to the
destination file format.
4. Click End to access the configuration window,
which varies depending on the driver selected.
5. Indicate the name for the ODBC data source and
select the destination file to which the records are
to be exported.
Note: If you are using a Microsoft Excel file, in
the ODBC configuration window, click the
Options >> button, then deselect the Read Only
check box. (Furthermore, you have to prepare the
.xls file for the export operation working
properly. See “Using a Microsoft Excel (.xls)
source file” on page 88).
6. The newly configured data source is now
accessible from the Destination ODBC list in the
export specification window. Select it, then click
Connect.

84 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 85 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

6 From the Destination Table Name drop-down list, select the destination table
(or the Microsoft Excel worksheet) to be used for the exportation. The
destination fields present in the file are displayed in the area below. If you are
using a Microsoft Excel file, the column titles are displayed.
7 From the Source Table Name list, select the database source table to be used
for the export activity. All the fields present in the table are displayed in the
area below.
8 Create the association between source and destination fields: Select a source
field and a destination field, then click Add Field. The two fields are
displayed at the center of the window, indicating their association, as
illustrated in the following figure:

The source field is inserted into the destination container, within the field to
which it is associated.
9 Specify the properties of the destination field into which the record will be
exported:

85
TemaImpExpPdf.book Page 86 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

For example, if the source record to be exported is (Terminal description):


TS0010 - Dimension: 6 has the following Destination field values:
- Size: 10
- Filler: -
- Just: Left
The Destination field will contain the value TS0010----
10 If necessary, you can use the Add Const. button to insert a default value in the
destination field:
a. Select the desired destination field, then click Add Const. In the central
area of the window, <CONSTANT_1> is inserted (the number is progressive)
as a source field associated with the selected destination field.
b. In the Default value text box, which is the only one enabled, type in the
value to be inserted into the destination field.
11 Continue until you have associated the desired fields. To remove a field, select
it, then click Remove.
12 Complete any additional settings using the following fields.

86 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 87 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Field or button Description


VB Script button This button is used to associate to the export specification a
script file, for automatic contemporaneous execution of
specific procedures, along with the exportation of each
record. There are two possible scenarios:
If the script already exists:
1. Click VB Script. The Select File window is displayed.
2. Select the desired script, then click Open. The complete
name is displayed in the window of the specification.
3. Click Enable to enable the execution.
If the script must be created or modified:
1. To create a script, choose Script > New from the menu bar.
The script editor window appears, into which you must
insert the code. Follow the procedures described in section
“Creating and using custom code (Vb.Net scripts)” on
page 97, in which you will also find examples of scripts for
executing some of the most common procedures.
2. To modify an existing script, choose Script > Open. Select
the script file you want, to access the editor window.
Along with Flexible Cardholder and Temaline Data Export,
some default scripts are provided for you.
Source filter condition Enables you to associate a filter with a specification, so that
the source records alone that satisfy certain criteria are
exported. You can type the filter in this box. Keep in mind that
this text box acts as a WHERE clause, and the search
condition must be inserted using SQL ODBC syntax.
For example:
• If you need to include a Unicode string with a filter, you
must put an ‘N’ before the Unicode string, as follows:
.
• If you only want to export the data for two zones in the
plant (for example, ZONE1 and ZONE2), you must set the
filter as follows:
(ZONES=ZONE1) or (ZONES=ZONES2)
• In particular, since access to the source data occurs using
ODBC, if a date is being used in the condition, you must
use the ODBC date format, that is to say:
{ts 'yyyy-mm-dd hh:mm:ss'}—for time and date
{ts 'yyyy-mm-dd'}—for date alone
{ts 'hh:mm:ss'}—for time alone

87
TemaImpExpPdf.book Page 88 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Field or button Description


Action on source record Allows you to set the deletion of the data source record after it
has been exported into the destination file.
Note: This mode does not apply to all ODBC data sources.
For example, the ASCII ODBC data source is read-only so
this feature is not supported.
Run after execution Allows you to set up an application to run automatically when
the export procedure has completed. The button gives access
to the ..\exe folder, where you can find the executables for
the Temaline Interface package. After specifying the
executable, select the Enable check box.

13 Click File > Save to save the specification that was created before performing
the export activity, or to save it for later use. The Save As Export
Specification file window appears, because this is the first time that the
specification is being saved.
14 Indicate the directory and the name of the specification just created, then click
Save. The specification just created can now be used to perform an export in
manual mode, using the Execution menu, or in batch mode, using Temaline
Interface. For further information, see “Exporting data” on page 101.
15 To exit the application, choose File > Exit.

See also
• “Using a Microsoft Excel (.xls) source file” on page 88

Using a Microsoft Excel (.xls) source file


If you are using a Microsoft Excel file as the destination container, you must
prepare the file according to specific criteria.
1 Rename each of the worksheets to be used for the exportation. Worksheet
names MUST include a letter and a number (for example, B5). Keep in mind
that each of the worksheets that make up the Microsoft Excel workbook (one
or more worksheets) constitutes a table.

Tip:
To rename a worksheet in Microsoft Excel, double-click the sheet tab (this is the tab near
the bottom of the workbook that displays the name of a sheet), and then type a new name
over the current name.

88 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 89 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

2 On line 1 of each of the renamed worksheets, give a title to each of the


columns to be used for exporting the records, for example Card_Number,
Terminal and so forth.
Note: Column headings must not contain any spaces. Use an underscore to
indicate spaces in headings of two or more words, for example CARD_NUMBER,
not CARD NUMBER.

The columns thus named make up the destination data fields into which the
source records are exported.
3 Once you have selected the Microsoft Excel worksheet to use for the
exportation, the names of the columns in the worksheet constituting the
destination fields appear in the Destination table name list of the export
specification window. These can be utilized to create the association with the
source fields:

See also
• “Using existing specifications” on page 95
• “Creating and using custom code (Vb.Net scripts)” on page 97
• “Tracing and diagnostic features” on page 104

89
TemaImpExpPdf.book Page 90 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Creating an export specification for exporting data to an XML file


The diagram below illustrates the procedure for exporting from the CMS database
to a destination file in XML format.

To create an export specification for export to an XML file:


1 From the Windows taskbar, click Start > Programs > Enterprise Buildings
Integrator > Temaline Interface > Flexible Cardholder and Temaline
Data Export.
2 In the login window, type in the database password (default scat). The
application startup window will be displayed.
3 From the application’s menu bar, select File > New > XML File Export, the
export specification window appears:

90 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 91 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

4 Type the unique identifier of the export specification to be created into the
Acronym field of the General area, then type the description of the export
activity into the Description field (for example, Export to XML File).
5 The Destination area allows specifying the name, path, and characteristics of
the XML file. It includes two possible options:

91
TemaImpExpPdf.book Page 92 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Button Description
Destination file This button allows you to use a destination file with a
fixed name.
By clicking it, the Select output file window will displayed:
• If the file into which the records are to be exported
already exists, select it, then click Open.
• If the file does not exist, create it by typing the name into
the File Name box, and then click Open.
In either case, the name of the file, with the complete path,
will be displayed in the export specification window next to
the Destination file button.i
iYou may type in the destination file name and path directly,
without using the Destination File button. In this case, you
must type in the absolute file path or a relative path (for
example, ..\Export\Transists002.xml), keeping in
mind that the current folder is, by default, that in which the
Flexible Cardholder and Temaline Data Export executable
can be found.
File name creator This button allows you to use a destination file whose name
is characterized by dynamic elements, such as the date, the
time, or a progressive number.
By clicking it, the File name creator window will be
displayed:
• Click Destination File Path and then select the directory
that will contain the destination file. The path will be
displayed in the white box underneath.
• In the File Name area and the File Extension area, select
the desired options, keeping in mind that you can utilize
different combinations of elements to make up the name.
(See figure “File name creator for an XML target file” on
page 93 for an example).
• To confirm the file name and path, click OK. The
complete name of the destination file will be displayed in
the export specification window next to the File name
creator button. (To cancel and return to the specification
window without saving, click Cancel.)
• To cancel the current settings and remove the file name
from the specification window, click Clear in the File
name creator window.

92 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 93 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Figure 4 File name creator for an XML target file

6 Specify the mode for creating the XSD file (the scheme file), which is the file
that defines the structure for the XML file. There are two types of structures
for the XML file that are described below:

93
TemaImpExpPdf.book Page 94 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

File structure Description


XML and XSD separated The XSD file will be created as a separate file. In this
case, the system will use the same rules for name
creation as those that were defined for the XML file,
except that the file will have extension XSD. (As an
example, for the file Event001.xml, which is made
up of a fixed part and a progressive number, the
scheme file will automatically be given the name
Event001.xsd).
XML and XSD joined The XSD file will be created as an essential part of the
XML file.

7 All of the other procedures for creating the export specification (choice and
definition of the fields to be exported, association of a filter, association of a
VB.Net script, and so forth) are analogous to those described for use of an
ASCII destination file. Accordingly, see “Creating an export specification for
exporting data to an ASCII file” on page 73.

See also
• “Using existing specifications” on page 95
• “Creating and using custom code (Vb.Net scripts)” on page 97
• “Tracing and diagnostic features” on page 104

94 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 95 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Using existing specifications


Once the specifications have been created and stored, they can be re-used for
performing exportations. Furthermore, when you are exporting transits from the
CMS database, you can use the default specification Timbdat.exp that comes with
the application. You can also utilize an existing specification as a basis for
creating new specifications.

To export using existing specifications:


1 From the Flexible Cardholder and Temaline Data Export menu bar, choose
File > Open. The window is displayed that allows you to select an existing
specification. By default, the active directory is the one in which the
executable for the application is located.
2 Select the desired specification, then click Open. The window for the
specification will appear, with the parameters and the destination file already
set. You can:
• use the specification just as it is to perform an exportation (see “Exporting
data” on page 101);
• modify it before performing the exportation, by adding or removing source
fields, for example, or associating a script to it, or whatever else might be
necessary (for related procedures, see “About export specifications” on
page 70);
• use the same destination file or create a new one.
3 After having made any changes, if necessary, click File > Save to save the
specification with the current name and have the changes take effect, or click
File > Save As to save the modified specification with a different name.
For more information, see “Export specifications and scripts provided by default”
on page 96.

95
TemaImpExpPdf.book Page 96 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Export specifications and scripts provided by default


The default export specifications described in the paragraphs below are provided
along with the Flexible Cardholder and Temaline Data Export application and can
be found in the path <drive>:\Program Files\Honeywell\EBI_Tema\Export.

Timbdat.exp
This specification can be used to export transit data from the DI_TRANSIT table
of the Temaline Interface database, into an ASCII file in TIMB.data format. (For
further information about this file format, see the Temaline Access Control
Configuration Guide, chapter “Importing/exporting transactions,” section
“TIMB.DAT Data File Format.”)
The settings for the TIMBDAT.exp specification are as follows:
• there is no field delimiter set;
• in addition to exporting records related to the terminal, card number, and
transit reason, the application will associate the TIMBDAT.vbs script file to the
specification. This allows you to compute values to be inserted into the
destination file, based on the type of transit that was performed,
simultaneously with the exportation of each record;
• the TIME_ATTENDANCE_TYPE=1 filter is applied to the source fields, so as to
export only the transit data that pertain to Time and Attendance;
• the option is set to delete the source records after they are exported.

See also
• “Using existing specifications” on page 95
• “Creating and using custom code (Vb.Net scripts)” on page 97
• “Tracing and diagnostic features” on page 104

96 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 97 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Creating and using custom code (Vb.Net scripts)


Scripts are programs, or sequences of instructions, by which you can execute
specific operations automatically.
In Flexible Cardholder and Temaline Data Export, the function of creating scripts
allows you to extend the possibilities involved in managing source and
destination fields during the exportation of data, which is useful for increasing the
flexibility of your operations. In fact, after they are created, scripts can be
associated with export specifications and be performed simultaneously with the
exportation of each record. In this way, you can manage the export activity
dynamically, independently of the specification's global settings.
In particular, the application has a script editor in it, which is to be used for
creating, managing, and debugging scripts.

In this section:

Topic See
Creating new scripts page 97
Modifying an existing script page 99

Section “Scripting reference for Flexible Cardholder and Temaline Data Export”
on page 116 provides a reference for the scripting language together with some
examples of commonly used scripts.

Creating a script to be associated with an export specification:


1 Within the Flexible Cardholder and Temaline Data Export window, select
Script > New from the menu bar.
2 The window illustrated in the figure below will be displayed:

97
TemaImpExpPdf.book Page 98 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

3 Locate the text Add here any extra Code. If necessary, use the vertical scroll
bar to locate the string:

4 Type in the code, then click Compile Script to debug the code you have
entered.
5 Because it is the first time that the script is being saved, when you click
Compile Script, the Save VBScript File window appears. Give the script a
name, then click Save.

98 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 99 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

6 There are two possible scenarios:


• If there are no errors in the code you have typed in, the message Compile
terminated without errors appears at the bottom of the window. Click
Close to exit the script editor.
• If there are errors in the code, these are displayed at the bottom of the
window. Correct them, then run the compile again.
7 Associate the script to an export specification to have it performed
simultaneously with the exportation of each record. To do it, select it using the
VBScript button in the specification window.

Attention:
When the same field is being exported several times into an ASCII or XML destination
file, you must indicate the position of the field in the Script. That is to say, for the script to
properly determine the field on which to act, it is necessary to use the index rather than
the name of the field. Thus, the syntax to be used is as follows:
OutRecord.Field(Index) = Value
See “Indicating the position of a field” on page 128 for a specific example of the code to
be used.

Modifying an existing script


You can modify existing scripts or the default scripts to use them as a basis for
creating new scripts.
1 From the Flexible Cardholder and Temaline Data Export menu bar, choose
Script > Open.
2 Make the desired changes in the resulting editor window.

99
TemaImpExpPdf.book Page 100 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

3 Click Compile Script to debug the code you have entered. There are two
possible scenarios:
• If there are no errors in the code, the message Compile terminated
without errors appears at the bottom of the window, and the script is
automatically saved with the same name.
• If there are errors in the code, these are displayed at the bottom of the
window. Make any necessary corrections, then press Compile Script
again.
4 Click Close to exit the script editor.

See also:
• “Scripting reference for Flexible Cardholder and Temaline Data Export” on
page 116

100 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 101 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Exporting data
The exportation, that is, the transfer of the source database table records to a
previously selected destination file, is performed on the basis of parameters and
criteria defined in the export specification created using Flexible Cardholder and
Temaline Data Export.
Any script that is associated with the specification will be executed
simultaneously with the exportation of each record.
There are two possible export modes:
• “Exporting data manually” on page 101
• “Exporting data in batch mode” on page 102

Exporting data manually


When you are finished setting the export specification, you can start the manual
exportation of source database records to the destination file by using the
Execution menu of Flexible Cardholder and Temaline Data Export.
There are two methods available for exporting data manually. They are:
• Start Step by Step—Performs the exportation one record at a time, which is
useful for verifying the accuracy of the specification created.
• Launch—Begins the exportation of all records

To export data manually using the Start Step by Step method:


1 From the Flexible Cardholder and Temaline Data Export menu bar, click
Execution > Start Step by Step.
2 In the export summary window that will be displayed, click Next Step at the
bottom (or select Execution > Next Step from the menu bar) to continue the
exportation.
3 If necessary, click Stop to interrupt execution (or choose Execution > Stop
from the menu bar).
4 When you are finished, the results of the export activity will be displayed in
the window. Click Close to return to the specification window.

Tip:
After having successfully verified a limited number of records, you can use the Execution
> Launch menu command to run the exportation of all records or you may run the batch
export mode, as described in the following.

101
TemaImpExpPdf.book Page 102 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

To export data manually using the Launch method:


1 From the Flexible Cardholder and Temaline Data Export menu bar, click
Execution > Launch.
2 The export summary window will appear. If necessary, click Stop to interrupt
execution (or choose Execution > Stop from the menu bar).
3 When you are finished, the results of the export activity will be displayed in
the window. Click Close to return to the specification window.
Any actions indicated within the specification (for example, the elimination of the
source record, the execution of a script, or the startup of an application at the end
of operations) will automatically be performed.

Exporting data in batch mode


Use this mode to export data on the basis of specific times or intervals, which are
defined in the subsystem configuration. You must first have created the proper
export specification (see “About export specifications” on page 70).
For this purpose, you will use the Batch Activity display of Temaline Interface.

To export data in batch mode:


1 From the menu bar, click Configure > Temaline Configuration >
Administration > Batch Activity
OR
From the EBI System Menu:
a. Click Access Configuration.
b. On the resulting EBI Access Configuration display, click the All Temaline
Configuration Tasks link.
c. On the resulting Temaline Configuration screen, click the Administration
tab.
d. On the Administration tab, click Utility Tools > Batch Activities.
2 On the Batch Activity screen, choose Flexible Export from the Activity Type
drop-down list box.
3 In the Description field, enter a description of the export activity (max. 35
characters), and select the Enable box.

102 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 103 Wednesday, April 14, 2010 10:09 AM

USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

4 In the Execution area, set the execution of the data operations in terms of
specific times or time intervals. Refer to the following table for a description
of the fields:

Field Description
From The start time of the activity.
To The end time of the activity.
Timeslot The time (in minutes) that must elapse between
operations on the data during the period specified in
the From and To fields.
Execution Time (from 01 to 12) These fields indicate the exact time at which the data
operation must be executed. It is possible to configure
one or more execution times as well as a configuring a
time slot. The two modes are not mutually-exclusive.
Execute at system startup Enable/disable the activity's automatic execution
when the system starts up.
Parameter The fields displayed in this area of the display vary
according to the type of activity to be executed (as
selected in the Activity Type box).
The possible operations are described below, together
with the fields displayed and the related procedures.

5 In the Export Specification File field of the Parameter area, type in the full
name (path + file name) of the specification created using Flexible Cardholder
and Temaline Data Export.
6 Click Save to set the data exportation to start up based on specific time
intervals and to run based on the particular criteria defined in the export
specification.

103
TemaImpExpPdf.book Page 104 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Tracing and diagnostic features


You can access the export summary window by using the Execution menu of
Flexible Cardholder and Temaline Data Export, either in “step-by-step” mode or
in one single operation. This window allows you to keep track of the exportation
activities, as illustrated in the figure below:

The system also produces a log file, which is located in the directory <drive>:\
Program Files\Honeywell\EBI_Tema\Traces under the name SCAT_
FlexExport.trc.

The file contains information relating to all the operations performed using
Flexible Cardholder and Temaline Data Export, as is illustrated in the following
figure:

104 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 105 Wednesday, April 14, 2010 10:09 AM

TRACING AND DIAGNOSTIC FEATURES

Figure 5 Details on the trace file on performed activities

For further information about managing and reading the trace files, see the
Temaline Access Control Configuration Guide, chapter “Performing maintenance
operations,” section “Managing Temaline Trace Files”.

105
TemaImpExpPdf.book Page 106 Wednesday, April 14, 2010 10:09 AM

4 – EXPORTING DATA USING FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

106 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 107 Wednesday, April 14, 2010 10:09 AM

Scripting and code procedure


reference 5
This chapter provides scripting and code reference information, as well as
practical examples.

To learn about Go to
Scripting reference for Cardholder Data Import page 108
Scripting reference for Flexible Cardholder and Temaline Data Export page 116
Scripting reference for Cardholder LDAP Import page 130

107
TemaImpExpPdf.book Page 108 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Scripting reference for Cardholder Data Import


This section provides reference information for the VB Script Language, as well as
some examples of scripts that are commonly used for data import operations.

To learn about Go to
Reference information for the scripting language page 109
Examples of scripts for import operations page 113

See Also:
• “Using VB.Net scripts (Custom code)” on page 29

108 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 109 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE FOR CARDHOLDER DATA IMPORT

Reference information for the scripting language


This section describes custom code options.

Field custom code


Field custom code enables you to check, validate, and change the destination field
value at the field management level. Run this code after the mapped source value
is copied into the destination field.
Function ManageFieldData(ByRef ImportObj As
ManageFieldDataParameter, ByRef OutVal As Object) As Int32

Function Description
ImportObj (IN)The object used to access the source field value
and the destination database connection. The
parameter type is ManageFieldDataParameter.
OutVal (OUT)The resulting value of the custom code
execution--this is the new destination field value. By
default this value is set with the original source value.
Return Value Indicates the state of the field custom code execution;
acceptable values are defined in module
DHNETImportInterfaces.RET_VALUES.

Record custom code


Record custom code enables you to check, and if necessary to change, values set
after the field association management and before the data writing in destination
database. You can work on each of the mapped destination fields. You can also set
a property to skip the import of the current record.
Function ManageRecordData(ByRef ImportObj As
ManageRecordDataParameter) As Int32

Function Description
ImportObj (IN/OUT) Object for accessing source and
destination fields value. You can also get the
destination database connection and set the
property to indicate whether the current record
should be skipped. The parameter type is
ManageRecordDataParameter.
Return Value Indicates the state of the record custom code
execution; acceptable values are defined in
module DHNETImportInterfaces.RET_
VALUES

109
TemaImpExpPdf.book Page 110 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Custom code return values


The custom code return values set the state of the custom code execution. They
are defined in module RET_VALUES that is exposed from the
DHNETImportInterfaces interface.
There are only two possible values:
• RET_OK: custom code successfully executed.
• RET_ERROR: an error is occurred during custom code execution.

Custom code reference assembly


Custom code includes the following reference assemblies:
• Standard .Net namespaces
- Imports System
- Imports System.Data
- Imports System.Windows.Forms
- Imports Microsoft.VisualBasic
- Imports System.Data.OleDb
• Namespace that defines the return values
- Imports DHNETImportInterfaces

Standard .Net namespaces


See Microsoft MSDN Library - .NET reference.

The ManageFieldDataParameter class


This class is used in record custom code for the following operations.
• Accessing source fields value
"Function GetSourceValue(ByVal FieldName As String, ByRef
FieldValue As Object) As Boolean
It returns the source field values by field name.

110 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 111 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE FOR CARDHOLDER DATA IMPORT

Field name Description


FieldName (IN) The name of the source field
FieldValue (OUT) The value of the source field specified with
FieldName
Return Value True: Execution completed without errors.
False: An error occurred during execution.

Example:
bRet = ImportObj.GetSourceValue("SourceValue1", strVal1)

• Accessing the destination database connection


ReadOnly Property GetDestConn() As OleDbConnection
It returns the opened connection on the destination database.
Example:
myOleDbConnection = ImportObj.GetDestConn()

The ManageRecordDataParameter class


• Accessing source field values
"Function GetSourceValue(ByVal FieldName As String, ByRef
FieldValue As Object) As Boolean
It returns the source field value by field name.

Field name Description


FieldName (IN) The name of one of the source fields
FieldValue (OUT) The value of the source field specified with
FieldName
Return Value True: Execution completed without errors.
False: An error occurred during execution.

Example:
bRet = ImportObj.GetSourceValue("SourceValue1", strVal1)

• Accessing destination field values


Function GetDestValue (ByVal FieldName As String, ByRef
FieldValue As Object) As Boolean
It returns the destination field values by field name.

111
TemaImpExpPdf.book Page 112 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Field name Description


FieldName (IN) The name of one of the destination field
FieldValue (OUT) (OUT) The value of the source field specified
with FieldName
Return Value True: Execution completed without errors.
False: An error occurred during execution.

Example:
bRet = ImportObj.GetDestValue("Surname", strVal1)

Function SetDestValue (ByVal FieldName As String, ByRef


FieldValue As Object) As Boolean

Field name Description


FieldName (IN) The name of the destination field
FieldValue (OUT) (OUT) The value of the destination field
specified with FieldName
Return Value True: Execution completed without errors.
False: An error occurred during execution.

Example:
bRet = ImportObj.SetDestValue("Surname", strVal1)

• Accessing the destination database connection


"ReadOnly Property GetDestConn() As OleDbConnection
It returns the opened connection on the destination database.
Example:
myOleDbConnection = ImportObj.GetDestConn()

• Accessing general information


Property SkipRecord() As Boolean
Indicate whether the record must be imported (default = True) or not (False).
Example:
ImportObj.SkipRecord = True

112 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 113 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE FOR CARDHOLDER DATA IMPORT

Examples of scripts for import operations


This section describes field custom code examples and record custom code
examples.

Field custom code examples


Example 1
This example shows how you can, at runtime, set the e-mail value using a Field
Custom Code on the "EMail" field association.
Source fields "_Name_" and "_Surname_" store respectively name and surname
information. Use the following syntax to create the destination E-mail value:
name.surname@company.com

Function ManageFieldData(ByRef ImportObj As


ManageFieldDataParameter, ByRef OutVal As Object) As Int32


' --- Add custom code here ---
' variables declaretion
Dim bRet As Boolean = True
Dim oValName As Object = Nothing
Dim oValSurname As Object = Nothing

' read value of source field "_Name_"


bRet = ImportObj.GetSourceValue("_Name_", oValName)
If Not (bRet) Then
Return (RET_ERROR) ' in case of error return RET_ERROR code
End If

' read value of source field "_Surname_"


bRet = ImportObj.GetSourceValue("_Surname_", oValSurname)
If Not (bRet) Then
Return (RET_ERROR) ' in case of error return RET_ERROR code
End If

' check if name and surname are valid


If (oValName Is System.DBNull.Value) OrElse (oValSurname Is
System.DBNull.Value) Then
Return (RET_ERROR)
End If

' set the output value for destination field "Email"


OutVal = oValName.ToString & "." & oValSurname.ToString &

113
TemaImpExpPdf.book Page 114 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

"@company.com"

Example 2
This example shows how to get the source database connection.

Function ManageFieldData(ByRef ImportObj As


ManageFieldDataParameter, ByRef OutVal As Object) As Int32

' --- Add custom code here ---
' get the destination connection
Dim oDestOleDbConnection As OleDbConnection = Nothing
oDestOleDbConnection = ImportObj.GetDestConn()

Record custom code examples


Example 1
This example shows how to, at runtime, set the e-mail value using a Record
Custom Code.
Suppose that destination fields "Name" and "Surname" are already set with the
field mapping and the company information is stored in the source field "_
Company_". Use the following syntax to create the destination Email value is:
name.surname@company.com

Function ManageRecordData(ByRef ImportObj As


ManageRecordDataParameter) As Int32

' --- Add custom code here ---
' variables declaretion
Dim bRet As Boolean = True
Dim oValName As String = Nothing
Dim oValSurname As String = Nothing
Dim oValCompany As String = Nothing
Dim oValEmail As String = Nothing

' read value of destination field "Name"


bRet = ImportObj.GetDestValue("Name", oValName)
If Not (bRet) Then
Return (RET_ERROR) ' in case of error return RET_ERROR code
End If

' read value of destination field "Surname"


bRet = ImportObj.GetDestValue("Surname", oValSurname)

114 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 115 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE FOR CARDHOLDER DATA IMPORT

If Not (bRet) Then


Return (RET_ERROR) ' in case of error return RET_ERROR code
End If

' read value of source field "_Company_"


bRet = ImportObj.GetSourceValue("_Company_", oValCompany)
If Not (bRet) Then
Return (RET_ERROR) ' in case of error return RET_ERROR code
End If

' create the EMail


oValEmail = oValName & "." & oValSurname & "@" & oValCompany &
".com"
' set the output value for destination field "Email"
bRet= ImportObj.SetDestValue("EMail", oValEmail)
If Not (bRet) Then
Return (RET_ERROR) ' in case of error return RET_ERROR code
End If

Example 2
This example shows how to get the source database connection.

Function ManageRecordData(ByRef ImportObj As


ManageRecordDataParameter) As Int32

' --- Add custom code here ---
' get the destination connection
Dim oDestOleDbConnection As OleDbConnection = Nothing
oDestOleDbConnection = ImportObj.GetDestConn()

115
TemaImpExpPdf.book Page 116 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Scripting reference for Flexible Cardholder and Temaline


Data Export
This section provides reference information for the VB Script Language, as well as
some examples of scripts that are commonly used for the data export operations.

To learn about Go to
Accessing and managing source and destination fields page 117
Coercing variables to a particular data type page 118
Managing strings page 119
Managing dates page 120
IF statement page 124
SELECT CASE statement page 125

See Also:
• “Creating and using custom code (Vb.Net scripts)” on page 97

116 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 117 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE FOR FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Accessing and managing source and destination fields

Purpose Code
Reading a value Object from the source Dim obj As Object
record FlexRecordSet.clsFlexRecordSet obj = SourceRecord.Field("FIELD_
SourceRecord NAME")
or
obj = SourceRecord.Field(FIELD_
INDEX)
Setting a value Object into a destination Dim obj As Object
record FlexRecordSet.clsFlexRecordSet OutRecord.Field("FIELD_NAME") =
OutRecord obj
or
OutRecord.Field(FIELD_INDEX) =
obj

117
TemaImpExpPdf.book Page 118 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Functions for coercing the obj variable


The table below lists the functions that allow coercing the obj variable which is
read from SourceRecord into a particular data type, for example, recovering a
source value and forcing it to be a date type record. For some of these functions,
further information is provided later in this appendix.

Function
Boolean Dim bln As Boolean
bln = cBool(obj)
Char Dim c as Char
c = CChar(obj)
Byte Dim bt As Byte
bt = CByte(obj)
Date Dim dt As DateTime
dt = CDate(obj)
Integer Dim i As Integer
i = CInt(obj)
Double Dim db As Double
db = CDbl(obj)
String Dim str As String
str = CStr(obj)

118 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 119 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE FOR FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Managing strings
Dim str As String
This function allows recovering the source value and forcing it to be a string type
record.
The table below lists the statements to be used for strings management:

Purpose Code
Comparing two specified Strings if(str = "ABD") then
endif
Determining whether the start/end of this instance if(str.StartsWith("ABC"))
matches the specified String then
endif
if(str.EndsWith("ABC"))
then
endif
Getting the character at a specified character position Dim c As Char
in this instance c= str.Chars(i)
Retrieves a substring from this instance from a Dim subStr as string
specified position for n chars subStr = str.SubString(i,
n)
Concatenating one or more Strings str = "ABC" & "DEF"
Inserting a specified instance of String at a specified str.Insert(i, "ABC")
index position in this instance
Deleting a specified number of characters from this str.Remove(i, n)
instance beginning at a specified position
Removing all blanks for a set of specified characters str.TrimStart()
from the beginning and end of this instance str.TrimEnd()
str.Trim()
Converting a String in lowercase or uppercase str.Tolower()
str.ToUpper()
Getting the number of characters in this instance Dim i As Integer
i = str.Length()
Padding on the right/left with spaces or a specified str.PadRight(n, c)
Unicode character, for a specified total length. str.PadLeft(n, c)

119
TemaImpExpPdf.book Page 120 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Managing dates
Dim dt As DateTime
This function allows retrieving the source value and coercing it to be a date type
record.
The table below lists the statements for dates management:
Purpose Code
Getting a date that is the current local date and dt = dt.Now
time on this computer
Converting the value of this instance to its str = dt.ToLongDateString()
equivalent long/short date string representation str = dt.ToShortDateString()
Converting the value of this instance to its str = dt.ToLongTimeString()
equivalent long/short time string representation str = dt.ToShortTimeString()
Converting the value of this instance to its str = dt.ToString
equivalent string representation
Getting the day/month/year/hour/minute/second/ Dim i As Integer
millisecond component of the date represented by i = dt.Day
this instance. i = dt.Month
i = dt.Year
i = dt.Hour
i = dt.Minute
i = dt.Second
i = dt.Millisecond
Adding the specified number of day/month/year/ Dim i As Integer
hour/minute/second/ millisecond to the value of dt = dt.addDays(i)
this instance dt = dt.addMonths(i)
dt = dt.addYears(i)
dt = dt.addHours(i)
dt = dt.addMinutes(i)
dt = dt.addSeconds(i)
dt = dt.addMilliseconds(i)

120 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 121 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE FOR FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Purpose Code
Returning a Long value specifying the number of Dim l As Long
time intervals between two Date values. Date1 is Dim dt1 As DateTime
subtracted from the value of Date2 to produce the Dim dt2 As DateTime
difference
l = DateDiff(DateInterval,
dt1, dt2)
possible DateInterval values:
• DateInterval.Day
• DateInterval.DayOfYear
• DateInterval.Hour
• DateInterval.Minute
• DateInterval.Month
• DateInterval.Quarter
• DateInterval.Second
• DateInterval.Weekday
• DateInterval.WeekOfYear
• DateInterval.Year
Converting the value of this instance to its Dim str As String
equivalent string representation using the specified str = dt.ToString("dd\/MM\/
format yyyy hh\:mm\:ss") formats
data in "dd/MM/yyyy
hh:mm:ss" format

The following lists the patterns that can be combined to construct custom
patterns. The patterns are case-sensitive; for example, “MM” is recognized, but
“mm” is not. If the custom pattern contains white-space characters or characters
enclosed in single quotation marks, the output string will also contain those
characters. Characters not defined as part of a format pattern or as format
characters are reproduced literally.

Format pattern description

Format Description and results


d The day of the month. Single-digit days will not have a leading
zero.
dd The day of the month. Single-digit days will have a leading zero.
ddd The abbreviated name of the day of the week, as defined in
AbbreviatedDayNames.
dddd The full name of the day of the week, as defined in DayNames.
M The numeric month. Single-digit months will not have a leading
zero.

121
TemaImpExpPdf.book Page 122 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Format Description and results


MM The numeric month. Single-digit months will have a leading zero.
MMM The abbreviated name of the month, as defined in
AbbreviatedMonthNames.
MMMM The full name of the month, as defined in MonthNames.
y The year without the century. If the year without the century is
less than 10, the year is displayed with not leading zero.
yy The year without the century. If the year without the century is
less than 10, the year is displayed with leading zero.
yyyy The year in four digits, including the century.
gg The period or era. This pattern is ignored if the date to be
formatted does not have an associated period or era string.
h The hour in a 12-hour clock. Single-digit hours will not have a
leading zero.
hh The hour in a 12-hour clock. Single-digit hours will have a
leading zero.
H The hour in a 24-hour clock. Single-digit hours will not have a
leading zero.
HH The hour in a 24-hour clock. Single-digit hours will have a
leading zero.
m The minutes. Single-digit minutes will not have a leading zero.
mm The minutes. Single-digit minutes will have a leading zero.
s The second. Single-digit seconds will not have a leading zero.
ss The second. Single-digit seconds will have a leading zero
f The fraction of a second in single-digit precision. The remaining
digits are truncated.
ff The fraction of a second in double-digit precision. The remaining
digits are truncated.
fff The fraction of a second in three-digit precision. The remaining
digits are truncated.
ffff The fraction of a second in four-digit precision. The remaining
digits are truncated.
fffff The fraction of a second in five-digit precision. The remaining
digits are truncated.
ffffff The fraction of a second in six-digit precision. The remaining
digits are truncated.
fffffff The fraction of a second in seven-digit precision. The remaining
digits are truncated.
t The first character in the AM/PM designator defined in
AMDesignator or PMDesignator, if any.

122 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 123 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE FOR FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Format Description and results


tt The AM/PM designator defined in AMDesignator or
PMDesignator, if any.
z The time zone offset (+ or - followed by the hour only). Single-
digit hours will not have a leading zero. For example, Pacific
Standard Time is -8.
zz The time zone offset (+ or - followed by the hour only). Single-
digit hours will have a leading zero. For example, Pacific
Standard Time is -08.
zzz The time zone offset (+ or - followed by the hour and minutes).
Single-digit hours and minutes will have a leading zeros. For
example, Pacific Standard Time is -08:00.
: The default time separator defined in TimeSeparator.
/ The default date separator defined in DateSeparator.
%c Where c is a format pattern if used alone. The % character can be
omitted if the format pattern is combined with literal characters of
other format patterns.
\c Where c is any character. Displays the character literally. To
display the backslash character, use \\.

123
TemaImpExpPdf.book Page 124 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

IF statement

Syntax Example
If condition [ Then ] Dim Number, Digits As Integer
[ statements ] Dim MyString As String
[ ElseIf elseifcondition Number = 53 ' Initialize variable
[ Then ] If Number < 10 Then
[ elseifstatements ] ] Digits = 1
[ Else ElseIf Number < 100 Then
[ elsestatements ] ] ' Condition evaluates to True so the next
End If statement is executed.
Digits = 2
Else
Digits = 3
End If

124 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 125 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE FOR FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

SELECT CASE statement

Syntax Example
Select [ Case ] Dim Number As Integer = 8
testexpression Select Number ' Evaluate Number.
[ Case expressionlist Case 1 To 5 ' Number between 1 and 5,
[ statements ] ] inclusive.
[ Case Else Debug.WriteLine("Between 1 and 5")
[ elsestatements ] ' The following is the only Case clause
] that evaluates to True.
End Select Case 6, 7, 8 ' Number between 6 and
8.
Debug.WriteLine("Between 6 and 8")
Case 9 To 10 ' Number is 9 or 10.
Debug.WriteLine("Greater than 8")
Case Else ' Other values.
Debug.WriteLine("Not between 1 and
10")
End Select

125
TemaImpExpPdf.book Page 126 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Examples of scripts for export operations


Below are some examples of some common procedures during exportation of
records. You can copy and paste the example code provided in this guide into
your own scripts.

Script See
Date/Time conversion page 126
Concatenating two or more source fields page 127
Filling in a destination field depending on the value in a source page 127
field
Indicating the position of a field page 128

Date and time conversion

Scenario
The contents of the source field TRANSIT_TIME (which contains both the date
and time of the transit), must be exported into the destination file in two separate
fields: one date field in "YYYYmmdd" format and one time field in
"hh:mm:ss.tt" format, where tt indicates AM/PM.

Solution
After declaring the date type variable, we will use the CDate function to access
the source field and force the date type. Then, we will use the dt.ToString
function to convert this value into a string of the desired format, within the two
destination fields.

Script
'Add here any extra code
Dim date As String
Dim time As String
Dim dt As DateTime
'Compute the date and time format
dt = CDate (SourceRecord.Field("TRANSIT_TIME"))
date = dt.tostring("YYYYmmdd")
time = dt.tostring("hh:mm:ss.tt")
OutRecord.Field("DATE") = date
OutRecord.Field("TIME") = time

126 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 127 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE FOR FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

Concatenating two or more source fields

Scenario
In the source file, the subject’s name ("NAME") and surname ("SURNAME") are
contained in two separate fields. We want to export them into the destination file,
in one single field, called "NAME".

Solution
We will use the str variable to concatenate the two source records and export
them together into the destination field.

Script
'Add here any extra code

Dim str As String


Dim name As String
Dim surname As String

name = SourceRecord.Field("NAME")
surname = SourceRecord.Field("SURNAME")
str = name & " " & surname
OutRecord.Field("NAME") = str

Filling in a destination field depending on the value in a source field

Scenario
Depending on the value contained in the source field SBI_TYPE (type of
cardholder), we want to export the corresponding string representation. As an
example, in our case, when the value of SBI_TYPE = 1, we want to insert
"Employee" into the destination field.

Solution
The value to be found in the source field can be found by using the Select Case
construct; the value must then be exported as a string into the CONSTANT fields
of the destination file.

Script
'Add here any extra code

Dim s As String

s = SourceRecord.Field("SBI_TYPE")

Select case s
case "1"

127
TemaImpExpPdf.book Page 128 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

OutRecord.Field("CONSTANT_1") = "Employee"
case "2"
OutRecord.Field("CONSTANT_2") = "Visitor"
case "3"
OutRecord.Field("CONSTANT_3") = "Vehicle"
case "4"
OutRecord.Field("CONSTANT_4") = "External Regular"
case "7"
OutRecord.Field("CONSTANT_5") = "Asset"
End Select

Indicating the position of a field

Scenario
We want to export the same field various times into a given destination text or
XML file. The position of the field needs to be indicated in the script.
The list of fields in the export specification is as follows:

Name of field to be exported Position


ADL_KEY 0i
DESCRIPTION 1
ADL_ID 2
AGGREGATION_1 3
ADL_ID 4
AGGREGATION_2 5
ADL_ID 6

i The position of the fields in the list always start from 0.

Solution
Access is made to successive occurrences of the field by using the index rather
than the name. The index refers to the position within the list of fields to be
exported into the destination file, in accordance with how this was set in the
export specification.

Script
'Add here any extra code

'To access the first occurrence of field ADL_ID (in position 2


of the list) you can use the name:
OutRecord.Field("ADL_ID") = 1

'or the index:

128 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 129 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE FOR FLEXIBLE CARDHOLDER AND TEMALINE DATA EXPORT

'OutRecord.Field(2) = 1

'To access the other occurrences of the field ADL_ID (in


positions 4 and 6 in the list) you must use the index:
OutRecord.Field(4) = 10
OutRecord.Field(6) = 100

129
TemaImpExpPdf.book Page 130 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Scripting reference information for Cardholder LDAP


Import
This section provides technical reference information on developing code
procedures for customizing the mapping between CMS fields and LDAP
attributes.

To learn about Go to
Reference information for the scripting language page 131
Examples of scripts for LDAP import operations page 137
Return values page 140
Declarations page 141
Custom control reference assembly page 147
TemaLDAPSynchroBaseObj object page 148
Accessing the CMS database page 151
Accessing the LDAP repository page 153

See also:
• “Using code procedures” on page 54

130 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 131 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE INFORMATION FOR CARDHOLDER LDAP IMPORT

Reference information for the scripting language

Field custom code


Field custom code can be used to check, validate and change the destination field
value at the field level management. It could be useful to manage data
transformations from LDAP data format to EBI data format. It is run after the
mapped source value is copied into the destination value.
Function ManageFieldData(ByRef LdapImportObj As
ManageFieldDataParameter, ByRef OutVal As Object) As Int32

Function Description
LdapImportObj (IN) The object used to access the source LDAP entry
attributes value and the destination database
connection. The parameter type is
ManageFieldDataParameter.
OutVal (OUT) The resulting value of the custom code
execution--this is the new destination field value. By
default this value is set with the original source value.
Return Value Indicates the state of the field custom code execution;
acceptable values are defined in module
DHNetLDAPImportInterfaces.RET_VALUES.

Record custom code


Record custom code enables you to check, and if necessary to change, values set
after the field association management and before the data writing in destination
database. You can work on each of the mapped destination fields and also create
objects to access the Ldap server. It is exposed a property to skip the import of the
current record.
Function ManageRecordData(ByRef LdapImportObj As
ManageRecordDataParameter) As Int32

ImportObj (IN/OUT) Object used to access source Ldap


entry attribute values and destination field
values. You can also get the destination database
connection and set the property indicating if the
import of the current record must be skipped.
The parameter type is
ManageRecordDataParameter.
Return Value Indicates the state of the record custom code
execution; acceptable values are defined in
module DHNetImportInterfaces.RET_VALUES

131
TemaImpExpPdf.book Page 132 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Custom code return values


The custom code return values set the state of the custom code execution. They
are defined in module RET_VALUES exposed from the
DHNetLDAPImportInterfaces interface.
The only two possible values are:
• RET_OK: custom code successfully executed.
• RET_ERROR: an error occurred during custom code execution.

Custom code reference assembly


Custom code includes the following reference assemblies.
• Standard .Net namespaces
- Imports System
- Imports System.Data
- Imports System.Windows.Forms
- Imports Microsoft.VisualBasic
- Imports System.Data.OleDb
• Namespace that defines the return values
Imports DHNetLDAPImportInterfaces

• Namespace that allows the access to Ldap repository


Imports DHNetLDAPObject

Standard .Net namespaces


See Microsoft MSDN Library - .NET reference.

The ManageFieldDataParameter class


This class is used in record custom code to allow the following operations.
• Accessing source attribute values
"Function GetSourceValue(ByVal AttributeName As String, ByRef
AttributeValue As Object) As Boolean
It returns the source field values by field name.

132 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 133 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE INFORMATION FOR CARDHOLDER LDAP IMPORT

Field name Description


AttributeName (IN) The name of the source attribute
AttributeValue (OUT) The value of the source attribute specified with
AttributeName. In the event of multiple values, the first
attribute value is returned.
Return Value True: Execution completed without errors.
False: An error occurred during execution.

Example:
bRet = LdapImportObj.GetSourceValue("SourceValue1", strVal1)

Function GetSourceValue (ByVal AttributeName As String, ByVal


AttributeIndex As Int32, ByRef AttributeValue As Object) As
Boolean
It returns the source field values by field name and value index.

Field name Description


AttributeName (IN) The name of the source attribute
AttributeIndex (IN) The index of the value in a multiple-value collection
AttributeValue (OUT) The value of the source attribute specified with
AttributeName and AttributeIndex.
Return Value True: Execution completed without errors.
False: An error occurred during execution.

Example:
bRet = LdapImportObj.GetSourceValue("SourceValue1", 2, strVal1)

ReadOnly Property GetSourceDN() As String


It returns the DN (Distinguished Name - a unique attribute) of the current
source entry.

Field name Description


Return Value True: Execution completed without errors.
False: An error occurred during execution.

Example:
bRet = LdapImportObj.GetSourceDN()

133
TemaImpExpPdf.book Page 134 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

• Accessing the destination database connection


ReadOnly Property GetDestConn() As OleDbConnection
It returns the opened connection on the destination database.
Example:
myOleDbConnection = ImportObj.GetDestConn()

The ManageRecordDataParameter class


• Accessing source attribute values
Function GetSourceValue(ByVal AttributeName As String, ByRef
AttributeValue As Object) As Boolean
It returns the source field values by field name.

Field name Description


AttributeName (IN) The name of the source attribute
AttributeValue (OUT) The value of the source attribute specified with
AttributeName. In the event of multiple values, the first
attribute value is returned.
Return Value True: Execution completed without errors.
False: An error occurred during execution.

Example:
bRet = LdapImportObj.GetSourceValue("SourceValue1", strVal1)

Function GetSourceValue (ByVal AttributeName As String, ByVal


AttributeIndex As Int32, ByRef AttributeValue As Object) As
Boolean
It returns the source field values by field name and value index.

134 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 135 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE INFORMATION FOR CARDHOLDER LDAP IMPORT

Field name Description


AttributeName (IN) The name of the source attribute
AttributeIndex (IN) The index of the value in a multiple-value collection
AttributeValue (OUT) The value of the source attribute specified with
AttributeName and AttributeIndex.
Return Value True: Execution completed without errors.
False: An error occurred during execution.

Example:
bRet = LdapImportObj.GetSourceValue("SourceValue1", 2, strVal1)

ReadOnly Property GetSourceDN() As String


It returns the DN (Distinguished Name - a unique attribute) of the current
source entry.

Field name Description


Return Value True: Execution completed without errors.
False: An error occurred during execution.

Example:
bRet = LdapImportObj.GetSourceDN()

• Accessing destination field values


Function GetDestValue (ByVal FieldName As String, ByRef
FieldValue As Object) As Boolean
It returns the destination field values by field name.

Field name Description


FieldName (IN) The name of the destination field
FieldValue (OUT) (OUT) The value of the source field specified with
FieldName
Return Value True: Execution completed without errors.
False: An error occurred during execution.

Example:
bRet = LdapImportObj.GetDestValue("Surname", strVal1)

135
TemaImpExpPdf.book Page 136 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Function SetDestValue (ByVal FieldName As String, ByRef


FieldValue As Object) As Boolean
It sets the destination field values by field name.

Field name Description


FieldName (IN) The name of the destination field
FieldValue (OUT) The value of the destination field specified with
FieldName
Return Value True: Execution completed without errors.
False: An error occurred during execution.

Example:
bRet = LdapImportObj.SetDestValue("Surname", strVal1)

• Accessing the destination database connection


ReadOnly Property GetDestConn() As OleDbConnection
It returns the opened connection on the destination database.
Example:
myOleDbConnection = LdapImportObj.GetDestConn()

• Accessing general information


Property SkipRecord() As Boolean
Indicates if the record must be imported (default = True) or not (False).
Example:
LdapImportObj.SkipRecord = True

136 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 137 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE INFORMATION FOR CARDHOLDER LDAP IMPORT

Examples of scripts for LDAP import operations


This section describes field custom code examples and record custom code
examples for LDAP import operations.

Field custom code examples


Example 1
This example shows how you can, at runtime, set the e-mail value using a Field
Custom Code on the "EMail" association. Source entry attributes "_Name_" and
"_Surname_" store respectively name and surname information. Use the
following syntax to create the destination E-mail value:
name.surname@company.com

Function ManageFieldData (ByRef LdapImportObj As


ManageFieldDataParameter, ByRef OutVal As Object) As Int32

' --- Add custom code here ---
' variables declaretion
Dim bRet As Boolean = True
Dim oValName As Object = Nothing
Dim oValSurname As Object = Nothing

' read value of source attribute "_Name_"


bRet = LdapImportObj.GetSourceValue("_Name_", oValName)
If Not (bRet) Then
Return (RET_ERROR) ' in case of error return RET_ERROR code
End If

' read value of source attribute "_Surname_"


bRet = LdapImportObj.GetSourceValue("_Surname_", 0, oValSurname)
If Not (bRet) Then
Return (RET_ERROR) ' in case of error return RET_ERROR code
End If

' check if name and surname are valid


If (oValName Is System.DBNull.Value) OrElse (oValSurname Is
System.DBNull.Value) Then
Return (RET_ERROR)
End If

' set the output value for destination field "Email"


OutVal = oValName.ToString & "." & oValSurname.ToString &
"@company.com"

137
TemaImpExpPdf.book Page 138 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Example 2
This example shows how you can get the source database connection.
Function ManageFieldData(ByRef LdapImportObj As
ManageFieldDataParameter, ByRef OutVal As Object) As Int32

' --- Add custom code here ---
' get the destination connection
Dim oDestOleDbConnection As OleDbConnection = Nothing
oDestOleDbConnection = LdapImportObj.GetDestConn()

Record custom code examples


Example 1
This example shows how you can, at runtime, set the e-mail value using a Record
Custom Code.
Suppose that destination fields "Name" and "Surname" are already set with the
field mapping and in the source entry the attribute "_Company_" is stored with
the company information. Use the following syntax to create the destination
Email value:
name.surname@company.com

Function ManageRecordData(ByRef LdapImportObj As


ManageRecordDataParameter) As Int32

' --- Add custom code here ---
' variables declaretion
Dim bRet As Boolean = True
Dim oValName As String = Nothing
Dim oValSurname As String = Nothing
Dim oValCompany As String = Nothing
Dim oValEmail As String = Nothing

' read value of destination field "Name"


bRet = LdapImportObj.GetDestValue("Name", oValName)
If Not (bRet) Then
Return (RET_ERROR) ' in case of error return RET_ERROR code
End If

' read value of destination field "Surname"


bRet = LdapImportObj.GetDestValue("Surname", oValSurname)
If Not (bRet) Then

138 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 139 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE INFORMATION FOR CARDHOLDER LDAP IMPORT

Return (RET_ERROR) ' in case of error return RET_ERROR code


End If

' read value of source entry attribute "_Company_"


bRet = LdapImportObj.GetSourceValue("_Company_", oValCompany)
If Not (bRet) Then
Return (RET_ERROR) ' in case of error return RET_ERROR code
End If

' create the EMail


oValEmail = oValName & "." & oValSurname & "@" & oValCompany &
"com"

' set the output value for destination field "Email"


bRet= LdapImportObj.SetDestValue("EMail", oValEmail)
If Not (bRet) Then
Return (RET_ERROR) ' in case of error return RET_ERROR code
End If

Example 2
This example shows how to get the source database connection.
Function ManageRecordData(ByRef LdapImportObj As
ManageRecordDataParameter) As Int32

' --- Add custom code here ---
' get the destination connection
Dim oDestOleDbConnection As OleDbConnection = Nothing
oDestOleDbConnection = LdapImportObj.GetDestConn()

139
TemaImpExpPdf.book Page 140 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Return values
For each code procedure, set variable bRet to False (bRet = False) in case of
error or to abort the synchronization of the current cardholder. If execution is
successful, set bRet to True (bRet= True).

140 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 141 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE INFORMATION FOR CARDHOLDER LDAP IMPORT

Declarations
In this section you will find reference information on the following custom codes:

Custom code
“Field mapping from LDAP to EBI” on page 141
“Field mapping from EBI to LDAP” on page 141
“Record writing” on page 142
“Saving a new record (HMI)” on page 142
“Saving an existing record (HMI)” on page 142
“Record delete (HMI)” on page 143
“Batch record line-up” on page 144
“Record batch import” on page 145
“Target operation types” on page 145

Field mapping from LDAP to EBI


This custom code transforms data from the LDAP format to the EBI format. It is
run on each field-attribute association driven by management types B, C (not
owner), and D (not owner).
Function ManageFieldData_LDAP_EBI(ByVal InLdapValue As Object,
ByRef OutEbiValue As Object) As Boolean

InLdapValue (IN) The LDAP attribute value as it is read from


LDAP.
OutEbiValue (OUT) The result of the transformation from Ldap
format to EBI format.

Field mapping from EBI to LDAP


This custom code transforms data from the EBI format to the LDAP format. It is
run on each field-attribute association driven by management types C (owner)
and D (owner).
Function ManageFieldData_EBI_LDAP(ByVal InEbiValue As Object,
ByRef OutLdapValue As Object) As Boolean

InEbiValue (IN) The EBI field value read from DB


OutLdapValue (OUT) The result of the transformation from EBI
format to LDAP format

141
TemaImpExpPdf.book Page 142 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Record writing
This custom code enables you to check, and if necessary to change, data after the
synchronization process and before the data is written in the LDAP repository and
the CMS DB.
Function ManageRecordData(ByRef SynchObj As Object) As Boolean

SynchObj (IN/OUT) Object used to access data of current LDAP


entry and CMS CH. The SynchObj object stores the
LDAP attribute values and Tema field values as
results of the synchronization process.
Its object type is TemaLDAPSynchroBaseObj.

Saving a new record (HMI)


This code is applied only on Save operations from the HMI in New state. It
carries out extra controls to validate and eventually modify data inserted by the
user and also to specify which is the target operation on return.
This custom code is executed after the standard HMI controls (data validation)
and before the synchronization process (data alignment).
Function ManageDataOnNew(ByRef SynchObj As Object, ByRef
NextStep As Int16) As Boolean

SynchObj (IN/OUT) Stores the current CMS CH data filled in


the HMI at the moment of save operation. If the
external key field is set, the SynchObj also stores the
information about the related LDAP entry read from
the repository.
Its object type is TemaLDAPSynchroBaseObj.
NextStep (OUT) Indicates the step to execute at the function
return. Target operations allowed are:
STEP_SKIP_WITH_NO_ERROR
STEP_INS_TEMA_UPD_LDAP_LINK
STEP_INS_TEMA_NO_LINK
STEP_SKIP_WITH_ERROR
For more information on Target operation, see Target
operation types.

Saving an existing record (HMI)


This code is applied only on Save operation from the HMI in Open state. It carries
out extra controls to validate and eventually modify data inserted by the user and
also to specify which is the target operation on return.

142 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 143 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE INFORMATION FOR CARDHOLDER LDAP IMPORT

This custom code is executed after the standard HMI controls (data validation)
and before the synchronization process (data alignment).
Function ManageDataOnOpen(ByRef SynchObj As Object, ByRef
NextStep As Int16) As Boolean

SynchObj (IN/OUT) Stores the current CMS CH data filled in


the HMI at the moment of save operation. If the
external key field is set, the SynchObj also stores the
information about the related LDAP entry read from
the repository. Its object type is
TemaLDAPSynchroBaseObj.
NextStep (OUT) Indicates the step to execute at the function
return. Target operations allowed are:
STEP_SKIP_WITH_NO_ERROR
STEP_UPD_TEMA_UPD_LDAP_LINK
STEP_UPD_TEMA_NO_LINK
STEP_UPD_TEMA_EXTERNAL_NO_LINK
STEP_UPD_TEMA_UPD_LDAP_NO_LINK
STEP_SKIP_WITH_ERROR
For more information on Target operation see Target
operation types.

Record delete (HMI)


This code is applied only on Delete operation from the HMI in Open state. It is
mainly used to reset the LDAP attributes of the entry linked to the CH you are
deleting. This custom code is executed after the standard HMI controls (data
validation) and before the CH deleting.
It enables you to set the target operation to execute on return.
Function ManageDataOnDelete(ByRef SynchObj As Object, ByRef
NextStep As Int16) As Boolean

SynchObj (IN/OUT) Stores the current CMS CH data read from


DB at the moment of delete operation requested from
the ?? in the HMI. If the external key field is set, the
SynchObj stores the information about the related
LDAP entry read from the repository. Its object type
is TemaLDAPSynchroBaseObj.

143
TemaImpExpPdf.book Page 144 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

NextStep (OUT) Indicates the step to execute at the function


return. Target operations allowed are:
STEP_SKIP_WITH_NO_ERROR
STEP_SKIP_WITH_ERROR
STEP_CONTINUE_DEFAULT
For more information on Target operation see Target
operation types.

Batch record line-up


Batch Line Up code is called during the batch synchronization process to validate
the operation (update or delete) and to set the target operation on return.
The Batch Line Up process manages two types of operation—Delete and Update.
It can take decisions in both scenarios. The operation type is defined by the
standard checks and it is passed to the function as a parameter.
Function ManageBatchLineUpData(ByRef SynchObj As Object, ByVal
OperationType As Int16, ByRef NextStep As Int16) As Boolean

SynchObj (IN/OUT) Stores the current CMS CH data read from


DB. If the external key field is set, the SynchObj also
stores the information about the related LDAP entry
read from the repository. Its object type is
TemaLDAPSynchroBaseObj.
Operation Type (IN) Indicates the operation type: Update or Delete.
NextStep (OUT) Indicates the step to execute at the function
return. Target operations allowed are:
STEP_SKIP_WITH_NO_ERROR
STEP_SKIP_WITH_ERROR
STEP_CONTINUE_DEFAULT
For more information on Target operation see Target
operation types.

Inside the ManageBatchLineUpData code there are two sections. One is reserved
for the controls on Update operation; the other is reserved for the controls on the
Delete operation.

If(OperationType = OPR_UPDATE) Then
' --- UPDATE ---
ElseIf(OperationType = OPR_DELETE) Then
' --- DELETE ---
End If

144 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 145 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE INFORMATION FOR CARDHOLDER LDAP IMPORT

Record batch import


Batch Import code is called during the batch synchronization process to validate
the operation (insert or update) and to set the target operation on return.
The Batch Import process manages two types of operation—Insert and Update. It
can take decisions in both scenarios. The operation type is defined by the standard
checks and is passed to the function as a parameter (OperationType).
Function ManageBatchImportData(ByRef SynchObj As Object, ByVal
OperationType As Int16, ByRef NextStep As Int16) As Boolean

SynchObj (IN/OUT) Stores the current CMS CH data read from


DB. If the external key field is set, the SynchObj also
stores the information about the related LDAP entry
read from the repository. Its object type is
TemaLDAPSynchroBaseObj.
Operation Type (IN) Indicates the operation type: Update or Delete.
NextStep (OUT) Indicates the step to execute at the function
return. Target operations allowed are:
STEP_SKIP_WITH_NO_ERROR
STEP_SKIP_WITH_ERROR
STEP_CONTINUE_DEFAULT
For more information on Target operation see Target
operation types.

Inside the ManageBatchImportData code there are two sections. One is reserved
for the controls on Insert operation, the other is reserved for the controls on
Update operation.

If(OperationType = OPR_INSERT) Then
' --- UPDATE ---
ElseIf(OperationType = OPR_UPDATE) Then
' --- DELETE ---
End If

Target operation types


Some custom codes (HMI code on New, HMI code on Open, HMI code on
Delete, Batch Line Up code, Batch Import code) can return the step has to be
executed after their termination. The following table explains target operation
types.

Target Operation Meaning


STEP_SKIP_WITH_NO_ Forces to skip the current cardholder synchronization
ERROR without sending an error.

145
TemaImpExpPdf.book Page 146 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Target Operation Meaning


STEP_SKIP_WITH_ERROR Forces the end of the current cardholder
synchronization with error.
STEP_CONTINUE_DEFAULT Used when the user doesn't want to change the default
target operation.
STEP_INS_TEMA_UPD_ Executes the insert of a New cardholder in CMS DB
LDAP_LINK with link in LDAP.
STEP_INS_TEMA_NO_LINK Enables you to insert a New cardholder without link
in LDAP.
STEP_UPD_TEMA_UPD_ Updates a cardholder in the CMS DB with a link in
LDAP_LINK LDAP.
STEP_UPD_TEMA_NO_LINK Updates a cardholder in the CMS DB without a link in
the LDAP repository.
STEP_UPD_TEMA_ Executes the update of a cardholder in the CMS DB
EXTERNAL_NO_LINK when the current cardholder External Source is set but
not to LDAP.
STEP_UPD_TEMA_UPD_ Removes the logic link between the CMS cardholder
LDAP_NO_LINK and the LDAP entry.

146 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 147 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE INFORMATION FOR CARDHOLDER LDAP IMPORT

Custom controls reference assembly


Custom controls include these reference assemblies so that you can manage
standard objects, access to Tema DB, and access to the LDAP repository:

Standard .Net namespaces


Imports System
Imports System.Data
Imports System.Windows.Forms
Imports Microsoft.VisualBasic

Namespaces that allow access to the Tema DB


Imports DHNETDB
Imports DHNETObjectDB

Namespaces that allow access to the LDAP repository


Imports DHNetLDAPInterfaces
Imports DHNetTemaLDAPSynchronizer
Imports DHNetTemaLDAP
Imports DHNetTemaLDAP.NEXT_STEP
Imports DHNetTemaLDAP.OPERATION_TYPE

147
TemaImpExpPdf.book Page 148 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

The TemaLDAPSynchroBaseObj object


Class TemaLDAPSynchroBaseObj stores the cardholder data and the LDAP entry
linked to the cardholder.
If the cardholder has the external key valorized, the corresponding LDAP entry is
loaded.
If the external key is not set or if the entry identified by the external key is not
found in Ldap, the entry is not loaded and the method GetLdapDN returns an
empty string.
When the entry is loaded into MySynchObj, only the mapped attributes in the
synchronize specification are loaded from the Ldap server.
TemaLDAPSynchroBaseObj enables you to access, in read and write, the
cardholder and LDAP entry value. All the modifications applied to the
TemaLDAPSynchroBaseObj from the custom Vb.Net are stored in memory and
are fixed only after the execution of the custom control.
In the following examples, assume that MySynchObj object is of
TemaLDAPSynchroBaseObj type.

Accessing Tema cardholder field values

Public Function Description Example


GetTemaValue(ByVal TemaFieldName Get Tema CH field iRet =
As String, value by field name. mySynchObj.GetTemaValue("
ByRef TemaFieldValue As Object) EXTERNAL_KEY", StrVal1)
As Int32
SetTemaValue(ByVal TemaFieldName Set Tema CH field iRet =
As String, value by field name. mySynchObj.SetTemaValue("
ByVal TemaFieldValue As Object) EXTERNAL_KEY", StrVal1)
As Int32

148 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 149 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE INFORMATION FOR CARDHOLDER LDAP IMPORT

Accessing the current LDAP entry

Public Function Description Example


GetLdapValue(ByVal Attr As GetLdap attribute iRet = mySynchObj.
String, value from loaded entry GetLdapValue
ByRef AttrValue As Object) by attribute name. Only the ("sn", StrVal1)
As Int32 attributes mapped in the
synchronization specification
are searchable.
SetLdapValue(ByVal Attr As Set Ldap attribute value to loaded iRet = mySynchObj.
String, entry by attribute name. Only the SetLdapValue
ByVal AttrValue As Object) attributes mapped in the ("sn", StrVal1)
As Int32 synchronization specification could
be set.
GetLdapEntryByExternalKey(By Load Ldap entry in memory by iRet = mySynchObj.
Val ExternlKey. GetLdapEntryByExternal
ExternalKey As String) Key(StrExternalKey)
As Int32
AddLdapValue(ByVal Attr As Add new value to Ldap multivalue iRet = mySynchObj.
String, ByVal AttrValue As attribute. AddLdapValue
Object) As Int32 ("MultiVAlueAttr1",
StrVal1)
RemoveLdapValue(ByVal Attr Remove value from ldap iRet = mySynchObj.
As String, ByRef AttrValue multivalue attribute. RemoveLdapValue
As Object) As Int32 ("MultiVAlueAttr1",
StrVal1)
AddObjectClassValue(ByVal Add new ObjectClass to the Ldap iRet = mySynchObj.
AttrValue As String) As entry loaded in memory. AddObjectClassValue
Int32 ("ObjClass1")
RemoveObjectClassValue(ByVal Remove an ObjectClass from the iRet = mySynchObj.
AttrValue As String) As Ldap entry loaded in memory. RemoveObjectClass
Int32 Value("ObjClass1")
GetLdapDN() As String Get the DN of the entry loaded in EntryDN = mySynchObj.
memory. GetLdapDN
If EntryDN = ““ the entry
is not loaded.

149
TemaImpExpPdf.book Page 150 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Accessing general information

Public ReadOnly Property Description Example


CurrEbiName() As String Get the current Ebi Name CurrEbi =
(SY_REGISTRY_SERVER mySynchObj.CurrEbiName
("Record Owner
Identifier") value).
CurrSpecId() As String Get the running SpecId =
synchronization mySynchObj.CurrSpecId
specification ID.

150 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 151 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE INFORMATION FOR CARDHOLDER LDAP IMPORT

Accessing the CMS database


You can access CMS DB using the object exposed by the namespaces
DHNETDB.

The DHNETDB.TemaTable public class methods

Public Function Description Example


Connect() As Boolean Open connection to Tema iRet =
database. oTemaTable.Connect()
Disconnect() As Boolean Close connection to Tema iRet =
database. oTemaTable.Disconnect()
GetConnectionstate() As Return the Connection dim CntState As
ConnectionState State. ConnectionState =
oTemaTable.GetConnectionS
tate
ExecSelect(ByVal sqlStr As String) Execute a select statement. Dim oDT as DataTable =
As DataTable ExecSelect (selectSqlStr)
ExecSelectScalar(ByVal sqlStr As Execute a select scalar Dim oRet as Object =
String) As Object statement. ExecSelectScalar(selectSq
lStr)
ExecCommand(ByVal sqlStr As Execute a SQL command bRet =
String, Optional ByVal (insert, update, delete). mpTemaTable.ExecCommand(s
useTransaction As Boolean = False) trSqlCommand, False)
As Boolean
ExecGetSchema(ByVal TableName As Return a DataTable that Dim oDT as DataTable =
String) As DataTable stores data about the ExecSelect (strTableName)
schema of the Tema Db
table.

EXAMPLE: Read data from table TABLENAME.


Dim oDataTable As DataTable
Dim oTemaTable As DHNetDB.TemaTable
' --- create the DHNetDB.TemaTable object ---
oTemaTable = New DHNetDB.TemaTable
Try

' --- connect the DHNetDB.TemaTable object ---
oTemaTable.Connect()
' --- Execute search ---
oDataTable = oTemaTable.ExecSelect("SELECT * FROM TABLENAME")
' --- read data from oDataTable ---

Catch ex As Exception

151
TemaImpExpPdf.book Page 152 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

' --- exception management ---


Finally
If Not (oTemaTable Is Nothing) Then
oTemaTable.Disconnect()
End If
oTemaTable = Nothing
End Try

152 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 153 Wednesday, April 14, 2010 10:09 AM

SCRIPTING REFERENCE INFORMATION FOR CARDHOLDER LDAP IMPORT

Accessing the LDAP repository


You can make searches in LDAP using the objects exposed by the
DHNetTemaLDAP namespace.

The DHNetTemaLDAP public class methods


Public Sub New(ByVal IDSpecification As Int32)
Class constructor

Public Overridable Function Connect(ByRef SetOptionErrorMask As


Int32, ByRef ConnectNativeError As Int32, Optional ByVal
ForceSimpleInit As Boolean = False) As Int32
Open the connection to the LDAP server using the information set
in the synchronization specification in use (defined in New
method).

Public Function Bind(Optional ByVal ForceSimpleBind As Boolean =


False) As Int32
Bind the LDAP server using the credential set in the
synchronization specification in use (defined in New method).

Public Function Unbind() As Int32


Unbind the LDAP server.

Public Function SearchAll(ByRef ErrorResult As Int32, ByVal Base


As String, ByVal Scope As Int32, ByVal Filter As String,
ByVal Attributes As String, ByVal AttrsOnly As Int32, ByVal
TimeOut As Int32, ByVal SizeLimit As Int32) As
TemaLDAPSearchResultsColl
Execute a search in LDAP specifying base of search (Base), scope
of search (Scope), filter (Filter), attribute list to return
(Attributes) and others search parameters.

Public Function SearchAll(ByRef ErrorResult As Int32, ByVal


Filter As String, ByVal Attributes As String) As
TemaLDAPSearchResultsColl
Execute a search in LDAP specifying filter (Filter) and
attribute list to return (Attributes).

Public Function SearchAll(ByRef ErrorResult As Int32, ByVal


Attributes As String ) As TemaLDAPSearchResultsColl
Execute a search in LDAP specifying the attribute list to return
(Attributes).

EXAMPLE: Search for attributes ATTR2 and ATTR3 using filter built on ATTR1. The
credential used is that set in the synchronization specification with id SpecId.
' --- objects declaration ---
Dim ObjSearcher As DHNetTemaLDAP.TemaLDAPSearcher = Nothing

153
TemaImpExpPdf.book Page 154 Wednesday, April 14, 2010 10:09 AM

5 – SCRIPTING AND CODE PROCEDURE REFERENCE

Dim ObjSearchResultColl As
DHNetTemaLDAP.TemaLDAPSearchResultsColl = Nothing
Try

' --- make filter and attribute list to search for ---
StrFilter = "ATTR1 =" & StrVal
StrAttribute = "ATTR2,ATTR3"
' --- searcher object creation ---
ObjSearcher = New DHNetTemaLDAP.TemaLDAPSearcher(SpecId)
' --- connection to ldap ---
iRet = ObjSearcher.Connect(Err1, Err2, True)
iRet = ObjSearcher.Bind(True)
' --- perform serach ---
ObjSearchResultColl = ObjSearcher.SearchAll(Err1, StrFilter,
StrAttribute)
' --- check serach result ---
If (Err1 = 0) And (Err2 = 0) And (Not (ObjSearchResultColl Is
Nothing)) Then

' --- count search result ---
IntVal = ObjSearchResultColl.CountResult
If (IntVal = 1) Then

' --- get search result ---
LdapExternaKey =
ObjSearchResultColl.GetSearchResult(0).GetAttribute("ATTR2").
GetValue(0)

End if

End if

Catch ex As System.Exception

Finally

' --- free search result ---
If Not (ObjSearcher Is Nothing) Then
ObjSearcher.Unbind()
ObjSearcher.Dispose()
ObjSearcher = Nothing
End If
ObjSearchResultColl = Nothing

End Try

154 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 155 Wednesday, April 14, 2010 10:09 AM

Database reference
6
This chapter describes field names and descriptions for the major cardholders.

To learn about Go to
Card object fields page 156
CH Employee object fields page 159
CH External Regular object fields page 163
Reason objects fields page 167
Enquiry data objects fields page 168

155
TemaImpExpPdf.book Page 156 Wednesday, April 14, 2010 10:09 AM

6 – DATABASE REFERENCE

CARD objects

Import field name Table Table field Data type Key


AcsBarCode Card AcsBarCode String
AcsMagStripe Card AcsMagStripe String
AffiliationCode Card AffiliationCode Numeric
AllowAccessOnLossOfComs Card AllowAccessOnLossO Bit
fComs
LocationTagName Card LocationTagName String
AttAbsReasonGrpg Card AttAbsReasonGrpg String
BackCardLayout Card BackCardLayout String
BuildingEntryExit Card BuildingEntryExit Bit
CardNumber Card CardNumber String
CardType Card CardType List
CardClassA Card CardClassA Bit
CardClassB Card CardClassB Bit
CardCommencementDateTime Card CommencementDateT Date Time
ime
CardExpiryDateTime Card ExpiryDateTime DateTime
CardStateID Card StateID List
Category Card Category List
ClassHCounter Card ClassHCounter Numeric
ClearCode Card ClearCode String X
CostOverride Card CostOverride Bit
CountryGrouping Card CountryGrouping String
DateIssued Card DateIssued Date Time
Edition Card Edition Numeric
EsGrpgWorkSched Card EsGrpgWorkSched String
EscortCapable Card EscortCapable Bit
EscortRequired Card EscortRequired Bit
EventLockoutOverride Card EventLockoutOverride Bit
ExtWagetypeGrpg Card ExtWagetypeGrpg String
FacilityCode Card FacilityCode Numeric
FrontCardLayout Card FrontCardLayout String

156 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 157 Wednesday, April 14, 2010 10:09 AM

CARD OBJECTS

Import field name Table Table field Data type Key


FS90CardCategoryID Card FS90CardCategoryID Numeric
Langulso Card Langulso String
LastPrinted Card LastPrinted Date Time
LayoutID Card LayoutID Numeric X
LongAccess Card LongAccess Bit
MailIndicator Card MailIndicator String
MsgID Card MsgID Numeric
NumTimesPrinted Card NumTimesPrinted Numeric
OcCtuDisable Card OnCtuDisable Bit
ParkingEntryExit Card ParkingEntryExit Bit
PINCode Card PINCode Numeric
Privileged Card Privileged Bit
PsGrpgAttAbsType Card PsGrpgAttAbsType String
SecondaryExpiryDate Card SecondaryExpiryDate Date Time
SEIssueCode Card SEIssueCode Numeric
SgrGroupID Card SgrGroupID Numeric
ShortDescription Card ShortDescription String
SoonToExpire Card SoonToExpire Bit
SourceSys Card SourceSys Numeric
TimeEventTypeGroup Card TimeEventTypeGroup String
TypeMsg Card TypeMsg Numeric
UsesBeforeExpiry Card UsesBeforeExpiry Numeric
AllowedTransit hsc_tb_cardSite
ApbDisable hsc_tb_cardSite ApbDlsable Bit
Canbe2Transit hsc_tb_cardSite Canbe2Transit Bit
CardNumberEnable hsc_tb_cardSite CardNumberEnable Bit
Enable2Transit hsc_tb_cardSite Enable2Transit Bit
CardSiteExpiryDateTime hsc_tb_cardSite ExpiryDateTime Date Time
PathDisable hsc_tb_cardSite PathDisable Bit
Site hsc_tb_cardSite Site Numeric X
CardSiteCommencementDateTime hsc_tb_cardSite CommencementDateT Date Time
ime
TimePresenceDisable hsc_tb_cardSite TimePresenceDisable Bit
UserPresenceDisable hsc_tb_cardSite UserPresenceDisable Bit

157
TemaImpExpPdf.book Page 158 Wednesday, April 14, 2010 10:09 AM

6 – DATABASE REFERENCE

Import field name Table Table field Data type Key


CompanyExternalKey OrganizationMod ExternalKey String
el

158 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 159 Wednesday, April 14, 2010 10:09 AM

CH EMPLOYEE OBJECTS

CH EMPLOYEE objects

Import field name Table Table field Data type Key


AlarmInstructPage Employee AlarmInstructPage String
AlarmPriority Employee AlarmPriority List
AlarmSubPriority Employee AlarmSubPriority List
LocationTagName Employee LocationTagName String
Card LocationTagName
AssociatedPage Employee AssociatedPage String
CardTrace Employee CardTrace Bit
CHCommencementDateTime Employee CommencementDateT DateTime
ime
CHExpiryDateTime Employee ExpiryDateTime DateTime
CHImage Employee CHImage String
ChromakeyLevel Employee ChromakeyLevel Numeric
CHSignature Employee CHSignature String
CHStateID Employee StateID List
DefBackCardLayout Employee DefBackCardLayout String
DefFrontCardLayout Employee DefFrontCardLayout String
PreferredName Employee PreferredName String
Name Employee Name String
Surname Employee Surname String
AdsiAccount Employee AdsiAccount String
Building Employee Building String
Category Employee Category List
Card Category
Class1 Employee Class1 List
Class2 Employee Class2 List
Class3 Employee Class3 List
Class4 Employee Class4 List
Class5 Employee Class5 List
Class6 Employee Class6 List
Class7 Employee Class7 List
Class8 Employee ListClass8 List

159
TemaImpExpPdf.book Page 160 Wednesday, April 14, 2010 10:09 AM

6 – DATABASE REFERENCE

Import field name Table Table field Data type Key


Class9 Employee ListClass9 List
Class10 Employee ListClass10 List
Email Employee Email String
ExternalKey Employee ExternalKey String X
Floor Employee Floor String
Identifier Employee Identifier String
Office Employee Office String
Parameter1 Employee Parameter1 String
Parameter2 Employee Parameter2 String
Parameter3 Employee Parameter3 String
Parameter4 Employee Parameter4 String
Parameter5 Employee Parameter5 String
RecOwner Employee RecOwner String
Room Employee Room String
Telephone Employee Telephone String
Telephone2 Employee Telephone2 String
VehicleID Employee VehicleID Numeric
Visitable Employee Visitable Bit
WebOperator Employee WebOperator String
WebWorkstation Employee WebWorkstation String
BirthDate Employee BirthDate DateTime
AlternateIdentifier Employee AlternateIdentifier String
Site SbiSiteBehavior Site Numeric X
BehaviorID SbiSiteBehavior Behavior Numeric
AltBehaviorID SbiSiteBehavior Behavior Numeric
SiteAltCommencementDateTime SbiSiteBehavior StartValidity DateTime
SiteAltExpiryDateTime SbiSiteBehavior End Validity DateTime
AcsBarCode Card AcsBarCode String
AcsMagStripe Card AcsMagStripe String
AffiliationCode Card AffiliationCode Numeric
AllowAccessOnLossOfComs Card AllowAccessOnLossO Bit
fComs
AttAbsReasonGrpg Card AttAbsReasonGrpg String
BackCardLayout Card BackCardLayout String

160 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 161 Wednesday, April 14, 2010 10:09 AM

CH EMPLOYEE OBJECTS

Import field name Table Table field Data type Key


BuildingEntryExit Card BuildingEntryExit Bit
CardNumber Card CardNumber String
CardType Card CardType List
CardClassA Card CardClassA Bit
CardClassB Card CardClassB Bit
CardCommencementDateTime Card CommencementDateT DateTime
ime
CardExpiryDateTime Card ExpiryDateTime DateTime
CardStateID Card StateID List
ClassHCounter Card ClassHCounter Numeric
ClearCode Card ClearCode String X
CostOverride Card CostOverride Bit
CountryGrouping Card CountryGrouping String
DateIssued Card DateIssued DateTime
Edition Card Edition Numeric
EsGrpgWorkSched Card EsGrpgWorkSched String
EscortCapable Card EscortCapable Bit
EscortRequired Card EscortRequired Bit
EventLockoutOverride Card EventLockoutOverride Bit
ExtWagetypeGrpg Card ExtWagetypeGrpg String
FacilityCode Card FacilityCode Numeric
FrontCardLayout Card FrontCardLayout String
FS90CardCategoryID Card FS90CardCategoryID Numeric
Langulso Card Langulso String
LastPrinted Card LastPrinted DateTime
LayoutID Card LayoutID Numeric X
LongAccess Card LongAccess Bit
MailIndicator Card MailIndicator String
MsgID Card MsgID Numeric
NumTimesPrinted Card NumTimesPrinted Numeric
OnCtuDisable Card OnCtuDisable Bit
ParkingEntryExit Card ParkingEntryExit Bit
PINCode Card PINCode Numeric
Privileged Card Privileged Bit

161
TemaImpExpPdf.book Page 162 Wednesday, April 14, 2010 10:09 AM

6 – DATABASE REFERENCE

Import field name Table Table field Data type Key


PsGrpgAttAbsType Card PsGrpgAttAbsType String
SecondaryExpiryDate Card SecondaryExpiryDate DateTime
SEIssueCode Card SEIssueCode Numeric
SgrGroupID Card SgrGroupID Numeric
ShortDescription Card ShortDescription String
SoonToExpire Card SoonToExpire Bit
SourceSys Card SourceSys Numeric
TimeEventTypeGroup Card TimeEventTypeGroup String
TypeMsg Card TypeMsg Numeric
AllowedTransit hsc_tb_cardSite AllowedTransit Numeric
ApbDisable hsc_tb_cardSite ApbDlsable Bit
Canbe2Transit hsc_tb_cardSite Canbe2Transit Bit
CardNumberEnable hsc_tb_cardSite CardNumberEnable Bit
Enable2Transit hsc_tb_cardSite Enable2Transit Bit
CardSiteExpiryDateTime hsc_tb_cardSite ExpiryDateTime DateTime
PathDisable hsc_tb_cardSite PathDisable Bit
CardSiteCommencementDateTime hsc_tb_cardSite CommencementDateT DateTime
ime
TimePresenceDisable hsc_tb_cardSite TimePresenceDisable Bit
UserPresenceDisable hsc_tb_cardSite UserPresenceDisable Bit
ServerRecordNumber CHAccessLevels ServerRecordNumber Numeric
CompanyExternalKey OrganizationMod ExternalKey String
el

162 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 163 Wednesday, April 14, 2010 10:09 AM

CH EXTERNAL REGULAR OBJECTS

CH EXTERNAL REGULAR objects

Import field name Table Table field Data type Key


AlarmInstructPage ExternalRegular AlarmInstructPage String
AlarmPriority ExternalRegular AlarmPriority List
AlarmSubPriority ExternalRegular AlarmSubPriority List
AssociatedPage ExternalRegular AssociatedPage String
CardTrace ExternalRegular CardTrace Bit
CHCommencementDateTime ExternalRegular CommencementDateT DateTime
ime
CHExpiryDateTime ExternalRegular ExpiryDateTime DateTime
CHImage ExternalRegular CHImage String
ChromakeyLevel ExternalRegular ChromakeyLevel Numeric
CHSignature ExternalRegular CHSignature String
CHStateID ExternalRegular StateID List
DefBackCardLayout ExternalRegular DefBackCardLayout String
DefFrontCardLayout ExternalRegular DefFrontCardLayout String
PreferredName ExternalRegular PreferredName String
UsesBeforeExpiry ExternalRegular UsesBeforeExpiry Numeric
Name ExternalRegular Name String
Surname ExternalRegular Surname String
AdsiAccount ExternalRegular AdsiAccount String
Building ExternalRegular Building String
Category ExternalRegular Category List
Card Category
Class1 ExternalRegular Class1 List
Class2 ExternalRegular Class2 List
Class3 ExternalRegular Class3 List
Class4 ExternalRegular Class4 List
Class5 ExternalRegular Class5 List
Class6 ExternalRegular Class6 List
Class7 ExternalRegular Class7 List
Class8 ExternalRegular Class8 List
Class9 ExternalRegular Class9 List

163
TemaImpExpPdf.book Page 164 Wednesday, April 14, 2010 10:09 AM

6 – DATABASE REFERENCE

Import field name Table Table field Data type Key


Class10 ExternalRegular Class10 List
Email ExternalRegular Email String
ExternalKey ExternalRegular ExternalKey String X
Floor ExternalRegular Floor String
Identifier ExternalRegular Identifier String
Office ExternalRegular Office String
Parameter1 ExternalRegular Parameter1 String
Parameter2 ExternalRegular Parameter2 String
Parameter3 ExternalRegular Parameter3 String
Parameter4 ExternalRegular Parameter4 String
Parameter5 ExternalRegular Parameter5 String
RecOwner ExternalRegular RecOwner String
Room ExternalRegular Room String
Telephone ExternalRegular Temephone String
Telephone2 ExternalRegular Telephone2 String
VehicleID ExternalRegular VehicleID Numeric
Visitable ExternalRegular Visitable Bit
WebOperator ExternalRegular WebOperator String
WebWorkstation ExternalRegular WebWorkstation String
BirthDate ExternalRegular BirthDate DateTime
AlternateIdentifier ExternalRegular AlternateIdentifier String
Site SbiSiteBehavior Site Numeric X
BehaviorID SbiSiteBehavior Behavior Numeric
AltBehaviorID SbiSiteAltBehavi Behavior Numeric
or
SiteAltCommencementDateTime SbiSiteBehavior StartValidity DateTime
SiteAltExpiryDateTime SbiSiteBehavior End Validity DateTime
AcsBarCode Card AcsBarCode String
AcsMagStripe Card AcsMagStripe String
AffiliationCode Card AffiliationCode Numeric
AllowAccessOnLossOfComs Card AllowAccessOnLossO Bit
fComs
AttAbsReasonGrpg Card AttAbsReasonGrpg String
BackCardLayout Card BackCardLayout String
BuildingEntryExit Card BuildingEntryExit Bit

164 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 165 Wednesday, April 14, 2010 10:09 AM

CH EXTERNAL REGULAR OBJECTS

Import field name Table Table field Data type Key


CardNumber Card CardNumber String
CardType Card CardType List
CardClassA Card CardClassA Bit
CardClassB Card CardClassB Bit
CardCommencementDateTime Card CommencementDateT DateTime
ime
CardExpiryDateTime Card ExpiryDateTime DateTime
CardStateID Card StateID List
ClassHCounter Card ClassHCounter Numeric
ClearCode Card ClearCode String X
CostOverride Card CostOverride Bit
CountryGrouping Card CountryGrouping String
DateIssued Card DateIssued DateTime
Edition Card Edition Numeric
EsGrpgWorkSched Card EsGrpgWorkSched String
EscortCapable Card EscortCapable Bit
EscortRequired Card EscortRequired Bit
EventLockoutOverride Card EventLockoutOverride Bit
ExtWagetypeGrpg Card ExtWagetypeGrpg String
FacilityCode Card FacilityCode Numeric
FrontCardLayout Card FrontCardLayout String
FS90CardCategoryID Card FS90CardCategoryID Numeric
Langulso Card Langulso String
LastPrinted Card LastPrinted DateTime
LayoutID Card LayoutID Numeric X
LongAccess Card LongAccess Bit
MailIndicator Card MailIndicator String
MsgID Card MsgID Numeric
NumTimesPrinted Card NumTimesPrinted Numeric
OnCtuDisable Card OnCtuDisable Bit
ParkingEntryExit Card ParkingEntryExit Bit
PINCode Card PINCode Numeric
Privileged Card Privileged Bit
PsGrpgAttAbsType Card PsGrpgAttAbsType String

165
TemaImpExpPdf.book Page 166 Wednesday, April 14, 2010 10:09 AM

6 – DATABASE REFERENCE

Import field name Table Table field Data type Key


SecondaryExpiryDate Card SecondaryExpiryDate DateTime
SEIssueCode Card SEIssueCode Numeric
SgrGroupID Card SgrGroupID Numeric
ShortDescription Card ShortDescription String
SoonToExpire Card SoonToExpire Bit
SourceSys Card SourceSys Numeric
TimeEventTypeGroup Card TimeEventTypeGroup String
TypeMsg Card TypeMsg Numeric
AllowedTransit hsc_tb_CardSite AllowedTransit Numeric
ApbDisable hsc_tb_CardSite ApbDlsable Bit
Canbe2Transit hsc_tb_CardSite Canbe2Transit Bit
CardNumberEnable hsc_tb_CardSite CardNumberEnable Bit
Enable2Transit hsc_tb_CardSite Enable2Transit Bit
CardSiteExpiryDateTime hsc_tb_CardSite ExpiryDateTime DateTime
PathDisable hsc_tb_CardSite PathDisable Bit
CardSiteCommencementDateTime hsc_tb_CardSite CommencementDateT DateTime
ime
TimePresenceDisable hsc_tb_CardSite TimePresenceDisable Bit
UserPresenceDisable hsc_tb_CardSite UserPresenceDisable Bit
ServerRecordNumber CHAccessLevels ServerRecordNumber Numeric
ExternalCompany ExternalCompan ExternalKey String
y
LocationTagName External LocationTagName String
Company
Card
CompanyExternalKey OrganizationMod ExternalKey String
el

166 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 167 Wednesday, April 14, 2010 10:09 AM

REASON OBJECTS

REASON objects

Import field name Table Table field Data type Key


PERIPHERAL_ KEY AC_REASON PERIPHERAL_KEY String
DESCRIPTION AC_REASON DESCRIPTION String
REASON_CODE AC_REASON REASON_CODE String
PERIPHERAL_ DESCRIPTION AC_REASON PERIPHERAL_ String
DESCRIPTION
DFW_REASON AC_REASON DFW_REASON Numeric
IDX_DYN_REASON AC_REASON IDX_DYN_REASON Numeric
FEEDBACK AC_REASON FEEDBACK Numeric
START_VALIDITY AC_REASON START_VALIDITY Date Time
STOP_VALIDITY AC_REASON STOP_VALIDITY Date Time
REASON_UNLOCK AC_REASON REASON_UNLOCK Numeric
REASON_TYPE AC_REASON REASON_TYPE Numeric
ADL_KEY AC_REASON ADL_KEY String
ATT_ABS_REASON_GRPG AC_REASON ATT_ABS_REASON_ String
GRPG
PS_GRPG_ATT_ABS_TYPE AC_REASON PS_GRPG_ATT_ String
ABS_TYPE
ES_GRPG_WORK_SCHED AC_REASON ES_GRPG_WORK_ String
SCHED
EXT_WAGETYPE_GRPG AC_REASON EXT_WAGETYPE_ String
GRPG
COUNTRY_GROUPING AC_REASON COUNTRY_ String
GROUPING
WAGETYPE_UNIT_ISO AC_REASON WAGETYPE_UNIT_ String
ISO
EXTERNAL_KEY AC_REASON EXTERNAL_KEY String X
ENABLE_TIME AC_REASON ENABLE_TIME Numeric
LocationTagName AC_REASON LocationTagName String
CompanyExternalKey OrganizationMod ExternalKey String
el

167
TemaImpExpPdf.book Page 168 Wednesday, April 14, 2010 10:09 AM

6 – DATABASE REFERENCE

ENQUIRY DATA objects

Import field name Table Table field Data type Key


ENQUIRY_ KEY AC_ENQUIRY_ ENQUIRY_KEY String X
DATA
FIELD1 AC_ENQUIRY_ FIELD1 Numeric
DATA
FIELD2 AC_ENQUIRY_ FIELD2 String
DATA
FIELD3 AC_ENQUIRY_ FIELD3 String
DATA
FIELD4 AC_ENQUIRY_ FIELD4 String
DATA
FIELD5 AC_ENQUIRY_ FIELD5 String
DATA
FIELD6 AC_ENQUIRY_ FIELD6 String
DATA
FIELD7 AC_ENQUIRY_ FIELD7 String
DATA
FIELD8 AC_ENQUIRY_ FIELD8 String
DATA
FIELD9 AC_ENQUIRY_ FIELD9 String
DATA
FIELD10 AC_ENQUIRY_ FIELD10 String
DATA
Identifier Employee Identifier String X

168 www.honeywell.com/buildingsolutions

Potrebbero piacerti anche