You
can configure portlet fragment caching with scripting
and the wsadmin tool.
Before you begin
Before starting this task,
the wsadmin
tool must be running. See the Starting the wsadmin scripting client
topic for more information about starting the wsadmin tool.
About this task
Important: If
you use the wsadmin tool to enable
portlet fragment caching, you must make sure that servlet caching
is also enabled. Similarly if you use the wsadmin tool to disable
portlet fragment caching, you must make sure that servlet caching
is also disabled. The settings for these two caching functions must
stay synchronized. If you enable or disable portlet fragment caching
using the administrative console, synchronization is automatically
taken care of for you.
Procedure
- Locate the
server object. The following example selects
the first server found:
Using Jacl:
set s1 [$AdminConfig getid /Server:server1/]
Using
Jython:
s1 = AdminConfig.getid('/Server:server1/')
- List the web containers and assign
them to the wc variable,
for example:
Using Jacl:
set wc [$AdminConfig list PortletContainer $s1]
Using
Jython:
wc = AdminConfig.list('PortletContainer', s1)
- Set the enablePortletCaching attribute to true and
assign it to the serEnable variable, for example:
Using Jacl:
set serEnable "{enablePortletCaching true}"
Using
Jython:
serEnable = [['enablePortletCaching', 'true']]
- Enable caching, for example:
Using
Jacl:
$AdminConfig modify $wc $serEnable
Using
Jython:
AdminConfig.modify(wc, serEnable)