Table of Contents

Class CPAddonBaseClass

Namespace
Contensive.BaseClasses
Assembly
CPBase.dll

CP.Addon - The Addon class represents the instance of an add-on. To use this class, use its constructor and open an cpcore.addon. Use these properties to retrieve it's configuration

public abstract class CPAddonBaseClass
Inheritance
CPAddonBaseClass
Inherited Members

Properties

Admin

When true, this add-on is displayed on and can be used from the admin navigator.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract bool Admin { get; }

Property Value

bool

ArgumentList

A crlf delimited list of name=value pairs. These pairs create an options dialog available to administrators in advance edit mode. When the addon is executed, the values selected are available through the cp.doc.var("name") method.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string ArgumentList { get; }

Property Value

string

AsAjax

When true, this addon returns the javascript code necessary to implement this object as ajax.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract bool AsAjax { get; }

Property Value

bool

BlockDefaultStyles

When true, the system only uses the custom styles field when building the page. This field is not updated with add-on updates.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string BlockDefaultStyles { get; }

Property Value

string

CollectionID

The ID local to this site of the collection which installed this cpcore.addon.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract int CollectionID { get; }

Property Value

int

Content

When true, this addon can be placed in the content of pages.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract bool Content { get; }

Property Value

bool

Copy

text copy is added to the addon content during execution.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string Copy { get; }

Property Value

string

CopyText

text copy is added to the addon content during execution.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string CopyText { get; }

Property Value

string

CustomStyles

Styles that are rendered on the page when the addon is executed. Custom styles are editable and are not modified when the add-on is updated.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string CustomStyles { get; }

Property Value

string

DefaultStyles

Styles that are included with the add-on and are updated when the add-on is updated. See BlockdefaultStyles to block these.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string DefaultStyles { get; }

Property Value

string

Description

The add-on description is displayed in the addon manager

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string Description { get; }

Property Value

string

DotNetClass

When present, the system calls the execute method of an objected created from this dot net class namespace.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string DotNetClass { get; }

Property Value

string

FormXML

This is an xml stucture that the system executes to create an admin form. See the support.contensive.com site for more details.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string FormXML { get; }

Property Value

string

Help

This copy is displayed when the help icon for this addon is clicked.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string Help { get; }

Property Value

string

If present, this link is displayed when the addon icon is clicked.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string HelpLink { get; }

Property Value

string

ID

The id of the addon currently executing.

public abstract int ID { get; }

Property Value

int

IconFilename

When present, this icon will be used when the add-on is displayed in the addon manager and when edited. The height, width and sprites must also be set.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string IconFilename { get; }

Property Value

string

IconHeight

The height in pixels of the icon referenced by the iconfilename.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract int IconHeight { get; }

Property Value

int

IconSprites

The number of images in the icon. There can be multiple images stacked top-to-bottom in the file. The first is the normal image. the second is the hover-over image. The third is the clicked image.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract int IconSprites { get; }

Property Value

int

IconWidth

The width of the icon referenced by the iconfilename

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract int IconWidth { get; }

Property Value

int

InFrame

When true, this addon will be displayed in an html iframe.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract bool InFrame { get; }

Property Value

bool

IsInline

When true, the system will assume the addon returns html that is inline, as opposed to block. This is used to vary the edit icon behaviour.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract bool IsInline { get; }

Property Value

bool

JavaScriptBodyEnd

Javascript code that will be placed in the document right before the end-body tag. Do not include script tags.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string JavaScriptBodyEnd { get; }

Property Value

string

JavaScriptOnLoad

Javascript that will be executed in the documents onload event.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string JavaScriptOnLoad { get; }

Property Value

string

JavascriptInHead

Javascript code that will be placed in the head of the document. Do no include script tags.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string JavascriptInHead { get; }

Property Value

string

A URL to a webserver that returns javascript. This URL will be added as the src attribute of a script tag, and placed in the content where this Add-on is inserted. This URL can be to any server-side program on any server, provided it returns javascript. For instance, if you have a script page that returns javascript,put the URL of that page here. The addon can be dropped on any page and will execute the script. Your script can be from any site. This technique is used in widgets and avoids the security issues with ajaxing from another site.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string Link { get; }

Property Value

string

MetaDescription

Text here will be added to the meta description section of the document head.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string MetaDescription { get; }

Property Value

string

MetaKeywordList

This is a comma or crlf delimited list of phrases that will be added to the document's meta keyword list

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string MetaKeywordList { get; }

