Hi all!
As read in WDK 6.7 Dev Guide, it is now possible to modify existing component configuration for <filter> elements :
Add your modification as follows:<component id="changepassword" modifies="changepassword:wdk/config/changepassword_component.xml"> <replace path="pages.filter[clientenv=webbrowser]"> <start>/custom/changepassword.jsp</start> </replace></component>
I must be happy since it was really missing in previous versions of wdk
But I want to modify app.xml for a filtered element.
I need to change repository_path for the 'non portal' clientenv
Here is the extract of wdk/app.xml I need to change :
<preferencesrepository> <filter clientenv='not portal'> <repository_path>/Resources/Registry/Preferences/Webtop</repository_path> </filter> <filter clientenv='portal'> <repository_path>/Resources/Registry/Preferences/Webtop/WDKPortlets</repository_path> </filter></preferencesrepository>
Here is my app.xml :
<?xml version="1.0" encoding="UTF-8" standalone="no"?><config> <scope> <application modifies="wdk/app.xml"> <replace path="preferencesrepository.filter[clientenv=not portal].repository_path"> <repository_path>/Resources/Registry/Preferences/MyWebtop</repository_path> </replace> </application> </scope></config>
The first problem comes with the space char in "not portal", I'm getting error "Invalid Argument 'pattern': 'element-name[attribute-name=attribute-value]'"
I decompiled ConfigElement.class and saw :
if (strPattern.indexOf(' ') != -1)
{
throw new IllegalArgumentException("Invalid Argument 'pattern': 'element-name[attribute-name=attribute-value]'");
}
Unbelievable since wdk has its own parser !
It would've been great if values had to be quoted [clientenv='not portal'] (XPATH syntax in fact)
I wanted to test if it would work with filters with no space :
<replace path="preferencesrepository.filter[clientenv=portal].repository_path">
I'm now getting : Can't locate a unique child element with path: preferencesrepository.filter[clientenv=portal].repository_path
Is there any way to achieve doing this ?
Thank you