Smarteditaddon issue in CI/CD pipeline

Smartedit works perfectly on local environment, but after deploying on development environment (which is deployed with CI/CD pipeline) smartedit stops responding with endless loading.

After some investigation was found that ant addoninstall command for smarteditaddon will generate inside smarteditaddon extension folder new properties file from project.properties.template file. Generated properties file contains properties for injection javascript files, which is required for proper functioning of smartedit (including webApplicationInjector.js). So deployment packages doesn’t contain properties, required for proper functioning of smartedit, due to CI/CD pipeline doesn’t executes ant addoninstall commands and in source control system is stored only custom extensions.

To fix this issue just add into project.properties file of storefront extension following properties:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14

# Enbale smarteditaddon
<your_custom_storefront>.wro4jconfigscan.smarteditaddon            = true

# Specifies the location of the spring context file added automatically to the global platform application context.
smarteditaddon.application-context                                 = smarteditaddon-spring.xml
<your_custom_storefront>.additionalWebSpringConfigs.smarteditaddon = classpath:/smarteditaddon/web/spring/smarteditaddon-web-spring.xml

smarteditaddon.javascript.paths.desktop                            = /shared/common/js/webApplicationInjector.js;/shared/common/js/reprocessPage.js;/shared/common/js/adjustComponentRenderingToSE.js;/desktop/common/js/smarteditaddon.js
smarteditaddon.javascript.paths.mobile                             = /shared/common/js/webApplicationInjector.js;/shared/common/js/reprocessPage.js;/shared/common/js/adjustComponentRenderingToSE.js;/mobile/common/js/smarteditaddon.js
smarteditaddon.javascript.paths.responsive                         = /shared/common/js/webApplicationInjector.js;/shared/common/js/reprocessPage.js;/shared/common/js/adjustComponentRenderingToSE.js;/responsive/common/js/smarteditaddon.js
smarteditaddon.css.paths.desktop                                   = /desktop/common/css/smarteditaddon.css
smarteditaddon.css.paths.mobile                                    = /mobile/common/css/smarteditaddon.css
smarteditaddon.css.paths.responsive                                = /responsive/common/css/smarteditaddon.css

Also ensure, that smartedit is installed properly:

  1. Add smartedit dependencies in localextensions.xml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
        <!-- Smart edit -->
<extension name="smartedit"/>
<extension name="oauth2"/>
<extension name="smarteditaddon"/>
<extension name="smarteditwebservices"/>
<extension name="cmswebservices"/>
<extension name="cmssmartedit"/>
<extension name="webservicescommons"/>
<extension name="permissionswebservices"/>
<extension name="cmssmarteditwebservices"/>
<extension name="previewwebservices"/>
  1. Install smarteditaddon into storefront ant addoninstall -Daddonnames=smarteditaddon -DaddonStorefront.yacceleratorstorefront=<your_custom_storefront>
comments powered by Disqus