Property Value

string

Name

The name of the cpcore.addon.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string Name { get; }

Property Value

string

NavIconType

The type of navigator entry to be made. Choices are: Add-on,Report,Setting,Tool

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string NavIconType { get; }

Property Value

string

ObjectProgramID

If present, this string will be used as an activex programid to create an object and call it's execute method.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string ObjectProgramID { get; }

Property Value

string

OnBodyEnd

If true, this addon will be execute at the end of every page and its content added to right before the end-body tag

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract bool OnBodyEnd { get; }

Property Value

bool

OnBodyStart

If true, this addon will be execute at the start of every page and it's content added to right after the body tag

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract bool OnBodyStart { get; }

Property Value

bool

OnContentEnd

if true, this add-on will be executed on every page and its content added right after the content box.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract bool OnContentEnd { get; }

Property Value

bool

OnContentStart

If true, this add-on will be executed on every page and its content added right before the content box

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract bool OnContentStart { get; }

Property Value

bool

OtherHeadTags

All content in the field will be added directly, as-is to the document head.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string OtherHeadTags { get; }

Property Value

string

PageTitle

All content in the field will be added to the documents title tag

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string PageTitle { get; }

Property Value

string

ProcessInterval

When present, this add-on will be executed stand-alone without a webpage periodically at this interval (in minutes).

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string ProcessInterval { get; }

Property Value

string

ProcessNextRun

The next time this add-on is scheduled to run as a processs

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract DateTime ProcessNextRun { get; }

Property Value

DateTime

ProcessRunOnce

Check true, this addon will be run once within the next minute as a stand-alone process.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract bool ProcessRunOnce { get; }

Property Value

