Filtering community listsAdded by IBM | Edited by IBM on March 15, 2012 | Version 3 (Show original)
|Use the CommunitiesListService commands to filter the information in community lists and to generate smaller lists containing more specific information.
Use the CommunitiesListService commands to filter the information in community lists and to generate smaller lists containing more specific information.
Before you begin
To use administrative commands, you must use the wsadmin client. See Starting the wsadmin client
To filter community lists, perform the following steps.
Parent topic: Administering Communities
- Start the wsadmin client from the following directory of the system on which you installed the Deployment Manager:
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 that you enter do not execute correctly. For more information, see Starting the wsadmin client
- Start the Communities Jython script interpreter using the following command:
If prompted to specify a service to connect to, type 1 to pick the first node in the list. Most commands can run on any node. If the command writes or reads information to or from a file using a local file path, you must pick the node where the file is stored.
- Use the following commands to filter the information in community lists and generate new lists.
The commands can also be used on application lists.
CommunitiesListService.filterListByApp(List list, String filter)
CommunitiesListService.filterListByName(List list, String filter)
Returns a new list containing only the communities where the application type matches the regular expression filter. Examples of applications include Confluence, IBM Lotus
™ Wiki, and Lotus Quickr
Depending on how the list is returned, you can filter an application from:
- All links, when the list is returned by the ManagedAppService.fetchAllLink command.
- A specific community, when the list is returned by the CommunitiesService.fetchCommByName command.
- The communities that a specific user is a member or owner of, when the list is returned by the CommunitiesService.fetchCommByMember command.
The following example gets a list of all the communities that the specified user is a member or owner of, and then gets a list of all the links associated with that user. The filter command then filters that list by the application name specified. A list of communities associated with the specified application is returned.
CommunitiesListService.filterListByType(List list, String filter)
Returns a new list containing only the communities and subcommunities whose names match the regular expression filter.
wsadmin>CommunitiesListService.filterListByName(allComm,"My Community Name")
This example returns a list of all communities and subcommunities using the fetchAllComm
command (command is set to a variable that will be used in the next command) and then filters the results to get the information for a particular community or subcommunity.
CommunitiesListService.filterListById(List list, String filter)
Returns a new list containing only the communities and subcommunities whose type (private, public, or publicInviteOnly) matches the regular expression filter.
This example retrieves a list of all the communities and subcommunities for a particular user (in this case Jane Smith) and then filters that list to display all the user's communities and subcommunities that are publicInviteOnly. The fetch command is set to a variable that will be used in the listService command.
Returns a new list containing only the communities and subcommunities whose ID matches the regular expression filter.
This example returns a list of all the communities and subcommunities and then filters the results by ID to list only the communities and subcommunities where the ID matches the one specified.