Exemplo n.º 1
0
        /// <summary>
        /// Builds a condition element from parsed data
        /// </summary>
        /// <param name="parsedData">Parsed data</param>
        /// <param name="project">Project</param>
        /// <param name="errorCollection">Error Collection</param>
        /// <param name="flexFieldObject">Flex field object to which the dialog belongs</param>
        /// <param name="exportSettings">Export Settings</param>
        /// <returns>Condition string</returns>
        public override string BuildConditionElementFromParsedData(GroupConditionResolver.GroupConditionData parsedData, GoNorthProject project, ExportPlaceholderErrorCollection errorCollection, FlexFieldObject flexFieldObject, ExportSettings exportSettings)
        {
            string groupContent = _defaultTemplateProvider.GetDefaultTemplateByType(project.Id, TemplateType.GeneralLogicGroup).Result.Code;
            string renderedConditionElements = _conditionRenderer.RenderConditionElements(project, parsedData.ConditionElements, GetOperatorFromTemplate(project, parsedData.Operator, errorCollection), errorCollection, flexFieldObject, exportSettings);

            groupContent = ExportUtil.BuildPlaceholderRegex(Placeholder_GroupContent).Replace(groupContent, renderedConditionElements);
            return(groupContent);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Builds a condition element from parsed data
        /// </summary>
        /// <param name="template">Export template to use</param>
        /// <param name="parsedData">Parsed data</param>
        /// <param name="project">Project</param>
        /// <param name="errorCollection">Error Collection</param>
        /// <param name="flexFieldObject">Flex field object to which the dialog belongs</param>
        /// <param name="exportSettings">Export Settings</param>
        /// <returns>Condition string</returns>
        public override async Task <string> BuildConditionElementFromParsedData(ExportTemplate template, GroupConditionData parsedData, GoNorthProject project, ExportPlaceholderErrorCollection errorCollection, FlexFieldObject flexFieldObject, ExportSettings exportSettings)
        {
            string groupContent    = template.Code;
            string operatorContent = await ConditionRenderingUtil.GetGroupOperatorFromTemplate(_defaultTemplateProvider, project, parsedData.Operator, errorCollection);

            string renderedConditionElements = await _conditionRenderer.RenderConditionElements(project, parsedData.ConditionElements, operatorContent, errorCollection, flexFieldObject, exportSettings);

            groupContent = ExportUtil.BuildPlaceholderRegex(Placeholder_GroupContent).Replace(groupContent, renderedConditionElements);
            return(groupContent);
        }
        /// <summary>
        /// Returns the value object to use for scriban exporting
        /// </summary>
        /// <param name="parsedData">Parsed data</param>
        /// <param name="project">Project</param>
        /// <param name="errorCollection">Error Collection</param>
        /// <param name="flexFieldObject">Flex field object to which the dialog belongs</param>
        /// <param name="exportSettings">Export Settings</param>
        /// <returns>Value Object</returns>
        protected override async Task <ScribanGroupConditionData> GetExportObject(GroupConditionData parsedData, GoNorthProject project, ExportPlaceholderErrorCollection errorCollection, FlexFieldObject flexFieldObject, ExportSettings exportSettings)
        {
            ScribanGroupConditionData conditionData = new ScribanGroupConditionData();

            string operatorContent = await ConditionRenderingUtil.GetGroupOperatorFromTemplate(_defaultTemplateProvider, project, parsedData.Operator, errorCollection);

            string renderedConditionElements = await _conditionRenderer.RenderConditionElements(project, parsedData.ConditionElements, operatorContent, errorCollection, flexFieldObject, exportSettings);

            conditionData.Content = renderedConditionElements;

            return(conditionData);
        }