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

How to use cmsoccaddon and modify its controller to meet our requirement.

kundan1986
Explorer
0 Likes
757

Dear Expert,

I want to use functionality of an existing cmsoccaddon but also want to modify it's controller a little bit.

i have installed this addon using below command:

ant addoninstall -Daddonnames=cmsoccaddon -DaddonStorefront.ycommercewebservices=<your_custom_commerce_webservices>

But i am not able to make any modification in our your _custom_commerce_webservices extension, as every time we do the build our changes is overridden by the OOTB controller.

Thanks,

Kundan

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Likes

Hi there,

Everytime you run ant clean all addons are uninstalled from your storefront / custom extensions and installed again, there two ways to implement what you are trying to do :

  • If the changes are too small you can try the @RequestMappingOverride annotation Example
  • Override the whole cmsoccaddon and use your own instead .. (It does the job but not my favorite)
kundan1986
Explorer
0 Likes

Hi Hamza,

Thanks for the suggestion, could you also tell me all the steps required for Overriding the whole cmsocccaddon.

0 Likes

Hi there,

  1. Go to extensioninfo.xml in the cmsoccaddon and add the following line <meta key="extgen-template-extension" value="true"/>
  2. then add a file with the name extgen.properties with the following content
YEXTNAME_TOKEN=cmsoccaddon
YPACKAGE_TOKEN=cmsoccaddonpackage
YMANAGER_TOKEN=CmsoccaddonManager
YCLASSPREFIX_TOKEN=Cmsoccaddon
YGENERATED_TOKEN=Generated

Finally execute ant extgen you should you find the cmsoccaddon listed along side the other template extensions 🙂