bool
[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string RemoteAssetLink { get; }

Property Value

string

RemoteMethod

if true, this add-on can be executed as a remote method. The name of the addon is used as the url.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract bool RemoteMethod { get; }

Property Value

bool

RobotsTxt

When present, this text will be added to the robots.txt content for the site. This content is editable through the preferences page

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string RobotsTxt { get; }

Property Value

string

ScriptCode

When present, the first routine of this script will be executed when the add-on is executed and its return added to the add-ons return

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string ScriptCode { get; }

Property Value

string

ScriptEntryPoint

If the ScriptCode has more than one routine and you want to run one other than the first, list is here.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string ScriptEntryPoint { get; }

Property Value

string

ScriptLanguage

The script language selected for this script.

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string ScriptLanguage { get; }

Property Value

string

SharedStyles

A comma delimited list of the local id values of shared style record that will display with this add-on

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract string SharedStyles { get; }

Property Value

string

Template

[Obsolete("Deprecated. Use cp.addon.id or cp.addon.ccguid to create a model object and use its properties", false)]
public abstract bool Template { get; }

Property Value

bool

ccGuid

The guid of the addon currently executing.

public abstract string ccGuid { get; }

Property Value

string

Methods

Execute(int)

Execute an addon in the default addon environment (type=simple, etc) and returns its resulting object. Generally addons return strings.

public abstract string Execute(int addonId)

Parameters

addonId int

The id of the addon to be executed.

Returns

string

Execute(int, addonExecuteContext)

Execute an addon in the default addon environment (type=simple, etc) and returns its resulting object. Generally addons return strings. Provide details for the execution environment, such as argument key value pairs.

public abstract string Execute(int addonId, CPUtilsBaseClass.addonExecuteContext executeContext)

Parameters

addonId int

The id of the addon to be executed.

executeContext CPUtilsBaseClass.addonExecuteContext

The context where the addon is being executed (on a page, in an email, etc.). Typical is 'Simple' which blocks html comments.

Returns

string

Execute(int, Dictionary<string, string>)

Execute an addon in the default addon environment (type=simple, etc) and returns its resulting object. Generally addons return strings. Pass arguments to the addon that can be read with cp.doc.get() methods.

public abstract string Execute(int addonId, Dictionary<string, string> argumentKeyValuePairs)

Parameters

addonId int

The id of the addon to be executed.

argumentKeyValuePairs Dictionary<string, string>

The executing addon can read these arguments with methods like cp.doc.getText("key").

Returns

string

Execute(string)

Execute an addon in the default addon environment (type=simple, etc) and returns its resulting object. Generally addons return strings.

public abstract string Execute(string addonGuid)

Parameters

addonGuid string

Returns

string

Execute(string, addonExecuteContext)

Execute an addon in the default addon environment (type=simple, etc) and returns its resulting object. Generally addons return strings. Provide details for the execution environment, such as argument key value pairs.

public abstract string Execute(string addonGuid, CPUtilsBaseClass.addonExecuteContext executeContext)

Parameters

addonGuid string

The guid of the addon to be executed.

executeContext CPUtilsBaseClass.addonExecuteContext

The context where the addon is being executed (on a page, in an email, etc.). Typical is 'Simple' which blocks html comments.

Returns

string

Execute(string, Dictionary<string, string>)

Execute an addon in the default addon environment (type=simple, etc) and returns its resulting object. Generally addons return strings. Pass arguments to the addon that can be read with cp.doc.get() methods.

public abstract string Execute(string addonGuid, Dictionary<string, string> argumentKeyValuePairs)

Parameters

addonGuid string

The guid of the addon to be executed.

argumentKeyValuePairs Dictionary<string, string>

The executing addon can read these arguments with methods like cp.doc.getText("key").

Returns

string

ExecuteAsProcess(int)

Execute an addon in a background process with the current session environment.

public abstract void ExecuteAsProcess(int addonid)

Parameters

addonid int

The id of the addon to be executed.

ExecuteAsProcess(int, Dictionary<string, string>)

Execute an addon in a background process with the current session environment. Arguments can be passed that the addon can read with cp.doc.get methods.

public abstract void ExecuteAsProcess(int addonid, Dictionary<string, string> argumentKeyValuePairs)

Parameters

addonid int

The id of the addon to be executed.

argumentKeyValuePairs Dictionary<string, string>

ExecuteAsProcess(string)

Execute an addon in a background process with the current session environment.

public abstract void ExecuteAsProcess(string addonGuid)

Parameters

addonGuid string

The guid of the addon to be executed.

ExecuteAsProcess(string, Dictionary<string, string>)

Execute an addon in a background process with the current session environment. Arguments can be passed that the addon can read with cp.doc.get methods.

public abstract void ExecuteAsProcess(string addonGuid, Dictionary<string, string> argumentKeyValuePairs)

Parameters

addonGuid string

The guid of the addon to be executed.

argumentKeyValuePairs Dictionary<string, string>

The executing addon can read these arguments with methods like cp.doc.getText("key").

ExecuteAsProcessByUniqueName(string)

Execute an addon in a background process with the current session environment.

public abstract void ExecuteAsProcessByUniqueName(string addonName)

Parameters

addonName string

The name of the addon to be executed.

ExecuteAsProcessByUniqueName(string, Dictionary<string, string>)

Execute an addon in a background process with the current session environment. Arguments can be passed that the addon can read with cp.doc.get methods.

public abstract void ExecuteAsProcessByUniqueName(string addonName, Dictionary<string, string> argumentKeyValuePairs)

Parameters

addonName string

The name of the addon to be executed.

argumentKeyValuePairs Dictionary<string, string>

The executing addon can read these arguments with methods like cp.doc.getText("key").

ExecuteByUniqueName(string)

Execute an addon in the default addon environment (type=simple, etc) and returns its resulting object. Generally addons return strings.

public abstract string ExecuteByUniqueName(string addonName)

Parameters

addonName string

The name of the addon to be executed.

Returns

string

ExecuteByUniqueName(string, addonExecuteContext)

Execute an addon in the default addon environment (type=simple, etc) and returns its resulting object. Generally addons return strings. Provide details for the execution environment, such as argument key value pairs.

public abstract string ExecuteByUniqueName(string addonName, CPUtilsBaseClass.addonExecuteContext executeContext)

Parameters

addonName string

The name of the addon to be executed.

executeContext CPUtilsBaseClass.addonExecuteContext

The executing addon can read these arguments with methods like cp.doc.getText("key").

Returns

string

ExecuteByUniqueName(string, Dictionary<string, string>)

Execute an addon in the default addon environment (type=simple, etc) and returns its resulting object. Generally addons return strings. Pass arguments to the addon that can be read with cp.doc.get() methods.

public abstract string ExecuteByUniqueName(string addonName, Dictionary<string, string> argumentKeyValuePairs)

Parameters

addonName string

The name of the addon to be executed.

argumentKeyValuePairs Dictionary<string, string>

The executing addon can read these arguments with methods like cp.doc.getText("key").

Returns

string

ExecuteDependency(string)

Add this addon as a dependency. The dependency will be executed only once during the process/doc/page. If this is the first time it is called, the addon will be executed, assets like js and css added, and the result returned. If it has been previously called, the addon is skipped.

public abstract string ExecuteDependency(string addonGuid)

Parameters

addonGuid string

Returns

string

ExportCollection(int, ref string, ref string)

Package a collection into a collection zip file and return a path to the zip file in the cdnFiles store.

public abstract bool ExportCollection(int collectionId, ref string collectionZipCdnPathFilename, ref string returnUserError)

Parameters

collectionId int

The id of the collection to be exported.

collectionZipCdnPathFilename string

A path in the cdnFiles store. (ex myfolder\subfolder)

returnUserError string

If the export is successful, this returns string.empty.

Returns

bool

ExportCollection(string, ref string, ref string)

Package a collection into a collection zip file and return a path to the zip file in the cdnFiles store.

public abstract bool ExportCollection(string collectionGuid, ref string collectionZipCdnPathFilename, ref string returnUserError)

Parameters

collectionGuid string

The guid of the collection to be exported.

collectionZipCdnPathFilename string

A path in the cdnFiles store. (ex myfolder\subfolder)

returnUserError string

If the export is successful, this returns string.empty.

Returns

bool

InstallCollectionFile(string, ref string)

Install addon collection from a file in private files

public abstract bool InstallCollectionFile(string tempPathFilename, ref string returnUserError)

Parameters

tempPathFilename string

The path and filename in the tempFiles store. A path starts with the folder name and ends with a slash (like myfolder\subfolder)

returnUserError string

If the installation is successful, this returns string.empty.

Returns

bool

InstallCollectionFileAsync(string)

Install addon collection from a file in private files

public abstract int InstallCollectionFileAsync(string tempPathFilename)

Parameters

tempPathFilename string

The path and filename in the tempFiles store. A path starts with the folder name and ends with a slash (like myfolder\subfolder)

Returns

int

InstallCollectionFromLibrary(string, ref string)

Install addon collection by its guid from the addon collection library

public abstract bool InstallCollectionFromLibrary(string collectionGuid, ref string returnUserError)

Parameters

collectionGuid string

The guid of the collection to be installed.

returnUserError string

If the installation is successful, this returns string.empty.

Returns

bool

InstallCollectionFromLibraryAsync(string)

Install addon collection by its guid from the addon collection library

public abstract int InstallCollectionFromLibraryAsync(string collectionGuid)

Parameters

collectionGuid string

The guid of the collection to be installed.

Returns

int

Install addon collection from a link. This link should download a collection zip or xml file when requested.

public abstract bool InstallCollectionFromLink(string collectionFileLink, ref string returnUserError)

Parameters

collectionFileLink string

This link should download a collection zip or xml file when requested.

returnUserError string

If the installation is successful, this returns string.empty.

Returns

bool

InstallCollectionFromLinkAsync(string)

Install addon collection by its guid from the addon collection library.

public abstract int InstallCollectionFromLinkAsync(string collectionFileLink)

Parameters

collectionFileLink string

This link should download a collection zip or xml file when requested.

Returns

int

InstallCollectionsFromFolder(string, bool, ref string)

Install addon collection by its guid from the addon collection library

public abstract bool InstallCollectionsFromFolder(string tempFolder, bool deleteFolderWhenDone, ref string returnUserError)

Parameters

tempFolder string

The path and filename in the tempFiles store. A path starts with the folder name and ends with a slash (like myfolder\subfolder)

deleteFolderWhenDone bool

Delete the temp folder when it is no longer needed.

returnUserError string

If the installation is successful, this returns string.empty.

Returns

bool

InstallCollectionsFromFolderAsync(string, bool)

Install addon collection by its guid from the addon collection library

public abstract int InstallCollectionsFromFolderAsync(string tempFolder, bool deleteFolderWhenDone)

Parameters

tempFolder string

The path and filename in the tempFiles store. A path starts with the folder name and ends with a slash (like myfolder\subfolder)

deleteFolderWhenDone bool

Delete the temp folder when it is no longer needed.

Returns

int

Open(int)

[Obsolete("Deprecated. Use a model object instead", false)]
public abstract bool Open(int AddonId)

Parameters

AddonId int

Returns

bool

Open(string)

[Obsolete("Deprecated. Use a model object instead", false)]
public abstract bool Open(string AddonNameOrGuid)

Parameters

AddonNameOrGuid string

Returns

bool