Class CPSiteBaseClass
- Namespace
- Contensive.BaseClasses
- Assembly
- CPBase.dll
Application settings and methods
public abstract class CPSiteBaseClass
- Inheritance
-
CPSiteBaseClass
- Inherited Members
Properties
AppPath
Deprecated. This was the url path to the application for virtually hosted sites. Should be a blank.
[Obsolete("Deprecated. This was the url path to the application for virtually hosted sites. Should be a blank.", false)]
public abstract string AppPath { get; }
Property Value
AppRootPath
Deprecated. This was the url path to the application for virtually hosted sites. Should be a blank.
[Obsolete("Deprecated. This was the url path to the application for virtually hosted sites. Should be a blank.", false)]
public abstract string AppRootPath { get; }
Property Value
Domain
For a webpage hit, this is the current domain used, otherwise it is the primary domain.
public abstract string Domain { get; }
Property Value
DomainList
A complete list of all domains supported.
public abstract string DomainList { get; }
Property Value
DomainPrimary
The primary domain name for the application. Used for email links, monitoring, etc.
public abstract string DomainPrimary { get; }
Property Value
FilePath
deprecated. Use CP.Http.CdnFilePathPrefix or CP.Http.CdnFilepathPrefixAbsolute
[Obsolete("Use CP.Http.CdnFilePathPrefix or CP.Http.CdnFilepathPrefixAbsolute", false)]
public abstract string FilePath { get; }
Property Value
MultiDomainMode
Deprecated
[Obsolete("Deprecated", false)]
public abstract bool MultiDomainMode { get; }
Property Value
Name
The application name
public abstract string Name { get; }
Property Value
PageDefault
For websites, the default script page.
public abstract string PageDefault { get; }
Property Value
PhysicalFilePath
Deprecated, please use cp.cdnFiles, cp.privateFiles, cp.WwwFiles, or cp.TempFiles instead.
[Obsolete("Deprecated, please use cp.cdnFiles, cp.privateFiles, cp.WwwFiles, or cp.TempFiles instead.", false)]
public abstract string PhysicalFilePath { get; }
Property Value
PhysicalInstallPath
Deprecated, please use cp.cdnFiles, cp.privateFiles, cp.WwwFiles, or cp.TempFiles instead.
[Obsolete("Deprecated, please use cp.cdnFiles, cp.privateFiles, cp.WwwFiles, or cp.TempFiles instead.", false)]
public abstract string PhysicalInstallPath { get; }
Property Value
PhysicalWWWPath
Deprecated, please use cp.cdnFiles, cp.privateFiles, cp.WwwFiles, or cp.TempFiles instead.
[Obsolete("Deprecated, please use cp.cdnFiles, cp.privateFiles, cp.WwwFiles, or cp.TempFiles instead.", false)]
public abstract string PhysicalWWWPath { get; }
Property Value
TrapErrors
Deprecated
[Obsolete("Deprecated", false)]
public abstract bool TrapErrors { get; }
Property Value
VirtualPath
Deprecated. This was a slash followed by the application name.
[Obsolete("Deprecated. This was a slash followed by the application name.", false)]
public abstract string VirtualPath { get; }
Property Value
htmlPlatformVersion
The html platform version for this site. replaces the site property html platform version htmlPlatform 0-4 is Bootstrap 4. htmlPlaform 5 is Bootstrap 5.
public abstract int htmlPlatformVersion { get; }
Property Value
Methods
AddActivity(string)
Add completed activity for online visit by current user, subject saved as message
public abstract int AddActivity(string subject)
Parameters
subjectstringA brief name for the activity to be shown in a list of other activities. Typically 'Call', 'Message', 'Meeting', 'Online Form', etc.
Returns
AddActivity(string, string)
Add completed activity for online visit by current user
public abstract int AddActivity(string subject, string detailsText)
Parameters
subjectstringA brief name for the activity to be shown in a list of other activities. Typically 'Call', 'Message', 'Meeting', 'Online Form', etc.
detailsTextstringThe details of the activity, non-html plain text.
Returns
AddActivity(string, string, int)
Add completed activity for online visit by the selected user
public abstract int AddActivity(string subject, string detailsText, int activityUserId)
Parameters
subjectstringA brief name for the activity to be shown in a list of other activities. Typically 'Call', 'Message', 'Meeting', 'Online Form', etc.
detailsTextstringThe details of the activity, non-html plain text.
activityUserIdint
Returns
AddActivity(string, string, int, DateTime, int, int)
Add a schedule, non-completed activity online-visit activity, by the selected user
[Obsolete("Use overload with activity-type", false)]
public abstract int AddActivity(string subject, string detailsText, int activityUserId, DateTime dateScheduled, int duration, int scheduledStaffId)
Parameters
subjectstringA brief name for the activity to be shown in a list of other activities. Typically 'Call', 'Message', 'Meeting', 'Online Form', etc.
detailsTextstringThe details of the activity, non-html plain text.
activityUserIdintdateScheduledDateTimedurationintscheduledStaffIdint
Returns
AddActivity(string, string, int, int)
Add completed activity for specific activity type, by the selected user
public abstract int AddActivity(string subject, string detailsText, int activityUserId, int typeId)
Parameters
subjectstringA brief name for the activity to be shown in a list of other activities. Typically 'Call', 'Message', 'Meeting', 'Online Form', etc.
detailsTextstringThe details of the activity, non-html plain text.
activityUserIdinttypeIdintsee ActivityLogTypeEnum, 1=visit online, 2=email-to, 3=email-from, 4=call-to, 5=call-from, 6=text-to, 7=text-from, 8=meeting-video, 9=meeting-in-person
Returns
AddActivity(string, string, int, int, DateTime, int, int)
Add a schedule, non-completed activity for specific activity type, by the selected user
public abstract int AddActivity(string subject, string detailsText, int activityUserId, int typeId, DateTime dateScheduled, int duration, int scheduledStaffId)
Parameters
subjectstringA brief name for the activity to be shown in a list of other activities. Typically 'Call', 'Message', 'Meeting', 'Online Form', etc.
detailsTextstringThe details of the activity, non-html plain text.
activityUserIdinttypeIdintsee ActivityLogTypeEnum, 1=online visit, 2=online purchase, 3=email-to, 4=email-from, 5=call-to, 6=call-from, 7=text-to, 8=text-from, 9=meeting-video, 10=meeting-in-person,
dateScheduledDateTimedurationintscheduledStaffIdint
Returns
AddLinkAlias(string, int)
Add a link alias record for this page.
public abstract void AddLinkAlias(string linkAlias, int pageId)
Parameters
AddLinkAlias(string, int, string)
Add a link alias record for this page.
public abstract void AddLinkAlias(string linkAlias, int pageId, string queryStringSuffix)
Parameters
linkAliasstringThe link alias to add.
pageIdintthe id of the page to be displayed by this link alias
queryStringSuffixstringThe query string to be added to the url that may effect how addons on the page render.
ClearProperty(string)
remove the property
public abstract void ClearProperty(string key)
Parameters
keystring
EncodeAppRootPath(string)
Use CP.Utils.EncodeAppRootPath()
[Obsolete("Use CP.Utils.EncodeAppRootPath()", false)]
public abstract string EncodeAppRootPath(string link)
Parameters
linkstring
Returns
ErrorReport(Exception)
Report an error, logging it and sending notifications as the app is confirgured. Does not rethrow the error.
public abstract void ErrorReport(Exception Ex)
Parameters
ExException
ErrorReport(Exception, string)
Report an error, logging it and sending notifications as the app is confirgured. Does not rethrow the error.
public abstract void ErrorReport(Exception Ex, string message)
Parameters
ErrorReport(string)
Report an error, logging it and sending notifications as the app is confirgured. Does not rethrow the error.
public abstract void ErrorReport(string message)
Parameters
messagestring
GetBoolean(string)
Read a site property as a boolean.
public abstract bool GetBoolean(string key)
Parameters
keystring
Returns
GetBoolean(string, bool)
Read a site property as a boolean. If the key is not set, sets and returns the default value.
public abstract bool GetBoolean(string key, bool defaultValue)
Parameters
Returns
GetBoolean(string, string)
Use correct defaultValue type
[Obsolete("Use correct defaultValue type", true)]
public abstract bool GetBoolean(string key, string defaultValue)
Parameters
Returns
GetDate(string)
Read a site property as a date.
public abstract DateTime GetDate(string key)
Parameters
keystring
Returns
GetDate(string, DateTime)
Read a site property as a date. If the key is not set, sets and returns the default value.
public abstract DateTime GetDate(string key, DateTime defaultValue)
Parameters
Returns
GetDate(string, string)
Use correct defaultValue type
[Obsolete("Use correct defaultValue type", false)]
public abstract DateTime GetDate(string key, string defaultValue)
Parameters
Returns
GetInteger(string)
Read a site property as an integer.
public abstract int GetInteger(string key)
Parameters
keystring
Returns
GetInteger(string, int)
Read a site property as an integer. If the key is not set, sets and returns the default value.
public abstract int GetInteger(string key, int defaultValue)
Parameters
Returns
GetInteger(string, string)
Use correct defaultValue type
[Obsolete("Use correct defaultValue type", false)]
public abstract int GetInteger(string key, string defaultValue)
Parameters
Returns
GetNumber(string)
Read a site property as a double. If the key is not set, sets and returns the default value.
public abstract double GetNumber(string key)
Parameters
keystring
Returns
GetNumber(string, double)
Read a site property as a double.
public abstract double GetNumber(string key, double defaultValue)
Parameters
Returns
GetNumber(string, string)
Use correct defaultValue type
[Obsolete("Use correct defaultValue type", false)]
public abstract double GetNumber(string key, string defaultValue)
Parameters
Returns
GetProperty(string)
Use GetText()
[Obsolete("Use GetText()", false)]
public abstract string GetProperty(string key)
Parameters
keystring
Returns
GetProperty(string, string)
Use GetText()
[Obsolete("Use GetText()", false)]
public abstract string GetProperty(string key, string value)
Parameters
Returns
GetText(string)
Read a site property as a string
public abstract string GetText(string key)
Parameters
keystring
Returns
GetText(string, string)
Read a site property as a string. If the key is not set, sets and returns the default value.
public abstract string GetText(string key, string defaultValue)
Parameters
Returns
IsTesting()
Deprecated
[Obsolete("Deprecated.", false)]
public abstract bool IsTesting()
Returns
LandingPageId()
Deprecated
[Obsolete("Deprecated.", false)]
public abstract int LandingPageId()
Returns
LandingPageId(string)
Deprecated
[Obsolete("Deprecated.", false)]
public abstract int LandingPageId(string domainName)
Parameters
domainNamestring
Returns
LogActivity(string, int, int)
Deprecated. Use LogActivity(subject, degtails, userId)
[Obsolete("Use LogActivity(message, user)", false)]
public abstract void LogActivity(string details, int userId, int ignoreId)
Parameters
LogAlarm(string)
Log an Alarm. Alarms are saved in the \Contensive\Alarms folder, and will automatically cause the server alarm to fail.
public abstract void LogAlarm(string cause)
Parameters
causestring
LogWarning(string, string, string, string)
Log a message to the site-warning log.The site warning log lets admins know there are issues they need to resolve. This is not code bugs, but content or setting relalted issues.
[Obsolete("Use CP.Site.SetSiteWarning()", false)]
public abstract void LogWarning(string name, string description, string typeOfWarningKey, string instanceKey)
Parameters
RequestTask(string, string, string, string)
Use CP.Utils.ExportCsv()
[Obsolete("Use CP.Utils.ExportCsv()", false)]
public abstract void RequestTask(string command, string SQL, string exportName, string filename)
Parameters
SetProperty(string, bool)
set a site-wide property. Read back with cp.site.GetText(), .getBoolean(), etc
public abstract void SetProperty(string key, bool value)
Parameters
SetProperty(string, DateTime)
set a site-wide property. Read back with cp.site.GetText(), .getBoolean(), etc
public abstract void SetProperty(string key, DateTime value)
Parameters
SetProperty(string, double)
set a site-wide property. Read back with cp.site.GetText(), .getBoolean(), etc
public abstract void SetProperty(string key, double value)
Parameters
SetProperty(string, int)
set a site-wide property. Read back with cp.site.GetText(), .getBoolean(), etc
public abstract void SetProperty(string key, int value)
Parameters
SetProperty(string, string)
set a site-wide property. Read back with cp.site.GetText(), .getBoolean(), etc
public abstract void SetProperty(string key, string value)
Parameters
SetSiteWarning(string, string)
Add a site warning that must be removed manually. Log a message to the site-warning log, which displays a Warning indicator in the admin site. This should only be for issues related to content and settings that an admin user can address. To log code issues, use cp.log. To set the server alarm, use cp.site.LogAlarm() .
public abstract void SetSiteWarning(string name, string description)
Parameters
namestringA short general description of the problem
descriptionstringA more detailed description that might include instructions how to fix the issue.
SetSiteWarning(string, string, bool)
Add or remove a site warning based on the boolean argument. Log a message to the site-warning log, which displays a Warning indicator in the admin site. This should only be for issues related to content and settings that an admin user can address. To log code issues, use cp.log. To set the server alarm, use cp.site.LogAlarm() .
public abstract void SetSiteWarning(string name, string description, bool addRemove)
Parameters
namestringA short general description of the problem
descriptionstringA more detailed description that might include instructions how to fix the issue.
addRemoveboolif true, the warning is added, else the warning is removed
TestPoint(string)
When debugging is true, add this message and timestamp to the debug trace.
public abstract void TestPoint(string message)
Parameters
messagestring
ThrowEvent(int)
[Obsolete("Deprecated. Use ThrowEventByName(string)", false)]
public abstract string ThrowEvent(int eventId)
Parameters
eventIdint
Returns
ThrowEvent(string)
[Obsolete("Deprecated. Use ThrowEventByName(string)", false)]
public abstract string ThrowEvent(string eventNameIdOrGuid)
Parameters
eventNameIdOrGuidstring
Returns
ThrowEventByGuid(string)
[Obsolete("Deprecated. Use ThrowEventByName(string)", false)]
public abstract string ThrowEventByGuid(string eventGuid)
Parameters
eventGuidstring
Returns
ThrowEventByName(string)
An addon can throw an Event that then executes other addons that bind to that event in their record. For example, ecommerce throws an event 'fulfillment'. An item like a giftcard can be emailed on fulfillment which occurs differently on different types of accounts.
public abstract string ThrowEventByName(string eventName)
Parameters
eventNamestring
Returns
UpdateRouteMap()
Rebuild the route map and restart the IIS application so the updated routes load on the next request. Call this after programmatically changing addons or link alias records.
public abstract void UpdateRouteMap()
installCollectionFile(string, ref string)
deprecated. Use CP.Addon.InstallCollectionFile()
[Obsolete("Use CP.Addon.InstallCollectionFile()", false)]
public abstract bool installCollectionFile(string privatePathFilename, ref string returnUserError)
Parameters
Returns
installCollectionFromLibrary(string, ref string)
Use CP.Addon.InstallCollectionFromLibrary()
[Obsolete("Use CP.Addon.InstallCollectionFromLibrary()", false)]
public abstract bool installCollectionFromLibrary(string collectionGuid, ref string returnUserError)