Esempio n. 1
0
        public static void AddJSPluginSupport(this deliveryUnit unit, jsPluginEnum plugin)
        {
            deliveryUnitItemSupportFile js = null;

            string   includePath = "".t(templateFieldDeliveryUnit.del_includepath); //ToString(); //.add("standard\\standard.css", "\\");
            string   outputPath  = "include\\";
            FileInfo fi          = null;
            string   in_path     = "";

            switch (plugin)
            {
            case jsPluginEnum.bibliography:
                // js = new deliveryUnitItemSupportFile(includepath.add("d3.js", "\\"), outputPath);
                break;

            case jsPluginEnum.D3:
                in_path = includepath.add("d3.js", "\\");
                fi      = new FileInfo(in_path);

                js = new deliveryUnitItemSupportFile(fi.FullName, outputPath);
                unit.Add(js, fi);
                break;

            case jsPluginEnum.JQuery:
                in_path = includepath.add("jquery.js", "\\");
                fi      = new FileInfo(in_path);
                js      = new deliveryUnitItemSupportFile(fi.FullName, outputPath);
                unit.Add(js, fi);
                break;

            case jsPluginEnum.ontologyViewer:
                // js = new deliveryUnitItemSupportFile(includepath.add("d3.js", "\\"), outputPath);
                break;

            case jsPluginEnum.strapdown:
                //unit.Add(new deliveryUnitItemSupportFile(includepath.add("strapdown.js", "\\"), outputPath));
                //unit.Add(new deliveryUnitItemSupportFile(includepath.add("strapdown.css", "\\"), outputPath));
                //unit.Add(new deliveryUnitItemSupportFile(includepath.add("strapdown-topbar.min.js", "\\"), outputPath));
                break;

            case jsPluginEnum.visualRDF:
                // js = new deliveryUnitItemSupportFile(includepath.add("d3.js", "\\"), outputPath);
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Adds a theme support file.
        /// </summary>
        /// <param name="sourcePath">The source path - relative to reportTheme folder</param>
        /// <param name="outputPath">The output path - relative to deliveryInstance output folder</param>
        /// <returns></returns>
        public deliveryUnitItemSupportFile AddThemeSupportFile(string sourcePath, string outputPath = "include\\", appendLinkType linkType = appendLinkType.unknown)
        {
            string tsf_path = deliveryUnitBuilder.themepath.add(sourcePath, "\\");

            FileInfo fi = new FileInfo(tsf_path);

            deliveryUnitItemSupportFile spf = new deliveryUnitItemSupportFile(fi.FullName, outputPath);

            if (linkType != appendLinkType.unknown)
            {
                spf.linkType = linkType;
            }

            Add(spf, fi);
            return(spf);
        }
Esempio n. 3
0
        /// <summary>
        /// Adds all files found in the <c>themeFolder</c> that match <c>search</c> and they were not already included
        /// </summary>
        /// <param name="themeFolder">The theme folder.</param>
        /// <param name="targetLinkType">Type of the target link.</param>
        /// <param name="outputPath">The output path.</param>
        /// <param name="includeSub">if set to <c>true</c> [include sub].</param>
        /// <param name="keepFolderStructure">if set to <c>true</c> [keep folder structure].</param>
        /// <returns></returns>
        public List <deliveryUnitItemSupportFile> AddThemeSupportFiles(string themeFolder, string search, string outputPath = "include\\", bool doForcePostLinks = false)
        {
            string        tsf_path = deliveryUnitBuilder.themepath.add(themeFolder, "\\");
            DirectoryInfo di       = Directory.CreateDirectory(tsf_path);

            List <deliveryUnitItemSupportFile> output = new List <deliveryUnitItemSupportFile>();

            FileInfo[] files = di.GetFiles(search);

            //List<String> filePaths = filePathOperations.findFiles(targetLinkType.getFileExtension(), tsf_path, includeSub);

            foreach (FileInfo fp in files)
            {
                string outp = outputPath;
                string inp  = fp.FullName;

                //if (keepFolderStructure)
                //{
                //    String sub = inp.removeStartsWith(di.FullName);
                //    sub = Path.GetDirectoryName(sub);
                //    outp = outp.add(sub, "\\");
                //}

                if (!items.containsItemFromSourcefile(fp))
                {
                    deliveryUnitItemSupportFile spf = new deliveryUnitItemSupportFile(inp, outp);
                    spf.sourceFileInfo = fp;
                    if (doForcePostLinks)
                    {
                        if (spf.linkType == appendLinkType.scriptLink)
                        {
                            spf.linkType = appendLinkType.scriptPostLink;
                        }
                    }

                    output.Add(spf);
                    Add(spf, fp);
                }
            }

            //Add(spf);
            return(output);
        }