Cleaning Up Personalization
- 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.
Do you maybe know if there’s an easy way of seeing how the user personalized their page?
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.
Daniel