Rectifying the count of forums and forum topics
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
Procedure
- Start the wsadmin client from the following
directory of the system on which you installed the Deployment Manager:
where app_server_root is the WebSphere® Application Server installation directory and dm_profile_root is the Deployment Manager profile directory, typically dmgr01.app_server_root\profiles\dm_profile_root\bin
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:
This command returns a new vector that contains a map pair to match the filter criteria.Vector vii=ForumsService.filterInput(VectorinputVector,java.lang.String toMatch,java.lang.String attrName)
The command takes the following parameters:For example, you might get a vector of forums by using the following command:- 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.
The inputVector vector contains two maps as follows:inputVector=ForumsService.fetchForums()
Each map has one value pair:inputVector = {name=forum-1,name=forum-2}
(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:
The vii vector variable now contains a single forum with a name key of forum-1:Vector vii=ForumsService.filterInput(inputVector,"forum-1","name")
vii = {name=forum-1}