public PropertyCollection BuildDynamicNavigationTemplates(deliveryInstance context, PropertyCollection data = null)
        {
            if (data == null)
            {
                data = new PropertyCollection();
            }

            string reldir  = context.directoryScope.FullName.removeStartsWith(context.directoryRoot.FullName);
            string selPath = reldir; // context.scope.path;

            IMetaContentNested mc = context.scope as IMetaContentNested;

            if (mc != null)
            {
                selPath = mc.path;
            }

            reportLinkCollection directory = context.linkRegistry.getLinkOneCollection(selPath, data.getProperString(templateFieldBasic.path_folder, templateFieldBasic.document_path, templateFieldBasic.documentset_path));

            string str_localdirectory = "";

            if (directory != null)
            {
                str_localdirectory = directory.makeHtmlInsert();
            }
            data.add(reportOutputDomainEnum.localdirectory, str_localdirectory);

            return(data);
        }
Пример #2
0
        /// <summary>
        /// Renders as dropdown.
        /// </summary>
        /// <param name="menu">The menu.</param>
        /// <param name="converter">The converter.</param>
        /// <returns></returns>
        public static string RenderAsDropdown(this reportLinkCollection menu, converterBase converter)
        {
            StringBuilder output = new StringBuilder();

            output.AppendLine(converter.GetContainerOpen(bootstrap_containers.dropdown_complete, bootstrap_color.basic, bootstrap_size.lg, menu.title, "#"));
            //output.AppendLine(converter.GetContent(bootstrap_component.dropdown_menuheadlink, bootstrap_color.basic, bootstrap_size.lg, menu.title));
            var Group = menu.GetGroupOfFirstLink();

            if (Group == null)
            {
                return("");
            }

            string currentGroup = Group.name;

            foreach (reportLink link in menu)
            {
                if (link.state != reportLinkState.pathIsUrl)
                {
                    throw new aceReportException("Link was not compiled!! compile links before rendering", aceReportExceptionType.executeScriptError);
                }
                if (link.group.name != currentGroup)
                {
                    output.AppendLine(converter.GetContent(bootstrap_component.dropdown_menuheader, bootstrap_color.basic, bootstrap_size.lg, currentGroup.imbTitleCamelOperation(true, false))); //. //.ToTitleCase(), "#"));
                    currentGroup = link.group.name;
                }
                output.AppendLine(converter.GetContent(bootstrap_component.dropdown_menuitem, bootstrap_color.basic, bootstrap_size.lg, link.linkTitle, link.linkPath));
            }

            output.AppendLine(converter.GetContainerClose(bootstrap_containers.dropdown_complete));
            string outstr = output.ToString();

            return(outstr);
        }
Пример #3
0
        /// <summary>
        /// Renders as dropdown.
        /// </summary>
        /// <param name="menu">The menu.</param>
        /// <param name="converter">The converter.</param>
        /// <returns></returns>
        public static string RenderAsToolbar(this reportLinkCollection menu, converterBase converter, bootstrap_size size = bootstrap_size.unknown)
        {
            if (size == bootstrap_size.unknown)
            {
                if (menu is reportLinkToolbar)
                {
                    reportLinkToolbar menu_reportLinkToolbar = (reportLinkToolbar)menu;
                    size = menu_reportLinkToolbar.size;
                }
                else
                {
                    size = bootstrap_size.md;
                }
            }

            var Group = menu.GetGroupOfFirstLink();

            if (Group == null)
            {
                return("");
            }

            string currentGroup = Group.name;

            StringBuilder output = new StringBuilder();

            output.AppendLine(converter.GetContainerOpen(bootstrap_containers.buttontoolbar, bootstrap_color.primary, size, menu.title, "#"));

            output.AppendLine(converter.GetContainerOpen(bootstrap_containers.buttongroup, bootstrap_color.primary, size, currentGroup.imbTitleCamelOperation(), "#"));

            foreach (reportLink link in menu)
            {
                if (link.state != reportLinkState.pathIsUrl)
                {
                    throw new aceReportException("Link was not compiled!! compile links before rendering", aceReportExceptionType.executeScriptError);
                }
                if (link.group.name != currentGroup)
                {
                    output.AppendLine(converter.GetContainerClose(bootstrap_containers.buttongroup));
                    currentGroup = link.group.name;
                    output.AppendLine(converter.GetContainerOpen(bootstrap_containers.buttongroup, bootstrap_color.primary, size, currentGroup.imbTitleCamelOperation(), "#"));
                }
                output.AppendLine(converter.GetContent(bootstrap_component.button, link.importance.ConvertToBootstrapColor(), size, link.linkTitle, link.linkPath));
            }

            output.AppendLine(converter.GetContainerClose(bootstrap_containers.buttongroup));

            output.AppendLine(converter.GetContainerClose(bootstrap_containers.buttontoolbar));
            string outstr = output.ToString();

            return(outstr);
        }
