Removing unwanted or inappropriate content
Use administrative commands to update or remove inappropriate information stored in the Communities database.
Before you begin
About this task
The following commands can only be used to manage community content. To remove data from the applications that can be integrated with Communities, such as Activities, Blogs, Files, and Wikis, you need to refer to the application documentation for each specific application. See the links at the end of this topic for more information.
WASX7015E: Exception running command: "CommunitiesService.updateCommunityDescription("My community", "updated by wsadmin cmd")"; exception information:
javax.management.RuntimeMBeanException
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: CLFRM0091E: Multiple communities found with name: My community
When
you see an error like this, instead of entering the name of the community
in the command, you must enter the UUID of the community instead.
For example:wsadmin>CommunitiesService.updateCommunityDescription("5742c4c8-0010-4e6e-abdb-65015e8a22e1", "updated first by wsadmin cmd")
- Using a browser, open the community or subcommunity that you want and copy the UUID from the URL.
- Run the CommunitiesService.fetchAllComm() wsadmin command to fetch all communities and subcommunities on the server. Copy the UUID from the output.
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 that you enter will not execute correctly.
- 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.execfile("communitiesAdmin.py")
- Use the following commands to make changes to content in
various fields of a community or subcommunity to which you do not
have owner access. You can use the commands to remove unwanted or
inappropriate content.
- CommunitiesService.updateCommunityName(String communityName, String newName)
Allows you to update an existing community or subcommunity name where:
- communityName refers to the existing community or subcommunity name, which must be specified exactly.
- newName is the new name of the community or subcommunity.
Both communityName and newName must be enclosed in double quotation marks (").
For example:CommunitiesService.updateCommunityName("JDs Community", "JDs New Name")
Note: When you use this command, if you get an error telling you that the community or subcommunity name is not unique, enter the UUID instead.You can obtain the UUID for a community or subcommunity by doing one of the following:- Using a browser, open the community or subcommunity that you want and copy the UUID from the URL.
- Run the CommunitiesService.fetchAllComm() wsadmin command to fetch all communities and subcommunities on the server. Copy the UUID from the output.
- CommunitiesService.updateCommunityDescription(String communityName, String newDescription)
Allows you to update (overwrite) the description field in an existing community or subcommunity. Any existing description is overwritten by the new text that you enter into this command.
Both communityName and newDescription must be enclosed in double quotation marks (").
For example:CommunitiesService.updateCommunityDescription("Ski Community", "The purpose of this community is to bring together people interested in skiing.")
- CommunitiesService.removeReferencesByUri(String communityName, List referenceURIs)
Allows you to remove all references to one or more existing bookmarks (URIs) from a specified community or subcommunity.
The command requires a two-step process: First, create a comma-separated list of the bookmarks (URIs) that you want to remove. These URIs are saved to a variable and this variable is used as input for the removeReferencesByUri command.
Because the URIs are specified as a list, each URI must be enclosed in double quotation marks and separated by commas. All URIs must be enclosed within brackets. The URI that is listed must match exactly the URI that is saved in the community or subcommunity, otherwise the command fails.
The communityName parameter is a string and must be enclosed in double quotation marks (").
For example:wsadmin>delete=["http://valid1.url.com", "http://valid2.url.com", "http://valid3.url.com"] wsadmin>CommunitiesService.removeReferencesByUri("Ski Club Community",delete)
- CommunitiesService.removeTagsFromCommunity(String communityName, List tagNames)
Allows you to remove tags from an existing community or subcommunity. This command is a two-step process. First, create a comma-separated list of the tags that you want to remove. This list of tags is saved to a variable and the variable is used as input for the removeTagsFromCommunity command.
Note: You can remove tags on a community or subcommunity, but you cannot remove tags associated with bookmarks or feeds within a community.Because the tags are specified as a list, each tag must be enclosed in double quotation marks and separated by commas. All tags must be enclosed within brackets.
The communityName parameter is a string and must be enclosed in double quotation marks (").
For example:wsadmin>tags=["snowboard", "mountain"] wsadmin>CommunitiesService.removeTagsFromCommunity("Ski Club Community", tags)
- CommunitiesService.removeWidgetsByWidgetDefIdForAllComm(String widgetDefId)
-
Allows you to remove the specified widget from all communities and subcommunities. widgetDefId corresponds to the defId attribute on <widgetDef> elements in widgets-config.xml.Note: Use this command with caution, it can delete a lot of data for many widgets. Backup your databases before running.widgetDefId is a string and must be enclosed in double quotation marks (").For example:
wsadmin>CommunitiesService.removeWidgetsByWidgetDefIdForAllComm("Blog")
- CommunitiesService.removeAllWidgetsByWidgetDefId(String communityUuid, String widgetDefId)
-
Allows you to remove all instances of the specified widget from the specified community. widgetDefId corresponds to the defId attribute on <widgetDef> elements in widgets-config.xml.
Both communityUuid and widgetDefId must be enclosed in double quotation marks (").
For example:wsadmin>CommunitiesService.removeAllWidgetsByWidgetDefId("c9042339-0019-48da-9df4-de9885665daa","Library")