Filtering community listsUse the CommunitiesListService commands to filter the information in community lists and to generate smaller lists containing more specific information.
Before you beginTo use administrative commands, use the wsadmin client. See Starting the wsadmin client for details.
ProcedureTo filter community lists, perform the following steps.
- From the dmgr host:
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, pick the node where the file is stored.
- Use the following commands to filter the information in community lists and generate new lists.
Note: The commands can also be used on application lists.
CommunitiesListService.filterListByApp(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 Quickr Wiki, and Lotus Quickr Teamspace.
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.
wsadmin>bymember=CommunitiesService.fetchCommByMember("users_email_address") wsadmin>links=ManagedAppService.fetchLinkByComm(bymember) wsadmin>CommunitiesListService.filterListByApp(links,"application_name")
CommunitiesListService.filterListByName(List list, String filter)
Returns a new list containing only the communities and subcommunities whose names match the regular expression filter.
wsadmin>allComm=CommunitiesService.fetchAllComm() 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.filterListByType(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.
CommunitiesListService.filterListById(List list, String filter)
Returns a new list containing only the communities and subcommunities whose ID matches the regular expression filter.
wwsadmin>all=CommunitiesService.fetchAllComm() wsadmin>CommunitiesListService.filterListById(all, "c6a2c680-5933-4efa-9a14-be1723445d30")
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.
Parent topicAdminister Communities