This is the login panel

Return to API Docs > Add-on Programming Interface, CPBaseClass

Contensive Add-on Programming Interface, CPBaseClass

When you install an Add-on Collection that includes a reference to a .Net Framework class, the system loads the assembly(s) stored in the collection folder to find your class. The assembly folder is located in the addon folder in the applications /private folder. When you upload a Collection zip file to a site, the assembly and all other assets are automatically stored here.

For more information about creating an addon that runs .Net Framework code, see the article How to Add a Visual Studio C# Code to an Add-on.

You create a .Net Framework addon by creating a windows class assembly with windows classes that inherit AddonBaseClass. These classes must include one method "Execute" that includes one argument CP of type CPBaseClass. The CP object exposes properties and methods to assist with Db, File system, cache, etc.

The Execute method of your Add-on class returns a string. (If you return a non-string object the system will convert it to json for you.)

CPBaseClass

When the system calls the execute method of your addon, it passes the object cp which inherits CPBaseClass. The addon is written with a reference to CPBaseClass, so all properties and methods of CPBaseClass are implemented through the cp object passed into the addon.

This .Net Framework Addon code returns a string this includes the version of cp

using Contensive.BaseClasses;

namespace MyNameSpace {
    public class CPVersionClass : AddonBaseClass 
    {
        public override object Execute(CPBaseClass cp) 
        {
            return "The version of cp is " + cp.Version;
        }
    }
}

CPBlockBaseClass

CPCacheBaseClass

CPContentBaseClass

CPCSBaseClass

CPDbBaseClass

CPDocBaseClass

CPEmailBaseClass

CPFileBaseClass

CPFileSystemBaseClass

CPGroupBaseClass

CPHtml5BaseClass

CPHtmlBaseClass

CPRequestBaseClass

CPResponseBaseClass

CPSiteBaseClass

CPUserBaseClass

CPUserErrorBaseClass

CPUtilsBaseClass

CPVisitBaseClass

CPVisitorBaseClass