Table of Contents

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

string

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

string

Domain

For a webpage hit, this is the current domain used, otherwise it is the primary domain.

public abstract string Domain { get; }

Property Value

string

DomainList

A complete list of all domains supported.

public abstract string DomainList { get; }

Property Value

string

DomainPrimary

The primary domain name for the application. Used for email links, monitoring, etc.

public abstract string DomainPrimary { get; }

Property Value

string

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

string

MultiDomainMode

Deprecated

[Obsolete("Deprecated", false)]
public abstract bool MultiDomainMode { get; }

Property Value

bool

Name

The application name

public abstract string Name { get; }

Property Value

string

PageDefault

For websites, the default script page.

public abstract string PageDefault { get; }

Property Value

string

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

string

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

string

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

string

TrapErrors

Deprecated

[Obsolete("Deprecated", false)]
public abstract bool TrapErrors { get; }

Property Value

bool

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

string

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

int

Methods

AddActivity(string)

Add completed activity for online visit by current user, subject saved as message

public abstract int AddActivity(string subject)

Parameters

subject string

A brief name for the activity to be shown in a list of other activities. Typically 'Call', 'Message', 'Meeting', 'Online Form', etc.

Returns

int

AddActivity(string, string)

Add completed activity for online visit by current user

public abstract int AddActivity(string subject, string detailsText)

Parameters

subject string

A brief name for the activity to be shown in a list of other activities. Typically 'Call', 'Message', 'Meeting', 'Online Form', etc.

detailsText string

The details of the activity, non-html plain text.

Returns

int

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

subject string

A brief name for the activity to be shown in a list of other activities. Typically 'Call', 'Message', 'Meeting', 'Online Form', etc.

detailsText string

The details of the activity, non-html plain text.

activityUserId int

Returns

int

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

subject string

A brief name for the activity to be shown in a list of other activities. Typically 'Call', 'Message', 'Meeting', 'Online Form', etc.

detailsText string

The details of the activity, non-html plain text.

activityUserId int
dateScheduled DateTime
duration int
scheduledStaffId int

Returns

int

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

subject string

A brief name for the activity to be shown in a list of other activities. Typically 'Call', 'Message', 'Meeting', 'Online Form', etc.

detailsText string

The details of the activity, non-html plain text.

activityUserId int
typeId int

see 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

int

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

subject string

A brief name for the activity to be shown in a list of other activities. Typically 'Call', 'Message', 'Meeting', 'Online Form', etc.

detailsText string

The details of the activity, non-html plain text.

activityUserId int
typeId int

see 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,

dateScheduled DateTime
duration int
scheduledStaffId int

Returns

int

AddLinkAlias(string, int)

Add a link alias record for this page.

public abstract void AddLinkAlias(string linkAlias, int pageId)

Parameters

linkAlias string
pageId int

AddLinkAlias(string, int, string)

Add a link alias record for this page.

public abstract void AddLinkAlias(string linkAlias, int pageId, string queryStringSuffix)

Parameters

linkAlias string

The link alias to add.

pageId int

the id of the page to be displayed by this link alias

queryStringSuffix string

The 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

key string

EncodeAppRootPath(string)

Use CP.Utils.EncodeAppRootPath()

[Obsolete("Use CP.Utils.EncodeAppRootPath()", false)]
public abstract string EncodeAppRootPath(string link)

Parameters

link string

Returns

string

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

Ex Exception

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

Ex Exception
message string

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

message string

GetBoolean(string)

Read a site property as a boolean.

public abstract bool GetBoolean(string key)

Parameters

key string

Returns

bool

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

key string
defaultValue bool

Returns

bool

GetBoolean(string, string)

Use correct defaultValue type

[Obsolete("Use correct defaultValue type", true)]
public abstract bool GetBoolean(string key, string defaultValue)

Parameters

key string
defaultValue string

Returns

bool

GetDate(string)

Read a site property as a date.

public abstract DateTime GetDate(string key)

Parameters

key string

Returns

DateTime

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

key string
defaultValue DateTime

Returns

DateTime

GetDate(string, string)

Use correct defaultValue type

[Obsolete("Use correct defaultValue type", false)]
public abstract DateTime GetDate(string key, string defaultValue)

Parameters

key string
defaultValue string

Returns

DateTime

GetInteger(string)

Read a site property as an integer.

public abstract int GetInteger(string key)

Parameters

key string

Returns

int

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

key string
defaultValue int

Returns

int

GetInteger(string, string)

Use correct defaultValue type

[Obsolete("Use correct defaultValue type", false)]
public abstract int GetInteger(string key, string defaultValue)

Parameters

key string
defaultValue string

Returns

int

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

key string

Returns

double

GetNumber(string, double)

Read a site property as a double.

public abstract double GetNumber(string key, double defaultValue)

Parameters

key string
defaultValue double

Returns

double

GetNumber(string, string)

Use correct defaultValue type

[Obsolete("Use correct defaultValue type", false)]
public abstract double GetNumber(string key, string defaultValue)

Parameters

key string
defaultValue string

Returns

double

GetProperty(string)

Use GetText()

[Obsolete("Use GetText()", false)]
public abstract string GetProperty(string key)

Parameters

key string

Returns

string

GetProperty(string, string)

Use GetText()

[Obsolete("Use GetText()", false)]
public abstract string GetProperty(string key, string value)

Parameters

key string
value string

Returns

string

GetText(string)

Read a site property as a string

public abstract string GetText(string key)

Parameters

key string

Returns

string

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

key string
defaultValue string

Returns

string

IsTesting()

Deprecated

[Obsolete("Deprecated.", false)]
public abstract bool IsTesting()

Returns

bool

LandingPageId()

Deprecated

[Obsolete("Deprecated.", false)]
public abstract int LandingPageId()

Returns

int

LandingPageId(string)

Deprecated

[Obsolete("Deprecated.", false)]
public abstract int LandingPageId(string domainName)

Parameters

domainName string

Returns

int

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

details string
userId int
ignoreId int

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

cause string

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

name string
description string
typeOfWarningKey string
instanceKey string

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

command string
SQL string
exportName string
filename string

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

key string
value bool

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

key string
value DateTime

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

key string
value double

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

key string
value int

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

key string
value string

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

name string

A short general description of the problem

description string

A 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

name string

A short general description of the problem

description string

A more detailed description that might include instructions how to fix the issue.

addRemove bool

if 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

message string

ThrowEvent(int)

[Obsolete("Deprecated. Use ThrowEventByName(string)", false)]
public abstract string ThrowEvent(int eventId)

Parameters

eventId int

Returns

string

ThrowEvent(string)

[Obsolete("Deprecated. Use ThrowEventByName(string)", false)]
public abstract string ThrowEvent(string eventNameIdOrGuid)

Parameters

eventNameIdOrGuid string

Returns

string

ThrowEventByGuid(string)

[Obsolete("Deprecated. Use ThrowEventByName(string)", false)]
public abstract string ThrowEventByGuid(string eventGuid)

Parameters

eventGuid string

Returns

string

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

eventName string

Returns

string

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

privatePathFilename string
returnUserError string

Returns

bool

installCollectionFromLibrary(string, ref string)

Use CP.Addon.InstallCollectionFromLibrary()

[Obsolete("Use CP.Addon.InstallCollectionFromLibrary()", false)]
public abstract bool installCollectionFromLibrary(string collectionGuid, ref string returnUserError)

Parameters

collectionGuid string
returnUserError string

Returns

bool