Sun Java System Portal Server 7 Developer Sample Guide

Customizing the Discussion Channels

This section contains the following:

Customizing DiscussionLite Channel

This section contains the following:

ProcedureTo Customize the DiscussionLite Channel Link Display Window

Steps
  1. Change directory to PortalServer-DataDir/portals/portal-ID/desktop/default/DiscussionLite directory and edit the following JSP files.

    • display.jsp - In this file, comment out or delete the following line:


      <a href="<%=desktopPathInfo%>?last=false&Discussions_dmode=vl&did=<%=Encoder.urlEncode(url)%>"><B><search:getValue soifAttribute="title" escape="true" truncate="28"/></B></a>
    • discussionLiteContent.jsp - In this file, comment out or delete the following lines. :


      Map pathInfo = new HashMap();
      pathInfo.put("action", "content");
      pathInfo.put("provider", "JSPDynamicSingleContainer");
      pathInfo.put("JSPDynamicSingleContainer.selectedChannel", "Discussions");
      pathInfo.put("last", "false");
      pageContext.setAttribute("pathInfo", pathInfo);
      <dtpc:getDesktopURL id="desktopPathInfo" pathinfo="$pathInfo"/>
  2. Replace all occurrences of desktopPathInfo with dt.

    The desktopPathInfo ensures that links are always displayed in the Discussions channel in a JSPDynamicSingleContainer. Remove this if you want links to be displayed in the Discussions Channels on the same tab. For example, replace the following line:


    <td align=center><font size="-1"><a target="ps_main" href="<%=desktopPathInfo%>?Discussions_dmode=cmt">New Discussion</a></font>

    with the following:


    <td align=center><font size="-1"><a target="ps_main" href="dt?Discussions_dmode=cmt">New Discussion</a></font>

    This procedure will work only if Discussions and DiscussionLite are displayed on the same tab as in the sample portal. DiscussionLite links will be displayed in the Discussions channel on the right side on the collaboration tab.

ProcedureTo Display DiscussionLite on the Front tab

Steps
  1. Modify MyFrontPageTabContainer and add DiscussionLite to the available and selected lists. For example:

    In the Portal Server management console, use the online help to display the DiscussionLite channel on the desktop.

  2. Modify the DiscussionLite channel display profile isEditable property and set it to true.

  3. Log in and verify.

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.