Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
what is the right syntax for DD config?
nyan
One DCR with content like
======================
<BOOK>
<PUBLISHINFO>
<STYLESHEET>shp1.xsl</STYLESHEET>
<PUBLISHDIR>/us</PUBLISHDIR>
</PUBLISHINFO>
<PUBLISHINFO> <STYLESHEET>chp2.xsl</STYLESHEET>
<PUBLISHDIR>/us</PUBLISHDIR>
</PUBLISHINFO>
<BOOK>
==================
dd config file with content as following:
<group name="PUBLISH_1" table="PUBLISH" root-group="no">
<attrmap>
<column name="SID" data-type="VARCHAR(128)" value-from-element="BOOK/0/SYSTEM/0/ID/0" is-replicant="no" allows-null="no"/>
<column name="STYSHTID" data-type="VARCHAR(128)" list-to-replicant="yes" value-from-field="BOOK/0/PUBLISHINFO/[0-2]/STYLESHEET/0" is-replicant="yes" allows-null="no" />
</attrmap>
<keys>
<primary-key>
<key-column name="SID"/>
<key-column name="STYSHTID"/>
</primary-key>
===============================
The result I have is no records(rows) be populated into DB 'publish' table. I expected at least two rows into the table. Does any syntax wrong?
Thx in advance!
Find more posts tagged with
Comments
Migrateduser
Looking at your dcr you dont have any value for SID which is a key. Didnt DD throw an error? Check the value of the tuple in the DD output. Post your DD output
nyan
1. DCR
--------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE contact SYSTEM "contact.dtd">
<contact>
<name>webmaster</name>
<phone>
<area>800</area>
<code>784-3000</code>
</phone>
<phone>
<area>800</area>
<code>123-4567</code>
</phone>
<phone>
<area>800</area>
<code>444-5555</code>
</phone>
</contact>
--------------------------------------------
2: cfg file
<data-deploy-configuration>
<data-deploy-elements filepath="c:/dd-home/conf/countryportal/database_db2_countryportal.xml" />
<client>
<deployment name="test">
<source>
<teamsite-templating-records
custom="yes" area="/default/main/Admin/WORKAREA/ContentWorkingArea"
options="wide">
<path name="templatedata/CommonContent/contact/data" />
</teamsite-templating-records>
</source>
<destinations>
<database use="TS4IBM" delete-tracker="yes" use-db2-app-driver="yes">
<dbschema>
<group name="TEST" table="TEST" root-group="yes">
<attrmap>
<column name="FID" data-type="VARCHAR(128)" value-from-element="contact/0/name/0" is-replicant="no" allows-null="no"/>
<column name="PUBLISH" data-type="VARCHAR(128)" value-from-field="contact/0/phone/[0-2]/area/0" is-replicant="yes" allows-null="yes" />
</attrmap>
<keys>
<primary-key>
<key-column name="FID"/>
</primary-key>
</keys>
</group>
</dbschema>
</database>
</destinations>
</deployment>
</client>
</data-deploy-configuration>
--------------------------------------------------------
3: DD cmd and LOGS
C:\dd-home\bin>iwdd.ipl cfg=C:\dd-home\conf\countryportal\test.cfg deployment=te
st
DataDeploy Version 5.5.2 Build 9275 Interwoven 20020617
TeamSite_Templating data_root is set to templatedata
Database Vendor set to ibm
SQL datatype for column FID is VARCHAR(128)
SQL datatype for column PUBLISH is VARCHAR(128)
# of columns: 2
# of primary key columns specified: 1
# of groups defined in <dbschema> element: 1
Area VPath:/default/main/Admin/WORKAREA/ContentWorkingArea
Setting up TDbSchemaAgent.
>>> Loading drivers <<<
Loading COM.ibm.db2.jdbc.app.DB2Driver ..
url : TS4IBM
login : ning
login timeout=3
Connecting to the database...
Try connecting using jdbc:db2:TS4IBM...
Connected to jdbc:db2:TS4IBM
Driver IBM DB2 JDBC 2.0 Type 2
Version 07.02.0003
Connected to [TS4IBM]
SELECT * FROM SYSIBM.SYSTABLES WHERE NAME = 'IWOV_IDMAPS'
Building mappings cache...
Built mapping cache(s) successfully.
# column mappings: 0
# table mappings: 0
# view mappings: 0
# constraint mappings: 0
SELECT * FROM SYSIBM.SYSTABLES WHERE NAME = 'IWDELTRACKER'
SELECT * FROM SYSIBM.SYSTABLES WHERE NAME = 'TEST'
Table [TEST] exists.
Running deployment [test]
extraction type=default
tuple mode=wide
area=/default/main/Admin/WORKAREA/ContentWorkingArea
/default/main/Admin/WORKAREA/ContentWorkingArea/templatedata/CommonContent/conta
ct/data
Generate DirectoryContents start:Mon Feb 10 17:07:03 EST 2003
Generate DirectoryContents end :Mon Feb 10 17:07:03 EST 2003
Generate TCustomDCRTupleProducer start:Mon Feb 10 17:07:03 EST 2003
Attribute name "inline" must be followed by the '=' character.
Line 18, Column 13, PublicID null, SystemID null
contact/0
contact/0/name/0
contact/0/phone/0
contact/0/phone/0/area/0
contact/0/phone/0/code/0
contact/0/phone/1
contact/0/phone/1/area/0
contact/0/phone/1/code/0
contact/0/phone/2
contact/0/phone/2/area/0
contact/0/phone/2/code/0
Generate TCustomDCRTupleProducer end :Mon Feb 10 17:07:04 EST 2003
Building replicant order column information.
Building replicant order column information... Done.
TUPLE={contact/0/phone/2=
, IWOV_PROC_FLAG=true, state=Original, contact/0/phone/1=
, contact/0/phone/0=
, contact/0/name/0=webmaster, contact/0/phone/2/code/0=444-5555, contact/0/phone
/2/area/0=800, contact/0=
, TeamSite/Templating/DCR/Type=CommonContent/contact, contact/0/phone/1/code/0=1
23-4567, contact/0/phone/1/area/0=800, contact/0/phone/0/code/0=784-3000, contac
t/0/phone/0/area/0=800, path=templatedata\CommonContent\contact\data\mytest.xml}
Performing delete+insert
Only one group is defined. Skipping delete for update.
Starting SchemaHelper Cache Cleanup Thread...
TTableSchemaHelper not found in cache for [TEST]. Creating new.
SELECT NAME, COLTYPE, LENGTH, NULLS FROM SYSIBM.SYSCOLUMNS WHERE TBNAME = ?
TTableSchemaHelper object for [TEST] found in cache.
SELECT KEYCOLNAME , KEYCOLVALUE FROM IWDELTRACKER WHERE PATH = ? AND AREA
= ?
1 PK values retrieved from iwdeltracker for templatedata\CommonContent\contact\d
ata\mytest.xml, /default/main/Admin/WORKAREA/ContentWorkingArea
TTableSchemaHelper object for [TEST] found in cache.
SelectCurrentRows
ELECT PUBLISH,FID FROM TEST WHERE FID IN (? ) ORDER BY FID
Index: 1, value: webmaster
SelectCurrentRows: 0 rows selected.
DELETE FROM IWDELTRACKER WHERE PATH = ? AND AREA = ?
INSERT INTO IWDELTRACKER( PATH , AREA , KEYCOLNAME , KEYCOLVALUE ) VALUES (?,?,?
,?)
1 rows inserted into iwdeltracker for templatedata\CommonContent\contact\data\my
test.xml, /default/main/Admin/WORKAREA/ContentWorkingArea
-- Updated
Stat for group [TEST]:
-----------------------------------
Rows inserted : 0
Rows updated : 0
Rows deleted : 0
Rows failed : 0
Rows rolled back : 0
Rows skipped : 0
-----------------------------------
Committing database [TS4IBM]...
Deployment[test]
-----------------------------------
DCRs inserted : 0
DCRs updated : 1
DCRs deleted : 0
DCRs failed : 0
DCRs rolled back : 0
DCRs skipped : 0
-----------------------------------
Started : Mon Feb 10 17:07:02 EST 2003
Finished: Mon Feb 10 17:07:04 EST 2003
### IWDataDeploy DONE ###
Migrateduser
Are you trying to modify the table outside of DD from some other application or you have already run deployment against the xml file before?
SELECT KEYCOLNAME , KEYCOLVALUE FROM IWDELTRACKER WHERE PATH = ? AND AREA
= ?
1 PK values retrieved from iwdeltracker for templatedata\CommonContent\contact\d
ata\mytest.xml, /default/main/Admin/WORKAREA/ContentWorkingArea
You need to fix your dbschema, you can have only one entry per file in the TEST table based on the key you are using.
nyan
I tested this based on pure new database (no user table exists before DD). No any customization for DD and database. How can I fix schema?
The steps I got this. 1) taking DD's sample contact DCR and make a file 'mytest.xml' just like I shown in the beginning the post. 2) make a configuration file I shown in the post ( for your db). 3) run the cmd I post (iwdd.ipl cfg=..../test.cfg depolyment=test).
Then you will see the result I have. The script will make 'test' and iwdeltracker' tables by itself, nothing I control from there.
I did try deploy xml file if the xml structure <contact><phone>800-000-0000</phone><phone>123-098-0987</phone><contact>, and this one can DD no problem. The problem is happen whenever you go levels deeper after <phone>, such as ...<phone><area>800</area><code>123-4567</code></phone>...;
Migrateduser
tested this based on pure new database (no user table exists before DD). No any customization for DD and database. How can I fix schema?
To change the table schema change the table map i.e. add or delete columns to your liking or change the datatypes , add keys etc...
Drop the table you had created earlier and rerun iwdd.ipl ....
and see if you see the problem again. Make sure you design your schema properly , use the right keys etc...
nyan
I believed that I did this many times, no user tables at all when I run the scripts.
Also for a new/fresh database, the schema is control by the mytest.cfg file. It seems that if the tables not exist in DD before the data population, DD will automaticlly create table and schema for you. I don't need make any extra steps in doing this.
Migrateduser
I am using DD5.6 and it works fine.
Take a look at my config and xml files
<data-deploy-configuration>
<data-deploy-elements filepath="C:/DATADE~1/conf/database.xml" />
<client>
<deployment name="basearea">
<source>
<teamsite-templating-records
custom = "yes"
options = "wide,full"
area = "/default/main/branch/WORKAREA/testwa"
>
<path name = "templatedata/metadata/foo.xml"
/>
</teamsite-templating-records>
</source>
<destinations>
<database use ="sybase-sqlanywhere-ms"
delete-tracker="yes"
update-type = "standalone"
>
<dbschema>
<group name="TEST" table="TEST3" root-group="yes">
<attrmap>
<column name="FID" data-type="VARCHAR(128)" value-from-element="contact/0/name/0" is-replicant="no" allows-null="no"/>
<column name="PUBLISH" data-type="VARCHAR(128)" value-from-field="contact/0/phone/[0-2]/area/0" is-replicant="yes" allows-null="no" />
</attrmap>
<keys>
<primary-key>
<key-column name="FID"/>
<key-column name="PUBLISH"/>
</primary-key>
</keys>
</group>
</dbschema>
</database>
</destinations>
</deployment>
</client>
</data-deploy-configuration>
XML File
----------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE contact SYSTEM "contact.dtd">
<contact>
<name>webmaster</name>
<phone>
<area>800</area>
<code>784-3000</code>
</phone>
<phone>
<area>900</area>
<code>123-4567</code>
</phone>
<phone>
<area>888</area>
<code>444-5555</code>
</phone>
</contact>
My Log file:
Database Vendor set to microsoft-inetuna
Max Identifier length set to 128 characters.
SQL datatype for column FID is VARCHAR(128)
SQL datatype for column PUBLISH is VARCHAR(128)
# of columns: 2
# of primary key columns specified: 2
# of groups defined in <dbschema> element: 1
Area VPath:/default/main/branch/WORKAREA/testwa
Setting up TDbSchemaAgent.
>>> Loading drivers <<<
url : vtdbns:1433?database=xxxxxx
login : sa
login timeout=3
Connecting to the database...
Try connecting using jdbc:inetdae:vtdbns:1433?database=xxxxxxxx&sql7=true...
Connected to jdbc:inetdae:vtdbns:1433?database=xxxxxxx&sql7=true
Driver i-net UNA 2000
Version 4.18
Connected to [vtdbns:1433?database=xxxxxxxx]
Building mappings cache...
Built mapping cache(s) successfully.
# column mappings: 0
# table mappings: 0
# view mappings: 0
# constraint mappings: 0
Table [TEST3] does not exist. Creating..
CREATE TABLE TEST3(FID VARCHAR(128) NOT NULL ,PUBLISH VARCHAR(128) NOT NULL , CONSTRAINT TEST3_key PRIMARY KEY (FID,PUBLISH))
Running deployment [basearea]
extraction type=full
tuple mode=wide
area=/default/main/branch/WORKAREA/testwa
/default/main/branch/WORKAREA/testwa/templatedata/metadata/foo.xml
Generate DirectoryContents start:Tue Feb 11 15:19:43 PST 2003
Generate DirectoryContents end :Tue Feb 11 15:19:43 PST 2003
Generate TCustomDCRTupleProducer start:Tue Feb 11 15:19:43 PST 2003
Generate TCustomDCRTupleProducer end :Tue Feb 11 15:19:43 PST 2003
Building replicant order column information.
Building replicant order column information... Done.
TUPLE={contact/0/phone/2=
, IWOV_PROC_FLAG=true, state=Original, contact/0/phone/1=
, contact/0/phone/0=
, contact/0/name/0=webmaster, contact/0/phone/2/code/0=444-5555, contact/0/phone/2/area/0=888, contact/0=
, TeamSite/Templating/DCR/Type=internet/book, contact/0/phone/1/code/0=123-4567, contact/0/phone/1/area/0=900, contact/0/phone/0/code/0=784-3000, contact/0/phone/0/area/0=800, path=templatedata\metadata\foo.xml}
TDbSchemaGroupCfg:RowsExistForTuple
ELECT COUNT(*) FROM TEST3 WHERE FID IN ( ? ) AND PUBLISH IN ( ? , ? , ? )
TTableSchemaHelper not found in cache for [TEST3]. Creating new.
TTableSchemaHelper object for [TEST3] found in cache.
INSERT:INSERT INTO TEST3(FID,PUBLISH) VALUES (?,?)
Column: FID, value-from-element: contact/0/name/0, Index: 1,Converting 'webmaster' to VARCHAR
Column: PUBLISH, field: contact/0/phone/0/area/0, Index: 2,Converting '800' to VARCHAR
INSERT:INSERT INTO TEST3(FID,PUBLISH) VALUES (?,?)
Column: FID, value-from-element: contact/0/name/0, Index: 1,Converting 'webmaster' to VARCHAR
Column: PUBLISH, field: contact/0/phone/1/area/0, Index: 2,Converting '900' to VARCHAR
INSERT:INSERT INTO TEST3(FID,PUBLISH) VALUES (?,?)
Column: FID, value-from-element: contact/0/name/0, Index: 1,Converting 'webmaster' to VARCHAR
Column: PUBLISH, field: contact/0/phone/2/area/0, Index: 2,Converting '888' to VARCHAR
4 rows inserted into iwdeltracker for templatedata\metadata\foo.xml, /default/main/branch/WORKAREA/testwa
-- Inserted
Stat for group [TEST]:
-----------------------------------
Rows inserted : 3
Rows updated : 0
Rows deleted : 0
Rows failed : 0
Rows rolled back : 0
Rows skipped : 0
-----------------------------------
Committing database [vtdbns:1433?database=xxxxxxxx]...
Deployment[basearea]
-----------------------------------
DCRs inserted : 1
DCRs updated : 0
DCRs deleted : 0
DCRs failed : 0
DCRs rolled back : 0
DCRs skipped : 0
-----------------------------------
Started : Tue Feb 11 15:19:41 PST 2003
Finished: Tue Feb 11 15:19:43 PST 2003
### IWDataDeploy DONE ###
nyan
So much cannot understand why even I believed exactly follow yours...? Following is What I followed.
1. ===============xml as you provided============
2. ===============<schema ... /> portion I took from yours ====
3. =============== Following is logs. and compare logs with yours, it seems that difference beginning at trace line 'TTableSchemaHelper not found in cache for [TEST3]. Creating new.' ====================
DataDeploy Version 5.5.2 Build 9275 Interwoven 20020617
TeamSite_Templating data_root is set to templatedata
Database Vendor set to ibm
SQL datatype for column FID is VARCHAR(128)
SQL datatype for column PUBLISH is VARCHAR(128)
# of columns: 2
# of primary key columns specified: 2
# of groups defined in <dbschema> element: 1
Area VPath:/default/main/Admin/WORKAREA/ContentWorkingArea
Setting up TDbSchemaAgent.
>>> Loading drivers <<<
Loading COM.ibm.db2.jdbc.app.DB2Driver ..
url : TS4IBM
login : ning
login timeout=3
Connecting to the database...
Try connecting using jdbc:db2:TS4IBM...
Connected to jdbc:db2:TS4IBM
Driver IBM DB2 JDBC 2.0 Type 2
Version 07.02.0003
Connected to [TS4IBM]
SELECT * FROM SYSIBM.SYSTABLES WHERE NAME = 'IWOV_IDMAPS'
SELECT * FROM SYSIBM.SYSTABLES WHERE NAME = 'IWOV_IDMAPS'
Creating identifier mapping table: IWOV_IDMAPS
CREATE TABLE IWOV_IDMAPS (TYPE INT NOT NULL, SHORTID VARCHAR(30) NOT NULL, LON
GID VARCHAR(1024) NOT NULL)
Created identifier mapping table: IWOV_IDMAPS Successfully
Creating index on IWOV_IDMAPS
SELECT * FROM SYSIBM.SYSTABLES WHERE NAME = 'IWDELTRACKER'
CREATE TABLE IWDELTRACKER ( PATH VARCHAR(255) NOT NULL , AREA VARCHAR(255) NO
T NULL , KEYCOLNAME VARCHAR(255) NOT NULL , KEYCOLVALUE VARCHAR(255) NOT NULL
)
CREATE INDEX iwdelt_idx ON IWDELTRACKER( PATH , AREA )
IWDELTRACKER created successfully.
SELECT * FROM SYSIBM.SYSTABLES WHERE NAME = 'TEST3'
SELECT * FROM SYSIBM.SYSTABLES WHERE NAME = 'TEST3'
Table [TEST3] does not exist. Creating..
CREATE TABLE TEST3(FID VARCHAR(128) NOT NULL ,PUBLISH VARCHAR(128) NOT NULL ,
CONSTRAINT TEST3_key PRIMARY KEY (FID,PUBLISH))
Running deployment [test]
extraction type=full
tuple mode=wide
area=/default/main/Admin/WORKAREA/ContentWorkingArea
/default/main/Admin/WORKAREA/ContentWorkingArea/templatedata/CommonContent/conta
ct/data
Generate DirectoryContents start:Wed Feb 12 16:31:28 EST 2003
Generate DirectoryContents end :Wed Feb 12 16:31:28 EST 2003
Generate TCustomDCRTupleProducer start:Wed Feb 12 16:31:28 EST 2003
contact/0
contact/0/name/0
contact/0/phone/0
contact/0/phone/0/area/0
contact/0/phone/1
contact/0/phone/1/area/0
contact/0/phone/2
contact/0/phone/2/area/0
contact/0
contact/0/name/0
contact/0/phone/0
contact/0/phone/0/area/0
contact/0/phone/0/code/0
contact/0/phone/1
contact/0/phone/1/area/0
contact/0/phone/1/code/0
contact/0/phone/2
contact/0/phone/2/area/0
contact/0/phone/2/code/0
Generate TCustomDCRTupleProducer end :Wed Feb 12 16:31:28 EST 2003
Building replicant order column information.
Building replicant order column information... Done.
TUPLE={contact/0/phone/2=
, IWOV_PROC_FLAG=true, state=Original, contact/0/phone/1=
, contact/0/phone/0=
, contact/0/name/0=webmaster, contact/0/phone/2/area/0=888, contact/0=
, TeamSite/Templating/DCR/Type=CommonContent/contact, contact/0/phone/1/area/0=9
00, contact/0/phone/0/area/0=800, path=templatedata\CommonContent\contact\data\m
ytest.bak}
TDbSchemaGroupCfg:RowsExistForTuple
ELECT COUNT(*) FROM TEST3 WHERE FID IN (
? )
Starting SchemaHelper Cache Cleanup Thread...
TTableSchemaHelper not found in cache for [TEST3]. Creating new.
SELECT NAME, COLTYPE, LENGTH, NULLS FROM SYSIBM.SYSCOLUMNS WHERE TBNAME = ?
INSERT INTO IWDELTRACKER( PATH , AREA , KEYCOLNAME , KEYCOLVALUE ) VALUES (?,?,
,?)
1 rows inserted into iwdeltracker for templatedata\CommonContent\contact\data\m
test.bak, /default/main/Admin/WORKAREA/ContentWorkingArea
-- Inserted
TUPLE={contact/0/phone/2=
, IWOV_PROC_FLAG=true, state=Original, contact/0/phone/1=
, contact/0/phone/0=
, contact/0/name/0=webmaster, contact/0/phone/2/code/0=444-5555, contact/0/phon
/2/area/0=888, contact/0=
, TeamSite/Templating/DCR/Type=CommonContent/contact, contact/0/phone/1/code/0=
23-4567, contact/0/phone/1/area/0=900, contact/0/phone/0/code/0=784-3000, conta
t/0/phone/0/area/0=800, path=templatedata\CommonContent\contact\data\mytest.xml
TDbSchemaGroupCfg:RowsExistForTuple
ELECT COUNT(*) FROM TEST3 WHERE FID IN (
? )
TTableSchemaHelper object for [TEST3] found in cache.
INSERT INTO IWDELTRACKER( PATH , AREA , KEYCOLNAME , KEYCOLVALUE ) VALUES (?,?,
,?)
1 rows inserted into iwdeltracker for templatedata\CommonContent\contact\data\m
test.xml, /default/main/Admin/WORKAREA/ContentWorkingArea
-- Inserted
Stat for group [TEST]:
-----------------------------------
Rows inserted : 0
Rows updated : 0
Rows deleted : 0
Rows failed : 0
Rows rolled back : 0
Rows skipped : 0
-----------------------------------
Committing database [TS4IBM]...
Deployment[test]
-----------------------------------
DCRs inserted : 2
DCRs updated : 0
DCRs deleted : 0
DCRs failed : 0
DCRs rolled back : 0
DCRs skipped : 0
-----------------------------------
Started : Wed Feb 12 16:31:17 EST 2003
Finished: Wed Feb 12 16:31:28 EST 2003
### IWDataDeploy DONE ###
nyan
Notice one thing, you are using DD 5.6 and I am using DD552. Does this make the difference ? What is the risks and differences for us to update to DD5.6?
Migrateduser
Its safe and easy to upgrade to DD5.6, you get the benefit of more bug fixes and new features.
nyan
Can anybody give the brief update steps I should follow and what is MUST do and MUST not do?