In the cp_change_23596.28
and later versions of the baseline, you do not need to manually initialize the card before using it. You only need to install the card component. This article describes the implementation of setting initialization parameters in this case.
If you need to set initialization parameters, refer to the following code:
// Set the initialization parameters.
CubeInitParam cubeInitParam
= CubeInitParam.getDefault()
// Engine initialization configuration
.setCubeEngineConfig(generateCubeEngineConfig())
// Register the card-to-client channel.
.setCubeModuleModels(generateModuleModel())
// Register a custom label.
.setCubeWidgetInfos(generateWidget());
// Initialize mPaaS
MP.init(this, MPInitParam.obtain().addComponentInitParam(cubeInitParam));
setAutoInitCube
/**
* Set whether the framework automatically initializes the cube. By default, the cube is automatically initialized.
* @param autoInitCube
* @return
*/
public CubeInitParam setAutoInitCube(boolean autoInitCube)
setCubeEngineConfig
/**
* Set CubeEngineConfig, please refer to the CubeEngineConfig introduction
* @param cubeEngineConfig
* @return
*/
public CubeInitParam setCubeEngineConfig(CubeEngineConfig cubeEngineConfig)
setCubeModuleModels
/**
* Register cube jsapi
* @param cubeModuleModels
*/
public CubeInitParam setCubeModuleModels(Collection<CubeModuleModel> cubeModuleModels)
setCubeWidgetInfos
/**
* Register a custom view (custom label)
* @param cubeWidgetInfos
*/
public CubeInitParam setCubeWidgetInfos(Collection<CubeWidgetInfo> cubeWidgetInfos)