Documente Academic
Documente Profesional
Documente Cultură
Version 7.1
Document Revision 01 January 2010
Copyright Notice
Notice
This document is a proprietary product of Autonomy and is protected by copyright laws and international treaty. Information in this manual is subject to change without notice and does not represent a commitment on the part of Autonomy. While reasonable efforts have been made to ensure the accuracy of the information contained herein, Autonomy assumes no liability for errors or omissions. No liability is assumed for direct, incidental, or consequential damages resulting from the use of the information contained in this document. The copyrighted software that accompanies this document is licensed to the End User for use only in strict accordance with the End User License Agreement, which the Licensee should read carefully before commencing use of the software. No part of this publication may be reproduced, transmitted, stored in a retrieval system, nor translated into any human or computer language, in any form or by any means, electronic, mechanical, magnetic, optical, chemical, manual or otherwise, without the prior written permission of the copyright owner. This document may use fictitious names for purposes of demonstration; references to actual persons, companies, or organizations is strictly coincidental.
Autonomy Corporation plc Cambridge Business Park Cowley Rd Cambridge CB4 0WZ Tel: +44 (0) 1223 448000 Fax: +44 (0) 1223 448001 Email: autonomy@autonomy.com
Contents
13
Chapter 1:
Introduction
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Required Database Privileges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introductory Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . XML for Defining Structured Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Database for Storing Structured Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mapping the XML Representation to the Database Schema. . . . . . . . . . . . . . . . Deploying XML to the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Architectural Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Use Case Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Migration Notes for DataDeploy 5.6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Migration Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . DataDeploy Administration User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . Invoking DataDeploy Deployments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iwsyncdb.cfg File Deprecated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Discontinued DataDeploy Commands and Scripts . . . . . . . . . . . . . . . . . . . . . . . Running DataDeploy in Threadperbranch Mode . . . . . . . . . . . . . . . . . . . . . . . . OpenDeploy-DataDeploy Synchronized Deployments. . . . . . . . . . . . . . . . . . . . DataDeploy Module Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Required Locations for Deployment Configuration and Schema Files. . . . . . . . Running DAS with DataDeploy 5.6 and OpenDeploy 6.0 on the Same Host . . . New Usage of TuplePreprocessor and ExternalDataSource . . . . . . . . . . . . . . . .
17
17 18 18 19 20 20 21 21 23 24 26 27 27 28 28 29 29 30 30 31 31 32 32
Chapter 2:
Deployment Concepts
Categories of Deployments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Overview of Database Deployment Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Source/Destination Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . User-Defined Database Schemas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33
33 34 35 35 35
3
Contents
Sample Deployment Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Update and Table Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Sources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Organization and Tuples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deployment Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
36 37 38 38 43
Chapter 3:
Configuration Files
Mapping a Database Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Mapping a Database Schema with the Browser-Based User Interface . . . . . . . . Updating an Existing Database Schema File . . . . . . . . . . . . . . . . . . . . . . . . . . . Mapping a Database Schema with iwsyncdb . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating the DataDeploy Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the Browser-Based User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using the iwsyncdb -ddgen Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying Multiple XML-Formatted Files as a List of Filelists. . . . . . . . . . . . . Sample Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TeamSite to Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TeamSite to XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TeamSite Extended Attributes to Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . TeamSite Extended Attributes to XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . TeamSite and TeamSite Extended Attributes to Database . . . . . . . . . . . . . . . . . Formatted XML to Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Formatted XML to Formatted XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . XML to Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . XML to Formatted XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Database to XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying Database Connection Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Database Configuration File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Invoking Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying Metadata to UDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Changing Default Datatype Size on Internal Tables . . . . . . . . . . . . . . . . . . . . . . . . Tablespace Attribute Usage in CREATE TABLE Statements . . . . . . . . . . . . . . . . . Vendor-Specific Configuration File Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Attributes of the database Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Attributes of the column Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
49
49 50 57 58 60 61 65 65 66 66 69 70 72 73 74 75 76 78 80 83 84 84 85 85 87 88 89 91
Chapter 4:
Database Auto-Synchronization
Requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Multiple Instances of OpenDeploy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuration Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing database.xml . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing Deployment Configuration File Templates and drop.cfg . . . . . . . . . . . . Editing iw.cfg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OpenDeploy Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring DAS in the User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying DAS Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
93
94 94 94 96 96 97 98 98 98
Contents
DAS Setup for Template Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 DAS Setup for Metadata Capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Configuring DAS Manually . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Running iwsyncdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 The Event Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 Configuring the Event Subsystem with the Browser-Based User Interface . . . 105 Configuring the Event Subsystem Manually . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Logging Options for Event Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 Generating DAS Reports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Using DAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Table Update Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Specifying How Tables are Updated. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 Table Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Database Object Name Lengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 DAS Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Configuring TeamSite Event Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 Database Virtualization Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 DAS and Metadata Deployment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Enabling DAS Publishing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 DAS Out-of-Sync Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Multibyte Characters in DAS Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 Increasing the Port Range on Linux to Accommodate Database Deployments . . . 123 Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Chapter 5:
DataDeploy Deployments
Standalone Database Deployments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Database Deployment Configuration and Execution . . . . . . . . . . . . . . . . . . . . Specifying an Alternate TeamSite Mount Point . . . . . . . . . . . . . . . . . . . . . . . . Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Target-Side Database Deployments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Synchronized Deployments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Server Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deployment Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
125
126 126 127 128 128 129 130 131 132
Chapter 6:
Advanced Features
Deploying Data as Database Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying Data as Database Triggers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying Data as Database Stored Procedures . . . . . . . . . . . . . . . . . . . . . . . . Filters and Substitutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting Up Filters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting Up Substitutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying Replicants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Replicant Order Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying Comma Separated Lists of Values as Replicants. . . . . . . . . . . . . . . Deploying Multiple Replicants from Multiple Nesting Levels . . . . . . . . . . . . .
137
137 137 139 140 140 147 149 149 150 157
5
Contents
Performance Enhancement for Deploying Heavily Nested DCRs . . . . . . . . . . Enhancing Deployment Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . External Tuple Preprocessor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . External Data Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying URL Content. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Miscellaneous Advanced Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Deploying Custom Data Content Records . . . . . . . . . . . . . . . . . . . . . . . . . . . . Encoding/Encrypting Database Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . Real Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Executing a Stored Procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Executing Stored Procedures with Deployments . . . . . . . . . . . . . . . . . . . . . . . Executing Arbitrary Queries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
157 158 159 166 175 177 177 179 180 180 181 182
Chapter 7:
Troubleshooting
Failure in creating the necessary tables for Microsoft SQL Server databases . Failure of Database deployments to a Sybase database . . . . . . . . . . . . . . . . . . Error in creating the IWDELTRACKER table in a UTF-8 schema . . . . . . . . . Deployment Failure due to Invalid Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . Validation Failure When dbschema.cfg is Manually Modified. . . . . . . . . . . . . Renamed Files Fail to Deploy When UDS Table is Used for Metadata . . . . . .
185
185 186 186 186 187 187
189
189 193 193 193 194 194 194 195 195 195 195 195 196 196 198 198 198 198
199
200 200 201 207 207
Contents
TeamSite Setup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Behavior On Other Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Configuring for Oracle OCI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Windows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Solaris. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Best Practices for Writing SQL Queries for Custom SQL Reports . . . . . . . . . . . . Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
219
219 219 220 221 222 223 223 225 228
231
231 231 232 233
Glossary Index
235 241
Contents
Tables
Table 1 Table 2 Table 3 Table 4 Table 5 Table 6 Table 7 Table 8 Table 9 Table 10 Table 11 Table 12 Table 13 Table 14 Table 15 Table 16 Table 17 Table 18 Table 19 Table 20 Table 21 Table 22 Table 23 Table 24 Table 25 Table 26 Table 27 Table 28 Table 29 Table 30 Table 31 Table 32 Table 33 Table 34 Table 35
Notation Conventions............................................................................................... Metadata Table (md)................................................................................................ Descriptor Table (desc)............................................................................................ Mapping XML-based Attributes to the DB Tables.................................................... Supported Use Cases for Data Deployments .......................................................... Migration Matrix ....................................................................................................... Data Sources ........................................................................................................... Tuple State Causes ................................................................................................. db Attributes............................................................................................................. vendor Attributes...................................................................................................... DAS Configuration Files........................................................................................... TeamSite Events in iw.cfg........................................................................................ Description of TeamSite Events............................................................................... Table Update Example .......................................................................................... Table Update Example (cont.) ............................................................................... Table Update Example (cont.) ............................................................................... Table Update Example (cont.) ............................................................................... Database Object Name Lengths............................................................................ DAS Triggers ......................................................................................................... Global Substitutions ............................................................................................... Non-Replicant Values ............................................................................................ Non-Replicant Values (cont.) ................................................................................. Non-Replicant Values (cont.) ................................................................................. Replicant Values .................................................................................................... SimpleDateFormat ................................................................................................. SimpleDateFormat Using the US Locale ............................................................... Database Tables.................................................................................................... Database Tables (deprecords) .............................................................................. Database Tables (employee)................................................................................. JDBC Date Conversion Functions ......................................................................... Table Headings in the Destination Database......................................................... Wide Table Mapping .............................................................................................. Wide Table Mapping (cont.)................................................................................... UDS ....................................................................................................................... UDS (cont.) ............................................................................................................
14 21 21 22 26 27 38 39 89 90 94 97 97 113 114 114 114 116 117 147 152 153 153 156 196 197 206 206 206 217 221 221 222 222 223
Tables
10
Figures
Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 20 Figure 21
62
Data Deployment Architecture .................................................................................... 25 Wide Tuple.................................................................................................................. 40 Wide Tuple with Similar Locale Keys .......................................................................... 40 Wide Tuple Default Base Table .................................................................................. 41 Narrow Tuples............................................................................................................. 42 Narrow Tuple Default Base Table............................................................................... 42 Generating an Initial Base Table ................................................................................. 43 Generating a Delta Table ............................................................................................ 44 Updating a Base Table ............................................................................................... 45 Sample Table Updates ............................................................................................... 46 Composite Table Views ............................................................................................. 48 Map DCT/DTD to Database Schema Window ............................................................ 51 Database Connection Window (for Oracle) ................................................................ 52 Map Data to a New Database Schema Window......................................................... 53 Mapping a Custom DTD and Specifying the Replicant Instances .............................. 54 Map Data Source to a New Database Schema Panel ................................................ 55 Display of the generated file ....................................................................................... 57 Map Data Source to an Existing Database Schema Panel......................................... 58 Configuration File: Specify Parameters for Data Source Window .............................. 61 Specify Parameters for Data Source Window (cont.) (TeamSite)............................... 62 Specify Parameters for Data Source Window (cont.) (OpenDeploy Server File System)
Figure 22 Create DataDeploy Configuration File: Specify Parameters for Data Source Window
(cont.) Part 262 Figure 23 Enter Destination Attributes Window .......................................................................... 63 Figure 24 Enter Database Connection Data Window (Oracle) ................................................... 63 Figure 25 Sample Generated DataDeploy Configuration File..................................................... 64 Figure 26 DAS............................................................................................................................. 93 Figure 27 DAS: Specify Parameters for DAS Setup Window ..................................................... 99 Figure 28 DAS Setup for Template Types Window .................................................................... 99 Figure 29 DAS Setup for Metadata Capture Window ............................................................... 100 Figure 30 Generation of Data Deployment Configuration Files ................................................ 102 Figure 31 Other DAS Setup Activities ....................................................................................... 103 Figure 32 How the Event Subsystem Works............................................................................. 105 Figure 33 Event Subsystem Configuration: Select Database Window ..................................... 106 Figure 34 Event Subsystem Configuration: Set Up Database Window .................................... 106 Figure 35 Warning Message ..................................................................................................... 107 Figure 36 Event Subsystem Configuration: Create Tables for Event Subsystem Repository WinDatabase Deployment for OpenDeploy Administration Guide
11
Figures
dow
Figure 37 Figure 38 Figure 39 Figure 40 Figure 41 Figure 42 Figure 43 Figure 44 Figure 45 Figure 46
107 Event Server Configuration: Start/Stop the Event Server Window ........................... 107 Using DAS ................................................................................................................ 112 Standalone Database Deployment ........................................................................... 126 Target-Side Database Deployment........................................................................... 129 Synchronized Database Deployment........................................................................ 130 Synchronized Database Fan-out Deployment .......................................................... 131 Sample Configuration File......................................................................................... 190 FormsPublisher Directory Structure .......................................................................... 220 Database Table Relationships Created by Sample dbschema.cfg File .................... 228 Using iwsyncdb to Create DataDeploy Configuration Files with Associated UDS .... 229
12
Intended Audience
Certain database deployment tasks require the licensing of the DataDeploy module. If you are using OpenDeploy in conjunction with TeamSite, you should also know TeamSite functionality and terminology. Many of the operations described in this manual require root or Administrator access to the OpenDeploy server host. If you do not have root or Administrator access to the OpenDeploy server host, consult your system administrator. This manual uses the term Windows to indicate any supported version of the Microsoft Windows operating system, such as Windows NT or Windows 2000. This manual uses the term UNIX to indicate any supported flavor of the UNIX operating system. Windows: Users should be familiar with either IIS or Netscape Web servers, and with basic Windows server operations such as adding users and modifying Access Control Lists (ACLs). UNIX: Users of this manual should be familiar with basic UNIX commands and be able to use an editor such as emacs or vi. It is also helpful to be familiar with regular expression syntax. If you are not familiar with regular expressions, consult a reference manual such as Mastering Regular Expressions by Jeffrey Friedl.
13
Notation Conventions
This manual uses the following notation conventions: Table 1 Bold Notation Conventions
Definition and Usage
Convention
Text that appears in a GUI element such as, a menu item, button, or element of a dialog box, and command names are shown in bold. For example: Click Edit File in the Button Bar. Book titles appear in italics. Terms are italicized the first time they are introduced. Important information may be italicized for emphasis. Commands, command-line output, and file names are in monospace type. For example: The iwextattr command-line tool allows you to set and look up extended attributes on a file. Monospaced italics are used for command-line variables.For example:
iwckrole role user
Italic
Monospace
Monospaced italic
This means that you must replace role and user with your values.
Monospaced bold
Monospaced bold represents information you enter in response to system prompts. The character that appears before a line of user input represents the command prompt, and should not be typed. For example:
iwextattr -s project=proj1 //IWSERVER/default/main/dev/ WORKAREA/andre/products/index.html
Monospaced bold italic text is used to indicate a variable in user input. For example:
iwextattr -s project=projectname workareavpath
means that you must insert the values of projectname and workareavpath when you enter this command.
[] |
Square brackets surrounding a command-line argument mean that the argument is optional. Vertical bars separating command-line arguments mean that only one of the arguments can be used.
14
Notation Conventions
This guide also uses the following conventions: The term Windows indicates any supported version of the Microsoft Windows operating system, such as Windows NT or Windows 2000. Directory paths use UNIX conventions. These conventions mandate using forward slashes (/ ) in path names. (Windows systems use backward slashes.) The Windows convention is used when referring to a Windows-specific directory. For example:
UNIX: docroot/news/front.html Windows: docroot\news\front.html
15
16
Chapter 1
Introduction
XML and relational databases have each become important components of applications that define and store structured content. XML can be used to define the structure of various kinds of content, such as metadata, which describe the characteristics of files or content that is rendered by a web application. Relational databases are typically used to support business critical applications, such as airline reservation systems, customer self-help portals, and online retail catalogs-all of which rely on dynamic content. The challenge that arises is how to reliably and effectively deploy XML-based content to a database. OpenDeploy addresses this challenge by enabling the distribution of structured content to databases that support business applications, personalization servers, enterprise portals and search engines. This is accomplished through the OpenDeploy DAS feature and the DataDeploy add-on module. These capabilities bridge the gap between XML and relational databases by mapping and delivering XML content based on any DTD to any relational schema. The entire process is configurable so that no coding is required.
NOTE
DataDeploy functionality is restricted by specific database imposed limitations. Please contact DB vendor for all such limitations.
Installation
Database Auto-Synchronization (DAS) is an integrated feature of the OpenDeploy base server. DataDeploy is a licensed add-on module to the OpenDeploy base server. Both of these capabilities are described later in this chapter. Refer DataDeploy Module Licensing section in the OpenDeploy Installation Guide for more information.
17
Chapter 1: Introduction
Invocation
DAS is invoked through TeamSite events using the Event Subsystem. See Chapter 4, Database Auto-Synchronization for more information on DAS. Database deployments using the DataDeploy module are performed in the same manner as other OpenDeploy deployments: From the browser-based user interface. From the command line using iwodcmd start. Note that if you are using the -k "key=value" option, use of the parameter iwdd is required to invoke DataDeploy deployment. The parameter iwdd is reserved for performing a deployment of a DataDeploy configuration. As a Web services call using ContentServices for OpenDeploy. Refer to the OpenDeploy Administration Guide for more information on these invocation methods.
18
Usage
Usage
Data deployment supports the following uses: Standalone - XML is flexible enough to define the structure of any content. Using OpenDeploy's data deployment capabilities, user-defined DTDs can be mapped to user-defined database schemas. XML data residing anywhere in the file system can then be deployed to databases. Synchronized deployment - synchronization of file and database assets guarantees the integrity of static and dynamic content. Common examples include: Files with associated metadata for use by a search engine. Online catalog content along with web presentation templates. Documents and personalization data for a portal. JSP code and related data for an application server. OpenDeploy provides cross-platform, transactional transfer of file assets to multiple servers. It can also be configured to deliver database content together with file system assets. If any part of the deployment transaction fails, the database and files are automatically rolled back. TeamSite - content managed within TeamSite may be assigned metadata, also known as extended attributes (EAs). Data deployments can be configured to extract EAs and deploy them to a target database. This allows content creators to synchronize the content in their workareas with the metadata in their development or test database. It is also possible to deploy EAs to production databases, typically at the same time the content they describe is being distributed to production servers. FormsPublisher - content creation often entails filling out template forms with information that is subsequently rendered by an application. For instance, details about a particular product in an online catalog might be entered into a template form and then displayed by an application in a web page. Content that is captured by templates is considered dynamic because it is filled in automatically by the web application at run time. FormsPublisher allows the definition of templates that are displayed to content creators. After data is entered into a template, it is saved as an XML-based file called a data content record (DCR). Data deployments can be configured to extract DCRs from the TeamSite repository and deploy them to a target database. If there are associated EAs, they can be deployed as well. DCR deployment maintains synchronization of dynamic content that is managed within TeamSite and is available in development, test, or production databases. MetaTagger - metadata can be defined and captured using MetaTagger. The metadata created using MetaTagger is XML content based on a particular DTD. Data deployments can be configured to deploy this metadata from TeamSite or from a standalone file system to a target database. The ability to automatically map and distribute metadata ensures that search engines, personalization servers and other metadata-based applications have the most up-to-date and accurate content.
19
Chapter 1: Introduction
Introductory Concepts
This section illustrates the relationship between XML and relational databases and how OpenDeploy bridges the two. An example is provided that introduces the following data deployment concepts: XML for defining structured content Database for storing structured content Mapping the XML representation to the database schema Deploying XML to the database
Essentially, our metadata element has a title attribute and contains one or more descriptor elements. Each descriptor element has a code, vocabulary and label attribute. The corresponding XML for our specific sales report might appear as follows:
<metadata title="Sales in Northern California"> <descriptor code="AG" vocabulary="Regions" label="Americas"/> <descriptor code="06" vocabulary="FIPS5-2" label="California"/> <descriptor code="A" vocabulary="Territory" label="West"/> </metadata>
20
Introductory Concepts
AG 06 A
Table 3
AG 06 A
The metadata table is the primary table and the descriptor table is its child table. The primary and foreign key columns are used for joining the two tables. For example, a search for all reports pertaining to Americas should return Sales in Northern California.
21
Chapter 1: Introduction
The objective in our metadata example is to map the XML-based attributes to the appropriate columns of the two database tables. In other words: Table 4 Mapping XML-based Attributes to the DB Tables md/report md/symbol (primary key) desc/sym (foreign key) desc/vocab desc/tag
The schema mapping is an XML file that contains a group element for each database table. You can write your own schema or have OpenDeploy generate one for you. Also, the OpenDeploy browser-based user interface lets you interactively construct the schema. The following simplified (and therefore syntactically incomplete) excerpt maps the title and code attributes in our metadata example into the root table. The symbol column, which will store the deployed code values, is identified as a primary key.
<group name="metadata" table="md" root-group="yes"> <attrmap> <column name="report" value-from-attribute="metadata/0/title"/> <column name="symbol" value-from-attribute="metadata/0/descriptor/[0-5]/code"/> </attrmap> <keys> <primary-key> <key-column name="symbol"/> </primary-key> </keys> </group>
The next excerpt maps the code, vocabulary, and label attributes to the other table. The designation [0-5] in each attribute mapping signifies that up to six instances of each attribute are permitted in our example. The sym column is identified as a foreign key that is related to the symbol column in the previous table.
<group name="descriptor" table="desc" root-group="no"> <attrmap> <column name="sym" value-from-attribute="metadata/0/descriptor/[0-5]/code"/> <column name="vocab" value-from-attribute="metadata/0/descriptor/[0-5]/vocabulary"/> <column name="tag"
22
Introductory Concepts
value-from-attribute="metadata/0/descriptor/[0-5]/label"/> </attrmap> <keys> <foreign-key parent-group="metadata"> <column-pair parent-column="symbol" child-column="sym"/> </foreign-key> </keys> </group>
Chapter 1: Introduction
<group name="metadata" table="md1" root-group="yes"> ... </group> <group name="descriptor" table="desc2" root-group="no"> ... </group> </dbschema> </database> </destinations> </deployment>
Architectural Overview
Figure 1 provides a simplified illustration of the basic data deployment architecture, including how deployments are invoked and how source content is converted into data tuples (the format into which data is transformed and used internally before it is saved as a record in the destination) and written to the destination database tables or XML files.
24
Architectural Overview
Figure 1
Source
A
TeamSite or LocalFile System
Invocation
CL TeamSi te Web Services Client
Destination
Data Deployment
B1
C1
XML XMLTuple Producer Tuple
Database
D1
Database Database Tuple Writer Tuple
XML
Tup
JDB
RDBMS RDB
Tup Database
RDBMS RDB
B2
JDB
C2
XML-formatted Files
Tup
OpenDeploy Base
1. A data deployment is invoked (A) by a command line tool (CLT), a web services call, or though a TeamSite event. The actions that follow depend upon whether the source of the content is an XML-based file or a database table. 2. If the source of the content is an XML-based file in a TeamSite or local file system (B1), the XML Tuple Producer parses the XML file and generates a tuple based on this XML content. If the source of the content is a database table (B2), the Database Tuple Producer reads the table using the JDBC API and generates a tuple based on the tables contents. 3. Next, the tuple that was produced in step 2 is passed to one of the following: DatabaseTupleWriter (C1) if the destination is a database table.The tuple is then mapped into the table format provided by the user. Using JDBC, the tuple is inserted into the destination database tables (D1). XMLTupleWriter (C2) if the destination is an XML file. The tuple is then mapped into the XML format specified by OpenDeploy and is written into the destination XML file (D2).
25
Chapter 1: Introduction
TeamSite to Formatted XML (see page 69 for more information) Metadata to Formatted XML (see page 72 for more information) Formatted XML to Formatted XML (see page 75 for more information)
Metadata to Database TeamSite Extended Attributes (Metadata) (see page 70 for more information)
Formatted XML*
XML
XML to Database (see page 74 XML to Formatted XML for more information) (see page 75 for more information) OpenDeploy and the DataDeploy module are not intended for database-to-database replication. Use the appropriate tool from your database vendor. Database to Formatted XML (see page 80 for more information)
Database
26
Migration Matrix
The following table summarizes how to perform tasks formerly done using DataDeploy 5.6. This section assumes OpenDeploy 6.0.x is properly installed and configured for database deployment operation. Refer Database Deployments section in the OpenDeploy Administration Guide for configuring database deployment operation for your OpenDeploy server. Note that in OpenDeploy 6.0.x, Database Auto-Synchronization (DAS) is provided as a standard feature of the base server and DataDeploy is a licensed add-on module that offers standalone and synchronized database deployments. Refer to DataDeploy Module Licensing section in the OpenDeploy Installation Guide for details about licensing the DataDeploy module. Table 6
Task
Migration Matrix
DataDeploy 5.6 OpenDeploy 6.0
Database DAS daemon is Auto-Synchroni configured for iwat zation (DAS). or event server triggers.
Run DAS deployments from a single base server instance of OpenDeploy. Only event server triggers are supported. No support for iwat triggers. See Chapter 4, Database Auto-Synchronization for more information. Use iwsyncdb -initial workareavpath [-nomdc] [dcrtype] command-line tool. Refer iwsyncdb section in the OpenDeploy Reference for more information. Use one of the following methods: Place legacy DataDeploy configuration in od-home/conf directory, and run it using OpenDeploy. Include reference to DataDeploy configuration file in OpenDeploy deployment configuration file using the dataDeploy element. See Standalone Database Deployments on page 126 for more information.
command-line tool. Configuring standalone DataDeploy deployments. Configure DataDeploy deployment configuration file.
27
Chapter 1: Introduction
Table 6
Task
Migration Matrix
DataDeploy 5.6 OpenDeploy 6.0
-k iwdd=internal-deployment-name. See command-line tools. Invoking DataDeploy Deployments on page 28 for more information.
Three-tier mode Run a DataDeploy Run a base server or receiver on the target, deployments. daemon on the target with the databaseDeployment element host. enabled in the sending and receiving OpenDeploy server configuration files, and the dbLoader element included in the deployment configuration. Synchronized Deploy and Run OpenDeploy-Da (DNR)-based taDeploy solution. deployments. Deploying to wide tables. Supported. Synchronize deployments using the dbLoader element in the deployment configuration. See Synchronized Deployments on page 130 for more information. Wide table is supported, but it is recommended you migrate to UDS.
in the Parameters text box, where internal-deployment-name refers to a named deployment element in the DataDeploy configuration file. Using the iwodcmd start command-line tool:
iwodcmd start OpenDeploy_configuration -k iwdd=internal-deployment-name
As a scheduled deployment configured either in the browser-based user interface, or from the command line using the iwodcmd schedadd command-line tool.
28
Note that the parameter iwdd is reserved for performing a deployment of a DataDeploy configuration.
iwsyncdb.ipl
The Perl script iwsyncdb.ipl has been discontinued, and has been replaced by the following scripts: Windows - iwsyncdb.bat UNIX - iwsyncdb.sh
29
Chapter 1: Introduction
The following features previously associated with the iwsyncdb.ipl script are no longer supported by the updated iwsyncdb.bat and iwsyncdb.sh scripts: Registration of iwat-based event triggers. DAS deployments now must be triggered using the TeamSite event server. Ability to start and stop the DAS and DataDeploy daemons. DAS and DataDeploy capabilities are now integrated into the OpenDeploy Base Server and Receiver. Ability to install and uninstall the DataDeploy daemon. There is no longer a separate daemon for DataDeploy.
iwsyncdb.cfg
The following options have been deprecated from the iwsyndb.cfg configuration file:
ignoredcrtype ignorecategory vmoption
30
TeamSite mount point When you are creating and configuring database deployment configurations and database schemas using the browser-based user interface, clicking the Browse button will display only these locations. This is a change from previous releases of DataDeploy, where these files could reside anywhere on the host. If you are not using the browser-based user interface, database schema files can reside anywhere on the host. Database deployment configuration files can also reside anywhere on the host, but if they reside outside the od-home/conf directory, a wrapper must be included in the deployment configuration specifying the location of the DataDeploy configuration file. See Referencing a DataDeploy Configuration File Within an OpenDeploy Configuration on page 127 for more information.
31
Chapter 1: Introduction
Running DAS with DataDeploy 5.6 and OpenDeploy 6.0 on the Same Host
If you have both DataDeploy 5.6 and OpenDeploy 6.0.x on the same host, you cannot run DAS on both software releases at the same time. Instead, you must take one of the following actions: Do not enable DAS on your OpenDeploy 6.0.x base server, or Ensure that the DataDeploy 5.6 DAS daemon is not running when you run DAS on your OpenDeploy 6.0.x base server. Running the DataDeploy 5.6 DAS daemon and enabling the OpenDeploy 6.0.x DAS feature on the same host is not supported.
32
Chapter 2
Deployment Concepts
Appendix B, Database Deployment Tutorials contains a tutorial that will help you understand the basic concepts, configuration, and execution of database deployments. If you are new to database deployments using OpenDeploy, it is recommended to go through this tutorial. This chapter covers some basic deployment concepts that are useful to understand as you configure OpenDeploy for database deployments and execute deployments: Categories of deployments. Overview of database deployment process. Source/Destination configurations. Implementation of user-defined schemas. A sample deployment scenario that demonstrates update types, data sources, data organization and tuples, and the typical steps in a deployment sequence.
Categories of Deployments
There are three categories of deployments Database auto-synchronization (DAS) Standalone database deployments Synchronized deployments of files and data DAS deployments are deployments that are automatically synchronized with events in TeamSite. Tables representing TeamSite workareas and the staging area are created in the database. As files are created in the workarea or submitted to staging, events are generated to automatically invoke database deployments to read the files and deploy the contents into the database.
33
Standalone database deployments require installation of the licensed add-on module for DataDeploy. Standalone deployments allow you to deploy any files (not just TeamSite files). Standalone deployments are not triggered by any events. You invoke standalone deployments on-demand to deploy content. Synchronized deployment of files and data allow you to supplement OpenDeploy file deployments with database deployments. Specifically, after files are deployed from a source OpenDeploy server to a target OpenDeploy server, a database deployment can be invoked to further push content into a database.
The tuple would contain an entry as follows to represent the data 'John' employee/0/name/ 0=John The configuration for the database deployment also specifies the destination, which is usually a database. A database destination is specified in the configuration file by specifying the target tables and columns. In addition, a mapping has to be specified to tell OpenDeploy how to map the data source to a table and column in the database. OpenDeploy uses the tuples and the database mapping to determine how and where to insert the data into the database. OpenDeploy also provides mechanisms such as filters, substitutions, and
34
Source/Destination Configurations
external manipulation techniques to make modifications on the data before it is deployed to the database.
Source/Destination Configurations
In the database deployment configuration file, you specify the source of the content to be deployed to the database. The source can be a database, XML file, and TeamSite extended attributes. The destination is usually a database. OpenDeploy has another option for source and destination referred to in this manual as Formatted XML. Formatted XML is a file that represents the tuple in an XML format. See Use Case Matrix on page 26 for more information on the various source/destination combinations.
Overview
OpenDeploy has two deployment approaches for database deployments: wide table mapping and user-defined schemas (UDS). Wide table mapping is a legacy format used primarily when user-defined schema mapping was not available in OpenDeploy. It is highly recommend to use user-defined schemas. User-defined schemas refer to the process of creating a normalized table structure for deploying your content. Normalization is the process of logically breaking down a database's tables and schema into separate tables that are related through keys. Specifically, user-defined database schemas can map a given record to rows in multiple tables that you can define with foreign and primary keys. The resultant tables have normalized data schemas.
35
Advantages of normalization include: Relationships between tables are easier to understand. Tables are easier to query. Data integrity is better maintained through referential constraints. For users still using legacy wide table format, see Appendix C, UDS vs. Wide Table Mapping for more information. To deploy data content records using user-defined database schemas, the records must be based on the Interwoven DTD or on customized data capture template DTDs. For more information on data content records, refer to the FormsPublisher Developers Guide. Data can be deployed using user-defined database schemas manually or automatically using DAS. The example in the following section describes deployment using DAS. For more information on DAS, see Chapter 4, Database Auto-Synchronization.
36
You can execute base and delta table updates manually (from the command line) or as part of an automated deployment through DAS. When DAS is configured, certain TeamSite events automatically trigger deployment.
Details about each update type are as follows: Base update - data is extracted from a TeamSite workarea, staging area, or edition, and is deployed to a base table containing full (as opposed to delta) data. The most common sources of data for a base table are staging areas and editions. Whenever a base table is generated, an entry for that table is recorded in a tracker table residing in the database. Delta update - in the TeamSite server, data from a workarea is compared with the data in a staging area or edition. Differences-the delta data-are identified and deployed to a delta table on the destination system. This table contains only the delta data from the workarea; it does not contain full static data about every item in the workarea (the delta tables associated base table should exist from a previous deployment). The relationship between the workarea data and the data in its parent area (a staging area or edition) is updated in the tracker table residing in the database. Standalone update - data is extracted from a TeamSite workarea, staging area, or edition and is deployed to a standalone table. A standalone update differs from a base update in that it does not generate an entry in the tracker table.
NOTE
Data synchronization- in the database system, OpenDeploy must keep a record of which delta tables are associated with which base tables, assuming you are using DAS. This is necessary so that delta tables from multiple workareas that are associated with a single base table from a staging area will remain synchronized when changes from one workarea are submitted to the staging area. This relationship is maintained by the tracker table residing in the same database as the base and delta tables.
37
Data Sources
When you deploy data from TeamSite to a database, you can specify that it come from a TeamSite workarea, staging area, or edition. Of these three, workarea data is the only type that can be deployed using all of the three types of update (base, delta, or standalone). When deploying staging area or edition data, set update-type to base if you plan subsequent delta table generation, or set update-type to standalone if you do not need to track the tables relationship to other tables. The following table shows which data sources are supported for each type of update: Table 7 Data Sources
Update Type Base TeamSite Source Area Workarea Edition Delta Standalone
Supported Supported
38
Original
Merging delta data from another workarea into a base table through a base update (such as when submitting the other workarea data to a staging area). Generating a new tuple through a delta update (such as when adding a new extended attribute to a file in a workarea). Updating a delta table through a delta update. Data existing in a base area but not in a workarea (such as when the data is deleted from the workarea, or when data is newly added to the base area from a different workarea).
NOTE
39
Wide Tuples
A wide tuple is an internal representation of all the data for the source element being deployed. By default, wide tuples deploy into wide tables when deployed to a database. Unlike narrow tuples, wide tuples can be deployed either manually or with DAS. Wide tuples contain exactly one path element and one state element, and any number of key-value pairs. Thus, a files extended attribute data can be represented in a single wide tuple even if the file has more than one extended attribute set. Figure 2 shows OpenDeploys internal representation of a wide tuple. Figure 2
Tuple 1 path = docroot/news/front.html News-Section = Sports Locale = SF state = Original
Wide Tuple
In a wide tuple, OpenDeploy eliminates the key = and value = labels for the key and value data, instead using the format key = value for each key-value pair. This arrangement simplifies the creation of a wide base table as described in Base Table Format: Wide Tuples on page 41. Support for wide tuples requires that all extended attribute keys be unique. For example, a file cannot have two keys named Locale. (To satisfy this requirement, TeamSite uses a numeric suffix for key names that would otherwise not be unique. For example, if the file docroot/news/ front.html has two Locale keys with the values SF and Oakland, the keys are named Locale/0 and Locale/1.) The resulting wide tuple is shown in Figure 3. Figure 3
Tuple 1
path = docroot/news/front.html News-Section = Sports Locale/0 = SF Locale/1 = Oakland state = Original
40
Tuple 1 (Wide)
path = docroot/news/front.html News-Section = Sports Locale/0 = SF Locale/1 = Oakland
State
docroot/news/front.html Sports
Oakland Original
Narrow Tuples
Narrow tuples are not a common way to deploy data due to structural constraints. Narrow tuples contain exactly one path, key, value, and state element. Figure 5 shows OpenDeploys internal representation of two narrow tuples. Tuple 1 is for the News-Section:Sports extended attribute for the file docroot/news/front.html. Tuple 2 is for the Locale:SF extended attribute for the same file. Because a narrow tuple can contain only one key-value pair, DataDeploy must create multiple tuples (two in this case) if a files extended attributes consist of more than one key-value pair.
41
Figure 5
Tuple 1
Narrow Tuples
Tuple 2
path = docroot/news/front.html key = Locale value = SF state = Original
NOTE
You cannot deploy data content records using narrow tuples. DAS only accepts wide tuples.
Tuple 1 (Narrow)
Tuple 2 (Narrow)
Value
Sports SF
State
Original Original
It is possible to deploy narrow tuples into a wide table by configuring DataDeploy to use wide tuples. When you do, the tuples are deployed to a wide table by default. You can also deploy narrow tuples to a wide table by manually configuring a set of SQL commands in the DataDeploy configuration file. These SQL commands then execute automatically during the deployment.
42
Deployment Sequence
The most common sequence of events when deploying in DAS mode from TeamSite to a database is as follows: 1. Generating an initial base table of a staging area or edition. 2. Generating a delta table for each workarea associated with the staging area or edition from step 1. 3. Configuring TeamSite to invoke OpenDeploy so that the base table from step 1 is automatically updated whenever changes have been submitted to its corresponding staging area or edition from a workarea. This section describes these steps, which are part of automated deployment through DAS.
1
SA1 WA1 WA2 WA3
2
BT1 Tracker Table
Tracker Table
43
1. Invoke OpenDeploy from the command line, specifying the deployment configuration file that contains the necessary parameters. OpenDeploy reads the configuration file and extracts all data from SA1. 2. Based on additional information in the configuration file, OpenDeploy creates base table BT1 in the destination database, populating it with the data from Step 1. 3. OpenDeploy creates the tracker table (or updates it if it already exists) to track relationships between base and delta tables
TeamSite
SA1
1
WA1 WA2 WA3
3 2
1. Invoke OpenDeploy from the command line, specifying the deployment configuration file that contains the necessary parameters. OpenDeploy compares the data in WA1 with the same data in SA1 to determine the tuple differences between the two areas. 2. OpenDeploy creates DT1, using the delta data it determined in Step 1. If there is no delta data, it creates an empty delta table. 3. OpenDeploy updates the tracker table to record that DT1 is a child of BT1.
44
TeamSite
DataDeploy
7
Workflo w or
SA1 WA
1 2
6
Tracker Table
WA WA
1a
1. If the submission occurs as part of a TeamSite workflow job, the TeamSite workflow subsystem obtains a list of files to be submitted from WA2 to SA1. This list of files is then passed to OpenDeploy (1a in Figure 9). If DAS is configured, OpenDeploy obtains the list of files to be submitted. 2. OpenDeploy compares the file list items in WA2 with the same items in SA1 to determine the tuple differences between the two areas. (These differences will be recorded in BT1 later in Step 5). 3. OpenDeploy checks the tracker table to determine the children of BT1. 4. Original rows from BT1 are propagated to DT1 and DT3 (but not to DT2). This ensures that the original rows in BT1 are not lost, but instead are stored as now-obsolete data in its child delta tables. 5. OpenDeploy updates BT1 with the data derived earlier in Step 2.
45
6. OpenDeploy removes from DT2 all rows whose path and key values are identical to those being submitted from WA2 to SA1. This ensures that items not being submitted from WA2 to SA1 are retained in DT2. 7. The workflow subsystem completes the submission of the file list to SA1.
Table Updates
Table updates for a scenario fitting this model would proceed as shown in Figure 10. For simplicity, the tables shown here have column headings identical to the tuple items Path, Key, Value, and State. In most situations, the columns will have other names. Because the term key has a specific meaning in many database languages, do not use key as a column heading. Figure 10 Sample Table Updates
State 0 BT1 Path Key State 1 BT1 Path Key
P1 K1
Value State
Value State
V1 Orig
Value State
V1 V2 Orig Orig
P1
K1
V1
Orig
Value State
Value State
Value State
V2 NtPres
Value State
Value State
1. State 0: In their starting state, all tables are synchronized. Because there are no differences between SA1, WA1, and WA2, there is no delta data. Therefore, DT1 and DT2 are empty. 2. State 1: Workarea WA2 is changed locally with new data P2, K2, and V2, but the changes are not submitted to staging area SA1. Because the changes are not submitted, you must execute a delta update so that delta table DT2 reflects the new data in WA2. During this delta update, OpenDeploy identifies the differences between SA1 and WA2 and records these differences (the delta data) in DT2. In this scenario the delta tables already exist and therefore only need to be updated. 3. State 2: Workarea WA2 (complete with its changes from previous State 1) is submitted to staging area SA1. In the configuration file for this deployment, Path and Key were named as the basis-for-comparison columns. Therefore, OpenDeploy compares the State 1 values of these columns in BT1 and DT2, sees that they are different, and determines that the row
46
from DT2 State 2 should append rather than replace the data in BT1. DT1 has the new values shown here because WA1 now differs from SA1. If necessary, a Get Latest operation in WA1 would bring WA1 into sync with SA1. Had State 1 DT2 contained a P1 K1 V2 row, it would have replaced rather than appended the original BT1 row. In that case, the original BT1 row would have been propagated to DT1, after which P1 K1 V2 would have replaced P1 K1 V1 in BT1. A subsequent Get Latest in WA1 would bring WA1 into sync with SA1, and the data in DT1 would be deleted). DT2 is empty because WA1 is once again in sync with SA1. This is the ending state that would exist if you completed the steps described in Updating a Base Table on page 45.
47
Value State
V1 Orig
Value State
V1 Orig
Value State
V1 Orig
Value State
V1 Orig
WA2 Path
P1 P2
Key
K1 K2
Value State
V1 V2 Orig New
WA2 Path
P1 P2
Key
K1 K2
Value State
V1 V2 Orig Orig
48
Chapter 3
Configuration Files
Before a deployment can be invoked and executed, you must configure it by doing the following: Map a database schema (if your deployment destination is a database). Create and then customize the DataDeploy configuration file(s). Specify database connection parameters in a database configuration file (only for deployments with a database destination). This chapter discusses the creation of database schemas, DataDeploy configuration files, and database configuration files and also how a configured deployment can be invoked. The information here applies both to DAS and to deployments using the DataDeploy module, both of which are described in subsequent chapters in this book. OpenDeploy contains many options for configuring database deployments, many of which are not described in this manual. Refer to Chapter 10, DataDeploy DTD in the OpenDeploy Reference for a full list of configurations and features.
49
Process Flow
The following is an outline of end-user and system actions that take place when data capture files are mapped to database schemas: 1. The user logs into the browser-based user interface and navigates to the Map DCT/DTD to Database Schema window. 2. The user sets the mapping parameters by specifying the following: Source - specify which file is to be used as the source for the mapping and whether that file is a datacapture.cfg file (DCT based on Interwoven 4.5/5.0 standards) or a custom DTD. Destination - specify whether to map to a new schema or to an existing one. Database - specify the type of database. Map Type - specify whether to begin the process with a new, blank map or an auto-generated new map. Auto-generated maps provide a convenient starting point because groups are automatically created from the elements of the source file. These groups and their elements can be modified. 3. The user creates groups and maps elements in the source file to columns in those groups. Note the following: Each schema must contain exactly one root group, which is the parent to all other groups in the schema. It is recommended that users create and save the root group before creating other groups because the user interface populates drop-down menus with the group and column names of saved groups. It is helpful if users have that root group information available when they create subsequent groups.
50
When creating columns, users must (a) select an element from the source file, (b) select the column into which the element is copied, and (c) copy the element into that column. This select-and-copy method ensures that item names in schemas are identical to item names in the source file. Changing item names would prevent DataDeploy from deploying DCRs correctly. Additionally, the select-and-copy method ensures the transfer of other important invisible data from the source file to the schema. The OpenDeploy user interface does not validate user input. If users enter invalid input, OpenDeploy will display errors at deployment time. 4. When a group and corresponding columns have been specified, the user saves the group. It is then displayed in the Mapped Tables pane of the user interface. 5. When the user finishes creating or editing groups, he views the resulting dbschema.cfg file and saves it to the desired location.
2. Select the OpenDeploy server on which you are setting the mapping parameters from the Selected Server list. 3. Select one of the following choices from the Source list: Data Capture Template - if the file is a datacapture.cfg file. Custom DTD - if the file is a DTD. This selection implies that a non-Interwoven DTD will be specified. 4. Enter the path to the file in the File box. You can also click Browse and navigate to the location. The available locations for the path are the following: TeamSite mount point (Y: or /iwmnt)
od-home/conf
directory (conf)
51
Double click to browse directories. Single click to select files. 5. Select New Schema or Existing Schema from the Destination list to indicate the type of schema to which you are mapping. 6. Select the type of database where your schema will be mapped from the Database list. 7. Select one of the following choices from the Map Type list: Auto - if you want to use an auto-generated map as a starting point. Manual - if you want to create a new, blank map. 8. Click Create Map. The result depends on the selections you made when you set the mapping parameters: If you chose to create a new schema, the Map Source File to a New Database Schema screen is displayed. See Creating a New Database Schema File on page 53. If you chose to edit an existing schema, the database connection screen is displayed. See Mapping to an Existing Database Schema on page 52.
3. Perform one of the following tasks: 4. For Oracle - enter the system identifier in the System Identifier (SID) box. 5. For other databases - enter the database name (for example, Microsoft SQL server or DB2) in the Name box. 6. Enter your database user name in the User box. 7. Enter your password in the Password box.
52
8. Enter the name of the host on which the database is located in the Host box. 9. Enter the port number to which the database server is listening in the Port box. 10. Click Connect. A status dialog box is displayed as the system connects to the database. A temporary connection is made to retrieve the database tables. After the tables are retrieved, the mapping tool is displayed and the connection is terminated. 11. In the mapping tool, select the table to map. Fields in the mapping tool are populated with the properties of that table. See the description of the mapping tool (section B of the UI) in Creating a New Database Schema File on page 53.
C A B
53
The screen contains the following panels: Panel A The Data Source panel displays the elements of the XML source file in a tree format. XML nodes contain nested elements, and are indicated by folder icons. Click the arrow next to a node to display its nested elements. If you have chosen a custom DTD as the source file, Replicant buttons are displayed next to replicant elements in the source tree. Click these buttons to open a dialog box (Figure 15) allowing you to view the existing values that specify the minimum and maximum instances of the replicant, and to set different minimum and maximum values. When you save different values, the new values are transferred to the dbschema.cfg file. After you save the group, click View dbschema.cfg to verify that your changes are reflected there. Figure 15 Mapping a Custom DTD and Specifying the Replicant Instances
Select elements in panel A and copy them to input boxes in panel B to map those elements to columns in a group. Some elements are not mappable (Replicant, for example); those elements cannot be selected. Panel B The Map Data Source to a New Database Schema panel (Figure 16) contains the buttons and input boxes allowing you to specify how elements from the source file map to columns in the groups you create.
54
Elements can be copied from panel A to panel B. Also, saved mappings listed in panel C can be edited when they are populated into panel B (see Panel C). Panel C When you save groups that you create in panel B, they are displayed in tree format in the Mapped Tables panel. Groups listed in panel C are hyper linked so that when you click on a group, panel B is populated with the mappings in that group. If you save (or remove) a group and it is not immediately displayed in the Mapped Tables panel, right click in that panel and choose Refresh from the Internet Explorer context menu. When that panel is refreshed the group is displayed. Panel D This panel contains these buttons: Save: Saves your mappings. Reset Map: Clears the input fields. Remove Group from Map: Removes selected groups from the schema. View dbschema.cfg: Displays the actual XML file, dbschema.cfg, that is the result of your mappings. 3. Create a root group. The root group is the parent to all other tables in the schema. Each schema must contain exactly one root table. It is recommended that you create and save a root group first because that enables the user interface to populate the drop-down menus with that tables group and column names. To specify a group as the root table, select the Root Group of the Schema check box. 4. Create additional groups according to your needs: a. Enter a name for the group in the Group Name box, or copy an element from the data source to that box. b. Create columns by copying elements to the Item Name and Column Name fields as described in Process Flow on page 50 and specify the following: Column Name - The name of the column.
55
Primary Key - Whether the data stored in that column is a primary key. Foreign Key - Whether the data stored in that column is a foreign key. Foreign Key Parent Group - The parent group of the data if it is a foreign key. This drop-down menu contains the group names of groups in the schema that have been saved. Foreign Key Parent Column - The parent column of the data if it is a foreign key. This drop-down menu contains the column names of groups that have been saved. Data Type/Length - The data type and maximum length of data in that column. Date Format - The format in which date data is stored in that column (for example, dd-mm-yyyy). Not Null - Whether the column data can be null. Is-URL - Whether the column data is a URL. If the column data is specified as a URL, DataDeploy deploys the content where that URL points, not the URL itself.
c. Click the Append Mapping or Delete Mapping buttons to add or delete columns from a group. 5. When you complete a group, click Save. The group is displayed in the Mapped Tables pane. If it is not immediately displayed there, right click in that panel and choose Refresh from the Internet Explorer context menu. When the Mapped Tables panel is refreshed the group is displayed. 6. When you have finished creating and saving groups, click View dbschema.cfg. The dbschema.cfg file is displayed (Figure 17).
56
7. Save the dbschema.cfg file by clicking the Save button (located at the bottom of the main window). The Select File dialog is displayed. 8. Browse to the location where you want to save the file. Double click to browse directories. The available locations for the path are the following: TeamSite mount point (Y: or /iwmnt)
od-home/conf
directory (conf)
57
The command options described in the following sections do not support creation or validation of a dbschema.cfg file for a metadata capture configuration file. See DAS and Metadata Deployment on page 121 if you intend to deploy metadata through DAS.
Details are as follows: This command generates dbschema.cfg files for each data type configured in iw-home/ local/config/templating.cfg under the specified workarea workareavpath. For data types that are configured to use custom DTDs, the command looks for a workareavpath/dcrtype/typename.dtd file.
58
Data types that do not have a datacapture.cfg file are skipped. The optional dcrtype setting causes the creation of a dbschema.cfg file for a single data type (rather than all data types in workareavpath). The -force option overwrites any existing dbschema.cfg files. The -DeployAll option maps all items defined in DCT and ignores database attribute settings. The -dtdfile option generates a dbschema.cfg file for the DTD residing in the file system. You must specify the full path to the associated DTD with this option. The -dcfile option generates a dbschema.cfg file for the DCT residing in the file system. You must specify the full path to the data capture file with this option. Refer to iwsyncdb section in the OpenDeploy Reference for more information on the iwsyncdb command.
or -initial
iwsyncdb -validate
NOTE
By default, iwsyncdb -validate is called as part of both the -ddgen and -initial options in iwsyncdb. Validation errors are recorded in a file called iwvalidate_dbschema.log in the DataDeploy log directory.
59
This command validates the dbschema.cfg files for data types configured in iw-home/local/ config/templating.cfg under the specified workarea workareavpath. The optional dcrtype argument specifies that the iwsyncdb command will validate a single data types dbschema.cfg file (rather than all data types dbschema.cfg files under workareavpath). If a particular data type does not have a dbschema.cfg file, that type is skipped and no errors are generated. Validating by Using a Complete Path Name The syntax for performing validation of a file specified by a complete path name is as follows:
iwsyncdb -validate dbschema_file_name
This command validates the file specified by dbschema_file_name. The dbschema_file_name argument must specify a complete path to a file that contains the dbschema element.
needs. If your deployment does need additional parameters to be set in its configuration file, you can create the file manually or use one of the automatic methods and then customize it. In either case, all manual configuration must conform to the structure and syntax of the DataDeploy DTD (od-home/dtd/conf/ddcfg.dtd).
NOTE
All configuration files generated by DataDeploy are UTF-8 encoded. Ensure that you save those files as UTF-8 if you edit them. On Windows systems, you can use Notepad or Wordpad to edit those files because those text editors support opening and saving files that are UTF-8 encoded.
2. Select the OpenDeploy server on which the DataDeploy configuration is being run from the Selected Server list. 3. Select TeamSite File System from the Area Type list if the data to be deployed resides in TeamSite. Otherwise, select the file system of the OpenDeploy server (the name of the each server appears in the list.) 4. Select Interwoven DCRs from the XML Data Type list if the deployment data conforms to the Interwoven DTD. Otherwise, select Custom Defined if the data conforms to a custom-defined DTD. 5. Click Next. A continuation of the previous window appears, depending on whether you selected a TeamSite file system (Figure 20) or an OpenDeploy server file system (Figure 21).
61
Figure 21 Specify Parameters for Data Source Window (cont.) (OpenDeploy Server File System)
6. Enter the vpath to the workarea in the Area: Vpath of Area box, or the directory on local disk from which you want to deploy data in the Directory on localhost box. You can also click Browse and navigate to the location. The available locations for the vpath are the following: TeamSite mount point (Y: or /iwmnt)
od-home/conf
directory (conf)
7. Select whether the data to be deployed is located in a Directory, Filelist, or File from the Location list. 8. Click Next. A continuation of the previous window appears (Figure 22). Figure 22 Create DataDeploy Configuration File: Specify Parameters for Data Source Window (cont.) Part 2
9. Enter the location (relative to the TeamSite vpath area or file system location) of the data you want to deploy in the Relative Path box, or click Browse and navigate to the location. Enter a period (.) if you do not want to specify a exact location within your TeamSite vpath area or file system location.
62
10. Specify one of the following Visit Directory options: deep - the directory and all its subdirectories that you specify are searched recursively. shallow - only the top level of the chosen directory is searched. no - no search for deployment data takes place in the location you specified. Note that this item only appears if Directory was specified as the data location in the previous screen. 11. Click Next. 12. The Enter Destination Attributes window appears (Figure 23). Figure 23 Enter Destination Attributes Window
13. Enter the dbschema.cfg file you want to use in the Dbschema file box, or click Browse and navigate to that location. The available locations for the path are the following: TeamSite mount point (Y: or /iwmnt)
od-home/conf
directory (conf)
If you saved a dbschema.cfg file during the current browser session through the Map Database section, the location of that file is displayed in the box. 14. Enter a name for the deployment in the Deployment name box. The default name is basearea. 15. Select the type of database from the Select database vendor list. 16. Click Next. The Enter Database Connection Data window (in this example, for Oracle) appears (Figure 24). Figure 24 Enter Database Connection Data Window (Oracle)
63
17. Enter the system identifier (Oracle only) or the database name (all other databases) in the System Identifier (SID) box or Database Name box, respectively. 18. Enter your user name in the User box. 19. Enter your password in the Password box. 20. Enter the name of the host where the database resides in the Host box. 21. Enter the port number where the database resides in the Port box. 22. (Optional) Check the Enforce Referential Integrity check box if you want to enforce the constraints set by the primary and foreign keys during deployment and while creating tables. 23. Click View Configuration File. The DataDeploy configuration file is displayed. Figure 25 is a sample file. Files generated from your input might look different: Figure 25 Sample Generated DataDeploy Configuration File
Modifications made to the file in this window cannot be saved. Modify the file through the previous steps, or through the TeamSite WebDesk interface. 24. Click Save to save the generated DataDeploy configuration file. 25. The Select File dialog box is displayed. Browse to the location where you want to save the file and click OK. The available locations for the path are the following: TeamSite mount point (Y: or /iwmnt)
od-home/conf
directory (conf)
After you have saved the DataDeploy configuration file you can click Deployment Setup to continue by executing a deployment.
64
where dcrtype provides data_category/data_type. This generates the following DataDeploy configuration file:
workareavpath/templatedata/data_category/data_type/data_type_dd.cfg.
is a text file containing a list of file paths where each path references a file containing xml formatted data.
xmlfilelist.txt: --------------c:/temp/xmldata1.dump.txt c:/temp/xmldata2.dump.txt xmldata1.dump.txt ----------------<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <xml-tuple-data version="2.0.0"> <data-tuple> <tuple-field name="Reviews/0"></tuple-field> <tuple-field name="Plot Summary">ps</tuple-field> <tuple-field name="ISBN">ABCDEF</tuple-field> <tuple-field name="Author">venkat</tuple-field> <tuple-field name="Cover Picture">pic4</tuple-field> 65
<tuple-field name="Reviews/0/Review Reader">b4r1</tuple-field> <tuple-field name="Reviews/0/Review Reader E-Mail">b4r1email </tuple-field> <tuple-field name="TeamSite/Templating/DCR/Type">internet/book </tuple-field> <tuple-field name="Price">10.00</tuple-field> <tuple-field name="Reviews/0/Reader Comments"> 0x000x000x000x000xa0xb</tuple-field> <tuple-field name="state">Original</tuple-field> <tuple-field name="Publication Date">1999-01-01</tuple-field> <tuple-field name="path">templatedata\internet\book\data\book5 </tuple-field> <tuple-field name="Cover">Paperback</tuple-field> <tuple-field name="Title">book4</tuple-field> </data-tuple> </xml-tuple-data>
TeamSite to Database
The following sample configuration file shows how to set parameters for a typical TeamSite to database deployment. This sample illustrates deploying a TeamSite DCR file to a table in UDS format.
<data-deploy-configuration> <data-deploy-elements filepath="/usr/od-home/conf/db.xml"/> <client> <deployment name="basearea"> <source> <teamsite-templating-records options="wide" area="/default/main/branch1/WORKAREA/wa1"> <path name="templatedata/internet/book/data" visit-directory = "deep" /> </teamsite-templating-records> 66
</source> <destinations> <database use="mydb1" update-type="standalone"> <dbschema> <group name="book" table="book" root-group="yes"> <attrmap> <column name="IW_State" data-type="varchar(255)" value-from-field="state"/> <column name="Path" data-type="varchar(255)" value-from-field="path"/> <column name="Title" data-type="VARCHAR(100)" value-from-field="Title" allows-null="no" is-url="no"/> <column name="Cover_Picture" data-type="VARCHAR(255)" value-from-field="Cover Picture" allows-null="yes" is-url="no"/> <column name="Author" data-type="VARCHAR(40)" value-from-field="Author" allows-null="no" is-url="no"/> <column name="Publication_Date" data-type="DATETIME" value-from-field="Publication Date" data-format="yyyy-MM-dd" allows-null="no" is-url="no"/> <column name="ISBN" data-type="VARCHAR(20)" value-from-field="ISBN" allows-null="no" is-url="no"/> <column name="Cover" data-type="CHAR(9)" value-from-field="Cover" allows-null="no" is-url="no"/> <column name="Price" data-type="REAL" value-from-field="Price" allows-null="no" is-url="no"/> <column name="Plot_Summary" data-type="VARCHAR(255)" value-from-field="Plot Summary" allows-null="yes" is-url="no"/> </attrmap> <keys> <primary-key> <key-column name="Title"/> <key-column name="ISBN"/> </primary-key> </keys> </group> <group name="Reviewers" table="Reviewers" root-group="no"> 67
<attrmap> <column name="ISBN" data-type="VARCHAR(20)" value-from-field="ISBN" allows-null="no" is-url="no"/> <column name="Title" data-type="VARCHAR(100)" value-from-field="Title" allows-null="no" is-url="no"/> <column name="Review_Reader" data-type="VARCHAR(255)" value-from-field="Reviews/[0-2]/Review Reader" allows-null="no" is-url="no" is-replicant="yes"/> <column name="Review_Reader_E_Mail" data-type="VARCHAR(255)" value-from-field="Reviews/[0-2]/Review Reader E-Mail" allows-null="yes" is-url="no" is-replicant="yes"/> <column name="Reader_Comments" data-type="VARCHAR(255)" value-from-field="Reviews/[0-2]/Reader Comments" allows-null="yes" is-url="no" is-replicant="yes"/> </attrmap> <keys> <primary-key> <key-column name="ISBN"/> <key-column name="Title"/> <key-column name="Review_Reader"/> </primary-key> <foreign-key parent-group="book"> <column-pair parent-column="Title" child-column="Title"> </column-pair> <column-pair parent-column="ISBN" child-column="ISBN"> </column-pair> </foreign-key> </keys> </group> </dbschema> </database> </destinations> </deployment> </client> </data-deploy-configuration>
68
TeamSite to XML
The following file configures a typical deployment from a TeamSite DCR to an XML file. The xml-formatted-data tag has a single attribute, file, which specifies the absolute path and file name of the destination file. A destinations section can have any number of xml-formatted-data elements, or a combination of xml-formatted-data and database elements.
<data-deploy-configuration> <client> <deployment name="teamsite-to-xml"> <source> <teamsite-templating-records options="wide" area="/default/main/branch/WORKAREA/myworkarea"> <path name="templatedata/intranet/weather/data/w1"/> </teamsite-templating-records> </source> <destinations> <xml-formatted-data file="/tmp/ts2xml.out"> <fields> <field name="Announcement" element="Announcement"/> <field name="Day" element="Day"/> </fields> </xml-formatted-data> </destinations> </deployment> </client> </data-deploy-configuration>
The XML file that results from invoking the above deployment:
<xml-tuple-data version="2.0.0"> <data-tuple> <tuple-field name="state">Original</tuple-field> <tuple-field name="path">templatedata\intranet\weather\data\a4 </tuple-field> <tuple-field name="Announcement">Its a hot and sunny day </tuple-field> <tuple-field name="Day">Monday</tuple-field> </data-tuple> </xml-tuple-data>
69
<column name="Source" data-type="VARCHAR(50)" value-from-field="TeamSite/Metadata/Source" allows-null="no"/> <column name="LaunchDate" data-type="DATETIME" data-format="yyyy-MM-dd" value-from-field="TeamSite/ Metadata/Launch Date" allows-null="no"/> <column name="ExpirationDate" data-type="DATETIME" data-format="yyyy-MM-dd" value-from-field="TeamSite/ Metadata/Expiration Date" allows-null="no"/> <column name="Keywords" data-type="VARCHAR(100)" value-from-field="TeamSite/Metadata/Keywords" allows-null="no"/> </attrmap> <keys> <primary-key> <key-column name="Title"/> </primary-key> </keys> </group> </dbschema> </database> </destinations> </deployment> </client> </data-deploy-configuration>
NOTE
If you remove column elements that are mapped to path, you must set the delete-tracker attribute to yes in the database element.
For deletions to work correctly, one of the following conditions must be met: All group elements contain a column child element with its name attribute set to path and mapped to a path value. Only the root group contains a column element with a name attribute set to path and mapped to a path value. The delete-tracker attribute is set to yes in the database element. For example:
<database db="localhost:2638" user="DBA" password="SQL" vendor="sybase" update-type="standalone" delete-tracker="yes" state-field="state"> 71
The following sample file shows the default format of a typical XML destination file:
<xml-tuple-data version="2.0"> <data-tuple> <tuple-field name="path">mydir/f9</tuple-field> <tuple-field name="state">Original</tuple-field> <tuple-field name="value">small</tuple-field> <tuple-field name="key">size</tuple-field> </data-tuple> <data-tuple> <tuple-field name="path">mydir/f9</tuple-field> <tuple-field name="state">Original</tuple-field> <tuple-field name="value">blue</tuple-field> <tuple-field name="key">color</tuple-field> </data-tuple> </xml-tuple-data>
72
value-from-field="ISBN" allows-null="no" is-url="no"/> <column name="Price" data-type="REAL" value-from-field="Price" allows-null="no" is-url="no"/> <column name="Plot_Summary" data-type="VARCHAR(255)" value-from-field="Plot Summary" allows-null="yes" is-url="no"/> <column name="Category" data-type="VARCHAR(40)" value-from-field="TeamSite/Metadata/Category" allows-null="yes" is-url="no"/> <column name="Languages" data-type="VARCHAR(60)" value-from-field="TeamSite/Metadata/Languages" allows-null="yes" is-url="no"/> </attrmap> <keys> <primary-key> <key-column name="Title" /> <key-column name="ISBN" /> </primary-key> </keys> </group> </dbschema> </database> </destinations> </deployment> </client> </data-deploy-configuration>
<field name="value" element="value"/> <field name="state" element="state"/> </fields> </xml-formatted-data> </source> <destinations> <database use="oracle8_db" table="TableFromXML"> <select> <column name="Path" value-from-field="path"/> <column name="KeyName" value-from-field="key"/> </select> <update> <column name="Value" value-from-field="value"/> <column name="State" value-from-field="state"/> </update> </database> </destinations> </deployment> </client> </data-deploy-configuration>
In this file, the field elements specify which attributes in the source XML file DataDeploy will use when building a tuple for each Path-Key-Value-State item in the file. The element attribute can name any valid element; it is not limited to naming just the path, key, value, or state elements shown here. Note that the xml-formatted-data element is used in this example and also in the XML-to-XML file in the next section. This tag is appropriate for deploying XML files that were generated by DataDeploy. For any other type of XML file, you can use the xml-source element. For more information, refer to Sample Scenarios for Using the xml-source Element section in the OpenDeploy Reference guide.
<source> <!-- Pull data tuples from XML file --> <xml-formatted-data file="/u/iw/wcuan/billTable.xml" > <fields> <field name="path" element="path" /> <field name="key" element="key" /> <field name="value" element="value" /> <field name="state" element="state" /> </fields> </xml-formatted-data> </source> <substitution> <!-- Modify each tuple according to the following --> <!-- match/replace pairs. In this case: any path --> <!-- that contains the string 'WORKAREA/.../' will --> <!-- have the string replaced by 'STAGING/'; any --> <!-- path that contains 'EDITION/abcd' will be --> <!-- replace with '/This/Special/Path', and any --> <!-- tuple whose key starts with 'BEFORE' will be --> <!-- changed to begin with 'AFTER'. --> <field name="path" match="(.*)/WORKAREA/[^/]+/(.*)" replace="$1/STAGING/$2" /> <field name="path" match="EDITION/abcd" replace="/This/Special/Path"/> <field name="key" match="^BEFORE(.+)" replace="AFTER$1"/> </substitution> <destinations> <xml-formatted-data file="/u/temp/someTable.xml"/> </destinations> </deployment> </client> </data-deploy-configuration>
In this file, the field elements specify which attributes in the source XML file DataDeploy will use when building a tuple for each Path-Key-Value-State item in the file.
XML to Database
The following file configures a typical deployment from an XML file to a database:
<data-deploy-configuration> 76
<data-deploy-elements filepath="c:/Intewoven/OpenDeployNG/etc/database.xml/> <client> <deployment name="deployment1"> <source> <xml-source options="wide" area="E:/Interwoven/OpenDeployNG/conf/data" area-type="os-filesystem" xml-type="custom"> <path name="." visit-directory="deep"/> </xml-source> </source> <destinations> <database use="oracle-db" update-type="standalone" state-field="state" delete-tracker="yes" enforce-ri="no"> <dbschema> <group name="deptRecords" root-group="yes"> <attrmap> <column name="deptId" data-type="VARCHAR(250)" value-from-element="deptRecords/0/dept/0/deptId/0" allows-null="no" is-url="no"/> <column name="name" data-type="VARCHAR(250)" value-from-attribute="deptRecords/0/dept/0/ description/0/name" allows-null="no" is-url="no"/> </attrmap> <keys> <primary-key> <key-column name="deptId"/> </primary-key> </keys> </group> <group name="employee" root-group="no"> <attrmap> <column name="name" data-type="VARCHAR(250)" value-from-attribute="deptRecords/0/employees/0/ employee/[0-5]/name" is-replicant="yes" allows-null="no" is-url="no"/> <column name="id" data-type="VARCHAR(250)" value-from-attribute="deptRecords/0/employees/0/ employee/[0-5]/id" is-replicant="yes" allows-null="no" is-url="no"/>
77
<column name="deptId" data-type="VARCHAR(250)" value-from-element="deptRecords/0/dept/0/deptId/0" allows-null="no" is-url="no"/> </attrmap> <keys> <primary-key> <key-column name="name"/> <key-column name="deptId"/> </primary-key> <foreign-key parent-group="deptRecords"> <column-pair parent-column="deptId" child-column="deptId"/> </foreign-key> </keys> </group> </dbschema> </database> </destinations> </deployment> </client> </data-deploy-configuration>
78
In this example, the source and generated XML formatted output looks like the following: XML source:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE press-release SYSTEM "employee.dtd"> <deptRecords> <dept> <deptId>00101</deptId> <description name="Engineering"/> </dept> <employees> <employee name="Simson Garfinkel" id="345"/> <employee name="Art Vandalay" id="506"/> </employees> </deptRecords>
79
Database to XML
This section describes extracting data tuples from single or multiple database tables and mapping to an XML file.
80
Filtering
The previous implementation extracts all rows from the specified table and creates XML output for the required fields. The following implementation allows you to filter the rows to select from the specified table. Use the database elements where-clause attribute to filter table rows. To filter rows, set the where-clause attribute to a string value that specifies the row selection criteria.
<data-deploy-configuration> <data-deploy-elements filepath="/local/iw-home/db.xml"/> <client> <deployment name="db-to-xml"> <source> <!--Pull data tuples from database --> <!--Oracle8 on Unix --> <database use="oracle8_db" table="tupleTable" vendor="oracle" where-clause="Epath='mypath.txt' AND Evalue like 'myvalue%'"> <fields> <field name="path"column="EPath"/> <field name="key"column="EKeyName"/> <field name="value"column="EValue"/> <field name="state"column="EState"/> </fields> </database> </source> <destinations> <xml-formatted-data file="/tmp/tupleTable.xml"> </xml-formatted-data> </destinations> </deployment> </client> </data-deploy-configuration>
In this example, DataDeploy executes the following query to extract data tuples:
SELECT * FROM TUPLETABLE WHERE Epath='mypath.txt' AND Evalue like 'myvalue%' 81
NOTE
You cannot use some of the SQL operators (such as > and <) within the string value for the where-clause attribute because doing so may generate XML parser errors. If you must use such operators as part of the where-clause attribute value, use the db-producer-query element, as shown in the next example.
82
NOTES
To deploy tuples to an XML file, use the db-producer-query element to specify a complete SQL query statement that DataDeploy should use to extract data tuples. Ensure that the entire SQL select query is within a single CDATA node. If more than one CDATA node is specified under db-producer-query, DataDeploy will only use the first node. Use the where-clause attribute for the database element and the db-producer-query subelement inside the database element only if the database element is a subelement of the source element. If you specify the db-producer-query subelement, DataDeploy ignores the database elements table and where-clause attribute values. If you do not specify a where-clause attribute value and a db-producer-query subelement, DataDeploy will select all rows from the table specified in the database elements table attribute.
The contents of the properties file is a set of name-value pairs, as shown in the following example:
prefetch=20 remarks=true batchvalue=25
If connection properties such as user and password are present in both the database element and the properties file, the values present in the properties file will be honored.
83
To use databases not certified by Interwoven, you need to specify the jdbc-driver and protocol-url attributes in the database element. The jdbc-driver attribute gives the name of the JDBC driver class as specified by the vendor that will be loaded by OpenDeploy. For example:
jdbc-driver="com.mysql.jdbc.Driver"
To use a non-certified database with OpenDeploy, make sure you specify vendor="rdbms".
You can specify database connection parameters for different databases in a common database configuration file and specify the path to this file in the data-deploy-elements section of the DataDeploy configuration file. Then a database can be referenced by specifying its name in the use attribute of the database element in the DataDeploy configuration file. The following example illustrates a generic entry for a database in the common database configuration file:
<database name="mydbinstance" db="dburl" user="my_db_username" password="my_dbpasswd" vendor="vendorname"> </database>
Invoking Deployment
After a DataDeploy deployment has been configured, it can be run in the following ways, similar to OpenDeploy deployments:
84
"iwodcmd start" (or iwodstart) Admin UI ContentServices for OpenDeploy (web services call)
From the browser-based user interface. From the command line using the iwodcmd start command-line tool. Using ContentServices for OpenDeploy.
3. Insert the contents of the generated dbschema.cfg file into the database section of your DataDeploy configuration file. 4. Run the deployment.
- used to keep track of base tables and delta tables created by DAS. - used to track row deletions.
iwdeltracker
85
- used to store an internal short name for the identifier when the length of the identifier execeeds the limit imposed by the database server. The following types of names are affected:
iwov_idmaps
Table names Column names View names Constraint names For example, on MySQL running on a Windows host, a reduced VARCHAR size is required. Using the create_table_overrides.xml file, you can modify these internal tables by changing the size of the VARCHAR columns in the CREATE TABLE statements. An example version of this file (create_table_overrides.xml.example) resides in the following location:
od-home/examples/etc
Make a copy of the example file without the .example extension and update the datatype size as appropriate. You cannot alter the column names, table names, column order, and datatype. The following sample shows the configuration of the create_table_overrides.xml file:
<sql-statements-override> <create> <table name="iwtracker"> <sql-statement> CREATE TABLE IWTRACKER ( NAME VARCHAR(255) NOT NULL, BASE VARCHAR(255) NOT NULL, BRANCH VARCHAR(255) NOT NULL, UPDATETIME VARCHAR(255) NOT NULL ) </sql-statement> </table> <table name="iwdeltracker"> <sql-statement> CREATE TABLE IWDELTRACKER ( PATH VARCHAR(255) NOT NULL, AREA VARCHAR(255) NOT NULL, KEYCOLNAME VARCHAR(255) NOT NULL, KEYCOLVALUE VARCHAR(255) NOT NULL ) </sql-statement> 86
</table> <table name="iwov_idmaps"> <sql-statement> CREATE TABLE IWOV_IDMAPS ( TYPE INT NOT NULL, SHORTID VARCHAR(255) NOT NULL, LONGID VARCHAR(255) NOT NULL ) </sql-statement> </table> <table name="iwdephistory"> <sql-statement> CREATE TABLE IWDEPHISTORY ( CONFIGNAME VARCHAR(255) NOT NULL, AREA VARCHAR(255) NOT NULL, DEPLOYMENTNAME VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, ACTIONCODE INT NOT NULL ) </sql-statement> </table> </create> </sql-statements-override>
87
88
Database/Driver
Oracle/JDBC thin
db="host_name:port:instanc db="host1:1357:db e_identifier" 1" db="bank01" (See Oracle documentation for details about configuring TNS names) db="(DESCRIPTION =(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = host1)(PORT = 1521)))(CONNECT_D ATA =(SERVICE_NAME = RAC.WORLD)))" db="sys1.interwov en. com:1357/bank01"
Oracle/JDBC RAC db="(DESCRIPTION =(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = host_name)(PORT = port)))(CONNECT_DATA =(SERVICE_NAME = RAC Service Name)))"
Sybase ASE
db="host_name:port/ database_name"
Microsoft JDBC
db="host_name:port;databas db="localhost:143 e= 3; database_name" database=datadepl oy" db="host_name:port?databas db="localhost:143 e= 3? database_name" database=datadepl oy"
89
Table 9
db Attributes (Continued)
Syntax of db Attribute Example
Database/Driver
*Used by OpenDeploy if the use-oci attribute in the database section is set to "yes". Requires installation of the OCI client library on the system where the OpenDeploy base server is installed.
NOTE
For all database vendors, OpenDeploy supports deploying to case-insensitive databases only.
"ibm"
Specifies IBM DB2. Sets a default max-id-length of 18 for constraint names and 128 for table, column, and view names. Specifies Sybase ASE. Sets a default max-id-length of 30. Specifies an Informix database. Sets a default max-id-length of 18. Specifies MySQL. Sets a default max-id-length of 128.
91
92
Chapter 4
Database Auto-Synchronization
The OpenDeploy base server facilitates the database auto-synchronization (DAS) feature. DAS is a deployment mode used in the TeamSite development environment to keep metadata and dynamic content synchronized with a database that typically resides on an integration or testing server. Specific user events, such as making a change to templating content, trigger data deployments directly from the source content repository to the target database. For optimal performance, DAS should be configured to work with the Event Subsystem, which lets you filter the events that DAS receives. The ability to filter events greatly improves the scalability and reliability of DAS. After you configure DAS, TeamSite data content records (DCRs) or extended attributes (EAs) are automatically deployed to a database whenever a TeamSite user performs any one of the following tasks: Creates, changes, or deletes a data content record through the FormsPublisher UI. Creates, changes, or deletes a TeamSite branch, area, or file containing extended attributes through the TeamSite UI. Figure 26 shows the sequence of events associated with DAS. Figure 26 DAS TeamSite
DCR or EAs are modified TeamSite event server triggers OpenDeploy.
OpenDepl
OpenDeploy uses DAS synchronize TeamSite data with database.
database
The modification of TeamSite DCRs or EAs results in a TeamSite event that triggers the DAS feature in OpenDeploy. OpenDeploy deploys the modified items to a database, where they can be used in the TeamSite development environment without impacting any production content.
93
Requirements
DAS is an integral part of OpenDeploy. You do not need any additional software to configure and run this feature. DAS only works in conjunction with TeamSite. You cannot use it with any other tool or file management system. Using DAS requires the following products: OpenDeploy TeamSite FormsPublisher (if DCRs are to be deployed using DAS). If FormsPublisher is not installed and configured for the area being deployed, only metadata is deployed.
Configuration Files
The following table lists those file that control the operation of DAS. Note that in the od-home/ ddtemplate directory, there example files (containing the .example extension) for each of the configuration files listed in the following table. You can edit these files for your use, but you must remove the .example extension before use. Table 11 DAS Configuration Files
File
daemon.cfg
Location
od-home/etc
Description
Configuration file used by the OpenDeploy base server for start-up. You do not need to modify daemon.cfg before running DAS. However, you can optionally add allowed-hosts and bind tags to daemon.cfg to further control access to the database server. Specifies database connection parameters for different databases. See Editing database.xml on page 96.
database.xml
od-home/etc
Configuration Files
Template for a database deployment configuration file used to deploy data to the wide table format. The .example file extension must be removed before using this file. Template for a database deployment configuration file used to deploy data to user-defined schemas. See Editing Deployment Configuration File Templates and drop.cfg on page 96 for more information. Template for a database deployment configuration file used to deploy data from custom DCRs to user-defined schemas. See Editing Deployment Configuration File Templates and drop.cfg on page 96 for more information. Utility configuration file used by the OpenDeploy base server when dropping tables. You must configure drop.cfg as described in Editing Deployment Configuration File Templates and drop.cfg on page 96 before running DAS.
ddcfg_uds. template
od-home/ ddtemplate
od-home/ ddtemplate
drop.cfg
od-home/ ddsyncdb
iw.cfg
(on UNIX)
Controls whether renaming, moving, or deleting files will trigger deployment. Also used to enable the Event Subsystem. See Editing iw.cfg on page 97 iw-home/etc for more information. (on Windows)
/etc od-home/ ddtemplate
Template for a database deployment configuration file use to deploy metadata to the wide table format. The .example file extension must be removed before using this file. Template for a database deployment configuration file use to deploy metadata to user-defined schemas.
databaseDeployment
element and its associated child elements and attributes. Controls name and port number for the OpenDeploy base server host, and the running mode. Refer Database Deployments section in the OpenDeploy Administration Guide for more information.
Utility configuration file used by the OpenDeploy base server when dropping tables.
These files are installed automatically when you install OpenDeploy, with the exception of iw.cfg. These files must be edited as described in this section before you can configure DAS either through the browser-based user interface or manually with the iwsyncdb command. See the sections following the table for instructions about configuring these files and scripts with your site-specific information.
95
Editing database.xml
The database.xml file specifies database connection parameters for different databases. (See Database Configuration File on page 84 for more information). You must set the following attributes in each database element in database.xml:
name db user password vendor
For example, the following settings in database.xml cause DataDeploy to connect to an Oracle 8i database server as marketing (using the password al450) and deploy data to the marketingdb database on port 1521 of the server dbserver1, if myproductiondb is being used:
<data-deploy-elements> <database name="myproductiondb" db="dbserver1:1521:marketingdb" user="marketing" password="al450" vendor="ORACLE"/> </data-deploy-elements>
After you modify the configuration file templates, you need to regenerate the deployment configuration file by running iwsyncdb -initial.
96
Configuration Files
Editing iw.cfg
You must edit the iwserver section of /etc/iw.cfg as follows to support DAS recognition of TeamSite events. Table 12 TeamSite Events in iw.cfg
TeamSite Event
SyncDestroy SyncRevert RenameFSE SetEA DeleteEA
Setting in iw.cfg
log_syncdestroy=yes log_syncrevert=yes log_renamefse=yes log_setea=no log_deleteea=no
Once configured, DAS will support these events when they are initiated from the TeamSite user interface. Table 13 Description of TeamSite Events
TeamSite Event
CreateBranch CreateWorkarea DeleteEA
Description
A branch has been created. A workarea has been created. An extended attribute (EA) has been deleted from a file. A branch has been deleted. An edition has been deleted. A workarea has been deleted. A new edition has been published from the staging area A branch has been renamed. An FSE has been renamed. A workarea has been renamed An EA has been added to/modified on a file. A file or directory has been submitted. A file with EAs has been created. A file with EAs has been deleted. A file with EAs has been modified. A file with EAs has reverted to an earlier version. A file or directory has been updated.
97
DestroyBranch DestroyEdition DestroyWorkarea PublishStagingArea RenameBranch RenameFSE RenameWorkarea SetEA Submit SyncCreate SyncDestroy SyncModify SyncRevert
Update
98
2. Select the OpenDeploy server from the Selected Server list. 3. Enter the path to the appropriate workarea in the Workarea box, or click Browse to navigate to the location. 4. Check the DAS Setup for Template Types box to deploy DCRs. 5. Check the DAS Setup for Metadata box to deploy extended attributes (metadata). 6. Click Next to continue. The boxes that you check indicate what actions occur when some or all of the following TeamSite events occur: Creations, changes, or deletions of a DCR through the FormsPublisher user interface. Creations, changes, or deletions of a TeamSite branch, area, or file containing extended attributes through the command line. Creations, changes, or deletions of a TeamSite branch, area, or file containing extended attributes through the TeamSite file system interface.
99
Here you have the option of selecting the DCR type from DCR Type list. You can also overwrite existing dbschema.cfg and *_dd.cfg files by checking its associated box. Click Execute to start the DAS module. After the DAS setup has completed, you can view the DataDeploy log by clicking its associated button.
You can also overwrite existing dbschema.cfg and *_dd.cfg files by checking its associated box. Click Execute to start the DAS module. As with the DAS Setup for Template Types, you can view the DataDeploy log by clicking its associated button.
Running iwsyncdb
This section describes how to run the iwsyncdb command, which performs the following activities:
100
Generates the dbschema.cfg file if DAS is set up. Generates configuration files for use by DAS. Submits the generated database deployment configuration files to the staging area and publishes an edition based on the updated staging area. Creates initial base and delta tables in the destination database for the updated TeamSite areas. The following subsections and diagrams explain these activities in detail.
for deploying only a specific DCR type. For workarea_vpath, specify the full vpath to the TeamSite workarea. For example, you would enter the following if the FormsPublisher is set up for branch b1 and workarea w1 on the default/main branch, and od-home is /usr/iw-home/datadeploy:
/usr/iw-home/datadeploy/bin/iwsyncdb -initial /default/main/ b1/WORKAREA/w1
101
2 1
deployment configuration file X_dd.cfg
iwsyncdb command
deployment
3
ddcfg_uds.template file
1. The iwsyncdb -initial command is executed from the command line. 2. The iwsyncdb script reads the datacapture.cfg file for each data type that exists in workarea_vpath specified in Step 1. For example, if the FormsPublisher directory in workarea_vpath contains the data types X, Y, and Z, iwsyncdb reads the datacapture.cfg file corresponding to each data type. Refer to the FormsPublisher Developers Guide for details about data types and the datacapture.cfg file. 3. The script uses ddcfg_uds.template as the base format of the deployment configuration files that it will generate for each data type. 4. Based on ddcfg_uds.template and the datacapture.cfg files for each data type, the script creates configuration files for each data type- X_dd.cfg, Y_dd.cfg, and Z_dd.cfg. These files configure a TeamSite-to-database deployment. The mdc_dd.cfg file is also created so that the OpenDeploy base server remains synchronized with other TeamSite features. 5. The newly generated database deployment configuration files are submitted to the staging area, and an edition based on the updated staging area is published.
NOTE
If iwsycndb succeeds in generating configuration files for the data types (data_type_dd.cfg), but fails to connect to your database, changes to database attributes in the ddcfg_uds.template file will not be propagated to the data_type_dd.cfg files. If this occurs, edit all data_type_dd.cfg files or use iwsyncdb -force to overwrite the data_type_dd.cfg files.
102
OpenDeploy base
Command Line iwsyncdb -initial (continued) server startup information OpenDeploy Base Server
Reads daemon.cfg
for startup information Runs continuously Automatically deploys data when TeamSite trigger events occur
RDBM
1. The iwsyncdb command registers a default set of TeamSite events as triggers that will automatically initiate deployment. See DAS Triggers on page 117 for details about which events are registered as triggers. 2. The iwsyncdb command initiates DAS. 3. OpenDeploy reads the daemon.cfg file, which contains additional daemon startup information. The daemon finishes its startup, and runs continuously until iwsyncdb -initial is invoked to configure DAS for another branch. 4. The OpenDeploy base server creates the following in the destination database: Initial wide base tables for the branch. Initial delta tables and views for the workarea. DAS is now configured and ready for use. The only time you need to repeat any configuration step is when you enable a different database, user, or password. If you add new templating
103
branches, workareas, or files through the TeamSite UI, DAS automatically generates the necessary deployment configuration files and initial tables.
The OpenDeploy user interface cannot be used to configure the event server for TeamSite 6.5 or later. Please use the tools provided with TeamSite.
The Event Subsystem is packaged and installed with TeamSite and can be used to deliver messages (events) to and from OpenDeploy with TeamSite as an event publisher and OpenDeploy as a subscriber. To do this, the Event Subsystem stores and queues events, and it lets you filter which of these events OpenDeploy receives. The Event Subsystem uses a standard model of message delivery, which is based on three concepts: Events - synonymous with message. Events are the result of changes, end-user actions, or occurrences in a Publisher program. For example, TeamSite server events include (but are not limited to):
CreateBranch Submit SyncDestroy
Events have names and properties, such as user, role, and timestamp, that are represented in the Event Subsystem as attribute/value pairs. OpenDeploy can be set up to perform functions after a TeamSite event occurs. For example, OpenDeploy can be configured to deploy data directly after end users submit content to TeamSite staging areas. Publishers - applications that send events to the Event Subsystem. The Event Subsystem then passes the events to Subscribers that have registered to receive them. Subscribers - applications that register with the Event Subsystem to receive events. Subscribers can filter events so that they receive only the ones they need. Figure 32 illustrates how the Event Subsystem works:
104
ProxyServlet
OpenDeploy (DAS)
The following software must be installed and configured before using the Event Subsystem (refer to the OpenDeploy Release Notes for the latest product release compatibility information): TeamSite. OpenDeploy installed on the same system as TeamSite and configured to use DAS. JDBC 2.0 compatible driver. Use JDBC type 4 drivers from i-net software if you are using Microsoft SQL Server 2000. The i-net driver is packaged with OpenDeploy and resides in the following location:
od-home/drivers/UNA2000.jar.
105
2. Select the database that is required for persisting events from the Database Vendor list and click Next. The Event Subsystem Configuration: Set Up Database window for that database appears (Figure 34). Figure 34 Event Subsystem Configuration: Set Up Database Window
3. Specify the following database attributes in the setup window for the database you selected: Host - the name of the database host. Listener Port - the port number on which the database server is listening. Database Name (all except Oracle) - the name of the database where the tables will be created. Database SID (Oracle only) - an attribute specific to Oracle databases, same as Database Name. User Name - the name of the user who has permissions to create tables in the specified database. Password - the database password for the specified user. Path to JDBC Driver - the default JDBC driver path specified, points to the JDBC driver shipped with DAS. This attribute can be changed to a user-specified driver. 4. Click Next. The Event Subsystem configuration files jmsconfig.xml and eventsubsystem.properties are now updated. Existing configuration files are copied to jmsconfig.xml.old and eventsubsystem.properties.old. The following warning is displayed (Figure 35):
106
5. Click OK to continue. If the database contains tables with names similar to those required by the Event Subsystem, the Event Subsystem Configuration: Create Tables for Event Subsystem Repository window appears (Figure 36). Figure 36 Event Subsystem Configuration: Create Tables for Event Subsystem Repository Window
This window contains the table names are listed, and provides you with an option to Drop and Recreate Tables or Keep Existing Tables. If the existing tables match those required by the Event Subsystem, click Keep Existing Tables. Otherwise, it is recommended that the tables be dropped and recreated by clicking either Drop and Recreate Tables or Back, and choosing a different database. 6. Select DAS > Start/Stop Event Server to display the Event Server Configuration: Start/Stop the Event Server window (Figure 37). Figure 37 Event Server Configuration: Start/Stop the Event Server Window
7. Click the Stop Event Server button (if the Event Subsystem is already running) and then restart it by clicking Start Event Server button. 8. Restart JmsProxyServlet to ensure that the servlet engine starts publishing to the Event Subsystem by entering the following TeamSite commands at the prompt.
iwreset iwreset -ui 107
2. Open the copied file using your favorite text or XML editor. 3. Uncomment the DatabaseConfiguration element.
108
4. Configure the RdbmsDatabaseConfiguration element for use with your RDBMS. The RdbmsDatabaseConfiguration element contains the following attributes:
driver url
- JDBC URL. - RDBMS user name. - password associated with RDBMS user name.
user
password
- (optional) maximum number of active connections that can be allocated from the connection pool. Specify the value 0 for no limit. Default value is 10.
maxActive maxIdle - (optional) maximum number of connections that can sit idle in the connection pool, before connections are evicted. Default value is 10.
- (optional) minimum number of seconds that a connection may remain idle before it may be evicted. The default value of 0 disables eviction of idle connections. Must be used in conjunction with the evictionInterval attribute.
minIdleTime
- (optional) interval in seconds between checking idle connections for eviction. Idle connections are removed after the time specified by the minIdleTime attribute.
evictionInterval
The following sample shows the RdbmsDatabaseConfiguration element configured for use with an Oracle database:
<RdbmsDatabaseConfiguration driver="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@myhost:1521:dbsid" user="user1" password="abc123" maxActive="10" maxIdle="5" minIdleTime="1800" evictionInterval="3600"/>
5. Set the jdbc_classpath variable in the following file to the location of your database vendors JDBC driver:
iw-home/eventsubsystem/conf/eventsubsystem.properties
For example: Windows - jdbc_classpath=c:\\drivers\\oracle\\ojdbc14.jar or UNIX - jdbc_classpath=/var/drivers/oracle/lib/ojdbc14.jar 6. Create and register database tables before you start the Event Subsystem. A number of SQL scripts that let you create and register the tables are included with OpenDeploy and reside in the following location:
iw-home/eventsubsystem/conf/ddl/create_dbvendor.sql
109
Run the script that corresponds with the database to use. You can execute the SQL script using a client utility supplied by the database vendor. For example, if you are using an Oracle database, use SQL*Plus. If you are using Microsoft SQL Server, use Query Analyzer. If you are running this script for the first time, the Event Subsystem tables may not be present and you will receive an error message. Ignore the error message and continue executing the script. 7. Start the Event Subsystem using one of the following methods, depending on your operating system: (Windows) Select Control Panel > Services > InterwovenEventSubsystem. (UNIX) Run the iw-home/private/bin/iweventsubd script. 8. Restart JmsProxyServlet to ensure that the servlet engine starts publishing to the Event Subsystem by entering the following commands at the prompt.
iwreset iwreset -ui
110
NOTE
If you are using TeamSite 6.5 or earlier, the name attribute appears as topicName. 3. Stop and restart the Event Subsystem. 4. Stop and restart DAS.
- designates very severe error events that will presumably lead the application to - designates error events that might still allow the application to continue running.
abort.
error info
- designates informational messages that highlight the progress of the application at coarse-grained level. This is the option used if an invalid option (any option other than the ones listed here) is specified. - (default) designates fine-grained informational events that are most useful to debug an application. Both debug and info messages are written to the log files.
debug
The fatal and error options do not generate log messages unless an actual error occurs. During startup and shutdown, no messages occur unless there is a problem. Although the configuration suggests that the log file is named openjms.log, the event subsystem actually logs information into the following files: Windows - eventsubd_out.log and eventsubd_err.log UNIX - eventsubd.log
111
Using DAS
After DAS is configured, it is transparent to FormsPublisher end users. Therefore, there are no additional tasks that an end user must perform to use DAS. The following diagram shows how DAS automatically updates the necessary tables when a TeamSite trigger event occurs. See the diagram key following the diagram for details about each step. Figure 38 Using DAS
TeamSite
iwsyncdb
- Receives and interprets data from TeamSite trigger event - Passes data to
2
OpenDeploy Determines which deployment configuration file to use Deploys data to database
RDBM
1. FormsPublisher end-user activity (that is, any activity shown in DAS Triggers on page 117) results in a TeamSite event trigger. The event trigger starts the iwsyncdb command and sends the changed data to the script. If the Event Subsystem is configured, the TeamSite trigger event directly triggers the OpenDeploy base server, without starting iwsyncdb.
112
Using DAS
2. The iwsyncdb command sends the data content record to the DataDeploy daemon. The daemon determines which database deployment configuration file(s) to use for the deployment. For TeamSite events (for example, Create Branch) that are not specific to a single file, the daemon uses the templating.cfg file to determine which data types (and therefore which database deployment configuration files) are affected by the TeamSite event. For example, in the case of a Create Branch TeamSite event, the OpenDeploy reads templating.cfg to determine which data types exist in the branch. OpenDeploy then uses the database deployment configuration files for each affected data type when deploying the new data to the database. For events that are file-specific (for example, renaming a file), the daemon uses the information from the TeamSite event information module to determine which file is affected and which database deployment configuration file to use. 3. OpenDeploy uses the appropriate database deployment configuration files to update the affected base and delta tables in the database.
113
When the initial delta table is created, it contains the same columns as the initial base table, in addition to values for each item: Table 15 Table Update Example (cont.)
Path State PressDate Headline Picture ...
mypath
New
cand.gif ...
When the data content record is submitted, its delta table values are transferred to the base table, and its own cells are cleared, as shown in the following two tables: Table 16 Table Update Example (cont.)
Path State PressDate Headline Picture ...
mypath
New
4/17/03
114
Using DAS
If you need to modify such fields, you must clear the value, then save and deploy the DCR. Then insert the new value, save the DCR, and deploy it. Databases report constraint violation errors if child tables reference the field values you are deleting. Therefore, you must also delete the corresponding rows in child tables. To do that automatically, set the ri-constraint-rule attribute to "ON DELETE CASCADE". Recreate the rows when you insert the new value for the parent table.
DATE, DATETIME, TIMESTAMP, CLOB, and BLOB data types are always updated regardless of whether the data has been modified.
This naming convention includes using double underscores between datacategory_datatype and branchname_areaname. Accordingly, tables for DCR/Templating data-types would be named the following:
STORENAME_DATATYPE__ACTUALAREA
where ACTUALAREA would be MAIN_BRANCHNAME_STAGING for staging area tables and MAIN_BRANCHNAME_WORKAREA_WANAME for workarea tables. For example, if you are deploying from area /store1/main/branch1/WORKAREA/wa1 for data category intranet and data type weather, the table names would be: For the staging area - STORE1_INTRANET_WEATHER__MAIN_BRANCH1_STAGING For workarea - STORE1_INTRANET_WEATHER__MAIN_BRANCH1_WORKAREA_WA1 For metadata for the same area, the table names would be: For the staging area - STORE1_TEAMSITE_METADATA__MAIN_BRANCH1_STAGING For workarea - STORE1_TEAMSITE_METADATA__MAIN_BRANCH1_WORKAREA_WA1
NOTE
The DAS table naming conventions are subject to change, so do not use the DAS table names in your production environment. Create synonyms or aliases for the DAS tables and use those names instead of DAS-generated table names.
For UDS tables, there is an additional group name nested between the data type and branch name:
115
storename_datacategory_datatype__groupname__branchname_areaname
For example:
STORE1_INTRANET_WEATHER__FORECASTERS__MAIN_BRANCH1_STAGING
Note that the group name is separated by two underscores (__) on each side.
The Longid column contains the entire character string for the object as it appears in the original source file. The Shortid column contains the generated name conforming to the databases object length limits. For example, a typical table might appear as follows: Table 18 Database Object Name Lengths
Type
2 1
Longid
Shortid
INFORMATION0_PRESENTATIONTITLE INTRANET_DEPTINFO__DATADPLYBRNCH_STAGING
116
Using DAS
Longid
Shortid
Because different databases support different maximum object name lengths, the threshold for when a Shortid name is generated depends on the database vendor or type. OpenDeploy uses the values set for the max-id-length attribute to determine this threshold. When deploying to an IBM DB2 database, OpenDeploy maps table, column, and view names only when a name exceeds 128 characters, and maps constraint names only when they exceed 18 characters. If you construct an SQL statement that performs an activity on a table that was created by OpenDeploy, and if that table contains any database objects whose names exceed the maximum length, the SQL statement must first reference the mapping table to determine the actual (Longid) object name(s). This requirement applies to all SQL statements, including those not executed through OpenDeploy.
DAS Triggers
DAS interprets the following TeamSite events as deployment triggers. The event can be initiated from the TeamSite UI, the TeamSite file system interface, or the command line. Whenever one of these events occurs, the delta and base tables are updated as shown in the following table. For delta table updates, only the tables affected by the triggering TeamSite event are updated. Table 19 DAS Triggers
TeamSite Event Delta Table Action Base Table Action
None. Build delta tables. Delete delta tables. Delete delta tables.
Build empty base tables. None. Delete base tables. None. None. None. None.
Modify data content Update or insert a new row. record Add data content record Delete data content record Insert a new row. Insert or update the NOT-PRESENT row.
117
Submit modified data 1. The Previous Staging row is Update the Staging content record propagated to all workareas except row. the submitting workarea. 2. Delete Previous Staging row from submitting workarea. Submit added data content record 1. The Placeholder row marked NOT-PRESENT is propagated to all workareas except the submitting workarea. 2. Delete the Placeholder row from the submitting workarea. 1. The previous Staging row is propagated to all workareas except the submitting workarea. 2. Delete the previous Staging row from the submitting workarea. Rebuild the delta tables. 1. Delete old delta tables. 2. Regenerate new delta tables. None. Update the Staging row.
Get latest (workarea) Rebuild the delta tables. Copy to (any area) Rename workarea Rename branch
None. None. None. 1. Delete old base tables. 2. Regenerate new base tables. None. None.
Regenerate delta tables. 1. Delete the row for the old file name. 2. Add a row for the new file name. 1. Delete the row for the old file name. 2. Add a row for the new file name.
Move file
None.
Delete file
If a row for the file exists in the base None. table, the row in the delta table is marked NOT-PRESENT. If no row existed in the base table, the row in the delta table is deleted. Insert or update the row. None.
Set metadata
118
Using DAS
Revert
Use the data from the earlier version None. of the file (selected in the TeamSite graphical user interface) to update or insert a new row.
For example, to prevent Rename events from being recorded, set the following in iw.cfg:
iwevents_exclude="RenameFSE"
You can also use (Perl 5) regular expressions with the following syntax to further control event logging:
renamefse_filter="REGEX"
For example, to specify that only Rename events occurring in the workarea bill are logged:
[iwserver] renamefse_filter="/default/main/WORKAREA/bill"
This entry sets regular expressions, one of which must match the event line (as seen in iwevents.log) for an event to be logged. If these are empty or absent, all corresponding events are logged.
NOTE
When viewing log files that have been created in a multibyte environment, ensure that you use an appropriate text editor to view them.
119
The virtualization view uses a column mapped to a state value in the WHERE clause of the view definition. However, the iwsyncdb -ddgen command run during DAS initialization automatically adds a column for the state value only for the root group in the generated template_type_dd.cfg file. To create virtualization views for all tables defined in the deployment (including non-root groups): 1. Generate or manually create the dbschema.cfg file for the data type. 2. For all the non-root groups, add a column element to map the state value, for example:
<column name="IW_state" data-type="VARCHAR(255)" value-from-field="state" allows-null="no"/>
3. Open the following file using your favorite text editor: (If deploying Interwoven-style DCRs) - od-home/ddtemplate/ddcfg_uds.template or
120
Using DAS
(If deploying custom DCRs) - od-home/ddtemplate/ddcfg_uds_custom.template 4. Add the table-view attribute to the database element for the deltagen deployment, for example:
<database use="usename" ... table-view="yes">
5. Issue the iwsyncdb -ddgen command for the workarea and template type for which you performed the preceding setup. 6. After running iwsyncdb -initial to register all the tables create views for the non-root groups use the CREATE VIEW command as explained earlier.
2. Rename the file mdc_ddcfg_uds.template.example to mdc_ddcfg_uds.template. 3. Configure the appropriate database sections. 4. Ensure that you also set up iw-home/local/config/datacapture.cfg. 5. If deploying metadata using UDS, run the following command:
od-home/bin/iwsyncdb -mdcdbschemagen
To deploy TeamSite metadata into a UDS in DAS mode, follow these steps: 1. Generate a default dbschema.cfg file for a metadata datacapture.cfg file that is located at iw-home/local/config/datacapture.cfg by entering the following command at the prompt:
iwsyncdb -mdcdbschemagen [-force]
2. Create an mdc_ddcfg_uds.template file in the od-home/ddtemplate directory. 3. Enter the following command at the prompt:
iwsycdb -mdcddgen [-force]
121
Uncomment logFile tags with the name property value of "TeamSiteDASLog" and "TeamSiteClientDASLog". For example:
<logFile name="TeamSiteClientDASLog" baseLogName="_IW_LOG_DIR_/iwui/iwevents/TeamSiteClientEvents" stateFileName="_IW_HOME_/servletd/logs/iwclientDASproxy. properties" waitTime="30000" isDAS="true"/> <logFile name="TeamSiteDASLog" baseLogName="_IW_LOG_DIR_/iwevents/TeamsiteEvents" stateFileName="_IW_HOME_/servletd/logs/iwDASproxy.properties" waitTime="30000" isDAS="true"/>
3. Restart the TeamSite services. 4. The DAS enabling can be verified by looking into the messages_handles database table for the messages published for the DAS.
example: Pseudo Query:
122
Select * from message_handles where destinationId in (Select destinationId from destinations where name ='TeamSite_User')
or
123
2. Restart OpenDeploy, but do not reboot the host. If you reboot the host, the ip_local_port_range value will be set to default value and you will have to run the above command again in order to increase the number of ports available. 3. You can make these changes in port range permanent by modifying the sysctl.conf file, which resides in the /etc directory. Open this file using your favorite text editor and add the following line of code:
net.ipv4.ip_local_port_range = 8192 65535
Tutorial
This manual includes a tutorial for configuring and using DAS. See Appendix B, Database Deployment Tutorials on page 199 for more information.
124
Chapter 5
DataDeploy Deployments
This chapter describes methods and configuration of data asset deployment using the optional DataDeploy module. You must license the DataDeploy module to perform any of the tasks listed in this chapter. Refer DataDeploy Module Licensing section in the OpenDeploy Installation Guide for details about enabling the DataDeploy module. Using the DataDeploy module, you can perform the following data asset deployments: Standalone database deployments - deployment of data assets from a base server to a database. Target-side database deployments - deployment of data assets as files from a base server to an OpenDeploy target. Upon receipt of the data asset files, they are subsequently moved to a database. Included in target-side database deployments are synchronized deployments that move code and content files to their targets simultaneously. These types of database deployments are on-demand, non event-driven deployments. They differ from automated (DAS) deployments in a number of ways: Database deployments do not require the presence of TeamSite. DAS deployments do, on the other hand, because they are triggered by events occurring in TeamSite. With database deployments, table naming conventions can be defined by the user, but with DAS, table names are generated based on the vpaths and data types involved (see Table Naming Conventions on page 115). The names and locations of the database deployment configuration files can be defined by the user. With DAS, the configuration files must be located in the TeamSite file system and must be named based on the templating data type involved. The rest of this chapter describes the different methods and configurations for configuring and performing database deployments. You should first familiarize yourself with how to the database deployment configuration tasks described in Chapter 3, Configuration Files before continuing with this chapter.
125
structured content files Structured content files are deployed to relational database using JDBC
source
database
Figure 39 shows an OpenDeploy source that has a repository containing structured content files. When the deployment is run, the deployment configuration references a separate DataDeploy configuration file also residing on the source. The DataDeploy configuration file contains the information and settings needed to access the structured content, and copy the contents to a relational database. Standalone deployments typically are used when you want to directly deploy structured content right into a database. Usually the database is near the source content, inside the same firewall. Popular use cases include writing templating data or metadata into the database. Standalone database deployments are similar to DAS, except that instead of a TeamSite event triggering a deployment, you can run the deployment at the time and method of your choosing, such as from the browser-based user interface, through a command-line tool, and through the deployment scheduling feature. You also can deploy any type of structured content, not just those associated with TeamSite.
Server Configuration
Only OpenDeploy base servers can perform standalone database deployments. The OpenDeploy base server must have its database deployment functionality enabled in its base server configuration file. Refer Database Deployments section in the OpenDeploy Administration Guide for more information.
126
This type of configuration is known as a DataDeploy wrapper file. The dataDeploy element contains the configFilePath attribute, whose value specifies the full path to the appropriate DataDeploy configuration file. This method is useful if you have legacy DataDeploy configuration files residing within the TeamSite directory. For example:
<dataDeploy configFilePath="/usr/DataDeploy/conf/datadeployment.cfg"/>
DataDeploy configurations files referenced in this manner can reside anywhere on the host file system, and contain the .cfg, as well as the .xml, file extension. See Creating the DataDeploy Configuration File on page 60 for more information. Note that other than the logRules element, the OpenDeploy configuration file includes only the dataDeploy element and its configFilePath attribute. No other OpenDeploy elements or attributes can reside in the deployment configuration. You can run the OpenDeploy deployment using any of the following methods: From the Start Deployment window in the browser-based user interface. You must include the following value:
iwdd=internal-deployment-name
in the Parameters text box, where internal-deployment-name refers to a named deployment element in the DataDeploy configuration file. Using the iwodcmd start command-line tool:
127
As a scheduled deployment configured either in the browser-based user interface, or from the command line using the iwodcmd schedadd command-line tool.
Any DataDeploy configuration you want to run must reside in the od-home/conf directory, and have the .xml extension. If you move a legacy DataDeploy configuration file into the conf directory, you must change its .cfg extension to .xml. You can also use OpenDeploy scheduling tools to DataDeploy configurations from the directory.
/conf
Tutorial
This manual includes a tutorial for configuring and running standalone database deployments. See Appendix B, Database Deployment Tutorials for more information.
128
sourc
target
databas
Deploying structured content in this manner allows OpenDeploy to reside closer to the target database, such as on the same LAN. Additionally, target-side database deployments allow you to take advantage of many OpenDeploy features, including the following: Fan-out transactional deployment, which allows synchronization of files and database content. Encrypted data transfer for secure deployment between OpenDeploy servers. Data compression for reduced network traffic between OpenDeploy servers.
129
Synchronized Deployments
Synchronized target-side database deployments guarantee the collective integrity of structured content destined for a database with code and content files. Common examples include: Files with associated metadata for use by a search engine. Online catalog details along with web presentation templates. Documents and personalization data for a portal. JSP code and related data for an application server. OpenDeploy provides a secure, flexible, and scalable solution for the cross-platform, transactional transfer of file assets to multiple servers. It can be configured to call DataDeploy to reliably and securely deliver database content along with file system assets. If any part of the deployment transaction fails, the database and files are automatically rolled back. Figure 41 shows an OpenDeploy source that has both structured content and standard code and content files. When the deployment is run, all the files are deployed to their separate target file locations, with structured content subsequently being deployed to the relational database. Figure 41 Synchronized Database Deployment
Code and content files are deployed to target. Structured content files are deployed to target source targe
database
130
Synchronized deployments can deploy files to multiple OpenDeploy targets as a fan-out deployment (Figure 42). However, only one target can be specified for the receipt of data asset files that are to be written to a database. Figure 42 Synchronized Database Fan-out Deployment
Code and content files are deployed to targe Code and content files are deployed to Structure content files are deployed to target. source Code and content files are deployed to target target databas XML content is deployed to
Server Configuration
Both OpenDeploy base servers and receivers can be recipient targets of synchronized database deployments. The following sections describe the requirements for source and target servers participating in a target-side database deployment.
Source Server
The following tasks must be performed on a source OpenDeploy base server: The DataDeploy module must be licensed. Refer to DataDeploy Module Licensing section in the OpenDeploy Installation Guide for more information. The databaseDeployment element in the source base server configuration file (by default odbase.xml) must be enabled. Refer to Database Deployments section in the OpenDeploy Administration Guide for more information.
131
The deployment configuration must include the dbLoader element. This element references a database schema file, and also references the defined database element in the servers database configuration file (database.xml, see next section). See Deployment Configuration on page 132 for more information. The dnrProperties elements infoStreamFormat attribute value must be set to manifest. Refer to Specifying the Deployment Information Stream Format section in the OpenDeploy Administration Guide for more information.
Target Servers
The following tasks must be performed on each target OpenDeploy base server or receiver: The databaseDeployment element on the target OpenDeploy servers configuration file (by default odbase.xml or odrcvr.xml) must be enabled. Refer to Database Deployments section in the OpenDeploy Administration Guide for more information. The servers database configuration file (database.xml) must contain a defined database element corresponding to the database type being used. See Database Configuration File on page 84 for more information.
Deployment Configuration
The deployment of database assets as part of a file deployment is specified by the inclusion of the dbloader element within the pathSpecification element of the deployment configuration:
<pathSpecification> ... <dbLoader useDatabaseRef="mydatabase" databaseXmlFile="/targethost/database.xml"> ... </dbLoader> ... </pathSpecification>
- specify the full path to the database XML file, where database connection parameters for different databases are listed. For example:
<dbLoader useDatabaseRef="mydatabase" databaseXmlFile="/targethost/database.xml">
132
where od-home is OpenDeploy home directory on the target. Within the dbLoader element, you must indicate which of the two methods of database asset deployment by specifying one of the following elements:
xmlData
- indicates that those files being deployed are XML files whose contents are to be deployed to a database. For example:
<dbLoader useDatabaseRef="mydatabase" databaseXmlFile="/targethost/database.xml"> <xmlData schemaMapFile="/myschemas/schemaForXmlType1.cfg" xmlType="interwoven"/> </dbLoader>
eaData
- indicates that those files being deployed have associated TeamSite extended attributes that are to be deployed to a database. For example:
<dbLoader useDatabaseRef="mydatabase" databaseXmlFile="/targethost/db.xml"> <eaData schemaMapFile="/usr/local/iw-home/local/config/ dbschema.cfg"/> </dbLoader>
Both the xmlData and eaData elements contain the same schemaMapFile attribute, which specifies the full path to the DataDeploy database schema file. For example:
schemaMapFile="/source/allschemas/map1.cfg"
This file contains the settings required to write the deployed database assets to the target database. The xmlData element also contains the xmlType attribute. Specify one of the following values for this attribute: - the DCRs use the Interwoven style, as indicated by the dcr-type attribute having the value iwov in TeamSites templating.cfg file.
interwoven custom - the XML or DCR files are based on the user's custom-defined style, as indicated by the dcr-type attribute having the value xml in TeamSites templating.cfg file.
Refer to the TeamSite documentation for more information on configuring the templating.cfg file.
133
You can also indicate that those files being deployed are XML files whose contents are to be deployed to a database, and that also have associated TeamSite extended attributes, by specifying the eaAndXmlData element under the dbLoader element. Within the eaAndXmlData element you can specify both the xmlData and eaData elements, for example:
<dbLoader useDatabaseRef="mydatabase" databaseXmlFile="/targethost/db.xml"> <eaAndXmlData> <xmlData schemaMapFile="/myschemas/schemaForXmlType1.cfg"/> <eaData schemaMapFile="/usr/local/iw-home/local/config/ dbschema.cfg"/> </eaAndXmlData> </dbLoader>
For example:
<xmlData schemaMapFile="/path/to/type1.schema" xmlType="custom"> <dbLoaderCustom> <![CDATA[ <external-tuple-processor class-name="myTppClass" interface-version="2.0"/> <filter> <keep> <or> <field name="key" match="city"/> <field name="value match="paris"/> </or> </keep> </filter> <substitution> <field name="key" match="BEFORE" replace="AFTER"/> </substitution> <substitution use="globalFromTargetDatabaseXml"/> ]]> </dbLoaderCustom> 134
</xmlData>
Any other DataDeploy elements other than ones listed here are ignored.
Synchronized Deployment
If you are performing a synchronized deployment of code and content files with database content, you can configure the source file locations files in one of the following methods: Configure separate definitions for the file and database asset legs, for example:
<deploymentConfiguration> ... <definition name="OpenDeploy_files"> ... </definition> <definition name"DataDeploy_files"> ... <dbLoader ...> ... </dbLoader> ... </definition> ... </deploymentConfiguration>
Configure separate path specifications within the same source file location, for example:
<remoteDiff area="/default/main/WORKAREA/jdoe/files"> <pathSpecification <path name="."/> </pathSpecification> <pathSpecification> <path name="data_assets"/> <targetRules area="od-home/tmp/files/data_assets"> ... </targetRules> <dbLoader ...> ... </dbLoader> 135
</pathSpecification> </remoteDiff>
Note that this method of configuration requires that all files reside within the specified source file system, and that the structured content files be in a distinct location from the other files. In this example, the code and content files destined for target file servers resides in the specified source file location:
/default/main/WORKAREA/jdoe/files
while the structured content files destined for the target database reside in a subdirectory:
/default/main/WORKAREA/jdoe/files/data_assets
Additionally, because this configuration is deploying two separate sets of files, they must also be kept distinct on the target. Therefore, a target override (the targetRules element) is included in the data asset deployment path specification, which directs the structured content files to the target override location:
od-home/tmp/files/data_assets
The remaining files are deployed to the target file location specified within the target element.
136
Chapter 6
Advanced Features
This chapter describes some of the advanced features that OpenDeploy provides. The following sections detail how to deploy data as database objects, set up filters and substitutions, deploy replicants, enhance deployment data, and use other miscellaneous features.
where trigger_prefix is any case-insensitive string which can be either a TeamSite EA or a value in an XML or DCR file.OpenDeploy examines each tuple for key-value pairs in which the key name starts with any of the specified prefix values. For example, for values whose keyname starts with Trig to be treated like database triggers, the section in the database configuration would look like:
<trigger> <fieldname prefix="Trig" /> 137
trigger
</trigger>
OpenDeploy examines each tuple for key-value pairs in which the key starts with the specified prefix value. If found, the value for that key is treated as a database trigger. OpenDeploy does not validate the value for a CREATE TRIGGER statements syntax and semantics. OpenDeploy looks for the trigger name and the table on which the trigger is being created. If a trigger exists with the same name on the same table, it is dropped and recreated. The following examples illustrate the configuration file for deploying a DCR field as a trigger, and the corresponding DCR file where the CREATE TRIGGER statement is specified:
<data-deploy-configuration> <data-deploy-elements filepath="od-home/etc/database.xml"/> <client> <deployment name="mydep2"> <exec-deployment use="basearea"/> </deployment> <deployment name="basearea"> <source> <teamsite-templating-records options="wide" area="/default/main/branch1/WORKAREA/wa"> <path name="templatedata/internet/book/data/book2" visit-directory="deep"/> </teamsite-templating-records> </source> <destinations> <!-- Sybase SQL Anywhere 7.x --> <database use="oracledb" update-type="standalone"> <trigger> <fieldname prefix="Reviews/1/Review Reader E-Mail"/> </trigger> <dbschema> <group name="book" table="triggertest" root-group="yes"> <attrmap> <column name="IW_State" data-type="varchar(255)" value-from-field="state"/> <column name="MyPath" data-type="varchar(255)" value-from-field="path"/> <column name="Title" data-type="VARCHAR(100)" value-from-field="Title" allows-null="no" is-url="no"/> <column name="Cover_Picture" data-type="VARCHAR(255)" value-from-field="Cover Picture" allows-null="yes" is-url="no"/> <column name="Author" data-type="VARCHAR(40)" value-from-field="Author" allows-null="no" 138
is-url="no"/> ... </attrmap> <keys> <primary-key> <key-column name="Title"/> <key-column name="ISBN"/> </primary-key> </keys> </group> </dbschema> </database> </destinations> </deployment> </client> </data-deploy-configuration>
DCR File:
<!DOCTYPE record SYSTEM "dcr4.5.dtd"> <record name="book2" type="content"><item name="Title"><value>patriot games</ value></item><item name="Cover Picture"><value>cvr.gif</value></item><item name="Author"><value>Tom Clancy</value></item><item name="Publication Date"><value>1999-01-01</value></item><item name="ISBN"><value>zcxcv1234</ value></item><item name="Cover"><value>Paperback</value></item><item name="Price"><value>44.99</value></item><item name="Plot Summary"><value>summary1</value></item><item name="Reviews"><value><item name="Review Reader"><value>John</value></item><item name="Review Reader E-Mail"><value>jj@aol.com</value></item><item name="Reader Comments"><value>comments</value></item></value><value><item name="Review Reader"><value>james</value></item><item name="Review Reader E-Mail"><value>create trigger test_trigger on triggertest after insert as insert into mytrig values (999) </value></item><item name="Reader Comments"><value>comments2</value></item></value></item></record>
The value of any_prefix can be any case-insensitive character string. OpenDeploy examines each tuple for key-value pairs in which the key name starts with any of the specified prefix values. For each match, the value for that key is treated like a database stored procedure; that is, OpenDeploy does not validate the syntax of the value of the key-value pair. Instead, OpenDeploy passes the value to the database, the key-value pair is not inserted into the table, and errors (if any) are returned to the user. If creation of a stored procedure fails and if the tuple contains non-stored procedure key-value pairs, the entire deployment is aborted.
Setting Up Filters
The types of filters that OpenDeploy allows are: data filters, category and DCR type filters, and event filters to be used by DAS.
Data Filters
Data filters let you explicitly state which tuples will be deployed. To set up a data filter a filter section, such as the following example, must be added to the configuration file:
<filter name="MyFilter"> <!--This is a filter that can be used by any deployment --> <keep> <!--Any of the following (logical OR):--> <!--dir2/subdir/index.html,any *.html file in dir1,--> <!--OR anything with key 'guard'AND value 'IGNORE --> <or> <field name="path"match="dir2/subdir/index.html"/> <field name="path"match="dir1/*.html"/> <and> <!--Must match all of these (logical AND)--> <field name="key"match="guard"/> <field name="value"match="IGNORE"/> </and> </or>
140
</keep> <discard> <!--Exclude the file dir1/ignoreme.html,anything --> <!--with key 'unneededKey',and anything with state --> <!--DELETED --> <or> <field name="path"match="dir1/ignoreme.html"/> <field name="key"match="unneededKey"/> <field name="state"match="DELETED"/> </or> </discard> </filter>
As shown in this example, the keep section contains criteria for selecting which tuples will be deployed, and the discard section contains criteria for those which will not be deployed. Both sections use field tags. All field tags must contain one name/match attribute pair. When you deploy narrow tuples, name must be either key, value, path, or state. When you deploy wide tuples, name can be any be any field name that is valid in the source area. The match attribute names a targeted value for name. The following example shows the filtering of wide tuples for a TeamSite DCR:
Tuple:CITY=Boston STORE_NAME=CompanyA TeamSite/Templating/DCR/Type=databases/location state=Original, STORE/0/ID=9999 path=data/compa.txt
141
A filter defined and located before the deployment section of the configuration file will be global. Global filters do not become active until they are called by the filter elements use attribute between the source and destinations sections of the configuration file. For a sample configuration file that displays the order of these sections, see Appendix A, Sample Configuration File on page 189. Note that filters can also be defined in an include file and then be called by the use attribute. If a configuration file does not contain a filter section, all tuples are deployed (limited only by the type of update being performed). A configuration file can contain any number of global filter sections.
The filter elements name attribute value is fixed as DCRFilter and should not be changed. A single instance of the ignore element contains all the elements representing filters. Each DCR filter is specified by an instance of the type element. Each category filter is specified by an instance of the category element. You can have any number of instances of type and category elements in any combination.
DCR Filters
The type element and its category-name and name attributes are combined to specify a single DCR filter. You can specify any number of instances of the type element within the single instance of the ignore element. For example, the following type element entry results in the filtering of the DCR type internet/yacht:
<type category-name="internet" name="yacht"/>
142
Category Filters
You can filter an entire category by adding an instance of the category element. Specify the category as a value for the name attribute. For example, the following category element entry results in the filtering of the category intranet:
<category name="intranet"/>
As with DCR types, you can exclude multiple categories by adding an additional category element for each excluded category.
In this example, those tuples included in the regular expression Reviews/.*/Review Reader are matched to the value b1r1 and discarded. The following example shows how the name-pattern attribute regular expression is used for substitution.
<substitution name="GlobalSubstitution"> <field name-pattern="Reviews/.*/Review Reader" match="b1r1" replace="Reviwer0"/> </substitution>
Here, like with the filtering example, the name-pattern attribute regular expression retrieves a group of strings or fields. Those that match the value b1r1 are replaced by the value Reviwer0.
143
Note the keep and discard sections in the preceding sample filter. Those sections contain the filtering criteria. The keep section contains the rules for filtering events that must be processed by DAS. The discard section contains the rules for filtering events that need not be processed by DAS.
144
Both sections can contain the following subsections that represent boolean and SQL operators:
<and> - Events that satisfy all criteria listed in this section are kept (or discarded if used in the <discard> section). <or> - Events that satisfy at least one of the criterion listed in this section are kept (or discarded if used in the <discard> section).
- Used to create a list-based criterion. Events that match at least one of the listed items satisfies the criterion. For example, the sample filter shown above keeps any of the following events would satisfy the <in> criterion: Submit, CreateWorkarea, SyncCreate, or DestroyWorkarea.
<in> <notin> <notin>
- Used to create a list-based criterion for events that are to be excluded. Do not use in a <discard> section; use <in> there instead.
<like> - Used to create a wildcard-based criterion. You can use the following wildcard characters when specifying the value for the match attribute in <like> and <notlike> subsections:
The % character is used to represent any sequence of characters The _ character is used to represent any single character. For example, note the <like> subsections in the sample filter shown above: Only a three character user name where the last two characters are ob would satisfy the first <like> criterion, and a TeamSite area name of any length that includes the string default would satisfy the second <like> criterion.
<notlike> - Used to create a wildcard-based criterion for events that not use <notin> in a <discard> section; use <like> there instead.
are to be excluded. Do
Each section (or subsection) must contain at least one name and match attribute/value pair. The name attribute refers to the property name. The value of the match attribute specifies the characteristics of the property to use as a filtering criterion. OpenDeploy would translate this example filter into the following SQL statement:
( timestamp > 1004050050851 and name IN ('Submit', 'CreateWorkarea', 'SyncCreate', 'DestroyWorkarea') and user like '_ob' or role = 'master' and area NOT LIKE '%default%')
145
The following sample event filter is a more specific example of filtering on an area.
<filter name="EventsFilter"> <keep> <and> <like> <field name="area" match="%default/main/br%"/> </like> </and> <and> <like> <field name="area" match="%templatedata/internet/book%"/> </like> </and> </keep> </filter>
This filter will pass any events that occur in the br branch under /default/main and also occur in the internet/book category and type under the templatedata directory. Note that the area has been split into two 'and' clauses because the event splits the area into two sections as shown below:
/default/main/br1/WORKAREA/wa /templatedata/internet/book/data/book1
Both 'and' clauses are not required as filtering can be done on only one of the sections. It depends on the level of desired filtering. Also note the use of forward slashes (/). Since the area is a TeamSite area, forward slashes should be used even if TeamSite is installed on Windows.
146
Setting Up Substitutions
Substitutions let you configure OpenDeploy to automatically replace character strings or entire fields in a table. A substitution can be set up to apply globally, to specific parts of a deployment (in-flow), or to a parameter string.
Global Substitutions
A substitution defined and located before the deployment section of the configuration file will be global. Global substitutions do not become active until they are called by the substitution elements use attribute between the source and destinations sections of the configuration file. For a sample configuration file that displays the order of these sections, see Appendix A, Sample Configuration File on page 189. Note that substitutions can also be defined in an include file and then be called by the use attribute. A configuration file can contain any number of global substitution sections. Global substitutions use field tags that must contain at least one name/replace attribute pair. As with filters, name is a tuple field. The replace attribute is the new string that will overwrite the existing string or field. Two additional attributes, match and global, are optional. Common usage examples are as follows: Table 20 Global Substitutions
To do this: Include this line in the Substitution section:
<field name="value" replace="Newvalue"/> <field name="path" match="blue" replace="red"/> <field name="path" match="blue" replace="red" global="yes"/> <field name="key" match="Original" replace="NotPresent"/>
Replace all Value field values with the string Newvalue In the Path field, replace first occurrence of blue with red In the Path field, replace all occurrences of blue with red In the State field, replace the first occurrence of Original with NotPresent
The following is a sample substitution. It can be used by any deployment. It replaces the first occurrence of the string fun in the path field with bar, and completely replaces the value field with the string SpecialValue.
<substitution name="GlobalSubstitution"> <field name="path" match="fun" replace="bar"/> <field name="value" replace="SpecialValue"/> </substitution>
147
In-Flow Substitutions
In-flow substitutions let you define substitution rules that apply only to specific parts of a deployment. OpenDeploy supports in-flow substitutions within the deployment and destinations elements. For example, if the in-flow substitution shown below were nested one level inside of a deployment element named ea-to-db, it would apply only to the ea-to-db deployment. You can also nest in-flow substitutions one level inside destinations elements, in which case the substitution applies only to a specific destination. A configuration file can contain any number of in-flow substitution sections. The following sample substitution uses Perl 5 regular expression syntax for match values. In this sample, any path that contains the string WORKAREA/.../ will have the string replaced by STAGING/; any path that contains EDITION/abcd will be replaced with /This/Special/Path, and any tuple whose key starts with 'BEFORE' will be changed to begin with AFTER.
<substitution> <field name="path" match="(.*)/WORKAREA/[^/]+/(.*)" replace="$1/STAGING/$2"/> <field name="path" match="EDITION/abcd" replace="/This/Special/Path" /> <field name="key" match="^BEFORE(.+)" replace="AFTER$1" /> </substitution>
In-flow substitutions have the same syntax as global substitutions. In addition, in-flow substitutions support a global attribute that lets you control whether the substitution applies to all occurrences or just the first occurrence of the matching pattern. If global is set to no, the substitution applies only to the first occurrence. If it is set to yes, the substitution applies to all occurrences. For example:
<substitution name="SubForThisTarget"> <field name="BField" match="from_a" replace="to_b" global="yes"/> </substitution>
148
Deploying Replicants
Parameter Substitutions
Any parameter string in a configuration file can be named using a parameter substitution. Syntax is as follows:
"varname=varvalue"
After a string is defined on the command line, all occurrences of $varname in the configuration file named on the command line are substituted with the string varvalue. Do not use the following terms for varname:
cfg deployment iwdd-op remote-host remote-port
(where ^ is a concatenator)
Deploying Replicants
This section details how to deploy replicant order numbers and comma separated lists of values as replicants.
Do not specify the name of the replicant order column as order because that is a SQL reserved word.
149
To create a replicant order column, define a column element in a group element that is in a dbschema element of the DataDeploy configuration file as shown in this example:
<column name="rep_order" data-type="INTEGER" value-from-field="not-used" allows-null="yes" replicant-order-column="yes"/>
1. Specify the value of the replicant-order-column attribute as yes. 2. Specify the value of the value-from-field attribute as not-used, or as an invalid field name. 3. Specify other attributes (data-type, name) as usual.
NOTE
When a replicant order column in a group is made a key column for the group, the group must contain a column that maps the path attribute value. Otherwise, real-updates are not supported.
150
Deploying Replicants
Non-Replicant Values
Assume that a DCR created from the following DCT is to be deployed. Note that a comma separated list of reviewers can be entered for the Reviewers item.
<data-capture-requirements type="content" name="book"> <!-- data-capture-requirements elements contain area elements --> <ruleset name="Book Information"> <description> This allows for the entry of details relating to a book. </description> <item name="Title"> <database data-type="VARCHAR(100)"/> <text required="t" maxlength="100"/> </item> <item name="Author"> <database data-type="VARCHAR(40)"/> <text required="t" maxlength="40"/> </item> <item name="ISBN"> <database data-type="VARCHAR(20)"/> <text required="t" maxlength="20"/> </item> <item name="Price"> <description>dollars and cents</description> <database data-type="REAL"/> <text required="t" maxlength="7" validation-regex="^[0-9]+\.[0-9]{2}$"/> <!-- validation-regex="^[0-9]+\.[0-9]{2}$" means there is a match if the entire string contains 1 or more digits followed by a . followed by 2 digits --> </item> <item name="Reviewers"> <description>Reviewer names separated by comma</description> <database data-type="VARCHAR(255)"/> <text required="t" maxlength="255"/> </item> </ruleset> </data-capture-requirements>
The following database schema definition is generated for this DCT when you run iwsyncdb -dbschemagen:
<dbschema> <group name="book" root-group="yes"> <attrmap> <column name="Title" data-type="VARCHAR(100)" value-fromfield=" 151
Title" allows-null="no"/> <column name="Author" data-type="VARCHAR(40)" value-fromfield=" Author" allows-null="no"/> <column name="ISBN" data-type="VARCHAR(20)" value-fromfield=" ISBN" allows-null="no"/> <column name="Price" data-type="REAL" value-from-field="Price" allows-null="no"/> <column name="Reviewers" data-type="VARCHAR(255)" valuefromfield="Reviewers" allows-null="no"/> </attrmap> <keys> <primary-key> <key-column name="Title"/> </primary-key> </keys> </group> </dbschema>
DCRs created and deployed by using the preceding DCT and associated database schema would create a single table in the database as follows: Table 21 Non-Replicant Values
Title Author ISBN Price Reviewers
Interwoven
Author1
12345
100.00
R1,R2,R3,R4
To deploy the same data such that the comma separated list of reviewers is stored in a separate table as replicant values, modify the database schema as follows:
<dbschema> <group name="book" root-group="yes"> <attrmap> <column name="Title" data-type="VARCHAR(100)" value-fromfield=" Title" allows-null="no"/> <column name="Author" data-type="VARCHAR(40)" value-fromfield=" Author" allows-null="no"/> <column name="ISBN" data-type="VARCHAR(20)" value-fromfield=" ISBN" allows-null="no"/> <column name="Price" data-type="REAL" value-from-field="Price" allows-null="no"/> </attrmap> <keys> <primary-key> <key-column name="Title"/> </primary-key> </keys> </group> 152
Deploying Replicants
<group name="reviewers" root-group="no"> <attrmap> <column name="Title" data-type="VARCHAR(100)" value-fromfield="Title" allows-null="no"/> <column name="Reviewers" data-type="VARCHAR(255)" list-to-replicant="yes" list-field="Reviewers" value-from-field="Reviewers/[0-4]/Reviewer" is-replicant="yes" allows-null="yes"/> </attrmap> <keys> <primary-key> <key-column name="Title"/> <key-column name="Reviewers"/> </primary-key> <foreign-key parent-group="book"> <column-pair parent-column="Title" child-column="Title"/> </foreign-key> </keys> </group> </dbschema>
In the preceding modified database schema, an additional group element represents the additional table that contains the list of reviewers. Note that the Reviewers column definition in that group contains list-field and list-to-replicant attributes. The list-field attribute contains the comma separated list of values, and the list-to-replicant indicates to OpenDeploy that it must transform that list into multiple values before deployment. A deployment based on the preceding modified database schema would look like this: Table 22 Non-Replicant Values (cont.)
Title Author ISBN Price
Interwoven
Author1
12345
100.00
R1 R2 R3 R4
153
Replicant Values
To deploy a comma separated list of replicants as another set of replicants (each source replicant is deployed to multiple rows in a table), use the DCT and database schema with table mapping as shown in the following example. In this example, the replicant field Select_expertise is used. It is a multi-select item in the DCT within the replicant item Reviews, where each book reviewer instance can have multiple expertise values.
<data-capture-requirements type="content" name="book"> <!-- data-capture-requirements elements contain area elements --> <ruleset name="Book Information"> <description> This allows for the entry of details relating to a book. </description> <item name="Title"> <database data-type="VARCHAR(100)"/> <text required="t" maxlength="100"/> </item> <item name="Author"> <database data-type="VARCHAR(40)"/> <text required="t" maxlength="40"/> </item> <item name="Publication Date"> <description>date format is YYYY-MM-DD</description> <database data-type="DATE" data-format="yyyy-MM-dd"/> <text required="t" maxlength="10" validation-regex="^[0-9][09][0-9][0-9]-[0-1][0-9]-[0-3][0-9]$" /> </item> <item name="ISBN"> <database data-type="VARCHAR(20)"/> <text required="t" maxlength="20"/> </item> <item name="Cover"> <database data-type="CHAR(9)"/> <radio required="t"> <option selected="t" value="Paperback" label="Paperback"/> <option value="Hardback" label="Hardback"/> </radio> </item> <item name="Price"> <description>dollars and cents</description> <database data-type="REAL"/> <text required="t" maxlength="7" validation-regex="^[0-9]+\.[0-9]{2}$"/> </item> <item name="Plot Summary"> 154
Deploying Replicants
<database deploy-column="f"/> <textarea/> </item> <item name="Reviews"> <database deploy-column="f"/> <replicant min="0" max="20"> <item name="Review Reader"> <text/> </item> <item name="Select_expertise"> <select required="f" size="4" multiple="t"> <option label="C++ Programmer" value="cplusplus"/> <option label="Java Programmer" value="java"/> <option label="Assembly Programmer" value="assembly"/> <option label="Cobol Programmer" value="cobol"/> </select> </item> <item name="Review Reader E-Mail"> <text/> </item> <item name="Reader Comments"> <textarea/> </item> </replicant> </item> </ruleset> </data-capture-requirements>
</primary-key> <foreign-key parent-group="book"> <column-pair parent-column="Title" child-column="Title_in_review"> </column-pair> </foreign-key> </keys> </group>
In the preceding database schema column, Reviewer_Expertise represents the comma separated replicant item Select_expertise, which needs to be specified in the list-field attribute: list-field="Reviews/[0-4]/Select_expertise". The values from this list will be mapped to the virtual field specified in the value-from-field attribute, which is: value-from-field="Reviews/[0-4]/Selectlist/[0-5]/selectval".In addition, the attribute list-to-replicant needs to be set to "yes" to indicate that a replicant comma separated list has to be mapped to another replicant. Each instance of the comma separated replicant Select_expertise maps to multiple rows in the database table. The database table for the preceding schema would be as follows: Table 24 Replicant Values
Title_in_review Reviewer Reviewer_Expertise
Java Message Service Java Message Service Java Message Service Java Message Service
Additionally, the following rules for mapping must be followed: 1. The virtual field specified for a column that maps list fields should have a similar node structure if the table contains columns mapped to replicants. For example:
<column name="Title_in_review" data-type="VARCHAR(100)" value-from-field="Title" allows-null="no" is-url="no"/> <column name="Reviewers" data-type="VARCHAR(255)" value-from-field="Reviews/[0-4]/Review Reader" allows-null="no" is-url="no" is-replicant="yes"/> <column name="Reviewer_Expertise" data-type="VARCHAR(255)" list-to-replicant="yes" value-from-field="Reviews/[0-4]/Selectlist/[0-5]/selectval" list-field="Reviews/[0-4]/Select_expertise" is-replicant="yes" allows-null="no" is-url="no"/>
The Reviewer_Expertise column maps the replicant Reviews/[0-4]/Select_expertise, which is a comma separated list. The column Reviewers maps a regular replicant item. The value-from-field attribute for the
156
Deploying Replicants
Reviewer_Expertise column should have the same root node structure and with Reviewers/[0-4], which is the same as the mapping for Reviewers.
thus it starts
Essentially, the normal replicant mappings and virtual field mappings should appear to OpenDeploy as if they are part of the same branch in the XML tree structure. If this naming convention is not followed, OpenDeploy will fail to traverse the tree and will produce no rows. 2. The replicant level of the mapped value-from-field should be one level greater than the field it is being mapped from, which is specified in the list-field attribute. For example, in the preceding database schema definition, value-from-field is one level higher than list-field:
list-field="Reviews/[0-4]/Select_expertise value-from-field="Reviews/[0-4]/Selectlist/[0-5]/selectval
where Treatment and Prognosis each have a maximum occurrence count of 0-5. 2. When multiple replicants from a level that is not the innermost level are mapped to the same table, multiple child replicants cannot be mapped to the same table unless its parent replicants are also mapped.
157
To use this feature, first generate the row-map-cache file using the iwsyncdb tool using the following syntax:
iwsyncdb -rowmapgen configfile deployment outfile
deployment - the deployment within the DataDeploy configuration with the schema mapping to generate the row map for. outfile
- the user-specified output file where the row map should be written to.
For example:
iwsyncdb -rowmapgen c:\Interwoven\OpenDeploy\conf\dd.xml base c:\files\rowmap.txt
After creating this row map file, you need to reference it in your DataDeploy configuration through the row-map-cache-file attribute of the database element as follows:
<database name="mydb" row-map-cache-file="c:\files\rowmap.rxt"
When executing deployments that contain DCRs which have replicants from various levels of nesting, DataDeploy checks whether the row-map-cache-file attribute is specified. If it is, the serialized Java objects are read from the row map cache file. If an error occurs while reading the row map cache file, or if no file is specified in the row-map-cache-file attribute, DataDeploy builds the data structures. In DAS mode, DataDeploy stores the most recently used row map cache file in memory. The row map file contains serialized Java objects. To deserialize this file, execute the following:
iwsyncdb -row-map-text path-to-row-map-cache-file [path-to-row-map-text-file]
where path-to-row-map-cache-file is the row map cache file generated earlier. The optional argument path-to-row-map-text-file specifies the file where the output should be written to. If no file is given, the output will be written to standard out.
158
Java interface definition that user implements to augument/supplement/ instrument a data tuple object, before it gets deployed by DataDeploy. User must implement PreProcessTuple method. */
public interface IWExternalTupleProcessor { /* Property name to obtain the name of the deployment for which the tuple preprocessor method is being called by DataDeploy. This property exists in the cmdLineParams Properties object passed to the PreProcessTuple() method by DataDeploy, when the interface-version is set to 2.0 in the <external-tuple-processor> tag. */ public static final String kCurrentDeploymentName = "IWCurrentDeploymentName";
159
/* PreProcessTuple The only method in the interface. DataDeploy supplies the data tuple in the form of a Hashtable object (keys being the field names). User can modify the tuple (adding, modifying deleting key-value pairs) and then return the modified tuple object back to DataDeploy. area: Points to the "area" attribute value if the tuple was produced by either <teamsite-templating-records> or <teamsite-extendedattributes> source. null otherwise. basearea: Points to the "basearea" attribute value if the tuple was produced by either <teamsite-templating-records> or <teamsiteextended-attributes> source when a differential extraction type is specified. null otherwise. The following method is called by DataDeploy when the interface- version attribute in the DD config file is either set to "1.0" or not set. */ public Hashtable PreProcessTuple(Hashtable tuple, String area, String basearea); /* The following method is called by DataDeploy when the interfaceversion attribute in the DD config file is set to "2.0". The argument cmdLineParams contains: 1) the command line parameters specified while invoking standalone deployments, or 2) arguments generated by the iwsyncdb CLT / Event Server subscriber (in DAS mode) All command line parameters are stored as key-value pairs in the Properties object. For example, given the following invocation line, iwodcmd start <your_dd_dep> iwdd=<internal_subdep> mytable=<your_tab> to get the "mytable" value specified in the command line while invoking a cmdLineParams.getProperty("mytable"). standalone deployment, call */ public Hashtable PreProcessTuple(Hashtable tuple, String area, String basearea, Properties cmdLineParams); }
160
public Hashtable PreProcessTuple(Hashtable input, String area, String basearea, Properties cmdLineParams) { if (cmdLineParams != null){
161
String deploymentName = cmdLineParams.getProperty( IWExternalTupleProcessor.kCurrentDeploymentName); System.out.println("PreProcessTuple() method called for " + "Deployment [" + deploymentName + "]."); } return ProcessTuple(input); }
private Hashtable ProcessTuple(Hashtable input) { // the input tuple contains path to the file, it's state value // and other user set extended attributes, in this example it would // be the book_id value // get the book_id value String book_id = (String) input.get("book_id"); // once we get the book_id, go to the database and retrieve the // related information. I am not typing the full code here for // retrieving the related information. // let's just assume that the related information we retrieved // has author, ISBN, price single-valued attributes. we add them // to the tuple here input.put("author","venkat"); input.put("ISBN", "12345"); input.put("price", "123.33"); // also assume that the related information has repeating-value // attributes reviewers and reviewer-email. let's assume we have // five reviewers and their email addresses to be added to the tuple // see the associated dd config file how these fields are mapped // to database table columns for (int i = 0; i < 5; i++){ input.put("Reviews/"+i+"/Name","reviewer"+i); input.put("Reviews/"+i+"/EMail","reviewer_email"+i); } return input; } }
This sample demonstrates how a user-written Java class can supplement data that would be deployed using DataDeploy. It assumes that you created a document in the TeamSite file system and set metadata on the file. The only Extended Attribute set on the document is called book_id.
162
Assuming that information related to the book_id value is present in another repository, you want to deploy that information using DataDeploy. This class assumes that the related information is present in another database/ table and retrieves such information from those tables and adds it to the data tuple. When DataDeploy invokes the PreProcessTuple method in this class, the Hashtable tuple object contains path, state and book_id values only. DataDeploy loads a Tuple preprocessor class only once during a deployment. This Java file should be compiled using JDK1.3 or later. CLASSPATH should include the following file:
od-home/lib/ddcombo.jar
After a successful compilation, you package your Java class files into a .jar file, and place it in the following directory:
od-home/(od-instance)/userlib
This sample configuration file demonstrates how to configure a user-written Java class that would be invoked by DataDeploy before deploying a data tuple. The tuple_processor.cfg.example file is displayed here:
<data-deploy-configuration> <external-tuple-processor class-name="TupleProcessorExample"/> <client> <!-- This deployment dumps EA data from a TeamSite area to --> <!-- several different database destinations --> <deployment name="ea-to-db"> <source> <!-- Pull data tuples from TeamSite EA's --> <teamsite-extended-attributes options="full,wide" area="/default/main/br1/WORKAREA/wa1"> <path name="test1.txt" /> </teamsite-extended-attributes> </source>
163
<destinations> <database db="localhost:1521:oracledb" user="user" password="password" vendor="oracle" update-type="standalone"> <dbschema> <group name="book_master" root-group="yes" table="book_master"> <attrmap> <column name="path" data-type="varchar(255)" value-from-field="path" allows-null="no"/> <column name="author" data-type="varchar(255)" value-from-field="author" allows-null="no"/> <column name="ISBN" data-type="varchar(255)" value-from-field="ISBN" allows-null="no"/> <column name="book_id" data-type="varchar(255)" value-from-field="book_id" allows-null="no"/> </attrmap> <keys> <primary-key> <key-column name="book_id"/> </primary-key> </keys> </group> <group name="book_detail" root-group="no" table="book_detail"> <attrmap> <column name="book_id" data-type="varchar(255)" value-from-field="book_id" allows-null="no"/> <column name="Reviewer_name" data-type="varchar(255)" value-from-field="Reviews/[0-4]/Name" allows-null="no" is-replicant="yes"/> <column name="Reviewer_Email" data-type="varchar(255)" value-from-field="Reviews/[0-4]/EMail" allows-null="no" is-replicant="yes"/> </attrmap> <keys> <primary-key> <key-column name="book_id"/> <key-column name="Reviewer_name"/> </primary-key> <foreign-key parent-group="book_master"> <column-pair parent-column="book_id" child-column="book_id"/> </foreign-key> 164
4. Create the DataDeploy configuration file. 5. Specify the external-tuple-processor element and the value of the class-name attribute in that configuration file as shown in the preceding example. 6. If you want OpenDeploy to invoke the following version of the PreProcessTuple () method:
public Hashtable PreProcessTuple(Hashtable input, String area, String basearea,Properties cmdLineParams)
follows:
It is recommended that you use the interface-version 2.0. Irrespective of the value set for the interface-version attribute, you must implement both versions of the PreProcessTuple() method to successfully compile the Java class you implement. 7. If you have defined substitution or filter elements in a deployment as well as an external-tuple-processor tag, you can control when OpenDeploy should invoke the TuplePreprocessor class by setting the exec-sequence attribute as follows: If you want OpenDeploy to invoke the TuplePreProcessor class before substitutions and filters are executed, specify the exec-sequence attribute as:
<external-tuple-processor class-name="com.interwoven. datadeploy.myclassname" exec-sequence="before-stages"/> 165
If you want OpenDeploy to invoke the TuplePreProcessor class after substitutions and filters are executed, specify the exec-sequence attribute as:
<external-tuple-processor class-name="com.interwoven. datadeploy.myclassname"exec-sequence="after-stages"/>
By default, OpenDeploy invokes the TuplePreProcessor class before substitutions and filters are executed. 8. Restart the OpenDeploy server instance.
166
import java.sql.*; import java.util.*; public interface IWExternalDataSource { public static final int kOpCodeInsert = 1; public static final int kOpCodeUpdate = 2; public static final int kOpCodeDelete = 3; public static final int kOpCodeQuery = 4; public static final double kProtocolVersion10 = 1.0; public abstract double GetProtocolVersion(); /* Implementation of this method must return 1.0 or kProtocolVersion10. If this method returns any other value or null deployment will be terminated abnormally. */ public abstract String GetExternalValue(Connection conn, String tableName, String columnName, int opCode, Hashtable tuple, boolean isReplicant); /* The main interface method that will be invoked by DataDeploy to get the value for a column that has been marked to have data generated/returned from an external source Parameters: conn - database connection. This is not the same connection that DataDeploy uses to perform the deployment. tableName - name of the table that has the column to contain externally generated value columnName - name of the column for which value is to be generated by the external source opCode - indicates type of operation that will be performed by DD on the table 1 - insert 2 - update 3 - delete 4 - query (SELECT) tuple - hashtable that contains the values for other columns. column name is the lookup key. isReplicant - true if the column for which value requested is mapped to a replicant field - false otherwise 167
This function should always return the intended value for the column as a String. DataDeploy would perform appropriate conversion of the String depending on the target column's datatype. Important: Implementation of this method should take care of re-entrancy. This method may be invoked by DataDeploy multiple times for the same opcode. For example, when DataDeploy inserts a row into the database, there is a preparation stage and there is a second stage that performs actual insert. This method should return the same value in both the cases. One way of achieving that is to look at the "path" attribute value in the tuple object, in conjunction with the opCode value. When this method is being called when DataDeploy needs to select the row, because the original value was supplied by this method, it needs to check the database to identify the value correctly and return it to DataDeploy. Note that any modifications to the key-value pairs in the tuple object aren't propagated or used by DataDeploy as it supplies only a copy of the tuple object rather than the object that it uses to perform the deployment. Similarly, the Connection object supplied to this method is not the same connection that DataDeploy uses to perform the deployment. For DAS deployments, the tableName value supplied to this method would be the 'mapped'value if the actual table name exceeded the length that the database supports. This method can query the IWOV_IDMAPS table to get the original name for the supplied mapped name. */ }
OpenDeploy loads your Java class only once, even if that same class is being used to generate values for multiple columns in various tables. It is the responsibility of the callout implementation to determine, according to the parameters supplied to the GetExternalValue() method, which values are returned. After you have implemented the Java class as described earlier, you must perform the following tasks: 1. Write a Java class that implements the preceding interface (for example, both the abstract methods GetExternalValue() and GetProtocolVersion()). See the comments interspersed throughout the preceding definition for the syntax and semantics of these two methods.
168
2. Compile the Java class and unit test it. During this phase od-home/lib/ddcombo.jar must be included in the CLASSPATH of the compile line. 3. Package your Java class files into a .jar file, and place it in the following directory:
od-home/(od-instance)/userlib
4. Add a column element that defines the column for the dynamic (or external) value to one of the following files: The DataDeploy configuration file that will be used for deployments. The dbschema.cfg file if you want to use External Data Source with deployments that use UDS. Using the following example External Data Source interface, such a column element would look like this:
<column name="column1" data-type="VARCHAR(100)" value-from-callout="iwov:dd:java:com.interwoven.datadeploy.sample. IWDataDeploySample"/>
Note that iwov:dd:java is a prefix that must precede the class and package name, here represented by com.interwoven.datadeploy.sample.IWDataDeploySample. 5. Restart the OpenDeploy server instance.
This is a sample implementation to demonstrate how DataDeploy can interact with a user-defined Java class to supply a value for a column during database deployment. You should compile this Java file using JDK1.1 or later. Include the following path in the CLASSPATH:
od-home/lib/ddcombo.jar
If you are using an Integrated Development Environment, refer to manuals of that product on how to set the CLASSPATH. Once the implementation compiles successfully, you must create a Java Archive for this class file and include the name of that archive in the CLASSPATH before invoking DataDeploy. For a description of the interface, refer to the IWExternalDataSource.java file, which is co-located with the IWDataDeploySample.java file.
169
You must have od-home/lib/ddcombo.jar file in the CLASSPATH or it must be specified in the -classpath argument to javac.
package com.interwoven.datadeploy.sample;
//import the Interface definition for the Java Callout import com.interwoven.dd100.dd.IWExternalDataSource; //import other stuff needed import java.sql.*; import java.util.*;
public class IWDataDeploySample implements com.interwoven.dd100.dd.IWExternalDataSource { // we will use a random generator to generate unique values // for each DCR //that gets deployed private static Random fRandom = null; // we will use a hashtable to store the values with // 'tableName' value as the key // and TableData object as the value private static Hashtable fValues = null; //Constructor public IWDataDeploySample() { //nothing to do at this time } /* GetProtocolVersion Implementation of the interface method to establish handshake with DataDeploy */ public double GetProtocolVersion() { /* currently only supported interface protocol version is 1.0 */ return com.interwoven.dd100.dd.IWExternalDataSource.kProtocolVersion10; } 170
/* GetExternalValue Implementation of the interface method to supply values */ public String GetExternalValue(Connection conn, String tableName, String colName, int opCode, Hashtable tuple, boolean isReplicant) { String path = (String) tuple.get("path"); //check our internal cache for any previously supplied //valuefor the given combination of tablename, colname //and path value String retVal = CheckCache4ExistingValue(tableName,colName,path); if (retVal == null){ //not in the cache //check the table itself. In case of an update we //have to supply the existing value retVal = CheckTable4ExistingValue(conn,tableName,colName,path); if (retVal == null || retVal.length() == 0){//no vaue in the target table //generate a new value retVal = generateNewValue(); } //add the newly generated value to our cache AddToCache(tableName,colName,path,retVal); } return retVal; } /* generateNewValue Generate a new value. We use a Random generator in this example. Alternatively the value could be coming from another source. For example from a SEQUENCE in the case of Oracle database server. */ private String generateNewValue() { if (fRandom == null){ 171
fRandom = new Random(); } Integer i = new Integer(fRandom.nextInt()); return i.toString(); } /* CheckCache4ExistingValue Check if we have already generated a value for the current combination of tablename, column name and path. */ private String CheckCache4ExistingValue(String tableName, String colName, String path) { String result = null; if (fValues == null){ fValues = new Hashtable(); } TableData tableData = (TableData) fValues.get(tableName); if (tableData == null){ tableData = new TableData(tableName); fValues.put(tableName,tableData); } result = tableData.getValue(colName,path); return result; } /* AddToCache Add the current combination to cache. */ private void AddToCache(String tableName, String colName, String path, String colValue) { if (fValues == null){ fValues = new Hashtable(); } TableData tableData = (TableData) fValues.get(tableName); if (tableData == null){ tableData = new TableData(tableName); 172
fValues.put(tableName,tableData); } tableData.putValue(colName,colValue,path); } /* CheckTable4ExistingValue Check the target table for any existing value for the current combination */ private String CheckTable4ExistingValue(Connection conn, String tableName, String colName, String path) { String query = "SELECT " + colName + " FROM " + tableName + " WHERE PATH = ?"; String result = ""; try { PreparedStatement stmt = conn.prepareStatement(query); stmt.setString(1,path); ResultSet rs = stmt.executeQuery(); if (rs.next()){ result = rs.getString(1); } rs.close(); stmt.close(); } catch (SQLException ex){ System.out.println("Exception:" + ex.getMessage()); result = ""; } return result; }
//maintains individual column values that we supply, per //table and per path private class TableData { private String fTableName = null; //'path' level cache private Hashtable fValues = null;
173
/* Constructor */ public TableData(String tableName) { fTableName = tableName; fValues = new Hashtable(); } /* getValue Get any existing value for the given combination */ public String getValue(String colName, String path) { String result = null; Hashtable forPath = (Hashtable) fValues.get(path); if (forPath != null){//no cache for this path, allocate a new one result = (String)forPath.get(colName); } return result; } /* putValue Store the combination */ public void putValue(String colName, String value, String path) { Hashtable forPath = (Hashtable) fValues.get(path); if (forPath == null){//no cache for this path, allocate a new one forPath = new Hashtable(); fValues.put(path,forPath); } forPath.put(colName,value); } } }
174
values are yes and no. values are any DCR element or metadata.
value-from-fieldvalid valuevalid
values are URLs that contain a file: or http: prefix. value is encoding method, such as UTF-8.
url-content-encodingvalid
Additionally, Binary Large Objects (BLOBs) and Character Large Objects (CLOBs) are supported data types. The following examples and descriptions illustrate how to construct column elements for deploying content pointed to from a URL:
Example 1
<column name="picture" data-type="BLOB" is-url="yes" value-from-field="TeamSite/Metadata/Picture"/>
During deployment, DataDeploy gets the metadata value for the key TeamSite/Metadata/ Picture for the file being deployed and treats that value as a URL. DataDeploy then reads the content pointed to by that URL and deploys the content to the picture column which is of data type BLOB.
175
Example 2
<column name="picture" data-type="BLOB" is-url="yes" value="file://C:/TEMP/MYPHOTO.GIF"/>
During deployment, DataDeploy reads the content of the file C:\TEMP\MYPHOTO.GIF and deploys it to the picture column which is of data type BLOB.
Example 3
<column name="page" data-type="CLOB" is-url="yes" value="http://www.interwoven.com/index.html"/>
During deployment, DataDeploy reads the content of file index.html from the HTTP server www.interwoven.com and deploys it to the page column which is of data type CLOB.
Example 4
<column name="picture" data-type="BLOB" is-url="yes" value-from-field="PressRelease/Picture"/>
During deployment, OpenDeploy gets the value for the item PressRelease/Picture from the DCR being deployed and treats that value as a URL. It then reads the content pointed to by that URL and deploys the content to the picture column which is of data type BLOB.
Example 5
<column name="mytextdata" data-type="VARCHAR(4000)" is-url="yes" value="file://C:/TEMP/MYTEXT.TXT"/>
During deployment, OpenDeploy reads the content of the file C:\TEMP\MYTEXT.TXT and deploys that content to the mytextdata column whose data type is VARCHAR(4000). In this case, the content of the file is assumed to be less than or equal to 4000 bytes.
Example 6
To deploy the content from the URL www.interwoven.com/index.html using UTF-8 encoding, the column element and its attributes would be:
<column name="urlcontent" data-type="CLOB" value-from-field="http://www.interwoven.com/index.html" is-url="yes" url-content-encoding="UTF-8"/>
176
To map an elements value to a column (for example, the value for title), the column element in the DataDeploy configuration file would look like this:
<column name="title" data-type="VARCHAR(100)" value-from-element="press-release/0/head/0/title/0"/>
To map the value of an elements named attribute to a column (for example, the value for the author attribute), the column element in the DataDeploy configuration file would look like this:
<column name="author" data-type="VARCHAR(100)" value-from-attribute="press-release/0/head/0/byline/0/author"/>
Note the /o/ succeeding each element name. Those are instance indicators that specify which instance of the nodes value or attribute is mapped. You must specify the maximum number of
177
instances (replicants) for a given node element. Arbitrarily large values can be specified when the maximum number of replicants allowed is unknown. Using the same example custom DCR snippet as above, mapping values of replicant elements (in this case, heading and paragraph) would look like this:
<column name="heading" data-type="VARCHAR(100)" value-from-element="press-release/0/body/0/heading/[0-5]" is-replicant="yes"/>
The dbschema.cfg file created for the PressRelease custom DTD example shipped with FormsPublisher would look like:
<dbschema> <group name="pr_master" table="pr_master" root-group="yes"> <attrmap> <column name="Path" data-type="varchar(255)" value-from-field="path"/> <column name="state" data-type="varchar(25)" value-from-field="state"/> <column name="title" data-type="varchar(100)" value-from-element="press-release/0/head/0/title/0"/> <column name="author" data-type="varchar(100)" value-from-attribute="press-release/0/head/0/byline/0/ author"/> <column name="location" data-type="varchar(15)" value-from-attribute="press-release/0/head/0/byline/0/ location"/> </attrmap> <keys> <primary-key> <key-column name="title"/> </primary-key> </keys> </group> <group name="pr_body" table="pr_body"> <attrmap> <column name="heading" data-type="varchar(40)" value-from-element="press-release/0/body/0/heading/[0-5]" is-replicant="yes"/> <column name="paragraph" data-type="varchar(100)" value-from-element="press-release/0/body/0/paragraph/[0-5]" 178
is-replicant="yes"/> <column name="title" data-type="varchar(100)" value-from-element="press-release/0/head/0/title/0"/> </attrmap> <keys> <primary-key> <key-column name="title"/> <key-column name="heading"/> <key-column name="paragraph"/> </primary-key> <foreign-key parent-group="pr_master" ri-constraint-rule=" ON DELETE CASCADE "> <column-pair parent-column="title" child-column="title"/> </foreign-key> </keys> </group> </dbschema>
To encode a password attribute, run iwsyncdb with the encodepassword option. For example:
iwsyncdb -encodepassword <path-to-database-xml-file>
Decoding requests to the OpenDeploy server are treated as Decryption only when 'strictAuthentication' is set to 'yes' (see the Restricting Access to Users with OpenDeploy Roles (Strict Authentication) section in the OpenDeploy Administration Guide). All password decoding requests to the OpenDeploy server are treated as decryption. The passwords are encrypted using iwodpassencrypter CLT and then saved in the database configuration file, database.xml, which is decrypted by the OpenDeploy server. The iwodpassencrypter CLT is available in both the OpenDeploy base server and receiver, and resides in the following directory: od-home/bin
179
Real Updates
By default, OpenDeploy performs updates by deleting existing rows and then inserting new rows into the database tables. Alternatively, instead of this delete followed by insert sequence, you can configure OpenDeploy to perform real updates. A real update is when OpenDeploy executes a series of UPDATE SQL statements. Real updates can only be performed if referential integrity is not being enforced (that is, the elements enforce-ri attribute must not be set to "yes" in the configuration file). If referential integrity is being enforced, OpenDeploy will only perform default (deletes followed by inserts) updates, because relational databases do not allow the modification of values or fields that are mapped to a primary/foreign key column due to constraint violation errors.
database
If the enforce-ri attribute is not set or set to "no", real updates are performed by setting the real-update attribute to "yes" in the database element. It is important to note that with real updates you still can not use UPDATE to change the value of columns designated as primary or foreign keys.
To execute a stored procedure called myproc2 that takes one numeric argument and a string argument, the sql tag definition would look like:
<sql user-action="execute_my_procedure" type="exec-proc"> myproc2(1,'argument2') </sql>
After you define the configuration file, you can execute the stored procedure by invoking DataDeploy as follows:
iwodcmd start depName -k iwdd=subDepName -k iwdd-op=do-sql -k user-op=option
where:
depName
subDepName - specifies the name of the deployment defined in the deployment configuration
file.
user-op=option
- specifies the user-action attribute value associated with the sql element in the DataDeploy configuration file.
The following command executes the myproc stored procedure for the preceding example:
iwodcmd start ddDeployment -k iwdd=dep1 -k iwdd-op=do-sql -k user-op=execute_my_procedure
<database use="dbconn"> <sql user-action="test" type="query"> <![CDATA[SELECT COUNT(*) "Count" FROM SYSIBM.SYSTABLES]]> </sql> <dbschema> ... </dbschema> </database> </destinations> </deployment> <deployment name="dep2"> <source> ... </source> <destinations> <database use="dbconn"> <sql user-action="test" type="query"> <![CDATA[SELECT COUNT(*) "Count2" FROM SYSIBM.SYSTABLES]]> </sql> <dbschema> ... </dbschema> </database> </destinations> </deployment> <deployment name="multi"> <exec-deployment use="dep1"/> <exec-deployment use="dep2"/> </deployment> </client> ... </data-deploy-configuration>
NOTE
The user-action attribute must be the same value for all deployments in the configuration.
182
NOTE
You can also embed SQL commands in the DataDeploy configuration files sql element. These commands execute automatically during deployment and do not require you to manually query the database.
The CREATE VIEW command in this example is the default DataDeploy schema that executes when table-view is set to yes in the DataDeploy configuration files database element.
183
184
Chapter 7
Troubleshooting
This chapter describes how to troubleshoot your OpenDeploy data deployment issues.
Failure in creating the necessary tables for Microsoft SQL Server databases
In some cases the iwoddbtool.bat fails to create the necessary tables for Microsoft SQL
Server databases. If you are using SQL Server, you must perform the following steps:
1. Open the server.xml file using your favorite text or XML editor. This file resides in
3. Substitute databaseName with the correct value for the database. 4. Save and close the file. 5. Restart OpenDeploy, including the administration and CSF services.
185
Chapter 7: Troubleshooting
PATH was incorrectly made into a reserved word in 15.0.2 version of Sybase, and this is considered a bug. It has been unreserved in 15.0.2 ESD #1 under CR 472762. Please refer to the Technote at http://www.sybase.com/detail?id=1051550. With latest ESD release from http://downloads.sybase.com this bug should had been fixed.
2. Open the create_overrides.xml using your favorite text or XML editor and edit the path and area VARCHAR size of the IWDELTRACKER table to a lower value so that it can create index 3. Run the deployment.
or
186
These symbols are treated as special characters to get input from the input stream. You can find more information at the following Web site:
http://www.velocityreviews.com/forums/t138185-redirect-stdin-usingquotltquot-in-process-started-w-runtimeexec.html
Also, in the MySQL script, you should not give exit explicitly like other databases, since the option -e exits automatically once the script is executed.
To avoid this problem, do not remove the value-from-element definitions in a column element when manual modifying the dbschema.cfg file.
Renamed Files Fail to Deploy When UDS Table is Used for Metadata
Deployments run by DAS while processing events generated due to renaming of DCRs or files with metadata fail if metadata or DCR deployment is configured to use UDS. To prevent such failures, columns mapped to the path value must be the primary key or part of a composite key in all group definitions in dbschema. The TeamSite List Modified option will show the original file as DELETED. While submitting the renamed file to the TeamSite staging area, the original file that was renamed (which is listed as DELETED in List Modified) should also be included in the same submit task.
187
Chapter 7: Troubleshooting
188
Appendix A
189
190
<!-- Start the destinations section. --> <destinations host="DDServer.interwoven.com" port="1357"> <!-- Filtered and substituted data will be sent to a --> <!-- DataDeploy server on port 1357 of the machine --> <!-- DDServer.interwoven.com. Then -->
that -->
<!-- send some tuples to 'table1' on the database --> <!-- is located using 'jdbc:remote.machine.com' and
Rows to update 12
<!-- provide user 'dba' with password 'ThisIsASecret'. --> <!-- Perform any other activities that are associated --> <!-- with the option 'ea-update'. Timeout is 45 seconds. --> <database name="myproductiondb" db="host1:1357:db1" table="table1" vendor="oracle" user="dba" password="ThisIsASecret" timeout="45"> <select> <!-- Select the row whose value in the column --> <!-- named 'filename' matches the current
path, --> <!-- whose value in column 'InterestingTag' --> <!-- matches the current key as modified by any --> <!-- substitutions, and that has literal --> <!-- value 'litData' in column 'info'. --> <column name="filename"
191
<!-- If it is necessary to create a new table for --> <!-- this deployment, the following SQL statement --> <!-- will be used for that purpose (as opposed to -->
SQL section 15
<!-- a capriciously chosen internal default) --> <sql action="create"> <!-- This comment should be ignored. However is --> <!-- subject to parameter --> CREATE TABLE table1 ( Path VARCHAR(300) NOT NULL, KeyName VARCHAR(300) NOT NULL, Value VARCHAR(4000) , State VARCHAR(4000) , CONSTRAINT KVP PRIMARY KEY --> <!-- the parameter token in the next line
substitution.
(Path,KeyName) ) </sql> </database> </destinations> </deployment> </client> <server> <!-- The DataDeploy server will listen on port 1949 of IP --> <!-- 204.247.118.99 --> <bind ip="204.247.118.99" port="1949" /> <!-- Only accept connections from these hosts --> <allowed-hosts>
Server section
192
1. Include File
You can use data-deploy-elements to name a file containing data to include by reference. The file named in data-deploy-elements can contain any number of database, filter, and substitution elements. It must use the same syntax for these elements that the main deployment configuration file uses. If mutually exclusive attributes are set in the include file and the main deployment configuration file, all are used in the deployment. If conflicting attributes are set in the two files, those set in the main deployment configuration file take precedence.
193
4. Client Section
The client section lets you specify a set of client-specific parameters and activities.
5. Deployment Section
The deployment section is where you assign a name to each deployment, and specify deployment source, destination, and update type. You can have any number of deployment sections in a configuration file, and each must have a unique name. The name shown here, ea-to-db, is the name you would specify on the command line when you invoke DataDeploy. The deployment section is required in all configuration files. The exec-deployment subelement lets you execute one or more deployments that are defined elsewhere in the same configuration file. Syntax is as follows:
<exec-deployment use="basearea" />
where basearea refers to the name of a deployment as defined in the name attribute in a deployment element.
194
6. Source Section
The source section resides one nesting level inside the deployment section. It is where you name the type of data to extract from TeamSite and the location(s) of that data. Each deployment section must have exactly one source section.
7. Source Type
The first nesting level within the source element contains a subelement defining what type of data is to be extracted from TeamSite.
define the update type. Each deployment section can have any number of destinations sections, allowing you to designate multiple destinations in a single configuration file.
Note on SimpleDateFormat
Use the following symbols to specify the data-format attribute value in the column element if the data-type attribute is set to DATE or DATETIME: Table 25 SimpleDateFormat
Symbol Meaning Presentation Example
G y M d h
196
era designator year month in year day in month hour in am/pm (1-12)
H m s S E D F w W a k K z
hour in day (0-23) minute in hour second in minute millisecond day in week day in year day in week in month week in year week in month am/pm marker hour in day (1-24) hour in am/pm (0-11) time zone escape for text single quote
(Number) (Number) (Number) (Number) (Text) (Number) (Number) (Number) (Number) (Text) (Number) (Number) (Text) (Delimiter) (Literal)
"yyyy.MM.dd G 'at' hh:mm:ss z" 1996.07.10 AD at 15:08:56 PDT "EEE, MMM d, ''yy" "h:mm a" "hh 'o''clock' a, zzzz" "K:mm a, z" "yyyyy.MMMMM.dd GGG hh:mm aaa" Wed, July 10, '96 12:08 PM 12 o'clock PM, Pacific Daylight Time 0:00 PM, PST 1996.July.10 AD 12:08 PM
You can also obtain a description of the SimpleDateFormat Java class from the Sun Java API documentation Web site:
http://java.sun.com/j2se/1.3/docs/api/java/text/SimpleDateFormat.html
197
198
Appendix B
Before we get started, you must perform the following tasks: Install the OpenDeploy base server software. Refer to Chapter 2, Installation in the OpenDeploy Installation Guide for more information. For the standalone tutorial, ensure the DataDeploy module is properly licensed for use. Refer DataDeploy Module Licensing section in the OpenDeploy Installation Guide for more information. Obtain access to one of the databases supported by OpenDeploy. Refer Supported Databases for Data Deployments section in the OpenDeploy Release Notes for more information. For these tutorials, we are using the Microsoft SQL server database. You should have administrator level access to SQL Server. Create a new database instance using the SQL Server console. Also get the user name, password, hostname, port, and name of the instance. For the DAS tutorial, a compatible version of TeamSite is also required, along with FormsPublisher (formerly FormsPublisher). Refer Release Compatibility section in the OpenDeploy Release Notes for compatibility information. Refer to your TeamSite documentation for installation and usage information.
using your favorite text editor, and uncomment out the databaseDeployment node. 2. Set the databaseDeployment elements daemon_port attribute value to 2345. 3. Open the following file:
od-home/etc/database.xml
This file contains the database parameters that OpenDeploy will use to connect to different databases. Search for microsoft-db. Edit this node with the parameters for your SQL Server database. If you are using a database other than SQL Server, make the respective
200
changes for the equivalent element for that database. Typically you will only need to change the following attributes:
db user password
This example uses the una2000.jar driver that is included with OpenDeploy. 4. Restart the OpenDeploy base server.
/conf /data
- contains the DTD shown here and a deployment configuration file. - contains XML files created for your convenience and follow the DTD shown here.
This will generate a file called dbschema.cfg in the same directory as the DTD. Open this file and you will see that the DTD was interpreted and is represented by two tables, deptRecords and employees. See Execute the Deployment on page 205 for examples of the table structure. Note that you can also map a DTD to an existing database schema by hand-editing a dbschema file or using the OpenDeploy browser-based user interface.
202
In this code sample, the filepath attribute under data-deploy-elements is set to the location of the database.xml file that we edited earlier. In the deployment element, the name attribute is the name of your deployment. Here it is named deployment1. The source section contains information about the data that OpenDeploy will deploy. The xml-source element indicates that the source of our data is XML files. (An alternative to xml-source is the teamsite-templating-records element, which we will use in the DAS tutorial.) The area attribute is set to the location of the source data. The area-type attribute is set to os-filesystem to indicate that the XML data resides on the regular file system. (The other setting is ts-filesystem for the TeamSite file system.) The xml-type attribute is set to custom to indicate that we have used a custom DTD (as opposed to a specially formatted Interwoven DTD) to create our XML records. The path element gives more detail about where the XML records reside. The name attribute is the location relative to the area (specified earlier) where the records are located. In our case, the records actually reside in the /data directory. Alternatively, we could have set area to be od-home/examples/conf-dd/tutorial/data and set the path attribute to .. visit-directory is set to deep which indicates that OpenDeploy should recursively go through all the sub directories in this location to get the data records. Next we will add the destination information:
<destinations> <database use="microsoft-db" delete-tracker="yes" enforce-ri="no">
- specifies which database definition contained in the file database.xml should be used by OpenDeploy for the connection.
delete-tracker - indicates whether OpenDeploy should create an internal system table called IWDELTRACKER. This table is used to track primary key values which is necessary
when OpenDeploy retrieves, updates, or deletes rows. The delete-tracker attribute value is no if you have defined a column named Path in your tables. When OpenDeploy sees a column named Path it will insert the path of the file as the value of the column. Since file paths are always unique, a path value can serve as a primary key for a table. So in this case, the IWDELTRACKER table is not necessary. The delete-tracker attribute is set to yes in this example, since our schema does not have a column named Path.
enforce-ri - indicates whether referential integrity should be enforced. Referential integrity refers to the relationships between tables. Tables within a database can be associated with one another via keys. A key simply refers to one or more columns of a database table. A row of one table can be linked to a row of another table by a set of column values (comprising the key) that are common to both rows.
203
For example, in our database schema, the table deptRecords has a primary key made up of the column deptId. The table employees is linked with the deptRecords by making its foreign key the same as the primary key of deptRecords. Notice that the foreign key of employees specifies its parent table as deptRecords and associates its column deptId with the deptId column of deptRecords. Referential integrity ensures that these relationships are maintained such that if you delete a row of a parent table when there is a child table that refers to that same row, the corresponding child table rows will also be deleted. The dbschema element also falls under the database element. Recall that we created the dbschema earlier. So after you run the iwsyncdb dbschemagen command to generate the dbschema, you copy the contents of that dbschema into the deployment configuration file that we are creating here. Once this has been done, we no longer need the original dbschema file for standalone deployment, since the dbschema in included in the main configuration file.
<dbschema> <group name="deptRecords" root-group="yes"> <attrmap> <column name="deptId" data-type="VARCHAR(255)" value-from-element="deptRecords/0/dept/0/deptId/0" allows-null="no" is-url="no"/> <column name="name" data-type="VARCHAR(255)" value-from-attribute="deptRecords/0/dept/0/description/ 0/name" allows-null="no" is-url="no"/> </attrmap> <keys> <primary-key> <key-column name="deptId"/> </primary-key> </keys> </group> <group name="employee" root-group="no"> <attrmap> <column name="name" data-type="VARCHAR(255)" value-from-attribute="deptRecords/0/employees/0/employee/ [0-5]/name" is-replicant="yes" allows-null="no" is-url="no"/> <column name="id" data-type="VARCHAR(255)" value-from-attribute="deptRecords/0/employees/0/employee/ [0-5]/id" is-replicant="yes" allows-null="no" is-url="no"/> <column name="deptId" data-type="VARCHAR(255)" value-from-element="deptRecords/0/dept/0/deptId/0" allows-null="no" is-url="no"/> </attrmap> <keys> <primary-key>
204
<key-column name="name"/> <key-column name="deptId"/> </primary-key> <foreign-key parent-group="deptRecords"> <column-pair parent-column="deptId" child-column="deptId"/> </foreign-key> </keys> </group> </dbschema>
This file must be located within the /conf directory and have the .xml extension. Be sure to make modifications to the file if any names or locations, such as the location of the XML data or database.xml file, are different than this sample file. We now have our database deployment configuration file. The SQL Server database is running, and our XML data is ready. We can now deploy the XML data to the SQL Server database using this configuration file.
where ddconfig is the name of our configuration file (do not specify the .xml extension). iwdd refers to the name of our deployment, which we are calling deployment1. You can also perform this same task using the OpenDeploy browser-based user interface by selecting the deployment and entering iwdd=deployment1 in the Parameters box contained in the Start Deployment window. You should see the deployment complete with no errors. If you see errors, check the logs residing in the following location:
205
od-home/log/DDTutorial
You will find multiple logs that have deployment1 in the name. The logs should help you resolve any errors. The most relevant log is called src.ddconfig.deployment1.yourhost.to.database.log. Common errors include invalid area and path attributes specified for the source data, and incorrect database connection parameters. Now we will look at the database to see if the tables were created and contain the data from the XML files. 1. Connect to SQL Server through the SQL Server Enterprise Manager. 2. View the tables. The following information should be displayed: Table 27 Database Tables
table_name
deptrecords employee iwdeltracker iwov_idmaps 3. View the details on the deptrecords table. The following information should be displayed: Table 28 Database Tables (deprecords)
DeptId name
00101 00102
Engineering Marketing
4. View the details on the employee table. The following information should be displayed: Table 29 Database Tables (employee)
Name id depId
206
DAS Tutorial
DAS Tutorial
In this section, we will deploy TeamSite data content records (DCRs) from a TeamSite area into a database. Unlike standalone deployments, the DataDeploy module is not needed to use DAS. It is included in the OpenDeploy base server. Before using DAS, TeamSite must be installed and running. As described in the introduction, DAS performs automated deployments. After the initial deployment (which creates the STAGING and workarea tables) has completed, OpenDeploy will be waiting for TeamSite events and will get triggered to execute a deployment based on these events. This behavior requires use of the TeamSite event server.
If you are using TeamSite 6.5 or later, the event server is automatically set up. You can skip to the next section. If you are using a version of TeamSite earlier than 6.5, follow the instructions in this section for setting up the event subsystem.
The event server uses a database to persist events. Therefore, we will need to set up a database for use by the event server. Once again, we will use SQL Server. The event server setup requires a few steps. The OpenDeploy browser-based user interface has a function to do the event server setup. To set up the event server using the browser-based user interface, follow these steps: 1. Select DAS > Event Server Configuration to display the Event Server Configuration: Select Database window. 2. Select SQL Server from the Database Vendor list and click Next. The Set Up window for SQL Server appears. 3. Configure the database parameters contained in the Set Up window: Host - the name of the database host. Listener Port - the port number on which the database server is listening. Database Name - the name of the database where the tables will be created. User Name - the name of the user who has permissions to create tables in the specified database. Password - the database password for the specified user. Path to JDBC Driver - the default JDBC driver path specified, points to the JDBC driver shipped with DAS. This attribute can be changed to a user-specified driver.
207
Click Next. This action will create new tables for the event server. If the tables already exist, you will be prompted to either keep them or drop them and recreate new tables. 4. Open a command prompt and navigate to the iw-home/bin directory, where iw-home is your TeamSite home directory. 5. Select DAS > Start/Stop Event Server Start to start the Interwoven Event Subsystem service. If you suspect any problems with the event server, check the logs residing in the following location:
iw-home/local/logs/eventsubd_*
This will restart the proxy servlet. You can also set up the event server manually from the command line instead of through the browser-based user interface. See Configuring the Event Subsystem Manually on page 108 for more information.
TeamSite Setup
The following sections describe setup tasks for TeamSite when using DAS.
3. Copy the entire templatedata directory to just under your workarea. So your workarea will have a structure similar to that below:
/default/main/WORKAREA/your-workarea/templatedata
For this deployment, we will choose the templating type called internet/careers to work with.
208
DAS Tutorial
If you are using an existing workarea and already had the templating examples set up, delete any files named dbschema.cfg and careers_dd.cfg that you have under templatedata/ internet/careers. If this is your first time using these templating examples, then you may have to configure TeamSite to recognize these examples as is described in the next step. 4. Open the file templating.cfg, residing in the following location:
iw-home/local/config/templating.cfg
using your favorite text editor, and change all the branch nodes so that the vpath-regex attribute is set to .*, for example:
vpath-regex=".*"
This allows you to use the templating examples on all the TeamSite branches. This file might be named templating.cfg.example instead of templating.cfg. If so, then make a copy of it and rename the copied file templating.cfg.
Create DCRs
Accessing the TeamSite user interface, create two DCRs in your workarea. Select File > New Form Entry. Complete the templating form and save the file. Repeat this process to create a second DCR. The DCRs should be saved to the following location:
templatedata/internet/careers/data
where TeamSite_mountpoint might be one of the following values: Windows - Y:\default UNIX - /iwmnt/default
209
It is important that this file is created under templatedata/internet/careers. So after executing this command, check in your workarea to see if this file was created under the careers directory.
There are several templates in this directory. For our example, to deploy DCRs to a set of tables that we have defined in our dbschema, we will use the ddcfg_uds.template. If this files name includes an additional extension, such as .new, remove it. Open the ddcfg_uds.template file using your favorite text editor. Change all instances of oracle-db to microsoft-db. The value microsoft-db refers to the database node in database.xml that we created above. OpenDeploy uses the database connection data referred to by the database elements use attribute. The data-deploy-elements elements filepath attribute value is the full path to the database.xml file. For example:
<data-deploy-elements filepath="od-home/etc/database.xml">
Set Up DAS
We are now ready to start DAS. The first step is to initialize your workarea for DAS. Navigate to the od-home/bin directory and enter the following command at the prompt:
iwsyncdb initial /default/main/WORKAREA/your_workarea internet/careers
By specifying internet/careers, only changes for the careers type in your workarea will trigger DAS. This command causes the following tasks to occur: OpenDeploy uses the ddcfg_uds.template and dbschema.cfg files to generate a configuration file called careers_dd.cfg under templatedata/internet/careers. Your workarea is submitted. Therefore, your workarea will not have any changes and will be up to date with STAGING. The STAGING and workarea tables are created, and the STAGING table is populated with the DCRs under careers/data. The last step is performed by OpenDeploy executing two deployments specified in the careers_dd.cfg file. If you open up the careers_dd.cfg file, you will see a configuration file much more complex than the one we created in the standalone tutorial.
210
DAS Tutorial
Notice that there are six different deployment sections. The first four are the ones we are primarily concerned with for DAS. The first two deployments called basearea and deltagen are run during the DAS initialization step we just completed:
basearea deltagen
- Generates workarea tables, deploys DCRs to the workarea tables. Since the workarea was submitted by DAS earlier, the workarea should have the same content as STAGING, and hence the workarea table will be empty. Recall, that the workarea tables only show differences between STAGING and the workarea. Now lets look at the log to see what occurred. Open the iwdd_default_main.log file residing in the od-home/logs directory. You will see the results of the basearea and deltagen deployments. We can query the database to check if the contents were deployed:
CONSUMERS DEPTRECORDS DESTINATIONS EMPLOYEE IWDELTRACKER IWOV_IDMAPS DEFAULT_INTERNET_CAREERS_CAREERS_MAIN_STAGING DEFAULT_INTERNET_CAREERS_CAREERS_MAIN_WORKAREA_JDOE IWTRACKER JNDI_CONTEXT MESSAGE_HANDLES MESSAGE_ID MESSAGES PERSONNELRECORDS SEEDS SYSTEM_DATA
where JDOE is our workarea name for this test. Notice there is no data in this table. This is because DAS submitted the workarea before doing the basearea deployment. The workarea table only shows differences between STAGING. At this point, STAGING and the workarea are identical.
211
- updates workarea table with any DCR changes made in your workarea.
For example, if you edit one of your DCRs but do not submit it, we would expect the workarea table to show the changed record. The following steps demonstrate this behavior: 1. Go to the TeamSite user interface and edit one of your DCRs, changing some data in the templating form. Select the DCR and then select Edit > Edit. 2. Save the DCR but do not submit it. The save will trigger a deltaupdate deployment. 3. Check the workarea table in the database. Now you will see the modified data in this table. 4. Submit the DCR. The submission will trigger the submitlist deployment. The STAGING table will contain the changes and the workarea table will be empty again. Notice that the state column which used to say Original in the STAGING table, now says Modified. 5. Create a new DCR in your workarea, but do not save it. This will trigger a deltaupdate deployment. Check the workarea table. It will have the record with a state of New. 6. Submit the DCR and see that the new record is now in the STAGING table and not in the workarea table. The STAGING and workarea tables are automatically synchronized with the TeamSite areas.
212
DAS Tutorial
7. Delete a DCR and observe the tables. At first, do not submit the change. You will see that the record is removed from the workarea table, but remains in the STAGING table. 8. Submit the deleted DCR. Now you will see that the record was removed from the STAGING table.
This allows us to have a unique table name for each workarea and STAGING area. There may be many workareas that all have a careers table, so we can not simply have one careers table. We need unique tables for each area that we are working with. This naming convention of using the branch name, category, type, and area creates a problem however. Database table names are very limited in the maximum length. So we can not have a table name that is too large. Certainly, adding the branch info and templating type info to the table name will exceed the name limit. To overcome this, OpenDeploy creates a mapping table. It internally generates a unique short name for the table. OpenDeploy will create an entry in the iwov_idmaps table mapping the short name to the long name
select * from iwov_idmaps; Type Shortid Longid 1 IWT_FC3BD105F88 DEFAULT_INTERNET_CAREERS__CAREERS__MAIN_STAGING 1 IWT_13A318BA73 DEFAULT_INTERNET_CAREERS__CAREERS__MAIN_WORKAREA_JDOE
Here we see what short names correspond to our desired tables. So the STAGING data is in the table DEFAULT_INTERNET_CAREERS__CAREERS__MAIN_STAGING.
213
The following steps use the Oracle_home variable. If your Oracle_home variable has not been set, enter the full path to the Oracle installation location.
Windows
If the execProcess attribute is set to no, follow these steps: 1. Check for the existence of environment variable %ORACLE_HOME%. If the variable is not present, add it and point to the Oracle installation home directory on your host. 2. Make the following entries in the PATH environment variable separated by semi-colons:
%ORACLE_HOME%\bin %ORACLE_HOME%\lib
This should be the directory containing ocijdbcX.dll where X is the version of Oracle client 3. Edit the registry and open the following entry:
\\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\iwodserver\ Parameters
4. Create the new string value JVM Option Number 11 and assign it the Data:
-Djava.library.path=oracle-home\bin;oracle-home\lib
where oracle-home is the actual value of the %ORACLE_HOME% variable. This should be the directory containing ocijdbcX.dll if the bin and lib directories do not have the required .dll file where X is the version of Oracle client in ocijdbcX.dll. 5. Change the string JVM Option Count strings value from b to c. 6. Restart OpenDeploy.
214
7. Run the deployment. If the execProcess attribute is set to yes, follow these steps: 8. Check for the existence of environment variable %ORACLE_HOME%. If the variable is not present, add it and point to the Oracle installation home directory on your host. 9. Make the following entries in the PATH environment variable separated by semi-colons:
%ORACLE_HOME%\bin %ORACLE_HOME%\lib
This should be the directory containing ocijdbcX.dll where X is the version of Oracle client. 10. Open the od-home\lib\iwddexec.bat file using your favorite text editor. 11. Locate the line containing the following string:
set JAVA_LIBRARY_PATH=%OD_LIB_DIR%;%JAVA_CLASSES%
This should be the directory containing ocijdbcX.dll if the bin and lib directories do not have the required .dll file where X is the version of Oracle client in ocijdbcX.dll. 12. Run the deployment.
Solaris
If the execProcess attribute is set to no, follow these steps: 1. Check for the existence of environment variable %ORACLE_HOME%. If the variable is not present, add it and point to the Oracle installation home directory on your host. 2. Make the following entry in the PATH environment variable:
$ORACLE_HOME/bin
This should be the directory containing libocijdbcX.so and libocijdbcX_g.so where X is the version of the Oracle client. 3. Add the entry $ORACLE_HOME/lib to LD_LIBRARY_PATH. 4. Open the od-home/processod file and search for the string JAVA_LIBRARY_PATH in the shell script. 5. Add the following entries each separated by colon to JAVA_LIBRARY_PATH both in the if and else cases i.e.
oracle-home/bin oracle-home/lib
6. This should be the directory containing libocijdbcX.so and libocijdbcX_g.so where X is the version of the Oracle client. 7. Run the deployment. 8. If the execProcess attribute is set to yes, follow these steps: 9. Check for the existence of environment variable %ORACLE_HOME%. If the variable is not present, add it and point to the Oracle installation home directory on your host. 10. Make the following entry in the PATH environment variable:
$ORACLE_HOME/bin
This should be the directory containing libocijdbcX.so and libocijdbcX_g.so where X is the version of the Oracle client. 11. Open the od-home/lib/iwddexec file using your favorite text editor. 12. Search for the function set_LD_LIBRARY_PATH_TO_LIB() in the shell script. Add the following entries each separated by colon to LD_LIBRARY_PATH both in the if and else cases i.e.
${ORACLE_HOME}/bin ${ORACLE_HOME}/lib
This should be the directory containing libocijdbcX.so and libocijdbcX_g.so where X is the version of the Oracle client. 13. Run the deployment.
Best Practices for Writing SQL Queries for Custom SQL Reports
When writing SQL queries for custom SQL reports, it is recommended that you use JDBC functions instead of database specific functions whenever possible. The following list shows examples of using date JDBC date/time functions instead of DBMS-specific ones: Replace datepart(yyyy,D.start_time) with YEAR(D.start_time). Replace datepart(m,D.start_time) with MONTHNAME(D.start_time). Replace datepart(d,D.start_time) with DAYOFMONTH(D.start_time).
216
Best Practices for Writing SQL Queries for Custom SQL Reports
The following table shows the full set of JDBC date conversion functions: Table 30 JDBC Date Conversion Functions
Function Name CURDATE() CURTIME() DAYNAME(date) Function Returns
The current date as a date value. The current local time as a time value. A character string representing the day component of date; the name for the day is specific to the data source.
DAYOFMONTH(date An integer from 1 to 31 representing the day of the month in date. ) DAYOFWEEK(date)
An integer from 1 to 7 representing the day of the week in date; 1 represents Sunday. An integer from 0 to 23 representing the hour component of time. An integer from 0 to 59 representing the minute component of time. An integer from 1 to 12 representing the month component of date. A character string representing the month component of date; the name for the month is specific to the data source. A timestamp value representing the current date and time. An integer from 1 to 4 representing the quarter in date; 1 represents January 1 through March 31. An integer from 0 to 59 representing the second component of time. A timestamp calculated by adding count number of interval(s) to timestamp; interval may be one of the following: SQL_TSI_FRAC_SECOND SQL_TSI_SECOND SQL_TSI_MINUTE SQL_TSI_HOUR SQL_TSI_DAY SQL_TSI_WEEK SQL_TSI_MONTH SQL_TSI_QUARTER SQL_TSI_YEAR An integer from 1 to 53 representing the week of the year in date. An integer representing the year component of date.
217
DAYOFYEAR(date) An integer from 1 to 366 representing the day of the year in date. HOUR(time) MINUTE(time) MONTH(date) MONTHNAME(date) NOW() QUARTER(date) SECOND(time)
WEEK(date) YEAR(date)
The complete set of JDBC functions in documented in the JDBC 3.0 Specification available from the Sun Microsystems Web site:
http://java.sun.com/
Conclusion
There are more options and features that comprise the database deployment function. These features and options are described in more detail elsewhere in this manual, and in the other OpenDeploy documentation. For example, see Filters and Substitutions on page 140 for more information on that topic. This tutorial should make you comfortable enough to try other types of deployments, such as metadata deployments, and use the other features described in the documentation.
218
Appendix C
219
components
output
data_type_1
data_type_2
...
datacapture.cfg
data
content_record_1 content_record_2 ...
presentation
pres_template_1.tpl pres_template_2.tpl ...
220
NOTE
Pat would need to perform additional configuration to set up FormsPublisher and OpenDeploy, but because the focus of this example is the UDS configuration, we will assume that this has already been done.
The ellipses (...) in the column headings indicate that OpenDeploy creates additional column headings for each replicant field, up to the maximum number of fields indicated in the data capture template. In this example, Pat indicated a maximum of 10 fields for the Reviewers replicant by giving the max attribute a value of 10. Therefore, each Reviewers subelement would contain 10 headings:
Name0-Name9 E-Mail0-E-Mail9 Comments0-Comments9
Under the wide table approach, when content contributors submit a data content record with replicant information, OpenDeploy sends the data content record to a wide table in a database. For the first data content record, created by user Chris, OpenDeploy creates the following row: Table 32 Wide Table Mapping
Path
mypath0
Author
origi nal
Assume another user, Don, submits a second data content record to the same data type, book, and that he does not specify any reviewers. After he submits the data content record,
221
OpenDeploy adds a new row in the table. OpenDeploy then inserts information from Dons data content record: Table 33 Wide Table Mapping (cont.)
Path
mypath0
Author
ISBN
William 1234- Software Usin Chris Faulkner 56 Inc. g Data Harper Lee 1256- Software Usin 89 Inc. g Tupl es
mypath1
Such data structures, created by mapping data to wide tables, present the following challenges: Tables can become so wide that they violate database limits, causing deployments to fail. When data is intended for an application, an administrator may need to use native database techniques (such as stored procedures or triggers) to transform the data from the wide table model into the required schema. Some key-value pairs will have no values because referential integrity is not being enforced. Data stored in such tables is not normalized. If users at create additional data content records using the wide table architecture, administrators will only be able to assume that the Path column contains unique information.
Author
ISBN
Publisher
Title
State
1234-56 1256-89
Using Data
original
222
Implementation of a UDS
Chris
chris@xyz.com
1234-56
Implementation of a UDS
OpenDeploy deployments are driven by XML configurations files. This section discusses configuration files that you must create for using user-defined schemas. Generation of these files is described in more detail in Chapter 3, Configuration Files. When implementing a user-defined database schema, you must create a dbschema.cfg file to specify the mapping of fields from XML files (such as data content records) into custom-defined groups of columns, using the groups element. These groups are analogous to tables, in database terminology, and are treated as tables by OpenDeploy.
NOTE
In addition to the dbschema.cfg file for each data type to be deployed, OpenDeploy uses a template configuration file, ddcfg_uds.template (or ddcfg_uds_custom.template if deploying custom DCRs), which defines a skeletal configuration for automating UDS deployments through DAS.
After the dbschema.cfg files and, if required, a ddcfg_uds.template or ddcfg_uds_custom.template file have been created, DataDeploy configuration files that are associated with the UDS must be created. This can be done as follows: For DAS deployments-with the iwsyncdb -initial command. For standalone deployments-with the database deployment UI. The following sections explain the process of implementing a UDS for DAS deployments.
223
If a column is designated as a primary key within a group, a column element for that key must exist within that groups attrmap element. If a column is designated as a foreign key: Its groups attrmap element must contain a column element whose name matches the name of the child column. Its parent group must exist. Its parent groups attrmap element must contain a column whose name matches the name of the parent-group attribute of the child groups foreign-key. A foreign key must have the same data-type attribute (for example, varchar) as its parent key. A column that is defined as a primary key cannot contain null values. Only use user-defined database schemas for database destinations, not database sources. In other words, only use the dbschema element inside a database element when the database element is inside a destinations element. Do not use narrow tuples. The options attribute for the teamsite-templating-records or teamsite-extended-attributes element inside the source element must be set to wide. If the update-type attribute in the database element is set to delta, each group element inside the dbschema element must have a base-table attribute. Specify a primary key for all non-leaf groups in the dbschema.cfg file. A group becomes a leaf group if its name is not used inside any part of the parent-group element. Do not use the select and update elements inside a database element if the database element contains a dbschema element. On the other hand, if a database element does not contain a dbschema element, database must contain select and update elements. If an attrmap element inside a group element has more than one column definition whose value-from-field attribute is set to a replicant field, the value for the specified value-from-field must have the same root element. For example, the Treatment and Drug fields in the following example must have the same root element (Treatment List):
<group name="drug_list"> <attrmap> <column name="Treatment" data-type="varchar(100)" value-from-field="Treatment List/[0-3]/Treatment" is-replicant="yes"/> <column name="Disease" data-type="varchar(100)" value-from-field="Disease " /> <column name="Drug" data-type="varchar(100)" value-from-field="Treatment List/[0-3]/Drug List/[0-4]/Drug" is-replicant="yes"/> </attrmap> ... </group> 224
Implementation of a UDS
Do not use the syntax that appears similar to regular expressions in the value-from-field attribute values (for example, Treatment List/[0-3]/Drug List/[0-4]/Drug) unless you are specifying a replicant field. Use this syntax only for replicant fields to indicate the maximum number of replicants for a given node in the XML tree. The length of column names specified in the dbschema.cfg file for each data type must be less than or equal to what is allowed by your database vendor. OpenDeploy will not map long column names to internally generated identifiers to comply with database column name length limitation.
<foreign-key parent-group="medical_master"> <column-pair parent-column="Disease" child-column="Disease"/> </foreign-key> </keys> </group> <group name="symptom_list" root-group="no"> <attrmap> <column name="Symptom" data-type="varchar(100)" value-from-field="Symptom List/[0-5]/Symptom" is-replicant="yes"/> <column name="Disease" data-type="varchar(100)" value-from-field="Disease"/> </attrmap> <keys> <primary-key> <key-column name="Symptom"/> <key-column name="Disease"/> </primary-key> <foreign-key parent-group="medical_master"> <column-pair parent-column= "Disease" child-column="Disease"/> </foreign-key> </keys> </group> <group name="prognosis_list" root-group="no"> <attrmap> <column name="Prognosis" data-type="varchar(100)" value-from-field="Prognosis List/[0-3]/Prognosis" is-replicant="yes"/> <column name="Disease" data-type="varchar(100)" value-from-field="Disease"/> </attrmap> <keys> <primary-key> <key-column name="Prognosis"/> <key-column name="Disease"/> </primary-key> <foreign-key parent-group="medical_master"> <column-pair parent-column="Disease" child-column= "Disease" /> </foreign-key> </keys> </group> <group name="Treatment_list" root-group="no"> <attrmap> <column name="Treatment" data-type="varchar(100)" value-from-field="Treatment List/[0-3]/Treatment" is-replicant="yes"/> 226
Implementation of a UDS
<column name="Disease" data-type="varchar(100)" value-from-field="Disease"/> </attrmap> <keys> <primary-key> <column-key name="Treatment"/> <column-key name="Disease" /> </primary-key> <foreign-key parent-group="medical_master"> <column-pair parent-column="Disease" child-column= "Disease" /> </foreign-key> </keys> </group> <group name="drug_list" root-group="no"> <attrmap> <column name="Treatment" data-type="varchar(100)" value-from-field="Treatment List/[0-3]/Treatment" is-replicant="yes"/> <column name="Disease" data-type="varchar(100)" value-from-field="Disease"/> <column name="Drug" data-type="varchar(100)" value-from-field="Treatment List/[0-3]/Drug List/[0-4]/Drug" is-replicant="yes"/> </attrmap> <keys> <primary-key> <key-column name="Drug" /> <key-column name="Disease"/> <key-column name="Treatment"/> </primary-key> <foreign-key parent-group="Treatment_list" > <column-pair parent-column="Disease" child-column="Disease" /> <column-pair parent-column="Treatment" child-column="Treatment" /> </foreign-key> </keys> </group> </dbschema>
227
The preceding mapping would result in the database table relationships shown in Figure 45, where N is a variable representing the number of rows in a table that contain a given data type. A 1-to-N relationship represents a one-to-many relationship. Figure 45 Database Table Relationships Created by Sample dbschema.cfg File
Prognosis List N N Symptom List 1 1 Medical Master 1 N Treatment List 1 N Drug List 1 N Vector List
228
Implementation of a UDS
templating.cfg
2 1
Command Line: iwsyncdb iwsyncdb DataDeploy configuration file Y_dd.cfg
3
ddcfg_uds.template file or ddcfg_uds_custom.templ
Figure 46 Using iwsyncdb to Create DataDeploy Configuration Files with Associated UDS 1. The user executes the iwsyncdb command with the -ddgen option. 2. The command invokes a script which does the following: Determines the data types being deployed by reading the templating.cfg file. Reads the datacapture.cfg file for each data type. Reads the dbschema.cfg file for each data type and checks that consistency rules are not violated. 3. The script then reads ddcfg_uds.template or ddcfg_uds_custom.template, which is used as a base format for the DataDeploy configuration file. 4. DataDeploy configuration files are generated based on the data types read by the iwsyncdb script.
NOTE
If any of the files in steps 2 and 3 are not found, an error is returned.
229
230
Appendix D
IWTRACKER
The IWTRACKER table maps the relationship among STAGING and workarea tables for DAS. The IWTRACKER table contains the following columns:
NAME
BASE - the name of the corresponding STAGING table. This only applies to workarea tables. For STAGING tables, this value will be __NO_BASE__. UPDATETIME BRANCH
- the time the particular row in the IWTRACKER table was updated.
IWDELTRACKER
The IWDELTRACKER table stores the primary key values for each file asset (a DCR or XML-based record) deployed to enable deletions and updates when none of the other target tables contain a mapping to the path value of the file. The path value is the absolute path to the file. It uniquely identifies each file since each file has a unique location. When a target table has a column mapped to the path of the file, OpenDeploy uses that path value to delete or update a row.
231
However, OpenDeploy does not require that tables contain a PATH column. Therefore, if there is no table with a PATH column, the IWDELTRACKER table is created automatically. The IWDELTRACKER table contains the following columns:
PATH AREA
- the area relative path to the file. - the path to the area where the file is located. - the name of the primary key column of the actual table receiving the - the value of the primary key.
KEYCOLNAME
deployment.
KEYCOLVALUE
A particular file asset may have multiple entries in the IWDELTRACKER table. For example, one file may map to more than one table or a file may contain replicants. Therefore, the IWDELTRACKER table will contain multiple rows with the same PATH and VALUE columns but different values for the primary key name and value. When OpenDeploy processes a deletion or update on a file, it references the IWDELTRACKER table for the primary key values corresponding to that file. Then it can proceed with the delete or update.
IWOV_IDMAPS
The IWOV_IDMAPS table is a lookup table that maps long identifiers used for a database table to short ids. Database vendors have limits on the size of identifiers, most commonly the following: Table name Columns Constraints Views For example, when using DAS, OpenDeploy will create tables that have the VPATH of the workarea embedded in the name. This results in a table name that is quite long and may exceed the database vendors limit for table name size. The IWOV_IDMAPS table is used to store an internally generated short name for the identifier when the length of the identifier exceeds the limits set by the database vendor. The table contains the following columns:
TYPE 1 2 3 232
IWTMP_LOB
SHORTID LONGIS
OpenDeploy will use the SHORTID column when doing actual database operations.
IWTMP_LOB
The IWTMP_LOB table is by OpenDeploy to temporarily store data that has the datatype of CLOB (character large object) or BLOB (binary large object). You can delete rows from this table when no deployments are running. This table is created only when deploying to an Oracle database version less than 9.0; that is, Oracle 8 or less.
233
234
Glossary
Base Table A table created in the database that represents the data in a TeamSite staging area or edition and contains full (as opposed to delta) data. Base tables act as references for submitted workarea tuple data. Whenever a base table is generated, an entry for that table is recorded in a tracker table residing in the database. Database Auto-Synchronization (DAS) DAS automatically updates the destination database when changes are made to content in TeamSite areas. DAS runs DataDeploy as a daemon, and by using various TeamSite events as triggers it initiates deployment directly from the content source to the destination database. The Event Subsystem lets you filter the events that DAS receives. Database Schema The organization or structure for a relational database, including the layout of tables and columns. A schema includes the constraints placed on tables through the use of primary and foreign keys. User-defined database schemas allow you to map a given record to rows in multiple tables that you can define with foreign and primary keys. The resultant tables have normalized data schemas. Data Capture Template (DCT) An XML file, datacapture.cfg, that defines the form used to capture data content from content contributors using FormsPublisher. A data capture template is associated with a data category and type. The category and type define the type of data required by the data capture template. The data that a content contributor enters in a data capture template is saved on the TeamSite file system as an XML file in the form of a data content record (DCR). Data Content Record (DCR) An XML file containing formatting information interspersed with data captured by FormsPublisher from a contributor or through other means. Data content records can be deployed to a database. Delete Tracker Table
235
A table created to track primary key values for the root group in order to retrieve, update, or delete rows that represent a single data content record (DCR). DataDeploy Wrapper File An OpenDeploy deployment configuration that simply contains a path to a DataDeploy configuration file, plus logging rules. When the deployment is run, the DataDeploy configuration file is invoked. Delta Table Tables used to capture differences between TeamSite workareas and staging areas. These differences-the delta data-are identified and deployed to a delta table on the destination system. This table contains only the delta data from the workarea; it does not contain full static data about every item in the workarea (the delta tables associated base table should exist from a previous deployment). The relationship between the workarea data and the data in its parent area (a staging area or edition) is updated in the tracker table residing in the database. Deployment The transferring of content into database tables or other XML files. Each deployment holds attributes that specify what is deployed and to where it is being deployed. Deployment Trigger A TeamSite event that triggers actions by the DAS feature. Destination Refers to where the source content will be deployed. A destination can be an XML file or a database. Edition A frozen, read-only snapshot of content as it exists in TeamSite. An edition contains a copy of all files in a TeamSite staging area at the time it was published. Editions serve as rollback points for projects in development, and they provide permanent archives. Event Subsystem The Event Subsystem allows you to selectively specify the TeamSite events that will trigger DAS deployments. DAS can also be configured to publish its deployment results to the Event Subsystem, which in turn allows the creation of DAS reports. The Event Subsystem is packaged with TeamSite. Filtering
236
A process of refining deployable files based on additional criteria, such as file permission rules or file transfer rules. OpenDeploy allows the use of filters that let you explicitly state which tuples will be deployed. Key-Value Pairs Fields in the tuple. The key is the name of an attribute, the value is the data value for the key. Metadata (Extended Attributes) A set of data that helps in cataloging, storing, and retrieving files, which can be deployed to a database. Metadata stored in TeamSite are also known as Extended Attributes (EA). Narrow Tuple A tuple that contains only two fields in addition to the path and state fields. The names of the fields are key and value. Narrow tuples are not a common way to deploy data due to structural constraints. For example, because a narrow tuple can contain only one key-value pair, OpenDeploy must create multiple tuples if a files extended attributes consist of more than one key-value pair. Also, you cannot deploy data content records using narrow tuples and you cannot automatically deploy narrow tuples with DAS. DAS only accepts wide tuples. Normalization The process of logically breaking down a database and its schema into smaller, more manageable tables. A normalized database is more flexible and contains less data redundancy. Other advantages to normalization include: relationships between tables are easier to understand, tables are easier to query, and data integrity is better maintained through referential constraints. Path Field A tuple field which is the area relative path name of the file associated with the tuples key-value pair(s). Replicant A repeatable data field in a FormsPublisher data capture form that can contain multiple nested items and instances. A contributor can add and remove copies of the replicant as needed while filling in a data capture form. Replicants cannot be linked. Source Refers to the origin of the data to be deployed; can be an XML file or TeamSite area. Staging Area
237
An area in TeamSite where a user integrates the contents of a workarea. Users submit read-only copies of files from their workareas to the staging area to integrate with other contributions. Standalone Deployment One of the modes of operation. Used to distribute content to repositories at run time and not by triggers or events. Standalone Table When OpenDeploy performs a standalone update, data is extracted from a TeamSite workarea, staging area, or edition and is deployed to a standalone table. A standalone update differs from a base update in that it does not generate an entry in the tracker table. State Field A tuple field that identifies whether the status of the data being deployed is: New: newly created or imported content. Modified: updated or modified content. Not Present: deleted content. Original: content deployed from another area. Submit The act of transferring content from a TeamSite workarea to the staging area. Tracker Table A table created to maintain the synchronization between delta tables from multiple TeamSite workareas and a single base table from a staging area that they are associated with. Tuple The format into which data is transformed and used internally before it is saved as a record in the destination. In addition to its state and path fields, a tuple contains either one key-value pair (a narrow tuple) or multiple key-value pairs (a wide tuple). Tuple Preprocessor A user-defined Java class that can be used to supplement a data tuple object before it is deployed. Two-Tier Usage Configuration A usage configuration that incorporates two systems: the source host where OpenDeploy executes (typically, this is a TeamSite server) and a second host running the relational database server. Two-tier configurations are typically used at sites that do not require firewall protection between the source host and the target database.
238
User-Defined Database Schema A schema that is comprised of more than one table whose relationships are defined by primary and foreign keys. Allows mapping of a given record to multiple tables (an alternative to using wide tables). Wide Table A table in which a single row represents an entire data content record (DCR). Each field in the DCR is mapped to a different column Wide Tuple A wide tuple contains multiple key-value fields in addition to state and path. OpenDeploy appends a numerical suffix to field names to maintain field name uniqueness. Workarea A virtual copy of content in TeamSite, which may be worked on independently without affecting the work of other contributors. A workarea can be owned by a single user or a number of users together.
239
240
Index
A
allowed-hosts element 198 architecture 24 attributes configFilePath 127 databaseXmlFile 132 db 89 row-map-cache-file 158 schemaMapFile (eaData) 133 schemaMapFile (xmlData) 133 useDatabaseRef 132 xmlData 133
D
DAS 23, 93 configuration 100 configuration files 94 database.xml 96 DataDeploy configuration templates 96 drop.cfg 96 iw.cfg 97 metadata capture setup 100 multiple OpenDeploy instances 94 OpenDeploy server configuration 98 parameters, specifying 98 reports 112 requirements 94 template type setup 99 triggers 117 user interface 98 data categories 219 data category 142 data deployment configuration files generating 101 data organization 38 data sources 38 data type 56 data types 219 database drivers 89 database auto-synchronization composite tables 47 delta table 44 deployment sequence 43 initial base table 43 iwsyncdb.ipl 100 table updates 46 updating base tables 45 workareas 101
241
B
base table format 41 base tables 43 querying 183 updating 45, 113 base updates 37 bind element 198
C
client element 194 column element 196 composite tables 47 concepts DAS 23 database 21 DataDeploy 23 deployments 23 structured content 20 configFilePath attribute 127 configuration files
database connection properties 83 database deployments 17 architectural overview 24 architecture 24 categories 33 DataDeploy module 125 process 34 source/destination configurations 35 standalone 126 synchronized 130 target-side 129 database element 179, 196 database element attributes db 89 database privileges 18 database schema 21 database schemas data categories 219 data types 219 dbschema.cfg 223, 225 overview 35 rules 223 UDS 35 user-defined 35 wide table 35 database.xml DAS 96 databaseXmlFile attribute 132 DataDeploy 23 DataDeploy configuration files 127 running 128 DataDeploy configuration templates DAS 96 dataDeploy element 127 DataDeploy module 17, 125 DataDeploy wrapper file 127 data-deploy-elements element 193 db attribute 89 dbLoader element 132 dbschema element 60 dbschema.cfg creation rules 223 DCR deployments 19 delta tables 44
242
updating 113 delta updates 37 deployment element 194 deployments concepts 20 DAS 23 data organization 38 data sources 38 database 17 database schemas 35 DataDeploy 23 DCR 19 EA 19 invocation 18 scenarios 36 standalone 19 synchronized 19 table types 37 tuples 38 UDS 219 update types 37 usage 19 use cases 26 wide table 219 destinations element 195 discard element 193 dlLoaderCustom element 134 drop.cfg DAS 96
E
EA deployments 19 eaAndXmlData element 134 eaData element 133 elements dataDeploy 127 dbLoader 132 dlLoaderCustom 134 eaAndXmlData 134 eaData 133 xmlData 133 elements, DTD allowed-hosts 198
bind 198 client 194 column 196 database 179, 196 data-deploy-elements 193 dbschema 60 deployment 194 destinations 195 discard 193 exec-deployment 194 filter 193 for-deployment 198 host 198 keep 193 select 196 server 198 source 195 sql 198 substitution 194 update 198 xml-formatted-data 196 Event Subsystem configuration files eventsubsystem.properties 109 event subsystem 104 configuring 105, 108 events 104 logging 111 publishers 104 subscribers 104 eventsubsystem.properties 109 exec-deployment element 194 external data source 169
I
internal tables 231 IWDELTRACKER 231 IWOV_IDMAPS 232 IWOV_LOB 233 IWTRACKER 231 invocation 18 iw.cfg DAS 97 TeamSite mount point, alternate 98, 128 IWDELTRACKER internal table 231 IWOV_IDMAPS internal table 232 IWOV_LOB internal table 233 iwsyncdb.ipl 100 IWTRACKER internal table 231
K
keep element 193
L
logging event subsystem 111 TeamSite event 119
M
MetaTagger 19
N
narrow tuples 40, 41 base table format 42
F
filter element 193 for-deployment element 198 FormsPublisher 19
O
OpenDeploy DAS 93 DataDeploy module 17
H
host element 198
R
real updates 180 replicants 149
243
comma separated lists 150 deploying 149 deploying multiple 157 order columns 149 row-map-cache-file attribute 158 rowmapgen 157
S
schema mapping 21 schemaMapFile (eaData) attribute 133 schemaMapFile (xmlData) attribute 133 select element 196 server element 198 source element 195 sql element 198 standalone database deployments 126 alternate mount point 128 configuration 127 DataDeploy configuration file 127 execution 127 server configuration 126 standalone deployments 19 standalone tables querying 183 standalone updates 37 structured content storing 21 XML 20 substitution element 194 substitutions global 194 in-flow 195 synchronized deployments 19, 130
TeamSite 19 TeamSite event logging 119 To 98 tuples 38 metadata 39 narrow 40, 41, 42 defined 237 state 39 wide 40, 41
U
update element 198 update types 37 base updates 37 delta update 37 standalone updates 37 useDatabaseRef attribute 132 user defined schemas configuration files 228 implementation 223 normalization of data 222 user-defined schema 219 user-defined schemas normalization 35
W
wide table limitations 221 wide table schemas 35 wide tuples 40 base table format 41
X T
table types 37 table updates 46 tables, internal 231 target-side database deployments 129 deployment configuration 132 server configuration 131 synchronized 130
244