public static Location ToLocation(this SPWebApplication webApp, string parentId) { var id = webApp.Id; var uri = webApp.GetResponseUri(SPUrlZone.Default); string url; if (uri != null) { url = uri.ToString(); } else { url = "No ResponseUri in default zone found."; } var location = LocationFactory.GetLocation( id, webApp.DisplayName, parentId, Scope.WebApplication, url, webApp.Sites.Count); return(location); }
public static Location ToLocation(this SPSite site, Guid parentId) { var id = site.ID; var activatedFeatures = site.Features.ToActivatedFeatures(id, Scope.Site, site.Url); string displayName; if (site.RootWeb != null) { displayName = site.RootWeb.Title; } else { displayName = "Site has no root web!"; } var location = LocationFactory.GetLocation( id, displayName, parentId, Scope.Site, site.Url, activatedFeatures, site.AllWebs.Count ); return(location); }
public static Location ToLocation(this SPSite site, string parentId) { LockState lockState = LockState.NotLocked; var id = site.ID; string displayName; int childCount; Guid? databaseId; if (site.IsReadLocked) { lockState = LockState.NoAccess; displayName = string.Format( "Site is Locked! {0}", site.Url ); childCount = 0; databaseId = null; //TODO: find out, if dbid can be read when site collection locked } else { if (site.RootWeb != null) { // TODO: check lock status https://technet.microsoft.com/en-us/library/ff631148(v=office.14).aspx // site.IsReadLocked --> No access displayName = site.RootWeb.Title; } else { displayName = "Site has no root web!"; // well, that's normally impossible, but you never know ... } childCount = site.AllWebs.Count; databaseId = site.ContentDatabase.Id; } var location = LocationFactory.GetLocation( id, displayName, parentId, Scope.Site, site.Url, childCount, databaseId, lockState ); return(location); }
public static Location ToLocation(this SPWeb web, string parentId) { var id = web.ID; var webUrl = web.Url; var location = LocationFactory.GetLocation( id, web.Title, parentId, Scope.Web, webUrl, 0, web.Site.ContentDatabase.Id ); return(location); }
public static Location ToLocation(this SPWeb web, Guid parentId) { var id = web.ID; var webUrl = web.Url; var activatedFeatures = web.Features.ToActivatedFeatures(id, Scope.Web, webUrl); var location = LocationFactory.GetLocation( id, web.Title, parentId, Scope.Web, webUrl, activatedFeatures, 0 ); return(location); }