API Changes From Kentico CMS 6 to 7

   —   
Kentico CMS 7 final has been released and upgrades from earlier versions are on their way. Here is a list of changes in the API you may want to know about ...
Hi there,

We are working on upgrade from v7 RC to v7 final, which will be available at the beginning of October, and on upgrade from v6 to v7 final, which will be available in second half of October. Let me just quickly summarize what API changes you should be aware of ...

Major changes

We have made several major changes which have helped us get rid of some references which were causing us a hard time in providing new features around documents, and also to make things more obvious.

New namespace CMS.DocumentEngine

The original libraries (and namespaces) CMS.WorkflowEngine (extension library for workflow for documents), and CMS.TreeEngine (base library for documents) were redefined as:
  • CMS.WorkflowEngine - Only basic workflow functionality, no longer connected to documents. Provides a general workflow engine that is also leveraged by the Marketing Automation feature.
  • CMS.DocumentEngine - This library joins the functionality of the previous workflow engine together with the base document library, providing the same options, but with better future maintainability.
Technically, all you need to do is change your using statements to use the CMS.DocumentEngine namespace.

New class SystemDataHelper

Class SqlHelperClass, which was becoming too large, was split to two classes:
  • SqlHelperClass - Providing methods related to SQL operations
  • SystemDataHelper - Providing methods related to general data manipulation and validation

New class AuthenticationHelper

Because class UserInfoProvider was growing too much as well, we moved the methods that provide authentication and password handling to a new class called AuthenticationHelper.

Minor changes

Similar to the previous version, we have made several minor improvements to further unify our API, or fix wrong behavior of methods which actually needed more parameters.

Here is the full list of API changes. Note that it doesn't include really low-level items as we want to keep it brief and useful:

V7DeletedObsoleteMethods.xlsx

Should you find anything missing from the list, do not hesitate to ask our support team at support@kentico.com or to post it in comments.
Share this article on   LinkedIn

Martin Hejtmanek

Hi, I am the CTO of Kentico and I will be constantly providing you the information about current development process and other interesting technical things you might want to know about Kentico.

Comments

James H commented on

I am currently going through the process of upgrading from 5.5 R2 - 8.2 and I hit the same error as Bob during the 6-7 upgrade so just thought I would shed some light on exactly what this error indicates & how to fix it.

As already pointed out by Juraj, the problem is related to old code being left over from the previous version, in this case UpgradeProcedure.cs. For me, this was the result of not stopping the site in IIS before running the upgrade and as such files became locked and therefore the overwrite failed.

The resolution was simple, make sure the site is stopped in IIS, ensure you have no files open in any other applications, then re-run the upgrade.

Martin Hejtmanek commented on

Hi Vikas,

Just open the Sites application, and click the New site wizard action button.

vikas bhargava commented on

in trial version how can i create a new website.. ..

Martin Hejtmanek commented on

Hi Robert,

ContentDocument was just temporary workaround for v6 to be able to connect TreeNode.Insert, Update methods to DocumentHelper. Since document workflow classes were merged with TreeEngine classes to a single assembly DocumentEngine, this no longer applies. You can tell whether the document is latest version or published version by checking the TreeNode property IsLastVersion.

BTW: I didn't get your message: "You can't get document data from nodes!"; Both of them provide both Tree and Document data, the only difference is that one of them is latest version and one of them is published one.

Let me know if you need some more information.

robert-tailor.co commented on

What happened to CMS.WorkflowEngine.ContentDocument? It was a useful way for ensuring developers explicitly knew whether they should be dealing with a Document or a Node. e.g.

if (foundNode is ContentDocument) {
return "Sweet";
}
else {
return "You can't get document data from nodes!";
}

Bob V. commented on

Thanks for your note, you are correct. When working with my infrastructure contact the individual had neglected to remove the '.new' extension. I found the Excel file listing the functions quite helpful, thank you!

I have a new issue that I just ran into today for the SearchBox web part.

[Error loading the WebPart 'SearchBox' of type 'SearchBox']
\CMSWebParts\SmartSearch\SearchBox.ascx.cs(33): error CS1061: 'System.Web.UI.WebControls.TextBox' does not contain a definition for 'WatermarkText' and no extension method 'WatermarkText' accepting a first argument of type 'System.Web.UI.WebControls.TextBox' could be found (are you missing a using directive or an assembly reference?)

Have any of the properties of CMS.TextBox changed in Kentico CMS version 7?

Juraj Hrinik commented on

Hi Bob,

this kind of problem can be caused only if file \App_Code\CMS\UpgradeProcedure.cs wasn't rewritten correctly because this method was static only in old version (v6) of this file. In v7 this method is called always on instance of class TableManager. You probably have file UpgradeProcedure.cs.new in same folder and you need to merge changes to existing file or completely overwrite old file. This will resolve your issue.

Bob V commented on

I just ran the upgrade procedure on my site. After remediating issues with custom code that included references to TreeEngine to now reference DocumentEngine I was presented with the following .NET Compilation error:

Compiler Error Message: CS0120: An object reference is required for the non-static field, method, or property 'CMS.DataEngine.TableManager.GetXmlSchema(string)'

The code in question is in the following location:

Source File: \App_Code\CMS\UpgradeProcedure.cs
Line: 173