Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Release 410
TemaImpExpPdf.book Page 2 Wednesday, April 14, 2010 10:09 AM
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.
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
5
TemaImpExpPdf.book Page 6 Wednesday, April 14, 2010 10:09 AM
CONTENTS
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
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
10 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 11 Wednesday, April 14, 2010 10:09 AM
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
The table below summarizes the function of each menu. The right-hand
column provides a link to the relevant topic in the guide.
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
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.
13
TemaImpExpPdf.book Page 14 Wednesday, April 14, 2010 10:09 AM
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.
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
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
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
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.
17
TemaImpExpPdf.book Page 18 Wednesday, April 14, 2010 10:09 AM
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.
18 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 19 Wednesday, April 14, 2010 10:09 AM
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:
19
TemaImpExpPdf.book Page 20 Wednesday, April 14, 2010 10:09 AM
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
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
Item Value
1 Band 1
2 Band 2
3 Band 3
4 Band 4
5 Band 5
22 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 23 Wednesday, April 14, 2010 10:09 AM
• the User field UF50 is a list that includes the employees' bands to be used into
the plant.
• UF50 description: Employee band
• 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
23
TemaImpExpPdf.book Page 24 Wednesday, April 14, 2010 10:09 AM
• 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
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
25
TemaImpExpPdf.book Page 26 Wednesday, April 14, 2010 10:09 AM
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.
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.
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
27
TemaImpExpPdf.book Page 28 Wednesday, April 14, 2010 10:09 AM
Note:
For further information on the available options, please refer to section
“Configuring the import settings” on page 13.
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
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.
29
TemaImpExpPdf.book Page 30 Wednesday, April 14, 2010 10:09 AM
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
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).
See Also:
• “Scripting reference for Cardholder Data Import” on page 108
31
TemaImpExpPdf.book Page 32 Wednesday, April 14, 2010 10:09 AM
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
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.
32 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 33 Wednesday, April 14, 2010 10:09 AM
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.
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
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.
35
TemaImpExpPdf.book Page 36 Wednesday, April 14, 2010 10:09 AM
36 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 37 Wednesday, April 14, 2010 10:09 AM
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
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
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.
39
TemaImpExpPdf.book Page 40 Wednesday, April 14, 2010 10:09 AM
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
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
42 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 43 Wednesday, April 14, 2010 10:09 AM
See Also:
• “Using the LDAP Configuration Tool” on page 44
43
TemaImpExpPdf.book Page 44 Wednesday, April 14, 2010 10:09 AM
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
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.
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
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.
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
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
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.
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
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
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.
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
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:
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
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
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
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.
54 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 55 Wednesday, April 14, 2010 10:09 AM
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
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.
56 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 57 Wednesday, April 14, 2010 10:09 AM
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.
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
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
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.
59
TemaImpExpPdf.book Page 60 Wednesday, April 14, 2010 10:09 AM
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
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.
61
TemaImpExpPdf.book Page 62 Wednesday, April 14, 2010 10:09 AM
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
Attention:
The configuration of these parameters must be coordinated with the customer’s IT LDAP
expert.
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
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.
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
66 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 67 Wednesday, April 14, 2010 10:09 AM
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
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
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
70 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 71 Wednesday, April 14, 2010 10:09 AM
71
TemaImpExpPdf.book Page 72 Wednesday, April 14, 2010 10:09 AM
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
73
TemaImpExpPdf.book Page 74 Wednesday, April 14, 2010 10:09 AM
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
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
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
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
78 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 79 Wednesday, April 14, 2010 10:09 AM
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
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
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
See also:
• “Using a Microsoft Excel (.xls) source file” on page 88
82 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 83 Wednesday, April 14, 2010 10:09 AM
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
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
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
86 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 87 Wednesday, April 14, 2010 10:09 AM
87
TemaImpExpPdf.book Page 88 Wednesday, April 14, 2010 10:09 AM
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
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
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
90 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 91 Wednesday, April 14, 2010 10:09 AM
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
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
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
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
95
TemaImpExpPdf.book Page 96 Wednesday, April 14, 2010 10:09 AM
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
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.
97
TemaImpExpPdf.book Page 98 Wednesday, April 14, 2010 10:09 AM
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
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.
99
TemaImpExpPdf.book Page 100 Wednesday, April 14, 2010 10:09 AM
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
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
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
102 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 103 Wednesday, April 14, 2010 10:09 AM
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
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
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
106 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 107 Wednesday, April 14, 2010 10:09 AM
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
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
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.
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
110 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 111 Wednesday, April 14, 2010 10:09 AM
Example:
bRet = ImportObj.GetSourceValue("SourceValue1", strVal1)
Example:
bRet = ImportObj.GetSourceValue("SourceValue1", strVal1)
111
TemaImpExpPdf.book Page 112 Wednesday, April 14, 2010 10:09 AM
Example:
bRet = ImportObj.GetDestValue("Surname", strVal1)
Example:
bRet = ImportObj.SetDestValue("Surname", strVal1)
112 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 113 Wednesday, April 14, 2010 10:09 AM
…
' --- Add custom code here ---
' variables declaretion
Dim bRet As Boolean = True
Dim oValName As Object = Nothing
Dim oValSurname As Object = Nothing
113
TemaImpExpPdf.book Page 114 Wednesday, April 14, 2010 10:09 AM
"@company.com"
…
Example 2
This example shows how to get the source database connection.
114 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 115 Wednesday, April 14, 2010 10:09 AM
Example 2
This example shows how to get the source database connection.
115
TemaImpExpPdf.book Page 116 Wednesday, April 14, 2010 10:09 AM
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
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
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
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
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
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.
121
TemaImpExpPdf.book Page 122 Wednesday, April 14, 2010 10:09 AM
122 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 123 Wednesday, April 14, 2010 10:09 AM
123
TemaImpExpPdf.book Page 124 Wednesday, April 14, 2010 10:09 AM
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
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
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
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
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
name = SourceRecord.Field("NAME")
surname = SourceRecord.Field("SURNAME")
str = name & " " & surname
OutRecord.Field("NAME") = str
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
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
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:
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
128 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 129 Wednesday, April 14, 2010 10:09 AM
'OutRecord.Field(2) = 1
129
TemaImpExpPdf.book Page 130 Wednesday, April 14, 2010 10:09 AM
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
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.
131
TemaImpExpPdf.book Page 132 Wednesday, April 14, 2010 10:09 AM
132 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 133 Wednesday, April 14, 2010 10:09 AM
Example:
bRet = LdapImportObj.GetSourceValue("SourceValue1", strVal1)
Example:
bRet = LdapImportObj.GetSourceValue("SourceValue1", 2, strVal1)
Example:
bRet = LdapImportObj.GetSourceDN()
133
TemaImpExpPdf.book Page 134 Wednesday, April 14, 2010 10:09 AM
Example:
bRet = LdapImportObj.GetSourceValue("SourceValue1", strVal1)
134 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 135 Wednesday, April 14, 2010 10:09 AM
Example:
bRet = LdapImportObj.GetSourceValue("SourceValue1", 2, strVal1)
Example:
bRet = LdapImportObj.GetSourceDN()
Example:
bRet = LdapImportObj.GetDestValue("Surname", strVal1)
135
TemaImpExpPdf.book Page 136 Wednesday, April 14, 2010 10:09 AM
Example:
bRet = LdapImportObj.SetDestValue("Surname", strVal1)
136 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 137 Wednesday, April 14, 2010 10:09 AM
137
TemaImpExpPdf.book Page 138 Wednesday, April 14, 2010 10:09 AM
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()
…
138 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 139 Wednesday, April 14, 2010 10:09 AM
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
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
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
141
TemaImpExpPdf.book Page 142 Wednesday, April 14, 2010 10:09 AM
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
142 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 143 Wednesday, April 14, 2010 10:09 AM
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
143
TemaImpExpPdf.book Page 144 Wednesday, April 14, 2010 10:09 AM
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
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
…
145
TemaImpExpPdf.book Page 146 Wednesday, April 14, 2010 10:09 AM
146 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 147 Wednesday, April 14, 2010 10:09 AM
147
TemaImpExpPdf.book Page 148 Wednesday, April 14, 2010 10:09 AM
148 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 149 Wednesday, April 14, 2010 10:09 AM
149
TemaImpExpPdf.book Page 150 Wednesday, April 14, 2010 10:09 AM
150 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 151 Wednesday, April 14, 2010 10:09 AM
Catch ex As Exception
151
TemaImpExpPdf.book Page 152 Wednesday, April 14, 2010 10:09 AM
152 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 153 Wednesday, April 14, 2010 10:09 AM
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
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
156 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 157 Wednesday, April 14, 2010 10:09 AM
CARD OBJECTS
157
TemaImpExpPdf.book Page 158 Wednesday, April 14, 2010 10:09 AM
6 – DATABASE REFERENCE
158 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 159 Wednesday, April 14, 2010 10:09 AM
CH EMPLOYEE OBJECTS
CH EMPLOYEE objects
159
TemaImpExpPdf.book Page 160 Wednesday, April 14, 2010 10:09 AM
6 – DATABASE REFERENCE
160 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 161 Wednesday, April 14, 2010 10:09 AM
CH EMPLOYEE OBJECTS
161
TemaImpExpPdf.book Page 162 Wednesday, April 14, 2010 10:09 AM
6 – DATABASE REFERENCE
162 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 163 Wednesday, April 14, 2010 10:09 AM
163
TemaImpExpPdf.book Page 164 Wednesday, April 14, 2010 10:09 AM
6 – DATABASE REFERENCE
164 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 165 Wednesday, April 14, 2010 10:09 AM
165
TemaImpExpPdf.book Page 166 Wednesday, April 14, 2010 10:09 AM
6 – DATABASE REFERENCE
166 www.honeywell.com/buildingsolutions
TemaImpExpPdf.book Page 167 Wednesday, April 14, 2010 10:09 AM
REASON OBJECTS
REASON objects
167
TemaImpExpPdf.book Page 168 Wednesday, April 14, 2010 10:09 AM
6 – DATABASE REFERENCE
168 www.honeywell.com/buildingsolutions