+

Search Tips   |   Advanced Search

Registering a new content source with a ConfigEngine task


We can register a new content source as a new category in the site toolbar using the webdav-modify-file configuration task.

The site toolbar displays content sources by category. When we add a category to the site toolbar, specify a new category array element in the addContent.json and addContent_wcm.json files stored in WebDAV at dav/fs-type1/themes/Portal8.0/system/. The webdav-modify-file task provides a way to update the JSON files without directly editing them.

In this procedure, we define a category called Sample Category. In the site toolbar, the Sample Category displays all portlets that have been tagged with SampleCategoryTag. We can use xmlaccess.sh to add tags to installed portlets. For the complete format of the array element used to define a new category in the JSON files, refer to Add a custom content source.

  1. Create a text file containing a regular expression to search and replace text.

    Example contents of file myRegex.txt:

    }\s*]\s*}
    

  2. Create a text file containing the replacement text that will define the new content source.

    Example contents of file myReplacement.txt:

    }, {
    "label":"Sample Category", 
    "searchStr":"Search sample category with tags", 
    "datastore":"com.ibm.pb.data.TaggedItemStore", 
    "url":ibmPortalConfig.contentHandlerURI + "rm/empty?tmparam=tm%3aname%3aSampleCategoryTag", 
    "renderers": []
    }
    ]
    }
    

  3. Run the webdav-modify-file

    When specifying path information, use forward slashes (/) instead of back slashes, regardless of the native operating system path format.

      ./ConfigEngine.sh webdav-modify-file -DTargetURI=dav:fs-type1/themes/Portal8.0/system/addContent_wcm.json -DRegexpFile=path_to_myRegex.txt -DReplaceWithFileContent=path_to_myReplacement.txt -DWasPassword=foo -DPortalAdminPwd=foo


Parent: Customize the site toolbar