October 2008 Archives

Fully Disable Search in ALUI Collab 4.5

| | Comments (2)
I'm working with a Collab deployment where we want to disable the search feature. This involves two things: disabling index requests from Collab to the Search Server and removing the search form from Collab's web UI.

Disabling Index Requests from Collab to Search

The easy part is disabling index requests from Collab to the Search Server. Just open %ALUI_HOME%\ptcollab\4.5\settings\config\config.xml and change the value for "search enabled" from "yes" to "no."

Removing Search from Project Explorer UI

For whatever reason, the Project Explorer view of Collab shows a search form even when the app is configured to not have its content index. This is shown below:

collab.projexp.search.before.jpg

















The only way I know of to remove the form is to modify the JSP files within collab.war. The process for modifying collab.war is:

  1. Open %ALUI_HOME%\ptcollab\4.5\webapp
  2. Backup webapp.war to webapp.war.orig
  3. Create a new subdirectory called build
  4. Extract collab.war into a new directory at %ALUI_HOME%\ptcollab\4.5\webapp\build
  5. Make the appropriate edits (described below)
  6. Package up the contents of %ALUI_HOME%\ptcollab\4.5\webapp\build
  7. Stop Collab
  8. Replace the old collab.war with the new one
  9. Start Collab
In the case you want to remove the search UI, as in this case, make the following edits:

  1. Open %ALUI_HOME%\ptcollab\4.5\webapp\war\project\appView\projectToolbar.jsp
  2. Comment out these lines:

        <jsc:toolbarHtmlBlock align="right"><nobr>
            <fmt:message key="project.search"/>
            <input type="text" id="searchText" class="formInputBoxText" align="center"/>
            <select id="searchScope" class="objectText" width="0%">
                <option value="all"><fmt:message key="project.search.scope.all.folders"/></option>
                <option value="current"><fmt:message key="project.search.scope.current.folder"/></option>
            </select>&nbsp;
        </jsc:toolbarHtmlBlock>
        <jsc:toolbarHtmlBlock align="right"><nobr>
            <collab:img src="search.gif" border="0" align="center" onclick="searchHandler()"/></nobr>
        </jsc:toolbarHtmlBlock>

  3. Open %ALUI_HOME%\ptcollab\4.5\webapp\war\layout\templates\appViewSearchBar.jsp
  4. Comment out these lines:

        <input type="hidden" name="projID" value="${fn:escapeXml(baseAppViewBean.currentProject.ID)}">
        <input type="hidden" name="isAppView" value ="true">
        <input type="hidden" name="projRestr" value ="1">
        <input type="hidden" name="collabType" value ="<%=com.plumtree.collaboration.cssearch.CollabIndexManager.OBJECT_TYPE_ALL%>">
            <td class="banText" align="${fn:escapeXml(tdAlign)}" width="50%" nowrap style="padding-right:5">
                <b><fmt:message key="project.search.label"/></b>
                <input size="32" name="searchString" value="" class="formInputBoxText">
                <collab:simpleUI>
                    <input type="submit" name="go" value="<fmt:message key="key.search"/>" class="formBtnText">
                </collab:simpleUI>
                <collab:notSimpleUI>
                <a href="#" onClick="document.searchForm.submit();"><collab:img src="search.gif" border="0" align="absmiddle" altKey="key.search"/></a>
                <a href="${fn:escapeXml(advancedSearchURL)}"><collab:img src="advancedSearch.gif" border="0" align="absmiddle" altKey="search.advanced"/></a>&nbsp;
                <input type="button" name="closeWindow" value="<bean:message key="button.close"/>" onClick="window.close()" class="formEditorBtnText">
                </collab:notSimpleUI>
            </td>

            <collab:simpleUI>
                <td class="banText" align="right">
                    <tiles:insert attribute="help"/>
                </td>
            </collab:simpleUI>


  5. Add the following lines in the place of what was just commented out:

    <td class="banText" align="${fn:escapeXml(tdAlign)}" width="50%" nowrap style="padding-right:5">
    <input type="button" name="closeWindow" value="<bean:message key="button.close"/>" onClick="window.close()" class="formEditorBtnText">
    </td>


  6. Save the files


The edits remove the undesired UI component from each project's individual view and the Project Explorer view, this latter being shown here:

collab.projexp.search.after.jpg

















By the way, these steps are a little tedious if you will need to tweak your customizations as you try to get it right. After setting up the directories and unzipping the original collab.war, I wrap the remaining steps in a script that lets me quickly run my iterations. That script's contents:

net stop "BEA ALI Collaboration"
c:
cd c:\bea\alui\ptcollab\4.5\webapp\build
zip -r collab.war *
mv -f collab.war ..\.
net start "BEA ALI Collaboration"


Note that I'm using command line tools "mv" and "zip" that come from the Unxutils project, a collection of Windows ports of Unix utilities.

That's it. Enjoy!


I spend a lot of time in web-based email systems, and I've lost way too many email messages to a timed-out session. If I'm writing something both important and complicated, then I often am still composing after my session times out. Then when I click send? I get an error message.

webmail_error.jpg

























Today though I realized that since the content of my message is still in my browser and resubmitted every time I refresh that error page, I can actually retrieve it. In Firefox, I have a HTTP header monitor called TamperData that shows me my headers, including the POST section from my web-based emails. In MSIE, I would use Fiddler, though I've not tested this exact use case there. In any case, I can indeed retrieve the message.

webmail_header.jpg















The next problem though is the message is encoded with plus+signs+between+the+words and without line breaks separating paragraphs. I realized I could write some simple Javascript to decode the message properly. You may want to do the same thing. I'll put the code here for you to read/take, and I'll also put the form here for my use and yours.

Enjoy.

<script>
function getit(sin) {
mystr=unescape(sin)
mystr=mystr.replace(/\+/g," ")
document.myform.theoutput.value=mystr
}
</script>
<form name=myform>
<hr><b>Enter your encoded message:</b><br>
<textarea rows=4 cols=80 name=theinput></textarea>
<br>
<input type=button value="Decode it!"onclick=getit(theinput.value)>
<br>
<textarea rows=20 cols=80 name=theoutput></textarea>
</form>
 

Enter your encoded message: