Quantcast
Channel: Kentico CMS for ASP.NET - DevNet - Forums - Version 7.x - API
Viewing all 660 articles
Browse latest View live

RE:Role with a space

$
0
0
kelly-lion
You are of course correct, that would be the best solution. I just don't know where all else they used it. I'll fix it the right way, but it will require digging and testing.

http://localhost/rest/settoken returns error 403

$
0
0
poplooukhin-gmail
Hi all

I tried to authenticate using request to http://localhost/rest/settoken?username=<username>&password=<password>&token=<token>. This request returns error with code 403. I passed valid username and password.

What is the problem?

Thanks

RE:http://localhost/rest/settoken returns error 403

$
0
0
kentico_martind2
Hello,

I would recommend you to search on the Google for "url=https://www.google.com/search?q=rest+authentication+403&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb]REST authentication 403[/url]"
so you can find articles like this one: HTTP 401 Unauthorized or 403 Forbidden for a “disabled” user?

So it seems that your used is not enabled/allowed to access the website.

Best regards,
Martin Danko


RE:Role with a space

$
0
0
FroggEye
Open Visual Studio and simply do a Ctrl+F and find the syntax in the code. That will probably cover most of your issues. There could be instances where they are looking for the role in a macro which is stored in the database which the simple find and replace will not work. BUT I'd assume you already know what areas on the website might already have permissions set based on that role so you could check to see if they are working as expected.

RE:http://localhost/rest/settoken returns error 403

$
0
0
poplooukhin-gmail
Hello, Martin

I tried to invoke the following request using Fiddler:
GET http://localhost:8080/rest/settoken?username=joedoe&password=12345&token=12345
User-Agent: Fiddler
Host: localhost:8080
Content-Type: text/html;charset=utf-8
Authentication: Basic am9lZG9lOjEyMzQ1

But I get following response:
HTTP/1.1 401 Unauthorized
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/8.0
Set-Cookie: CMSPreferredCulture=en-US; expires=Sat, 13-Dec-2014 20:58:03 GMT; path=/; HttpOnly
Set-Cookie: ASP.NET_SessionId=bbljwthjctinhsfysnnj4ye5; path=/; HttpOnly
X-AspNet-Version: 4.0.30319
WWW-Authenticate: Basic realm="CMS REST Service"
X-Frame-Options: SAMEORIGIN
X-SourceFiles: =?UTF-8?B?QzpcaW5ldHB1Ylx3d3dyb290XEtlbnRpY29DTVM3XFJFU1RTZXJ2aWNlLnN2Y1xzZXR0b2tlbg==?=
X-Powered-By: ASP.NET
Date: Fri, 13 Dec 2013 20:58:03 GMT
Content-Length: 6036

I enabled REST services in Kentico, I added webhttpbinding and rest service in web.config

Why I get this error?

Thanks for your reply

RE:Checkbox list Custom CMS Form user control

$
0
0
rooossone
Hi Again,

So I decided to go back to basics and see if I could create ANY form control...
http://devnet.kentico.com/docs/devguide/index.html?developing_form_controls.htm

I followed the above guide to the letter. However, I am seeing the same error appear on the Doc type form. where it is failing to load the Type of the control.... I can provide the associated event log as well....


Source: FormEngine

EventCode: LOADFORMCONTROL

UserName: administrator

IPAddress: ::1

EventDescription: Message: Could not load type 'CMSApp.CMSFormControls.TestControl'.
Stack Trace:
at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
at System.Web.UI.TemplateParser.Parse()
at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
at CMS.FormControls.EditingFormControl.InitializeControl(FormUserControlInfo ci, String controlCodeName, FormFieldInfo ffi, String defaultValue, Object value)
at CMS.FormControls.EditingFormControl.CreateControl(FormFieldInfo ffi)

Could not load type 'CMSApp.CMSFormControls.TestControl'.
at System.Web.UI.TemplateParser.ProcessException(Exception ex)
at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)

Could not load type 'CMSApp.CMSFormControls.TestControl'.
at System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError)
at System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly)
at System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData)


This is incredibly frustrating as there really isn't any more information out there regarding the creation of custom form controls and the errors I see a far less than informative imo.

Adding new products using a generic handler

$
0
0
lucas-inorbital
I'm trying to add a new product to the shopping cart through a generic handler (.ashx). The item appears in the cart if i add it through an onclick event on the asp.net button, but item doesn't show up when i add it through the generic handler.

Both cart (through aspx and ashx) have the same ShoppingCartID and GUID, but the items that are stored in the ShoppingCartObject is different. Any help would be greatly appreciated.


var skuId = QueryHelper.GetInteger("id", -1);

if (skuId <= 0)
return;

var product = SKUInfoProvider.GetSKUInfo(skuId);

if (product == null)
return;

// Get current shopping cart
var cart = ECommerceContext.CurrentShoppingCart;

// Ensure cart in database
ShoppingCartInfoProvider.SetShoppingCartInfo(cart);

// Add item to cart object
var param = new ShoppingCartItemParameters(product.SKUID, 1);
ShoppingCartItemInfo cartItem = cart.SetShoppingCartItem(param);

// Save item to database
ShoppingCartItemInfoProvider.SetShoppingCartItemInfo(cartItem);

RE:Authentication in Kentico using REST API


RE:Adding new products using a generic handler

$
0
0
lucas-inorbital
Seems like EcommerceContext.CurrentShoppingCart isn't updated at all.

