static Item GetItemBySiteProperty(Sites.SiteContext siteContext, string propertyKey) { var property = siteContext.Properties[propertyKey]; if (string.IsNullOrEmpty(property)) { return(null); } if (ID.IsID(property) || property.StartsWith(Constants.ContentPath)) { return(siteContext.Database.GetItem(property)); } return(GetItemByShortPath(siteContext, property)); }
static bool HasNotFoundItemKey(Sites.SiteContext siteContext) { return(!string.IsNullOrEmpty(siteContext.Properties[NotFoundItemPropertyKey])); }
static Item GetItemByShortPath(Sites.SiteContext siteContext, string shortPath) { var fullPath = string.Concat(StringUtil.EnsurePostfix('/', siteContext.StartPath), shortPath.TrimStart('/')); return(siteContext.Database.GetItem(fullPath)); }