Monday, 3 November 2014

How to load a new cockpit configuration without performing the update running system in SAP Hybris

The usual way to update the cockpit configuration is click on "Create Project Data" on the extension with the configuration. And then update the system. This may take some time. Here is a faster way.
  • Go to HAC and then to Console > Bean Shell and paste the code below:
import de.hybris.platform.core.initialization.SystemSetupContext;
import de.hybris.platform.cockpit.systemsetup.CockpitImportConfig;
import de.hybris.platform.core.Registry;
  
// We use the context to store the name of the extension.
SystemSetupContext context = new SystemSetupContext(null, null, null, "myextension");
// We get the bean from the application context to have it autowired.
CockpitImportConfig importer = (CockpitImportConfig) Registry.getApplicationContext().getBean("cockpitImportConfig");
importer.importCockpitConfig(context);
  • Change myextension with the name of the extension which contains the configuration you want to import (for example: bwcore).
  • Click on execute
If you have errors in your configuration, you may turn on the logging of the importer adding the following line to the file local.properties:
log4j.logger.de.hybris.platform.cockpit.systemsetup.CockpitImportConfig=TRACE

No comments:

Post a Comment