3

As a follow-up to my last ADF question (Adding a Date option to Session Footprint), I'm looking to learn how to set up cartridges on an SDL Tridion 2011 environment.

I can follow Jaime's post for 2013 up through installation, but get the following when using his SetClaim.aspx example:

CS0234: The type or namespace name 'Runtime' does not exist in the namespace 'Tridion.ContentDelivery.AmbientData' (are you missing an assembly reference?)

SetClaim.aspx's code-behind has:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Tridion.ContentDelivery.AmbientData;

public partial class Test : System.Web.UI.Page
{

    private readonly int maxSize = 0;

    protected void Page_Load(object sender, EventArgs e)
    {

        AmbientDataContext.CurrentClaimStore.Put(new Uri("taf:claim:jaimesideas:blogurl"), "http://jaimesantosalcon.blogspot.com", Tridion.ContentDelivery.AmbientData.Runtime.ClaimType.Normal);
        String claim = AmbientDataContext.CurrentClaimStore.Get<String>(new Uri("taf:claim:jaimesideas:blogurl"));
        ClaimStore cs = AmbientDataContext.CurrentClaimStore;
        if (cs != null)
        {
            foreach (var c in cs.GetAll())
            {
                Response.Write(string.Format("{0} - {1}<br/>", c.Key, c.Value));
            }
        }
    }

}

Tridion.ContentDelivery.AmbientData.Runtime is available in the 2013 documentation, but I don't see the AmbientData namespace mentioned in the SDL Tridion 2011 SP1 Content Delivery ASP.NET API .chm documentation.

I'm looking for help on the right namespace and methods to use for cartridges for a 2011 cartridge example or clarification on what documentation to check.

Or let me know if we're only supposed to do custom cartridges on 2013 or later. :-)

2 Answers 2

5

I don't have the 2011 .Net API handy, but I never used this third parameter to the Put method. Try the following:

AmbientDataContext.CurrentClaimStore.Put(new Uri("taf:claim:myclaim"), "claimvalue");

You can use custom cartridges with Tridion 2011.

1
  • Thanks for clarifying. The two-parameter method worked and my fault for not checking the API with intellisense (duh). Dec 4, 2013 at 20:34
3

Like Philippe said, in Tridion 2011 you can't use the third parameter like that.

AmbientDataContext.CurrentClaimStore.Put(new Uri("taf:claim:jaimesideas:blogurl"), "http://jaimesantosalcon.blogspot.com", Tridion.ContentDelivery.AmbientData.Runtime.ClaimType.Normal);

Tridion 2011 SP1 has

  • Claimstore.Put(Uri, Object)
  • Claimstore.Put(Uri, Object, Boolean)

Tridion 2013 GA has

  • Claimstore.Put(Uri, Object)
  • Claimstore.Put(Uri, Object, Boolean) -> marked Obsolete
  • Claimstore.Put(Uri, Object, ClaimType) -> new in Tridion 2013

The third parameter, ClaimType is in the Tridion.ContentDelivery.AmbientData.Runtime namespace which caused the confusion. The fun thing about this ClaimType is that we now can set immutable and readonly claims.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.