コード例 #1
0
        public static List <ProjectFolderInfo> GetFoldersByPath(this MappingInfo mapping, string path)
        {
            List <ProjectFolderInfo> res = new List <ProjectFolderInfo>();

            foreach (ProjectFolderInfo projectFolder in mapping.ProjectFolders)
            {
                if (projectFolder.FullPath.Trim('\\') == path.Trim('\\') && projectFolder.Checked != false)
                {
                    res.Add(projectFolder);
                }

                res.AddRange(projectFolder.GetFoldersByPath(path));
            }
            return(res);
        }
コード例 #2
0
        public static MappingInfo GetDefaultMapping(string rootPath, string name)
        {
            MappingInfo mapping = new MappingInfo();

            mapping.Name     = name;
            mapping.Host     = "localhost";
            mapping.Username = "";
            mapping.Password = "";

            mapping.TridionFolders = new List <TridionFolderInfo>();
            mapping.TridionFolders.Add(new TridionFolderInfo {
                TridionRole = TridionRole.PageLayoutContainer, ScanForItems = true
            });
            mapping.TridionFolders.Add(new TridionFolderInfo {
                TridionRole = TridionRole.ComponentLayoutContainer, ScanForItems = true
            });
            mapping.TridionFolders.Add(new TridionFolderInfo {
                TridionRole = TridionRole.PageTemplateContainer
            });
            mapping.TridionFolders.Add(new TridionFolderInfo {
                TridionRole = TridionRole.ComponentTemplateContainer
            });

            mapping.ProjectFolders = new List <ProjectFolderInfo>();
            mapping.ProjectFolders.Add(new ProjectFolderInfo
            {
                ProjectFolderRole = Misc.ProjectFolderRole.PageLayout,
                Checked           = true,
                RootPath          = rootPath,
                Path           = "Views\\PageLayouts",
                TemplateFormat =
                    "<CompoundTemplate xmlns=\"http://www.tridion.com/ContentManager/5.3/CompoundTemplate\"><TemplateInvocation><Template xlink:href=\"{0}\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:title=\"{1}\" /><TemplateParameters></TemplateParameters></TemplateInvocation></CompoundTemplate>",
                SyncTemplate = true
            });
            mapping.ProjectFolders.Add(new ProjectFolderInfo
            {
                ProjectFolderRole = Misc.ProjectFolderRole.ComponentLayout,
                Checked           = true,
                RootPath          = rootPath,
                Path           = "Views\\ComponentLayouts",
                TemplateFormat =
                    "<CompoundTemplate xmlns=\"http://www.tridion.com/ContentManager/5.3/CompoundTemplate\"><TemplateInvocation><Template xlink:href=\"{0}\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:title=\"{1}\" /><TemplateParameters></TemplateParameters></TemplateInvocation></CompoundTemplate>",
                SyncTemplate = true
            });
            return(mapping);
        }
コード例 #3
0
        public static MappingInfo ClearMapping(this MappingInfo mapping)
        {
            MappingInfo clearedMapping = new MappingInfo();
            clearedMapping.Name = mapping.Name;
            clearedMapping.Host = mapping.Host;
            clearedMapping.Username = mapping.Username;
            clearedMapping.Password = mapping.Password;
            clearedMapping.TimeZoneId = mapping.TimeZoneId;
            clearedMapping.TridionFolders = mapping.TridionFolders;

            if (mapping.ProjectFolders != null && mapping.ProjectFolders.Count > 0)
            {
                clearedMapping.ProjectFolders = new List<ProjectFolderInfo>();
                foreach (ProjectFolderInfo projectFolder in mapping.ProjectFolders)
                {
                    ProjectFolderInfo clearedProjectFolder = projectFolder.ClearProjectFolder(false);
                    if (clearedProjectFolder != null)
                        clearedMapping.ProjectFolders.Add(clearedProjectFolder);
                }
            }

            return clearedMapping;
        }
コード例 #4
0
        public static MappingInfo GetDefaultMapping(string rootPath, string name)
        {
            MappingInfo mapping = new MappingInfo();
            mapping.Name = name;
            mapping.Host = "localhost";
            mapping.Username = "";
            mapping.Password = "";

            mapping.TridionFolders = new List<TridionFolderInfo>();
            mapping.TridionFolders.Add(new TridionFolderInfo { TridionRole = TridionRole.PageLayoutContainer, ScanForItems = true });
            mapping.TridionFolders.Add(new TridionFolderInfo { TridionRole = TridionRole.ComponentLayoutContainer, ScanForItems = true });
            mapping.TridionFolders.Add(new TridionFolderInfo { TridionRole = TridionRole.PageTemplateContainer });
            mapping.TridionFolders.Add(new TridionFolderInfo { TridionRole = TridionRole.ComponentTemplateContainer });

            mapping.ProjectFolders = new List<ProjectFolderInfo>();
            mapping.ProjectFolders.Add(new ProjectFolderInfo
            {
                ProjectFolderRole = Misc.ProjectFolderRole.PageLayout,
                Checked = true,
                RootPath = rootPath,
                Path = "Views\\PageLayouts",
                TemplateFormat =
                    "<CompoundTemplate xmlns=\"http://www.tridion.com/ContentManager/5.3/CompoundTemplate\"><TemplateInvocation><Template xlink:href=\"{0}\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:title=\"{1}\" /><TemplateParameters></TemplateParameters></TemplateInvocation></CompoundTemplate>",
                SyncTemplate = true
            });
            mapping.ProjectFolders.Add(new ProjectFolderInfo
            {
                ProjectFolderRole = Misc.ProjectFolderRole.ComponentLayout,
                Checked = true,
                RootPath = rootPath,
                Path = "Views\\ComponentLayouts",
                TemplateFormat =
                    "<CompoundTemplate xmlns=\"http://www.tridion.com/ContentManager/5.3/CompoundTemplate\"><TemplateInvocation><Template xlink:href=\"{0}\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:title=\"{1}\" /><TemplateParameters></TemplateParameters></TemplateInvocation></CompoundTemplate>",
                SyncTemplate = true
            });
            return mapping;
        }