public string newPost(string blogid, string username, string password, XmlRpcStruct rpcstruct, bool publish)
{
Authenticate(username, password);
CheckUserRights(blogid, username);
var entryTitleRaw = rpcstruct["title"];
if (entryTitleRaw == null)
throw new ArgumentException("'title' must be provided");
var entryTitle = entryTitleRaw.ToString();
var currentBlog = GetContentDatabase().GetItem(blogid);
if (currentBlog != null)
{
BlogHomeItem blogItem = currentBlog;
var template = new TemplateID(blogItem.BlogSettings.EntryTemplateID);
var newItem = ItemManager.AddFromTemplate(entryTitle, template, currentBlog);
SetItemData(newItem, rpcstruct);
if (publish)
ContentHelper.PublishItemAndRequiredAncestors(newItem.ID);
return newItem.ID.ToString();
}
else
return string.Empty;
}