public string ValidateBlogFolders(string FolderPath, string DatePath, string CategoryPath, string TagPath, string EditorPath)
{
try {
string sFolderPath = ContentPageHelper.ScrubSlug(CMSConfigHelper.DecodeBase64(FolderPath));
string sCategoryPath = ContentPageHelper.ScrubSlug(CMSConfigHelper.DecodeBase64(CategoryPath));
string sTagPath = ContentPageHelper.ScrubSlug(CMSConfigHelper.DecodeBase64(TagPath));
string sDatePath = ContentPageHelper.ScrubSlug(CMSConfigHelper.DecodeBase64(DatePath));
string sEditorPath = ContentPageHelper.ScrubSlug(CMSConfigHelper.DecodeBase64(EditorPath));
if (String.IsNullOrEmpty(sFolderPath) || String.IsNullOrEmpty(sCategoryPath)
|| String.IsNullOrEmpty(sTagPath) || String.IsNullOrEmpty(sDatePath)
|| String.IsNullOrEmpty(sEditorPath)) {
return "FAIL";
}
if (sFolderPath.Length < 1 || sCategoryPath.Length < 1 || sTagPath.Length < 1 || sDatePath.Length < 1 || sEditorPath.Length < 1) {
return "FAIL";
}
List<string> lstParms = new List<string>();
lstParms.Add(sCategoryPath);
lstParms.Add(sTagPath);
lstParms.Add(sDatePath);
lstParms.Add(sEditorPath);
Dictionary<string, int> ct = (from p in lstParms
group p by p into g
select new KeyValuePair<string, int>(g.Key, g.Count())).ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
bool bDuplicate = ct.Where(x => x.Value > 1).Any();
if (SiteData.CurretSiteExists && !bDuplicate) {
var exists = pageHelper.ExistingPagesBeginWith(SiteData.CurrentSite.SiteID, sFolderPath);
if (!exists) {
return "OK";
}
}
if (!SiteData.CurretSiteExists) {
return "OK";
}
return "FAIL";
} catch (Exception ex) {
SiteData.WriteDebugException("webservice", ex);
return ex.ToString();
}
}