Search DominoPower's 11,433 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
Great scripts for discussion forums (continued)

Mapping discussion threads
Earlier attempts at developing thread maps fail with large views because of return value size limitations. To get around this limitation, I created a WebQueryOpen agent that builds the thread map dynamically. This agent relies on a view sorted by the unique ID of the parent document of the discussion.

The agent builds the thread map by first getting the unique ID of the document the user is opening and then getting the parent document of the discussion based on that ID. The agent then loops through all the documents with the same parent document unique ID. The first step in the loop is to determine if the document being evaluated is the document being opened by the user. If so, a small arrow icon is added to the line to indicate where the user is in the discussion. Finally, the agent tests the form of the document being added to the thread map and generates the appropriate HTML based on that form's fields.

Users can view the documents in the discussion from two views, one where the user can add comments and another for read-only purposes. So, before we actually begin the loop to create the thread map, the agent parses the HTTP Query_String field to determine the referring view. Once we determine the view, the agent then places the appropriate JavaScript code to load the correct navigation document in the navigation frame, mentioned earlier.

Print a discussion
In one project, my client required a printable version of any thread in the discussion. These printable versions, similar to DominoPower's EasyPrint feature, are simply plain text, no graphics, and the most basic HTML versions of the same information. To do this, I created a simple form where the user selects the parent document of a particular thread. Then a QuerySaveAgent does the real work.

After declaring all the variables, the agent builds a document collection based on the value the user selected from the form. Then, the agent checks the HTTP_User_Agent field to determine the user's browser. This allows the agent to generate the appropriate JavaScript code.

If ((Left(pDoc.HTTP_User_Agent(0),9) = "Mozilla/4") And (Not (pDoc.HTTP_User_Agent(0) Like "*MSIE*") )) Then
Print {<A HREF="javascript:window.print()">Print</A>
}
Else
Print "Click FILE - PRINT to print this page.
"
End If

Then the agent begins a loop through the document collection. This loop generates the HTML for the entire thread of the discussion. To get around the problem of hard returns in the body field, the agent uses the Evaluate command, as shown in this code chunk:

eval = Evaluate(|@ReplaceSubstring( Body; @Char(13) ; "
" )|, doc)
Print eval(0) & "<P>"

The agent also adds the author and creation date.

Search, keyword, and category
My client also required very specific search functionality and formatting of search results. These requirements could not be met using the existing search solutions provided with Domino. The solution here uses two forms, one sub-form, two QuerySaveAgents and a script library. The main search form contains two HTML <FORM> tags. One offers the user the ability to do a general text search. The second allows the user to choose specific field values through a drop down list and search based on those values.


« Previous  ·  1  ·  2  ·  3  ·  4  ·  Next »
Other articles you might like
Home > Internet Technologies > JavaScript (13 articles)
   Sorting your Domino views with JavaScript
   Give your Domino views life with DHTML
   Using dynamically generated HTML to thwart spam email address harvesting
Home > Social Computing (25 articles)
   Integrating Twitter with an IBM internal social network
   Fun with Sametime and Skype
   More thoughts on social computing and Lotus
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Remember Young Admins...there are 2 files
WebSphere Portal 6.1.0.2 and Lotus Domino 8.5
The CKEditor - with Domino
How not to crash in LotusScript
IBM Lotus to Google Apps Migration Remorse
Webcast Series: Mobile Collaboration with Lotus Software
Domino Login Control for Mobile Apps
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- Advertisement --

Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.

Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.

Learn how to easily clean up your address book.

-- Advertisement --

Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
  • Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
  • User friendly aproach, using a point and click access to features
  • Reports from any Lotus Notes databases
  • Runs reports through a Notes client, web browser and scheduled basis
  • Allows use of LotusScript for advanced data manipulation
  • Enables self service reporting capabilities to end-users


Learn more at www.integra4notes.com.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login