Additional Blogs by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
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.
  • 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.
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.
2 Comments