public EditingSession InitializeEditingSession(StructureNode structureNode) { var toolboxItem = new ToolboxManager().GetToolboxItemByCode(structureNode.WidgetTypeCode); var toolboxItemNativeType = new CmsPageContentActivator().GetToolboxItemNativeType(toolboxItem); var defaultForm = new ConfiguratorCmsPageContentBuilder().GenerateDefaultForm(toolboxItemNativeType, FormStyle.Edit); var runtime = new FormsRuntime(); return(runtime.EditingSession(defaultForm, toolboxItemNativeType, structureNode.Parameters)); }
public ConfiguratorFormDescription GetConfiguratorForm(string widgetTypeCode) { var toolboxItem = new ToolboxManager().GetToolboxItemByCode(widgetTypeCode); var toolboxItemNativeType = new CmsPageContentActivator().GetToolboxItemNativeType(toolboxItem); var defaultForm = new ConfiguratorCmsPageContentBuilder().GenerateDefaultForm(toolboxItemNativeType, FormStyle.Edit); // new CmsPageContentActivator().GetDefaultContentParameterValues(toolboxItem) //.ToDictionary(x => x.Key, x => x.Value) var description = new ConfiguratorFormDescription { Layout = new StructureNodeConverter().GetPageStructure(defaultForm), DefaultValues = new Dictionary <string, string>() }; return(description); }