Recalculate the count of forums and forum topics
If an administration task in the Forums application fails, the total count of forums and forum topics displayed in the Forums user interface might be incorrect. We can use administrative commands to manually recalculate the count of forums and forum topics in the organization and ensure the figures are up-to-date.
To recalculate the number of forums and forum topics, start the Forums Jython script interpreter
cd app_server_root/profiles/Dmgr01/bin
./wsadmin.sh -lang jython
execfile("forumsAdmin.py")...and run commands...
- ForumsService.reCountAllForums()
- Recalculate the total number of forums in the organization.
- ForumsService.reCountForums(Vector forums)
- Recalculate the number of specified forums in the organization. Specify the forums to recalculate as a vector variable that represents multiple forums.
For example:
ForumsService.reCountForums(myforums)
- ForumsService.reCountForumById(java.lang.String uuid)
- Recalculate the number of topics in a specific forum. Specify the forum by its UUID.
For example:
ForumsService.reCountForumById("778CE573-78A5-2ECF-8525-7346003DB078")
- ForumsTopicsService.reCountTopics(Vector topics)
- Recalculate the number of specified topics in the organization. Specify the topics to recalculate as a vector variable that represents multiple topics.
For example:
ForumsTopicsService.reCountTopics(mytopics)
Filter a vector result
Vector vii=ForumsService.filterInput(VectorinputVector,java.lang.String toMatch,java.lang.String attrName)
Returns new vector containing a map pair to match the filter criteria.
- inputVector
- The source vector containing the map collection.
- toMatch
- The value pattern that we are using to narrow down the results.
- attrName
- The key to be filtered in the map.
For example, you might get a vector of forums by :
inputVector=ForumsService.fetchForums()
The inputVector vector contains two maps :
inputVector = {name=forum-1,name=forum-2}
Each map has one value pair:
(key = "name", value="")
In this example, 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}
Parent topic:
Administer Forums
Related:
Start the wsadmin client