1

I have a tricky one for the hardcore Tridion CD people here...

I want to load and enrich a User's CustomerCharacteristics from an Ambient Data Cartridge, but been struggling to find a way to load/find this object.

The correct way of loading a user is to use:

JSPPage jspPage = new JSPPage(pageContext, "tcm:1-2-64");
User user = jspPage.getUser();

But in the context of a cartridge I am running before the page, and I don't have access to the pageContext object. Or do I?

Does anyone know a way to get the PageContext object for a page from a filter? And would there be an easy-ish way to make this object available to a Cartridge?

  • I remember having to create a PageContext myself once, but that was a long time ago, and there I really needed it for the Out (or JspWriter) property. You might want to decompile JSPPage.getUser() and see what is all done in there and see if you can get to that without a PageContext or JSPPage. – Bart Koopman Aug 15 '13 at 14:28
3

The context is not available in a Cartridge or ADF because there are different implementations in .Net and Java for it and ADF should be technology agnostic.

What about using this class.

User user = UserManager.CheckUser(presentationId, userId, login);

This API does not need the context, now, how to get the userId, if it is an existing user, it will be stored in the WAI cookie, I think you can use a Cookie claim to read it or read it in a previous Filter/Http Module and put it in the claim store.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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