Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Changes on methods used on version 5.5 View modes: 
User avatar
Member
Member
Leandro Brito - 11/4/2011 1:43:31 PM
   
Changes on methods used on version 5.5
Hello,

I implemented a code for generate url using the document's category, so I installed the version 6 on my pc and got erros in some methods that not exists more.

Development of the code
Category name in the url.

The main error that I got is on method :
DocumentCategoryInfoProvider.GetDocumentCategories("DocumentID = " + documentId, null);

This method and others that I used don't exists in this version and I need them to get the category display name to concat in my url and generate a new document alias.

Exist some namespace to compability of versions or other way to do my code works again.

Thanks
Leandro

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/6/2011 3:23:55 AM
   
RE:Changes on methods used on version 5.5
Hi,

We are sorry for this inconvenience. The document with API changes is being finished and should be ready very soon.

However, I do not see any changes in the method you posted - could you please post here the whole error message or the code you are using so we check if it is being thrown from some under laying code?

Best regards,
Juraj Ondrus

User avatar
Member
Member
Leandro Brito - 11/7/2011 8:44:08 AM
   
RE:Changes on methods used on version 5.5
Hi Juraj,

First
DocumentCategoryInfoProvider.GetDocumentCategories("DocumentID = " + documentId, null);


Error:
CMS.TreeEngine.DocumentCategoryInfoProvider does not contain a definition for "GetDocumentCategories".


I change this for
CMS.SettingsProvider.InfoDataSet<CategoryInfo> dscat = CategoryInforProvider.GetDocumentCategories(Convert.ToInt32(documentId), "DocumentID = " + documentID, ""); Is it correct?


Second
CMS.GlobalHelper.UrlHelper.GetFullApplicationUrl()

Fixed deleting the namespace and using URLHelper.GetFullApplicationUrl().


Third
CMS.SiteProvider.CategoryInfoProvider.GetCategoryInfo(string categoryName)

The signature doesn't exist, now the method need passa sitename too. How can I get the sitename in a custom method like RetornCategoryName() called inside transformation?


Some methods I could fixed using others parameters, but if kentico has a compability namespace or some easy way to continue using the same code of version 5.5, this is better for me, because the site already on live.

Thanks.
Leandro Brito

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/10/2011 1:39:07 AM
   
RE:Changes on methods used on version 5.5
Hi Leandro,

The API changes documentation should be available soon, I hope :-(

The third method is named in the same way just the parameters were changed.

Now you can use one of these two overloads:

GetCategoryInfo(int categoryId)
GetCategoryInfo(string categoryName, string siteName)

Best regards,
Juraj Ondrus

User avatar
Member
Member
Leandro Brito - 11/10/2011 4:24:13 AM
   
RE:Changes on methods used on version 5.5
Ok Juraj,

I'll wait by the documentation.
Thanks for the help.

Leandro