Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Datadeploy 1 to N relationship
olivierb
Hi
I'm trying to do a 1-to-N - 1-to-N relationship using the example in the Datadeploy administration guide (p31). But in the last table all the rows of the replicant are created in the database even if they are not initialize in the DCR. So if the max replicant attribute is 10 i will have 10 rows in the database created on the deployment even if only used 2 of them.
My database schema :
CMS_PROMOS_PPT2
1-to-N
CMS_PROMOS_PPT_INFO_TECH2
1-to-N
CMS_PROMOS_PPT_ZONE_LIBRE2
Here are my files :
datacapture.cfg
<container name="promotion">
<label>Promotion</label>
<item name="ctx_ref">
<database deploy-column="f" />
<text required="t" maxlength="50" size="50" validation-regex="^[_a-zA-Z0-9-]+$" />
</item>
<item name="ctl_theme">
<database deploy-column="f" />
<select required="t" multiple="t">
<inline command="/IW/iw-home/iw-perl/bin/iwperl /IW/iw-home/local/config/wadis_dev/inline/af_theme.ipl processus/promotions processus_promotions_fr.dcr t2c1" />
</select>
</item>
<item name="cti_promo">
<database deploy-column="f" />
<text required="t" maxlength="60" size="60" />
</item>
</container>
<container name="info_tech_repl">
<label>Information technique </label>
<item name="info_tech_repl">
<database deploy-column="f" />
<replicant min="0" max="2">
<item name="cti_info">
<label>Titre information technique</label>
<database deploy-column="f" />
<text required="f" maxlength="65" size="65" />
</item>
<item name="texte">
<database deploy-column="f" />
<replicant min="0" max="2">
<item name="ctx_libre">
<database deploy-column="f" />
<text required="f" maxlength="40" size="40" />
</item>
<item name="ctx_ilibre">
<database deploy-column="f" />
<text required="f" maxlength="20" size="20" />
</item>
</replicant>
</item>
</replicant>
</item>
</container>
Here my dbschema.cfg :
<group name="promo_pour_tous" table="CMS_PROMOS_PPT2" root-group="yes">
<attrmap>
<column name="CMS_PROMOS_PPT_PK" data-type="VARCHAR(3209)" value-from-field="path"/>;
<column name="CMS_PROMOS_PPT_ID" data-type="VARCHAR(40)" value-from-field="promotion/0/ctx_ref" allows-null="no" is-url="no"/>
<column name="STITRE" data-type="VARCHAR(240)" value-from-field="promotion/0/cti_promo" allows-null="no" is-url="no"/>
</attrmap>
<keys>
<primary-key>
<key-column name="CMS_PROMOS_PPT_PK"/>
</primary-key>
</keys>
</group>
<group name="replicants2" table="CMS_PROMOS_PPT_INFO_TECH2" root-group="no">
<attrmap>
<column name="CMS_PROMOS_PPT_FRGN" data-type="VARCHAR(3209)" value-from-field="path"/>
<column name="STITRE_INFO_TECHNIQUE" data-type="VARCHAR(100)" value-from-field="info_tech_repl/0/info_tech_repl/[0-2]/cti_info" allows-null="yes" is-url="no" is-replicant="yes"/>
<column name="INUMERO_REPLICATION" data-type="NUMBER(9)" value-from-field="not-used" allows-null="no" replicant-order-column="yes"/>
</attrmap>
<keys>
<primary-key>
<key-column name="STITRE_INFO_TECHNIQUE"/>
<key-column name="CMS_PROMOS_PPT_FRGN"/>
</primary-key>
<foreign-key parent-group ="promo_pour_tous">
<column-pair parent-column="CMS_PROMOS_PPT_PK" child-column="CMS_PROMOS_PPT_FRGN"/>
</foreign-key>
</keys>
</group>
<group name="replicants3" table="CMS_PROMOS_PPT_ZONE_LIBRE2" root-group="no">
<attrmap>
<column name="STITRE_INFO_TECHNIQUE" data-type="VARCHAR(100)" value-from-field="info_tech_repl/0/info_tech_repl/[0-2]/cti_info" is-replicant="yes"/>
<column name="CMS_PROMOS_PPT_INFO_TECH_FRGN" data-type="VARCHAR(3209)" value-from-field="path"/>
<column name="STEXTE_LIBRE" data-type="VARCHAR(100)" value-from-field="info_tech_repl/0/info_tech_repl/[0-2]/texte/[0-2]/ctx_libre" allows-null="no" is-url="no" is-replicant="yes"/>
<column name="SREPONSE_LIBRE" data-type="VARCHAR(100)" value-from-field="info_tech_repl/0/info_tech_repl/[0-2]/texte/[0-2]/ctx_ilibre" allows-null="no" is-url="no" is-replicant="yes"/>
<column name="INUMERO_REPLICATION" data-type="NUMBER(9)" value-from-field="not-used" allows-null="no" replicant-order-column="yes"/>
</attrmap>
<keys>
<primary-key>
<key-column name="INUMERO_REPLICATION"/>
<key-column name="CMS_PROMOS_PPT_INFO_TECH_FRGN"/>
<key-column name="STITRE_INFO_TECHNIQUE"/>
</primary-key>
<foreign-key parent-group ="replicants2">
<column-pair parent-column="CMS_PROMOS_PPT_FRGN" child-column="CMS_PROMOS_PPT_INFO_TECH_FRGN"/>
<column-pair parent-column="STITRE_INFO_TECHNIQUE" child-column="STITRE_INFO_TECHNIQUE"/>
</foreign-key>
</keys>
</group>
Anyone have an idea for deploying only the replicant that have been filled ?
Thanks
Olivier
Find more posts tagged with
Comments
jcoates
Did you get an answer to your question? I'm also having trouble with replicants of replicants not being inserted into the database using data deploy.