Pages

Monday, October 19, 2009

Lotus Connections Communities: Enable "Suscribe to ..." as default and hide it

The customer I work for, wants that for all Forum entries a notification is sent as default and the user should not have the possibility to disable this. Though I don't think, this is a good idea but anyway, here is the description how to do this.


The following changes have then been applied to tick the notifications checkboxed by default and hide them in the Web UI:


  1. Edit
    Communities.ear/comm.web.war/WEB-INF/forum/views/topicThread.jsp

  2. Locate:
    <div id="contentArea" class="lotusLimit">
    <c:if test="${not topic.deleted}">
    <div id="forum" class="lotusForum">
    <div class="lotusMessage lotusHidden"></div>
    <c:if test='${canSubscribe}'>

  3. set the body content of the innermost tag (c:if) to
    <div class="lotusRight" style="display:none;"> 
    <input id="${subscribeCheckId}" type="checkbox" checked="checked"/>
    <label for="${subscribeCheckId}"><fmt:message key="label.forum.notify" /></label>
    </div>

  4. Edit
    Communities.ear/comm.web.war/javascript/build/dojo/communities.js

  5. Locate
    <td><input name=\"subscribe\" dojoAttachPoint=\"subscribeNode\" type=\"checkbox\" id=\"${id}_subscribe\" value=\"true\" ${checkedAttr} />

  6. Change to
    <td style="display:none"><input name=\"subscribe\" dojoAttachPoint=\"subscribeNode\" type=\"checkbox\" id=\"${id}_subscribe\" value=\"true\" checked=\"checked\" />


Important: the changes applied to both files are not recommended as they are no official and supported customization option for Lotus Connections!


At first the customer did this by themselves, but they did not hide (display:none) the elements, but removed the first one (in jsp) entirely from the file, without documenting which files have been changed and what was changed. DONT TRY THIS AT HOME!


Always:


  1. Create a backup of the files you change

  2. Document which file you change

  3. Document what you change

  4. Avoid modifying the HTML structure by REMOVING elements. Try to hide them instead, either by CSS-Stylesheet (best), style-element (ok) or javascript (last option)