private EditPage ( string blogId, string pageId, string userName, string password, BlogEngine.Core.API.MetaWeblog.MWAPage mwaPage, bool publish ) : bool | ||
blogId | string | /// The blog id. /// |
pageId | string | /// The page id. /// |
userName | string | /// The user name. /// |
password | string | /// The password. /// |
mwaPage | BlogEngine.Core.API.MetaWeblog.MWAPage | /// The m page. /// |
publish | bool | /// The publish. /// |
return | bool |
internal bool EditPage(
string blogId, string pageId, string userName, string password, MWAPage mwaPage, bool publish)
{
var page = Page.GetPage(new Guid(pageId));
if (!page.CanUserEdit)
{
throw new MetaWeblogException("11", "User authentication failed");
}
if (!page.IsPublished && publish)
{
if (!page.CanPublish())
{
throw new MetaWeblogException("11", "Not authorized to publish this Page.");
}
}
page.Title = mwaPage.title;
page.Content = mwaPage.description;
page.Keywords = mwaPage.mt_keywords;
page.ShowInList = publish;
page.IsPublished = publish;
if (mwaPage.pageParentID != "0")
{
page.Parent = new Guid(mwaPage.pageParentID);
}
page.Save();
return true;
}