Clearing All - portal dynacaches (DistributedMap) with one click


IBM Dyna Cache Monitor is best way to monitor the any dynacache instances (at WAS level). Most of the time when you access the portal page (with WCM portlet on it or not) portal generate entries in multiple cache objects ( i.e like user information goes into different cache object, portlet related goes into different, and portal page related stuff goes into different cache object..etc). 

During the development it may be very annoying to go to individual caches and clear those to make sure you are seeing proper(updated) content. (Note: Some of portal/wcm caches gets cleared automatically when you change but not all).

We can clear all caches with single click by injecting the below small piece of code into the Cache Monitor JSP (WebSphere\wp_profile\installedApps\sivapcCell\Dynamic Cache Monitor.ear\CacheMonitor.war\selectInstance.jsp)

    <form name="clearAll" method="get" action="selectInstance.jsp">
        <input type="hidden" name="clearAll" value="true">
        <input type="submit" value="Clear All" class="buttons">
    </form>
    <%
    if (request.getParameter("clearAll") != null
        && request.getParameter("clearAll").equals("true")) {
            out.println("<script> var msg = 'Clearing All caches....\\n';");
            Cache tempCache = null;
            String cacheName = "";
            java.util.ListIterator cacheIterator = configuredInstances.listIterator();
            while (cacheIterator.hasNext()) {
                cacheName = (String)cacheIterator.next();
                tempCache = CacheMonitor.getCache(cacheName);
                out.print("msg = msg + 'Clearing-Cache:::"+cacheName.toString() +"\\n';");
                System.out.println("Clearing-Cache:::"+cacheName.toString());
                tempCache.clear();
            }
            out.println("alert(msg);</script>");
    }
    %>  
    <br/>


Didn't want to make any fancy UI changes , so "Clear All" button looks like below



Once you click on , you will see javascript alert as below.

NOTE :
  1. It is not IBM recommended* way , just came up with this to make my development process simple. 
  2. No guarantees with future version of cache monitor implementations (Tested with latest cachemonitor available as of today, installed on Portal 8/7)

References

1. Visit below link for Download, Install & Update instructions for DynaCache Monitor.

Customizing the WCM email body content (Custom WCM Workflow Notification Email)


After looking at the out-of-the-box WCM workflow notification emails, most of business customers feel they want a customize body of WCM email and look for the options to customize it.

Fig: Sample out of the box workflow notification email


But unfortunately there is no out-of-the-box configuration to update email body directly. And to accomplish this, only option left is by writing the custom work flow actions.
This article explains full details on how to configure and customize the WCM workflow notification emails.

Pros :
1.      We can customize the format of the WCM notification email
Cons:
1.      Maintenance of this custom workflow modules

Performance : I don’t think we need to worry about the performance for this implementation as we will be executing this mostly on authoring environments, it shouldn’t affect production (rendering) system .( Assuming these custom actions are not included in the expiry stage and your syndication is setup  for “live items” only)

Download/Browse the Sample Code

 



References: 
  1. http://www-10.lotus.com/ldd/portalwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Web+Content+Manager+8+Product+Documentation#action=openDocument&res_title=Creating_an_email_action_to_notify_users_groups_or_both_wcm8&content=pdcontent
  2. http://www-10.lotus.com/ldd/portalwiki.nsf/xpDocViewer.xsp?lookupName=IBM+WebSphere+Portal+7+Product+Documentation#action=openDocument&res_title=Mapping_attributes_on_Linux_in_a_clustered_environment_wp7&content=pdcontent
  3. http://www-10.lotus.com/ldd/portalwiki.nsf/dx/Using_IBM_Web_Content_Manager_Custom_WorkFlow_action_to_assign_approvers_for_an_artifact_at_runtime_based_upon_their_access_to_parent_site_area
  4. http://www-10.lotus.com/ldd/portalwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Web+Content+Manager+8+Product+Documentation#action=openDocument&res_title=Enabling_email_wcm8&content=pdcontent

Mapping LDAP email attribute to Portal -(Custom WCM Workflow Notification Email)-Part1


Make sure when you access the user profile from portal , email attribute is populated and if not following things need done to map the email attribute

a. update the following in the wkplc.properties file (attributes will be there , just need add the value)

for standalone
standalone.ldap.attributes.mapping.portalName=ibm-primaryEmail
standalone.ldap.attributes.mapping.ldapName=mail                  


for federated
federated.ldap.attributes.mapping.portalName=ibm-primaryEmail
federated.ldap.attributes.mapping.ldapName=mail

NOTE: “mail” is e-mail property name in LDAP

b. execute the following ConfigEngine command

For standalone
./ConfigEngine.sh wp-update-standalone-ldap-attribute-config -DWasPassword=password

For federated
./ConfigEngine.sh wp-update-federated-ldap-attribute-config -DWasPassword=password

c. restart the server.

Once the portal is restarted check user e-mail value populated properly. 

References: