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); }
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); }
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; }
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; }