Sun Java System Portal Server 7 Developer Sample Guide

Customizing Discussions Channel

ProcedureTo Display Additional Fields in the List View of Discussions

Steps
  1. Change directories to PortalServer-DataDir/portals/portal-ID/desktop/default/DiscussionProvider.

  2. Modify query.jsp file and add xxx field to viewAttributes.

    For example, add content-length as follows:


    <search:setViewAttributes viewAttributes= "url,title,description,rd-rating,author,last-modified,rd-last-changed,rd-reference-id, rd-num-rating,rd-sum-rating,rd-peak-rating,rd-reference-url,htmldesc,content-length"/>
  3. Add the new fields in fullDiscussionDisplay.jsp file wherever appropriate.

    For example:


    <search:getValue soifAttribute="content-length"/>

To Modify the Sort Order in List All Discussions Page

By default, discussions are sorted by the last-modified date/time. That is, discussions are displayed in a descending order with the latest or most recent discussion shown first.

To modify the sort order in list All Discussions page, modify the viewOrder property in fullDiscussion.jsp file. For example, you can reset the value below to author or rd-last-changed:


<jx:set var="viewOrder" value="-last-modified"/>

To Modify viewHits in View Discussion Page


<jx:set var="hitNumber" value="500"/>

By default, the viewHits property is set to 500. Make this -1 if you want all the comments to be displayed or reduce this number to improve performance. For example, if the value is 200, only the first 200 comments will be displayed in this case (includes comments and sub-comments.) The hitNumber for view discussion page can be reset in the viewDiscussion.jsp file.

ProcedureTo Inherit Classification and readACL

If you have classified only the parent discussion manually or modified the access control for the parent discussion, you may want to inherit those values in discussion replies as follows:

Steps
  1. Change directories to PortalServer-DataDir/portals/portal-ID/desktop/default/DiscussionProvider.

  2. Edit feedbackProcess.jsp file and modify the values of inheritClassification and inheritReadACL.

    By default, these are set to false. Reset them to true if you want comments to inherit the parent’s classification field and readACL field. Note that comments are automatically protected in this case.

  3. Save the file.

ProcedureTo Control Access to Discussions

This can be accomplished by one of the following two ways:

Steps
  1. Modify the dbname property in the display profile for Discussions and DiscussionLite channel for each role to point to a different database.

    In this case users in one role cannot view discussions created by users in a different role.

  2. Or modify the ReadACL of the parent discussion as it gets submitted in the database and set inheritReadACL to true.

    That is, you must search for the discussion first or search for rd-reference-id <contains> ROOT and modify the readACL field for discussions.