private async Task <Result> AddTemplateFromResourceFile(string resourceFileName, string templateName) { var content = ResourceUtility.GetEmbeddedResource(this.GetType(), resourceFileName); var result = await InsertTemplateToCommonData(templateName, content); Ensure.IsSuccessResult(result); return(result); }
public async Task <Result> Initialize() { try { await AddTemplateFromResourceFile(_DefaultFlowTemplate, FlowDataManager.CommonDataName_DefaultFlowConfig); await AddTemplateFromResourceFile(_DefaultSparkJobTemplate, _SparkJobTemplateName); await AddTemplateFromResourceFile(_FlattenerConfig, ConfigFlattenerManager.DefaultConfigName); var localClusterContent = ResourceUtility.GetEmbeddedResource(this.GetType(), _DefaultSparkClusterConfig); await DesignTimeStorage.SaveByName("localCluster", localClusterContent, SparkClusterData.DataCollectionName); return(new SuccessResult("Templates initialized for local")); } catch (Exception ex) { return(new FailedResult($"Templates failed to initialized for local with error {ex.Message}")); } }