Show TOC

Background documentationRemoving Personalization Locate this document in the navigation structure

 

The portal provides a tool called Personalization Cleanup that enables an administrator to remove a specific user's personalization on a specific object.

This is particular useful when an attribute is defined in the portalapp.xml of a portal component, then is personalized, and then needs to be updated in the portalapp.xml. After the new portal component is deployed, the personalized value is still present in the PCD, and supercedes even the new value in the portalapp.xml.

Running Personalization Cleanup

To run the tool, go to   System Administration   Support   Portal Content Directory   Personalization Cleanup  

This graphic is explained in the accompanying text.

To remove personalization for a specific object, do one of the following:

  • Search by Object

    1. Select the Object radio button.

    2. Enter the PCD name of the object (without the pcd: prefix)

    3. Click Show. All users with personalization for the specified object are displayed.

    4. Select the users whose personalization you want to remove.

    5. Click Remove.

  • Search by User, Group or Role (Principal)

    1. Select the Principal radio button.

    2. Enter a search string for the user, group or role whose personalization you want to remove.

    3. Click Show. All users who fit the search string and with any personalization in the PCD are displayed.

    4. Select the logon ID of the user, group or role whose personalization you want to remove. All objects personalized by the selected principal are displayed.

    5. Select the objects from which you want to remove personalization for the selected user, group or role.

    6. Click Remove.

Removing Personalization via Code

Personalization can be removed by performing a personalized lookup (a lookup in which a personalization principal is specified), and then removing some or all of the modifications by calling removeModifications() or removeAttributeModifications() on the IPcdContext object. This removes the personalization for the user specified as the personalization principal.

These are the same methods for removing delta link modifications when performing a nonpersonalized lookup.

The following removes all personalization from an object for the current user:

Syntax Syntax

  1. Hashtable env = new Hashtable();
    
    env.put(Context.INITIAL_CONTEXT_FACTORY,
        IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
    env.put(Constants.REQUESTED_ASPECT, IPcdAttribute.PERSISTENCY_ASPECT);
    env.put(Context.SECURITY_PRINCIPAL, request.getUser());
    env.put(IPcdContext.PCD_PERSONALIZATION_PRINCIPAL, request.getUser());
    
    InitialContext iCtx = null;
    
    String myObjectName = "pcd:portal_content/myFolder/myObject";
    
    try {
        iCtx = new InitialContext(env);
    
        IPcdContext myObject = (IPcdContext) iCtx.lookup(myObjectName);
    
        myObject.removeModifications("");
    }
    catch (Exception e) {}
    
End of the code.