+

Search Tips   |   Advanced Search

Filtering content for tagging

Use filtering mechanisms to control which terms users can use and which terms they cannot use as tags. The portal provides both a blacklist and a whitelist filter.

You enable and disable both filters in the WAS console under the Resource Environment Provider > CPConfigService for tagging and rating. For details see the topics about Set service configuration properties and the CP Configuration Service for tagging and rating.

    Blacklist filter

    The blacklist filter allows us to block selected terms from being used as tags, for example terms that could be perceived as offensive. If we enable the blacklist filter, the portal checks every term that users type as a tag before it is eventually applied and stored. If a user types a term listed on the blacklist, the portal blocks this tag and responds with a message. We can determine the terms that to be on the blacklist using xmlaccess.sh.

    To enable the blacklist filter, the following configuration property in the CP Configuration Service to true:

      com.ibm.wps.cp.filter.tagging.blacklist = true

    Whitelist filter

    The whitelist filter allows us to limit the set of tags that users can apply. If we enable the whitelist filter, the portal checks every term that users type as a tag against the whitelist before it eventually applies and stores it. If a user types a term that is not listed on the whitelist, the portal blocks this tag and responds with a message. We can set the terms that to be on the whitelist using xmlaccess.sh.

    To enable the whitelist filter, add at least one entry to the whitelist filter database and set the following configuration property in the CP Configuration Service to true:

      com.ibm.wps.cp.filter.tagging.whitelist = true

    The portal applies the filter only if you activate it and add at least one entry to the whitelist filter database.

We can configure both filter lists using xmlaccess.sh. The following examples show how to add or remove terms to the blacklist. To work with the whitelist, adapt the examples by changing the ID of the filter from DefaultBlacklistFilter to DefaultWhitelist Filter . Sample scripts for the XML configuration interface are located under the directory PORTAL_HOME/doc/xml-samples .

Example: Create new words to the blacklist filter:

<request
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="PortalConfig_8.5.0.xsd"
    type="update" create-oids="true">
    <!-- sample for creating a filter with some sample entries -->
    <portal action="locate">
        <filter-instance action="update" id="DefaultBlacklistFilter">
            <filter-data value="badword_1" action="update"/>
            <filter-data value="badword_2" action="update"/>  </filter-instance>
    </portal>
</request>
This sample snippet registers the two words badword_1 and badword_2 with the blacklist filter for all locales. Note that specify DefaultBlacklistFilter for the attribute id of the tag filter. We can optionally specify the attribute locale for the tag filter data. After running this XML script, users will not be able to use badword_1 or badword_2 as tags.

Example: Create or delete individual words:

<request
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="PortalConfig_8.5.0.xsd"
    type="update" create-oids="true">
    <!-- sample for creating a filter with some sample entries -->
    <portal action="locate">
        <filter-instance action="update" id="DefaultBlacklistFilter">
            <filter-data value="badword_1" update="delete"/>
            <filter-data value="badword_3" update="update"/>
        </filter-instance
    </portal>
</request>
This sample snippet removes the term badword_1 and adds badword_3 from the blacklist.

Example: Deleting all terms from the blacklist filter:

<request
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="PortalConfig_8.5.0.xsd"
    type="update" create-oids="true">
    <!-- sample for deleting a whole filter -->
    <portal action="locate">
        <filter-instance action="delete" id="DefaultBlacklistFilter">
        </filter-instance>
    </portal>
</request>
This sample snippet deletes all terms from the blacklist.


Parent How tagging and rating works in the portal

Related tasks:

Set service configuration properties

Related reference:

CP Configuration Service for tagging and rating


Related information


Work with xmlaccess.sh