8

Good Morning.

I am having problems after deploying the skeleton of a custom cartridge. I've done a couple of cartridges before but this time it is driving me crazy.

After adding the cartridge conf in (cd_ambient_config.xml ) I am executing my claimStoreTest.aspx page to see which claims are available in my context...and guess what!...I can not see any of my 4 claims, I don't even see anything about the execution of my processor in the logs.

here is the configuration of the cartridge :

<?xml version="1.0" encoding="UTF-8"?>
<CartridgeDefinition Version="6.1"
    Uri="taf:cartridge:client" Description="cartridge that gets data from a cookie for the PoC"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="schemas/cd_ambient_cartridge_conf.xsd">
    <ClaimDefinitions>
        <ClaimDefinition Uri="taf:claim:client:claim1"
            Scope="SESSION" Description="claim1" />
        <ClaimDefinition Uri="taf:claim:client:claim2"
            Scope="SESSION" Description="claim2" />
        <ClaimDefinition Uri="taf:claim:client:claim3"
            Scope="SESSION" Description="claim3" />
        <ClaimDefinition Uri="taf:claim:client:claim4"
            Scope="SESSION" Description="claim4" />
    </ClaimDefinitions>
    <ClaimProcessorDefinitions>
        <ClaimProcessorDefinition Uri="taf:claimprocessor:client"
            ImplementationClass="com.client.adf.cookieCartridge.claims.CookieClaimProcesor"
            Description="client Cookie claim processor.">
            <RequestStart>
                <InputClaims/>
                <OutputClaims>
                    <ClaimDefinition Uri="taf:claim:client:claim1" />
                    <ClaimDefinition Uri="taf:claim:client:claim2" />
                    <ClaimDefinition Uri="taf:claim:client:claim3" />
                    <ClaimDefinition Uri="taf:claim:client:claim4" />
                </OutputClaims>
            </RequestStart>
        </ClaimProcessorDefinition>
    </ClaimProcessorDefinitions>
</CartridgeDefinition>

This is the skeleton of the implementation of the custom cartridge :

CookieClaimProcesor Class

Thank You!!!

Regards. yeremy.

1 Answer 1

2

If the Tridion version that you are using is prior 2013 SP1 you should execute your logic in onRequestStart. I noticed that you don't have code in your onRequestStart, please put the logic to create/populate your claims in that method.

In Tridion 2013 SP1 there is a new syntax that allow us to include the scope for a claim added/populated using the API.

claimStore.put(claimUri,value,ClaimValueScope.REQUEST)
claimStore.put(claimUri,value,ClaimValueScope.SESSION)
7
  • Could you guys clarify how this answer fits the question? It seems to me that the code should be in request start regardless of the Tridion version, and the logging should have worked regardless (but probably didn't due to incorrect /missing logback configuration). Was the code in onSessionStart and moving it to onRequestStart fixed it? Did you fix the logging too? Future visitors might want to know :) Jan 13, 2014 at 13:43
  • Yes Peter, I moved the logic from onSessionStart to OnRequestStart and it started working. Now i can see in the logs that my claims are being put in the claimsStore, but actually, I cannot see the in the log some intries i wrote in the code. Jan 13, 2014 at 14:22
  • @PeterKjaer I did not get it eiter but speaking to Yeremy explained it. The code listing in the question is not complete, the OnSessionStart() contains logging and some other code. None of the logging was triggered due to logging configuration. Moving the code from OnSessionStart() to OnSessionRequest() did not fix the logging, but at least got the business logic to work.
    – Jan H
    Jan 14, 2014 at 16:00
  • 1
    If you already had a ADF session before (from previous debugging) the OnSessionStart() will not be triggered and the code you had in there was not executed. To start a new session clear the ADF cookies in your browser and reload the page. That will force a new session (the ADF session id is kept in the cookie) and hence will trigger the OnSessionStart().
    – Jan H
    Jan 14, 2014 at 16:06
  • @EricHuiza Why do you say "prior 2013 SP1 you should execute your logic in onRequestStart"? ADF in Tridion 2011 also supports OnSessionStart(), OnRequestStart() and OnRequestEnd().
    – Jan H
    Jan 14, 2014 at 16:08

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.