meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

sap_hybris_commerce:cockpit_framework:fast_import_of_cockpit_configuration [2019/12/18 20:17] (current)
Line 1: Line 1:
 +====== How to load a new cockpit configuration without updating the system ======
  
 +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 > Scripting Languages Console, select Bean Shell and past this code:
 +
 +<code java>
 +import de.hybris.platform.core.initialization.SystemSetupContext;
 +import de.hybris.platform.cockpit.systemsetup.CockpitImportConfig;
 +import de.hybris.platform.core.Registry;
 +import java.io.PrintStream;
 +final String extensionName = "myextension";
 + 
 +try {
 +//We use the context to store the name of the extension.
 +SystemSetupContext context = new SystemSetupContext(null, null, null, extensionName);
 +//We get the bean from the application context to have it autowired.
 +CockpitImportConfig importer = (CockpitImportConfig) Registry.getApplicationContext().getBean("cockpitImportConfig");
 +importer.importCockpitConfig(context);
 +} catch (Exception e) {
 +  System.err.println("There was an error:");
 +  e.printStackTrace(System.err);
 +  return "Error, please see the console of the app server";
 +}
 +return "OK"
 +</code>
 +
 +  * Change **myextension** with the name of the extension which contains the configuration you want to import.
 +  * Click on the **rollback** button and change it to **commit**. This script doesn't require transsantions.
 +  * 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**:\\ 
 +
 +<code>
 +log4j.logger.de.hybris.platform.cockpit.systemsetup.CockpitImportConfig=TRACE
 +</code>
 +
 +--Based on SAP Hybris 6.1