cancel
Showing results for 
Search instead for 
Did you mean: 

Override an element-reader

mikemars
Champ in-the-making
Champ in-the-making
Hi,

Is it possible to override an element-reader configuration? I can't seem to get it to work.

In particular I would like to override the advanced-search reader which is found in web-client-config.xml.

I have tried adding the following to web-client-config-custom.xml:

<plug-ins>
      <element-readers>
         <element-reader element-name="advanced-search" class="com.someco.web.config.CustomAdvancedSearchElementReader" />
      </element-readers>
   </plug-ins>
I have also commented out the following line in web-client-config.xml to check if it was just an override issue:

<element-reader element-name="advanced-search" class="org.alfresco.web.config.AdvancedSearchElementReader" />
Even with this line commented out it still won't pick up the new advanced-search config.

I am using Alfresco version 3.4d

Any help appreciated.
1 REPLY 1

mikemars
Champ in-the-making
Champ in-the-making
For anyone else trying to override the 'advanced-search' element-reader, from what I can see it's not possible.

advanced-search is both configured and used in the web-client-config.xml file. It's the use of advanced-search within web-client-config.xml that stops it being overriden.

In the end I had to create a new tag called <custom-advanced-search>

e.g:


<config evaluator="string-compare" condition="Advanced Search">
<advanced-search>
    …
</advanced-search>
<custom-advanced-search>
   …
</custom-advanced-search>
</config>

A reader for this tag can then be configured in web-client-config-custom.xml:


<plug-ins>
  <element-readers>
    <element-reader element-name="custom-advanced-search" class="com.someco.web.config.CustomAdvancedSearchElementReader" />
  </element-readers>
</plug-ins>