Home

 

Retrieving and listing community data

The community fetch commands return a Java™ vector of Java hash maps. No file checkout or server restart is required when using these commands.


To use administrative commands, use wsadmin. See Start wsadmin for details.


Java hash maps provide a useful mechanism for storing community data so that it can be quickly retrieved. You can use the community fetch commands to return a vector of hash maps that contain all the data for communities.

The fetch commands return a list of communities. You then pass the lists to print commands to print data for specific communities.

  1. Start wsadmin so that you can access the Communities configuration files.

    1. Access the Communities configuration files:

      If you are asked to select a server, you can select any server.

  2. Use these commands to return a list of communities:


    Communities fetch commands

    Option Description
    CommunitiesService.fetchAllComm() Returns a vector of hash maps of all communities.
    CommunitiesService.fetchCommById(string communityUUID) Returns the community with the specified UUID.You can obtain the UUID for the community by doing one of the following:

    • Using a browser, open the community that you want and copy the UUID from the URL.

    • Run the CommunitiesService.fetchAllComm() wsadmin command to fetch all communities on the server and copy the UUID from the output.

    For example:

      wsadmin>CommunitiesService.fetchCommById("59d8e5a7-ba0e-488f-8bcd-1f79a994e419")
      [{createdBy=[Andy Jones, 2BC32FEF-E736-4C81-986C-30780C5EF8C3], lastMod=6/18/09 3:09:02 PM EDT, description= Community of developers working on JAVA projects in our company.  This is a community to share ideas., name=JAVA Developers community, uuid=59d8e5a7-ba0e-488f-8bcd-1f79a994e419, memberSize=6, type=publicInviteOnly, tags=[developers, java], created=6/18/09 3:08:48 PM EDT, lastModBy=[Andy Jones, 2BC32FEF-E736-4C81-986C-30780C5EF8C3]}] wsadmin>
      

    CommunitiesService.fetchCommByMemberEmail(String email) Returns all the communities that the user of the specified e-mail address is a member of.For example:

      CommunitiesService.fetchCommByMember("john_doe@company.com")
      

    This command replaces the older command, CommunitiesService.fetchCommByMember(String email), which has been deprecated for IBM Lotus Connections 2.5.

    CommunitiesService.fetchCommByMemberUuid(String uuid) Returns all the communities that the user with the specified UUID is a member of.For example:

      CommunitiesService.fetchCommByMemberUuid("193F1CE8-E10A-4B9A-B933-C8ECD6C072E4")
      

    The Member's UUID is the External LDAP identifier for a specific user. The UUID can be found by looking at the SNCOMM.MEMBERPROFILE Communities database table and looking in the DIRECTORY_UUID column. Alternatively, you can use the CommunitiesService.fetchMember(list_of_comm) Mbean command to list out the membership list (with each user's UUID) for each of the communities specified by the list.

    CommunitiesService.fetchCommByName(String name) Returns the community with the specified name.

    There is a maximum of one community in the list, but that list can be used in the other methods that use a list input. If no match is found, the list will be empty. For example:

      wsadmin>CommunitiesService.fetchCommByName("Test Community")
      

    CommunitiesService.fetchMember(List list) Returns the input list of communities with an additional property for each community that is the member list for that community.

    This command is run in two steps. First, generate a list of data to input into the fetchMember command and assign the list to a variable. The variable is then used as input into the fetchMember command. For example:

      wsadmin>allComm=CommunitiesService.fetchAllComm() wsadmin>CommunitiesService.fetchMember(allComm)
      

    CommunitiesService.fetchReference(List list)

    Adds the references to communities in the list passed into this command and returns a new list with references.

    This command is run in two steps. First, generate a list of data to input into the fetchReference command and assign the list to a variable. The variable is then used as input into the fetchReference command. The term reference refers to any feed or bookmark for a community. For example:

      wsadmin>allComm=CommunitiesService.fetchAllComm() wsadmin>CommunitiesService.fetchReference(allComm)
      

  3. Use these commands to print the information that is generated by using the fetch commands:


    Communities print commands

    Option Description
    CommunitiesService.listComm(List list) Prints the information associated with the communities in the list input to the wsadmin command window in an easy-to-read format. The data printed includes community name, UUID, type, who created it, creation date, last person who modified it, date of last modification, membership list size, and description. If the list includes members, then this command also prints the membership list. If the list includes references, the command also prints the reference information.

    This command is run in two steps. First, generate the data to input into the listComm command and assign the list to a variable. The variable is then used as input into the listComm command. For example:

      wsadmin>byMember=CommunitiesService.fetchCommByMember("jane_doe@company.com") wsadmin>CommunitiesService.listComm(byMember)
      

    CommunitiesService.listCommToFile(List list, String filename) Prints the information associated with the communities in the list input to the specified file using an easy-to-read format. The to which the file is to be output must already exist. The data printed includes community name, UUID, type, who created it, creation date, last person who modified it, date of last modification, membership list size, and description. If the list includes members, then this command also prints the membership list. If the list includes references, the command also prints the reference information.

    This command is run in two steps. First, generate the data to input into the listCommToFile command and assign the list to a variable. The variable is then used as input into the listCommToFile command. For example:

      wsadmin>byMember=CommunitiesService.fetchCommByMember("jane_doe@company.com") wsadmin>CommunitiesService.listCommToFile(bymember,"/temp/CommMembers.txt")
      


Administer Communities


+

Search Tips   |   Advanced Search