Monday, 21 October 2013

Extends Vs Modifies in WDK customizations

While doing wdk customizations many of us get confused with 2 terms “modifies” and “extends”
Similarity: Both the keywords can be used if you want to change the existing component.

Now let me take an example to explain what is the difference between both.

The following example shows the effect of deleting an element from a component configuration that
has been extended.

In my webtop WDK component definition defines a component  “component1” as below

<component id="component1">
<test>
<a>aaa</a>
<b>bbb</b>
</test>
</component>

Now Webtop layer component “component2”  extends this definition as follows:

<component id="component2" extends="component1:wdk/config/component1.xml">
...</component>

In my custom component I don’t want to have configuration element  <test> <a> aaa </a>.. So my custom configuration removes this using modifies keyword,

Note: You have to modify the component where the original definition for  <test> <a> aaa </a>..  configuration added i.e wdk layer and not the webtop layer definition.

<component modifies="component1:wdk/config/component1.xml">
<remove path="test.a"/></component>

This removes the element <a> from your component. If some other application extends the Webtop

component2, it will not be affected by your modification.

2 comments:

  1. Can i expect few more basic wdk customization examples from your blog.posts from you are easy to understand

    ReplyDelete