public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } if (AuthRequest.IsQueryExists("Delete")) { var groupName = AuthRequest.GetQueryString("GroupName"); try { DataProvider.ChannelGroupDao.Delete(SiteId, groupName); AuthRequest.AddSiteLog(SiteId, "删除栏目组", $"栏目组:{groupName}"); } catch (Exception ex) { FailDeleteMessage(ex); } } if (AuthRequest.IsQueryExists("SetTaxis")) { var groupName = AuthRequest.GetQueryString("GroupName"); var direction = AuthRequest.GetQueryString("Direction"); switch (direction.ToUpper()) { case "UP": DataProvider.ChannelGroupDao.UpdateTaxisToUp(SiteId, groupName); break; case "DOWN": DataProvider.ChannelGroupDao.UpdateTaxisToDown(SiteId, groupName); break; } AddWaitAndRedirectScript(GetRedirectUrl(SiteId)); } if (IsPostBack) { return; } VerifySitePermissions(ConfigManager.SitePermissions.ConfigGroups); RptContents.DataSource = ChannelGroupManager.GetChannelGroupInfoList(SiteId); RptContents.ItemDataBound += RptContents_ItemDataBound; RptContents.DataBind(); BtnAddGroup.Attributes.Add("onclick", ModalNodeGroupAdd.GetOpenWindowString(SiteId)); }
public void Export() { var siteInfo = SiteManager.GetSiteInfo(_siteId); var feed = AtomUtility.GetEmptyFeed(); AtomUtility.AddDcElement(feed.AdditionalElements, new List <string> { SiteAttribute.Id, "PublishmentSystemId" }, siteInfo.Id.ToString()); AtomUtility.AddDcElement(feed.AdditionalElements, new List <string> { SiteAttribute.SiteName, "PublishmentSystemName" }, siteInfo.SiteName); AtomUtility.AddDcElement(feed.AdditionalElements, new List <string> { SiteAttribute.SiteDir, "PublishmentSystemDir" }, siteInfo.SiteDir); AtomUtility.AddDcElement(feed.AdditionalElements, new List <string> { SiteAttribute.TableName, "AuxiliaryTableForContent" }, siteInfo.TableName); AtomUtility.AddDcElement(feed.AdditionalElements, new List <string> { SiteAttribute.IsRoot, "IsHeadquarters" }, siteInfo.IsRoot.ToString()); AtomUtility.AddDcElement(feed.AdditionalElements, new List <string> { SiteAttribute.ParentId, "ParentPublishmentSystemId" }, siteInfo.ParentId.ToString()); AtomUtility.AddDcElement(feed.AdditionalElements, SiteAttribute.Taxis, siteInfo.Taxis.ToString()); AtomUtility.AddDcElement(feed.AdditionalElements, SiteAttribute.SettingsXml, siteInfo.Additional.ToString()); var indexTemplateId = TemplateManager.GetDefaultTemplateId(siteInfo.Id, TemplateType.IndexPageTemplate); if (indexTemplateId != 0) { var indexTemplateName = TemplateManager.GetTemplateName(_siteId, indexTemplateId); AtomUtility.AddDcElement(feed.AdditionalElements, DefaultIndexTemplateName, indexTemplateName); } var channelTemplateId = TemplateManager.GetDefaultTemplateId(siteInfo.Id, TemplateType.ChannelTemplate); if (channelTemplateId != 0) { var channelTemplateName = TemplateManager.GetTemplateName(_siteId, channelTemplateId); AtomUtility.AddDcElement(feed.AdditionalElements, DefaultChannelTemplateName, channelTemplateName); } var contentTemplateId = TemplateManager.GetDefaultTemplateId(siteInfo.Id, TemplateType.ContentTemplate); if (contentTemplateId != 0) { var contentTemplateName = TemplateManager.GetTemplateName(_siteId, contentTemplateId); AtomUtility.AddDcElement(feed.AdditionalElements, DefaultContentTemplateName, contentTemplateName); } var fileTemplateId = TemplateManager.GetDefaultTemplateId(siteInfo.Id, TemplateType.FileTemplate); if (fileTemplateId != 0) { var fileTemplateName = TemplateManager.GetTemplateName(siteInfo.Id, fileTemplateId); AtomUtility.AddDcElement(feed.AdditionalElements, DefaultFileTemplateName, fileTemplateName); } var channelGroupInfoList = ChannelGroupManager.GetChannelGroupInfoList(siteInfo.Id); channelGroupInfoList.Reverse(); foreach (var channelGroupInfo in channelGroupInfoList) { var entry = ChannelGroupIe.Export(channelGroupInfo); feed.Entries.Add(entry); } var contentGroupInfoList = ContentGroupManager.GetContentGroupInfoList(siteInfo.Id); contentGroupInfoList.Reverse(); foreach (var contentGroupInfo in contentGroupInfoList) { var entry = ContentGroupIe.Export(contentGroupInfo); feed.Entries.Add(entry); } feed.Save(_filePath); }