Adobe Campaign Schema - Template vs Aggregate
While looking into the schema, I saw in some places we are referring to an element of a different schema instead of declaring it again and again. But in some places, it is done using template attribute and other places use aggregate attribute.
So to test, I though of using the element "auditTrail" declared inside the library xtk:common
The element is as as below
<element name="auditTrail">
<element defOnDuplicate="true" name="createdBy" template="xtk:common:createdBy"/>
<element defOnDuplicate="true" name="modifiedBy" template="xtk:common:modifiedBy"/>
<attribute defOnDuplicate="true" default="GetDate()" desc="Creation date" label="Creation date"
name="created" type="datetime"/>
<attribute defOnDuplicate="true" default="GetDate()" desc="Modification date"
label="Last modified" name="lastModified" pkgStatus="always" type="datetime"/>
</element>
I inserted the element inside one of my schema as below using both of aggregate and template
<element ...>
....
<element aggregate="xtk:common:auditTrail" name="Audit" label="Audit using aggregate" />
<element template="xtk:common:auditTrail" name="AuditTempl" label="Audit using template" />
</element>
And here is the outcome. Aggregate doesn't add a grouping element with the label provided whereas template does.
Note, template attribute is used as an attribute of attribute declaration element as below too.
<attribute name="phone" template="nms:common:phone"/>
Here the template destination entity has to be declared as an element as below from the nms:common schema
<element dataPolicy="phone" desc="Phone number" label="Phone" length="32" name="phone" type="string"/>
Refer to: Adobe Link
So to test, I though of using the element "auditTrail" declared inside the library xtk:common
The element is as as below
<element name="auditTrail">
<element defOnDuplicate="true" name="createdBy" template="xtk:common:createdBy"/>
<element defOnDuplicate="true" name="modifiedBy" template="xtk:common:modifiedBy"/>
<attribute defOnDuplicate="true" default="GetDate()" desc="Creation date" label="Creation date"
name="created" type="datetime"/>
<attribute defOnDuplicate="true" default="GetDate()" desc="Modification date"
label="Last modified" name="lastModified" pkgStatus="always" type="datetime"/>
</element>
I inserted the element inside one of my schema as below using both of aggregate and template
<element ...>
....
<element aggregate="xtk:common:auditTrail" name="Audit" label="Audit using aggregate" />
<element template="xtk:common:auditTrail" name="AuditTempl" label="Audit using template" />
</element>
And here is the outcome. Aggregate doesn't add a grouping element with the label provided whereas template does.
Note, template attribute is used as an attribute of attribute declaration element as below too.
<attribute name="phone" template="nms:common:phone"/>
Here the template destination entity has to be declared as an element as below from the nms:common schema
<element dataPolicy="phone" desc="Phone number" label="Phone" length="32" name="phone" type="string"/>
Refer to: Adobe Link
Comments
Post a Comment