Skip to Content
Author's profile photo Daniel Wroblewski

Cleaning Up Personalization

You deploy an application and create an iView, and people use it, and then some people personalize the iView. After a while, you redeploy and change one of the properties. But anyone who personalized the property still gets their personalized value.  Many people ask for a way to remove personalization. As it turns out, the portal comes with a handy tool for clearing the personalization that users may have added to portal objects.   The reason why this is so good is that, unfortunately, the administration interfaces do not allow an administrator to clear personalization from an object. Yes, you can clear personalization using PCD APIs, but this is a lot of work for clearing a single property.  So the guys who brought you the PCD also created this little tool to help clear personalization. It doesn’t do everything, but it may be helpful for you.  You can clear personalization in one of two ways:

  • By Principal: You can specify a user, group or role, and clear all the personalization for that user. Or you can view all the objects that were personalized by that user, and then select the objects for which to clear the user’s personalization. image
  • By Object: You can specify an object, and then view all the user’s who have personalized the object. You can then select the users whose personalization you want to remove. image

To get to the personalization cleanup tool, go to System Administration –> Support –> Portal Content Directory –> Personalization Cleanup.

Personalization API

We will be describing the PCD in detail in the next few weeks, including its personalization features, but here is a quick tip for removing personalization via code.  The PCD API enables you to remove the personalization for a specific user from a specific object.  The following code removes all personalization for the current user for the object pcd:portal_content/DanielContent/DanRole/danWS/hello. Hashtable env = new Hashtable();  env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY); env.put(Context.SECURITY_PRINCIPAL, request.getUser()); env.put(Constants.REQUESTED_ASPECT, IPcdAttribute.PERSISTENCY_ASPECT); env.put(IPcdContext.PCD_PERSONALIZATION_PRINCIPAL, request.getUser());  InitialContext   iCtx = null;  try {    String lookupObject = "pcd:portal_content/DanielContent/DanRole/danWS/hello";                    iCtx = new InitialContext(env);                    IPcdContext myPcdContext = (IPcdContext) iCtx.lookup(lookupObject);                    myPcdContext.removeModifications(""); } catch (NamingException e) {    e.printStackTrace(); }You can instead use the removeAttributeModifications() method if you want to remove personalization to only attributes and not, for example, iViews added to pages.  More on this later, when we discuss the PCD.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Thank you for this, really helped a lot!

      Do you maybe know if there’s an easy way of seeing how the user personalized their page?

      Author's profile photo Daniel Wroblewski
      Daniel Wroblewski
      Blog Post Author

      Easy is a relative word, 🙂

      You can use the PCD to look up a specific page or iView, then click on the little pencil at the far right to set a personalzied view. In the dialog box, you can specify whether to personalize the view and for what user.

      After that, when you use the property editor of the PCD Inspector, it will show you personalized values for the properties.

      I hope this helps.