cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

how to create custom filters in extensionacceleratoraddon ? I have to install this addon in my extensionstorefront.

Former Member

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

To do the same we need to create a package inside acceleratoraddon/web/src and place the filter class there. We then need to create a bean in the resource/{addonName}/web/spring/{addonName}-web-spring.xml.

 <bean id="someFilter" class="org.some.filter.SomeFilter" >
     </bean>

You would now need to add this filter bean in to the defaultStorefrontTenantDefaultFilterChainList like in the resource/{addonName}/web/spring/{addonName}-web-spring.xml -

 <bean id="someFilterListMergeDirective" depends-on="defaultStorefrontTenantDefaultFilterChainList" parent="listMergeDirective">
         <property name="add" ref="someFilter"/>
         
     </bean>

Once that is done we just need to install the addon on to the storefront using the command ant addoninstall -Daddonnames="AddOnName1,AddOnName2" -DaddonStorefront.<storefrontTemplateName>="Storefront1,Storefront2"

Then do an ant clean all, refresh the workspace and you should be able to see the filter in the {storefront}/web/addonsrc/{addonName}/{package}/someFilter.java

this filter is now hooked in the defaultStorefrontFilterChainList.

thanks,

Ask a Question