Exemplo n.º 1
0
        public void ImportChannelsAndContents(int parentId, string siteContentDirectoryPath, bool isOverride)
        {
            var filePathArrayList = GetSiteContentFilePathArrayList(siteContentDirectoryPath);

            var siteContentIe = new SiteContentIe(Fso.PublishmentSystemInfo, siteContentDirectoryPath);

            var parentOrderString = "none";

            //int parentID = 0;
            foreach (string filePath in filePathArrayList)
            {
                var firstIndex  = filePath.LastIndexOf(PathUtils.SeparatorChar) + 1;
                var lastIndex   = filePath.LastIndexOf(".", StringComparison.Ordinal);
                var orderString = filePath.Substring(firstIndex, lastIndex - firstIndex);

                if (StringUtils.StartsWithIgnoreCase(orderString, parentOrderString))
                {
                    parentId          = siteContentIe.ImportChannelsAndContents(filePath, true, isOverride, parentId);
                    parentOrderString = orderString;
                }
                else
                {
                    siteContentIe.ImportChannelsAndContents(filePath, true, isOverride, parentId);
                }
            }
        }
Exemplo n.º 2
0
        public void ImportChannelsAndContentsFromZip(int parentId, string siteContentDirectoryPath, bool isOverride)
        {
            var filePathArrayList = GetSiteContentFilePathArrayList(siteContentDirectoryPath);

            var siteContentIe = new SiteContentIe(Fso.PublishmentSystemInfo, siteContentDirectoryPath);

            Hashtable levelHashtable = null;

            foreach (string filePath in filePathArrayList)
            {
                var firstIndex  = filePath.LastIndexOf(PathUtils.SeparatorChar) + 1;
                var lastIndex   = filePath.LastIndexOf(".", StringComparison.Ordinal);
                var orderString = filePath.Substring(firstIndex, lastIndex - firstIndex);

                var level = StringUtils.GetCount("_", orderString);

                if (levelHashtable == null)
                {
                    levelHashtable = new Hashtable
                    {
                        [level] = parentId
                    };
                }

                var insertNodeId = siteContentIe.ImportChannelsAndContents(filePath, true, isOverride, (int)levelHashtable[level]);
                levelHashtable[level + 1] = insertNodeId;
            }
        }
Exemplo n.º 3
0
        public void ImportSiteContent(string siteContentDirectoryPath, string filePath, bool isImportContents)
        {
            var siteContentIe = new SiteContentIe(Fso.PublishmentSystemInfo, siteContentDirectoryPath);

            siteContentIe.ImportChannelsAndContents(filePath, isImportContents, false, 0);
        }