Пример #4
0
        /// <summary>
        /// Gets the service page link collection.
        /// </summary>
        /// <param name="scoped">The scoped.</param>
        /// <param name="context">The context.</param>
        /// <param name="format">The format.</param>
        /// <returns></returns>
        public static reportLinkCollection GetDocumentSetsLinkCollection(this metaDocumentSet scoped, deliveryInstance context, reportOutputFormatName format, List <reportElementLevel> levels, bool makeAppApsolut = true)
        {
            reportLinkCollection menu = new reportLinkCollection();

            menu.title       = scoped.documentSetTitle.or(scoped.name);
            menu.description = scoped.documentSetDescription;
            // String parent = context.GetDirectoryPath(scoped, levels);
            foreach (metaDocumentSet pg in scoped.documentSets)
            {
                string path = pg.GetIndexPath(context, format, levels, makeAppApsolut);
                menu.AddLink(pg.documentSetTitle.or(pg.name), pg.documentSetDescription, path.getWebPathBackslashFormat().Trim('/'));
            }
            return(menu);
        }
        public PropertyCollection BuildNavigationTemplates(deliveryInstance context, PropertyCollection data = null)
        {
            if (data == null)
            {
                data = new PropertyCollection();
            }
            reportLinkCollection logs = context.linkRegistry[reportOutputDomainEnum.logs.ToString()];

            if (logs.Any())
            {
                string str_logs = data.getProperString("", reportOutputDomainEnum.logs);

                if (imbSciStringExtensions.isNullOrEmpty(str_logs))
                {
                    str_logs = logs.makeHtmlInsert();
                    data.add(reportOutputDomainEnum.logs, str_logs);
                }
            }
            return(data);
        }
Пример #6
0
        /// <summary>
        /// Creates collection of links with correct url paths
        /// </summary>
        /// <param name="menu">The menu.</param>
        /// <param name="context">The context.</param>
        /// <param name="format">The format.</param>
        /// <param name="levels">The levels.</param>
        /// <returns></returns>
        /// <exception cref="imbSCI.Reporting.exceptions.aceReportException">CompileLinkCollection - found link with undefined state</exception>
        public static reportLinkCollection CompileLinkCollection(this reportLinkCollection menu, deliveryInstance context, reportOutputFormatName format, List <reportElementLevel> levels)
        {
            if (menu == null)
            {
                return(null);
                //throw new aceReportException(context,"reportLinkCollection sent to metaTools.CompileLinkCollection() was null", aceReportExceptionType.compileScriptError);
            }
            reportLinkCollection output = new reportLinkCollection(menu.GetMainGroup().name, menu.GetMainGroup().description);
            reportInPackageGroup group  = menu.GetMainGroup();

            output.title       = menu.title;
            output.description = menu.description;

            foreach (reportLink link in menu)
            {
                if (link.group != group)
                {
                    var g = output.AddGroup(link.group.name, link.group.description);
                    g.priority = link.group.priority;
                    group      = g;
                }

                reportLink compiledLink = new reportLink(link);

                bool accept = true;

                switch (link.state)
                {
                case reportLinkState.pathIsMetaModelPath:
                    compiledLink.element = context.scope.resolve(metaModelTargetEnum.scopeRelativePath, link.linkPath, null).First();
                    compiledLink.state   = reportLinkState.pathIsUrl;
                    break;

                case reportLinkState.registryQuery:
                    compiledLink.element = ((IHasReportRegistry)context.scope.root).reportRegistry.GetReport(link.registryQuery);
                    if (compiledLink.element == null)
                    {
                        compiledLink.state = reportLinkState.undefined;
                    }
                    else
                    {
                        compiledLink.state = reportLinkState.pathIsUrl;
                    }

                    break;

                case reportLinkState.elementInstance:
                    compiledLink.state = reportLinkState.pathIsUrl;
                    break;

                case reportLinkState.pathIsUrl:
                    // cool
                    break;

                case reportLinkState.undefined:
                    accept = false;
                    throw new aceReportException(context, "CompileLinkCollection - found link with undefined state", aceReportExceptionType.compileScriptError).add(link.linkTitle).add(link.linkDescription);
                    break;
                }
                if (compiledLink.linkPath.isNullOrEmpty() && compiledLink.state == reportLinkState.pathIsUrl)
                {
                    compiledLink.linkPath = link.element.CompileLinkForElemenet(context, format, levels); //path;
                }
                if (compiledLink.state != reportLinkState.pathIsUrl)
                {
                    accept = false;
                }
                if (accept)
                {
                    output.AddLink(compiledLink);
                }
            }

            output.sortup();

            return(output);
        }