I am trying to use footprints in XPM with a custom made claim, for a Smart Target promotion.
That claim is created when I pass a querystring parameter to any page in the website.
Promotion works well, and I get the expected results. My problem is when trying to overwrite the claim using XPM footprint.
I have followed these steps to configure it: http://blog.trivident.com/2014/12/creating-custom-footprints/
I see the footprint in XPM but when I apply a value, my promotion doesn't update. I always get the fallback content or the promotion for the claim value I established before; Current claim value is never overwritten using footprint (or at least I never get the appropiate promotion).
Any idea of what I am missing?
Thank you.
This is what I have done (hope it isn't too long):
To create my claim, first I created a processor that sets the value using querystring; if I don't get the parameter, claim is not set:
public void onRequestStart(ClaimStore claimStore)
throws AmbientDataException
{
this.LOG.debug("TeamClaimProcessor");
try
{
@SuppressWarnings("unchecked")
Map<String, String[]> paramValues = (Map)claimStore.get(WebClaims.REQUEST_PARAMETERS, Map.class);
String equipo = "";
if (paramValues.containsKey("equipo")) {
equipo = ((String[])paramValues.get("equipo"))[0];
this.LOG.debug("TeamClaimProcessor : Retrieved equipo: " + equipo);
claimStore.put(TeamClaims.TEAM_VALUE, equipo);
}
}
catch (Exception e)
{
this.LOG.error(e.getMessage(), e);
}
}
Value of URI:
public class TeamClaims
{
public static final URI TEAM_VALUE = URI.create("taf:claim:team:value");
}
I created a config file for my claim:
<?xml version="1.0" encoding="UTF-8"?>
<CartridgeDefinition Version="6.1" Uri="taf:cartridge:team" Description="Team cartridge."
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="schemas/cd_ambient_cartridge_conf.xsd">
<ClaimDefinitions>
<ClaimDefinition Uri="taf:claim:team:value" Scope="SESSION" Description="Equipo elegido por el usuario" />
</ClaimDefinitions>
<ClaimProcessorDefinitions>
<ClaimProcessorDefinition Uri="taf:claimprocessor:team" ImplementationClass="com.tridion.fecron.ambientdata.TeamClaimProcessor"
Description="Claim processor that gets team.">
<RequestStart>
<InputClaims>
</InputClaims>
<OutputClaims>
<ClaimDefinition Uri="taf:claim:team:value" />
</OutputClaims>
</RequestStart>
</ClaimProcessorDefinition>
</ClaimProcessorDefinitions>
</CartridgeDefinition>
Then I added that config file to cd_ambient_conf.xml
in my website (it is a Tomcat-Java based website), and I add my claim to the GloballyAcceptedClaims
:
<GloballyAcceptedClaims>
<Claim Uri="taf:claim:team:value"/>
</GloballyAcceptedClaims>
I added this to the app smarttarget_conf.xml
file:
<taf_claim_team>tm</taf_claim_team>
In fredhopper instance, I added the claim to the trigger-types.xml
file:
<trigger-type basetype="text" url-param="tm_value" name="Team Value">
<list-of-values multiselect="true">
<value>madrid</value>
<value>barcelona</value>
<value>athletico</value>
</list-of-values>
</trigger-type>
Then I created my promotions based on that trigger.
When I enter my page using ?equipo=madrid I get the Madrid promotion, etc. So far it works fine.
To add the footprint to XPM I added to C:\Tridion\web\WebUI\Editors\SiteEdit\Configuration\SiteEditEditor.xml
<footprint ID="equipo" controlID="FootprintRadio" Icon="footprint.sessionlength" />
And to C:\Tridion\web\WebUI\Models\SiteEdit\Configuration\SiteEditModel.xml
<footprint ID="equipo" claimUri="taf:claim:team:value">
<title>
<value>Equipo de futbol</value>
</title>
<description>
<value>Equipo elegido por el usuario</value>
</description>
<settings>
<isMandatory>false</isMandatory>
</settings>
<values>
<value text="" default="true">
<label>(ninguno)</label>
</value>
<value text="madrid">
<label>madrid</label>
</value>
<value text="barcelona">
<label>barcelona</label>
</value>
<value text="athletico">
<label>athletico</label>
</value>
</values>
</footprint>
Footprints are there when I access to XPM. But when I apply a value, my promotion keeps showing the same content, no matter what I choose.