If i do
ShoppingCartInfoProvider.GetShoppingCartInfo(ECommerceContext.CurrentShoppingCart.ShoppingCartGUID)


I would get the updated items in the shopping cart. Is there a way to force EcommerceContext.CurrentShoppingCart to update?

Custom Authenticate FailureText

$
0
0
nrussell
We have implemented custom authentication on our Kentico Website using the Authenticate Handler. This works fine but I would like to handle a couple of different failure cases to provide more meaningful error messages.
Typically with the .Net Login control I would just set the FailureText on the control during my Authentication handler and fail the login. Within Kentico the OnAuthenticate method there is no way to access the Login control and the AuthenticationEventArgs don't seem to contain mechanism for passing back the failure reason.

Is there anyway to handle this?

Upgrade to v7 with some issues

$
0
0
whiplash
Hi Guys

We have recently upgraded a site from v5, gone through upgrades until v7.

The project is now down to 2 errors, these are as follows:


MacroResolver.OnResolveCustomMacro += new MacroResolver.MacroHandler(ResolveCustomMacro);
ClassHelper.OnGetCustomClass += new ClassHelper.GetClassEventHandler(GetCustomClass);


This code is in the Init() of CMSCustom class.

I have tried various options but can't seem to find a suitable replacement for the 'MacroHandler' and 'GetClassEventHandler' methods.

Does anyone have any idea? Some help on this would be much appreciated.


Thanks

RE:Upgrade to v7 with some issues

$
0
0
kentico_jurajo
Hello,

For some reason the automatic replacement in the App_Code\Global\CMS\CMSCustom.cs file was not executed. Please, manually replace the old names with the new ones as described below:

using CMS.GlobalHelper; -> using CMS.GlobalHelper; using CMS.Compatibility;
MacroResolver.OnResolveCustomMacro -> MacroResolverCompatibility.OnResolveCustomMacro
MacroResolver.OnResolveCustomMacro -> MacroResolverCompatibility.OnResolveCustomMacro
MacroResolver.MacroHandler -> MacroResolverCompatibility.MacroHandler
ClassHelper.OnGetCustomClass -> ClassHelperCompatibility.OnGetCustomClass
ClassHelper.GetClassEventHandler -> ClassHelperCompatibility.GetClassEventHandler

Best regards,
Juraj Ondrus

RE:Upgrade to v7 with some issues

$
0
0
whiplash
Hi Juraj

OK - so, if I have interpreted that correctly then my code should be as follows:


MacroResolverCompatibility.OnResolveCustomMacro += MacroResolverCompatibility.MacroHandler(ResolveCustomMacro);
ClassHelperCompatibility.OnGetCustomClass += new ClassHelperCompatibility.GetClassEventHandler(GetCustomClass);


It seems the bolded Method 'MacroHandler' complains with "Non-invocable member 'CMS.Compatibility.MacroResolverCompatibility.MacroHandler' cannot be used like a method.

I have a good feeling I'm wrong lol

RE:Upgrade to v7 with some issues

$
0
0
kentico_jurajo
Hello,

What was the upgrade path? I did this replacement on my upgraded version and it is working fine:

MacroResolverCompatibility.OnResolveCustomMacro += new MacroResolverCompatibility.MacroHandler(ResolveCustomMacro);

Also, this worked for other upgrades. It seems that something esle went wrong during the upgrade.

Best regards,
Juraj Ondrus

RE:Upgrade to v7 with some issues

$
0
0
whiplash
Hi

The upgrade path was going from v5 to 5.5 to 5.5R2 to 6 to 7


RE:Integration Bus not reporting errors?

$
0
0
kentico_zdenekc
Hi,

In the parallel email conversation, we've reached the dead end where even the tasks were not logged in your environment, but we weren't able to reproduce it with the simple scenario, it's hard to clarify what exactly was wrong here.
If you ever find any new clues, or if others came accross the same issue, please don't hesitate to let us know. Thanks.

Regards,
Zdenek

RE:Upgrade to v7 with some issues

$
0
0
kentico_jurajo
Hello,

Have you launched the site after each upgrade? This API change should have been done automatically already after upgrade to v6 - during the first site launch.
Have you followed all the instructions closely?

Best regards,
Juraj Ondrus

RE:Upgrade to v7 with some issues

$
0
0
whiplash
OK thanks for your assistance. We may have ran through the upgrades without launching the site after each upgrade, thinking we could fix the issues after all upgrades had run.

That was us trying to save time which doesn't seem to be the case.


Kind Regards

RE:Upgrade to v7 with some issues

$
0
0
kentico_jurajo
Hello,

In the instructions, there are only things you have to do. There are no steps that are optional, only relevant things. During the first startup of the site some scripts and code is executed as well as automatic import of new web parts and modules is done (this was the first attempt to do as many things as possible in an automatic way).

Best regards,
Juraj Ondrus

RE:Smart Search Sorting

$
0
0
ewood-mgma
Hi FroggEye,

I know its been a few months since you first posted this question, but did you ever find a solution to your problem?

I'm using the Smart Search Filter, which follows a similar syntax for how you have set up sorting, trying to sort by documentname and that doesn't work, although sorting by score and documentcreatedwhen doe work. Sorting by documentpagetitle also doesn't work. There seems to be no rhyme or reason for when a field is sortable or not. At the very least it would be nice to get an error message from kentico if it perceives my sort filter to be garbage.

-Eddie
Viewing all 660 articles
Browse latest View live