Nucleus .Net Core CMS

SiteExtensions Class

Namespace: Nucleus.Extensions
Assembly: Nucleus.Extensions.dll
Extension methods to transform Models.SiteSiteSettings from name/value pairs to strongly-typed classes and back again.

Fields

UNCHANGED_PASSWORD Field

Value used to present a password whose value has not been changed.

Methods

HasProperty (Site,String) Method

HasProperty (Site site, String typeUri)
Returns a value which specifies whether the site's user profile values contains a property with the specified typeUri.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
typeUri String

SetSiteMailTemplates (Site,SiteTemplateSelections) Method

SetSiteMailTemplates (Site site, SiteTemplateSelections siteTemplateSelections)

GetSiteTemplateSelections (Site) Method

GetSiteTemplateSelections (Site site)
Parameters
Name Type
site Nucleus.Abstractions.Models.Site

SetSiteMailSettings (Site,MailSettings) Method

SetSiteMailSettings (Site site, MailSettings mailSettings)
Sets SiteSettings based on a Models.Mail.MailSettings object.

GetSiteMailSettings (Site,MailSettings) Method

GetSiteMailSettings (Site site, MailSettings defaultValues)
Gets a Models.Mail.MailSettings object based on SiteSettings.

GetSiteMailSettings (Site) Method

GetSiteMailSettings (Site site)
Gets a new Models.Mail.MailSettings object.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site

GetIconPath (Site,IFileSystemManager) Method

GetIconPath (Site site, IFileSystemManager fileSystemManager)
Return the relative path to the site's icon image file.

GetCssFilePath (Site,IFileSystemManager) Method

GetCssFilePath (Site site, IFileSystemManager fileSystemManager)
Return the relative path to the site's icon image file.

GetDirectFilePath (Site,Guid,IFileSystemManager) Method

GetDirectFilePath (Site site, Guid fileId, IFileSystemManager fileSystemManager)
Return a direct file path, if the file system provider supports it.
Remarks
Return a direct link if the file system provider supports it (because it is faster than returning a redirect to Azure Blob Storage). This "skips" the Nucleus permissions check, but the performance difference is > 200ms. This function should only be used for cases where it is ok to skip the permission check, like site logo/css/favicon.<br /><br /> If the file system provider does not support a direct link, a link to the FileController with an encoded file id parameter is returned, with a ~/ prefix. Callers must call IUrlHelper.Content on the result of this function.

SetPassword (Site,MailSettings) Method

SetPassword (Site site, MailSettings settings)
Set the Models.Mail.MailSettings password if the user has changed the value.

GetPassword (Site) Method

GetPassword (Site site)
Get (decrypt) the Models.Mail.MailSettings password.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site

EncryptPassword (Site,String) Method

EncryptPassword (Site site, String password)
Encrypt and encode a password and return the result.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
password String

DecryptPassword (Site,String) Method

DecryptPassword (Site site, String password)
Encrypt and encode a password and return the result.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
password String

AbsoluteUrl (Site,Boolean) Method

AbsoluteUrl (Site site, Boolean useSSL)
Return the absolute Uri for the specified site as a string.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
useSSL Boolean

AbsoluteUri (Site,Boolean) Method

AbsoluteUri (Site site, Boolean useSSL)
Return the absolute Uri for the specified site.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
useSSL Boolean

AbsoluteUrl (Site,Page,Boolean) Method

AbsoluteUrl (Site site, Page page, Boolean useSSL)
Return the absolute Uri for the specified site and page as a string.

AbsoluteUri (Site,Page,Boolean) Method

AbsoluteUri (Site site, Page page, Boolean useSSL)
Return the absolute Uri for the specified site and page.

AbsoluteUri (Site,String,Boolean) Method

AbsoluteUri (Site site, String relativeUrl, Boolean useSSL)
Return the absolute Uri for the specified site and relative url.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
relativeUrl String
useSSL Boolean

AbsoluteUrl (Site,String,Boolean) Method

AbsoluteUrl (Site site, String relativeUrl, Boolean useSSL)
Return the absolute Uri for the specified site and relative url as a string.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
relativeUrl String
useSSL Boolean

AbsoluteUrl (Site,Page,String,Boolean) Method

AbsoluteUrl (Site site, Page page, String relativeUrl, Boolean useSSL)
Return the absolute Uri for the specified site and page and relative url as a string.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
page Nucleus.Abstractions.Models.Page
relativeUrl String
useSSL Boolean

AbsoluteUri (Site,Page,String,Boolean) Method

AbsoluteUri (Site site, Page page, String relativeUrl, Boolean useSSL)
Return the absolute Uri for the specified site and page and relative url.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
page Nucleus.Abstractions.Models.Page
relativeUrl String
useSSL Boolean

ValidateHomeDirectory (Site,String) Method

ValidateHomeDirectory (Site site, String key)
Validate the site home directory.
Parameters
Name Type
site Nucleus.Abstractions.Models.Site
key String
Remarks
The home directory is validated using using Azure/S3 rules for container names, since that's mostly what the site home directory will be. This prevents some valid folder names for local storage from being used, but the more strict validation will allow users to migrate to Azure/S3 later if required, and still have a valid home directory setting.