Recalculate the count of forums and forum topics.
Before you begin
To run
administrative commands, you must use the wsadmin client. For more
information, see Starting
the wsadmin client.
When
you use these commands, you do not have to check the configuration
file in and out, nor restart the Forums server, because the commands
take effect immediately.
About this task
If an administration task in the Forums application fails,
the total count of forums and forum topics that are displayed in the
Forums user interface might be incorrect. You can use administrative
commands to manually recalculate the count of forums and forum topics
in your organization and ensure that the figures are up-to-date.
Procedure
To recalculate the number of forums and forum topics,
complete the following steps.
- Start the wsadmin client from the following
directory of the system on which you installed the Deployment Manager:
app_server_root\profiles\dm_profile_root\bin
where
app_server_root is the WebSphere® Application Server
installation directory and
dm_profile_root is the
Deployment Manager profile directory, typically dmgr01.
You must
start the client from this directory or subsequent commands fail.
For more information, see Starting the wsadmin client.
- Start the Forums Jython script interpreter
by using the following command:
execfile("forumsAdmin.py")
If you are prompted to specify
a service to connect to, enter 1 to select
the first node in the list. Most commands can run on any node. If
the command specifies a file by using a local file path, select the
node where the file is stored.
- Run any of the following commands:
- ForumsService.reCountAllForums()
Recalculates the total number of forums in your organization.
This
command does not take any parameters.
- ForumsService.reCountForums(Vector forums)
Recalculates the number of specified forums in your organization,
where you specify the forums that you want to recalculate as a vector
variable that represents multiple forums.
For example:
ForumsService.reCountForums(myforums)
- ForumsService.reCountForumById(java.lang.String uuid)
Recalculates the number of topics in a specific forum, where
you specify the forum by its UUID.
For example:
ForumsService.reCountForumById("778CE573-78A5-2ECF-8525-7346003DB078")
- ForumsTopicsService.reCountTopics(Vector topics)
Recalculates the number of specified topics in your organization,
where you specify the topics that you want to recalculate as a vector
variable that represents multiple topics.
For example:
ForumsTopicsService.reCountTopics(mytopics)
- Use the following command to filter a vector result:
Vector vii=ForumsService.filterInput(VectorinputVector,java.lang.String toMatch,java.lang.String attrName)
This
command returns a new vector that contains a map pair to match the
filter criteria.
The command takes the following parameters:
- inputVector
- The source vector that contains the map collection.
- toMatch
- The value pattern that you are using to narrow down your results.
- attrName
- The key that you want to be filtered in the map.
For example, you might get a vector of forums by
using the following command:
inputVector=ForumsService.fetchForums()
The
inputVector vector contains two maps as follows:
inputVector = {name=forum-1,name=forum-2}
Each
map has one value pair:
(key = "name", value="")
In
this example, you want to filter the vector to retrieve the maps in
which the value of the name key is forum-1 so you run the following
command:
Vector vii=ForumsService.filterInput(inputVector,"forum-1","name")
The
vii vector variable now contains
a single forum with a name key of forum-1:
vii = {name=forum-1}