cancel
Showing results for 
Search instead for 
Did you mean: 

Extending behaviours

aussen2
Champ in-the-making
Champ in-the-making
I need to extend the SectionType behaviour of WCMQS and would like to know what the best approach would be. Instead of changing and re-packaging the WQS module itself I would like to extend it through my own module. This would allow me to have all the necessary changes combined with all my other additions in one package. Updating the core WQS module would also be much easier this way.

So I would have my own implementation of SectionType.java that extends the original class. But how do I register this new behaviour in a way that tells Alfresco not to use the original one? If I just overwrite the wcmquickstartmodule_sectionType bean, how can I tell Alfresco that this bean from my own module overwrites the bean from the WQS module and not the other way round? Can I somehow affect in which order the modules are loaded and therefore make sure that the bean definition from my module is picked up after the one from the WQS module?
1 REPLY 1

bremmington
Champ on-the-rise
Champ on-the-rise
If you take a look at the "module-context.xml" file that's embedded in the WQS module you should see at the very end of it this line:

   <import resource="classpath*:alfresco/extension/webquickstart-custom-context.xml" />

If you place any bean definitions into the file referenced by that line then they will definitely take precedence over the ones shipped in the module itself (Spring uses the last definition it comes across).

Out of interest, what are you adding/changing in the SectionType behaviours?