Manage Learn to apply best practices and optimize your operations.

Thread On A Page (Web)

This agent is designed to be run by web clients clicking on a link in the
standard discussion database, it works in rel 4.6 & 5 & possibly 4.5. The
function is to display the main topic & any responses on one web page - no more
jumping around the thread map!
Call the agent 'ThreadPage', make it shared, run manually from the action menu
& 'run once (@commands used)'. Main Topic form has a field called MainID with
the formula:

Response forms have the same field but inherit from their topic.

Create a link to the agent with an action hotspot with this formula:

db := @ReplaceSubstring(@Subset(@DbName; -1);"\\":" ";"/":"+");
@URLOpen( "/" + db + "/ThreadPage?OpenAgent&unid%" + MainID )

'ThreadPage options

Option Public
Option Declare

'ThreadPage declarations

%INCLUDE "lserr.lss"

' Version 1.1 March 1999
' Updates v 1.0 May 1998 by adding a 'respond' link to each message in the
' Uses authors name field FROM & Topic field CATEGORIES

Public Const View$ = "($All)"

Public Const H1On$ = {&LTstrong>&LTFONT SIZE=3 COLOR="008080" FACE="Times Roman">}
Public Const HTOn$ = {&LTstrong>&LTFONT SIZE=2 COLOR="008080" FACE="Times Roman">}
Public Const HOff$ = "</FONT></strong>"
Public Const nbspc$ =
"             &
nbsp;            &nb
sp;        "

Public Const StatusBarConf$ = { ONMOUSEOVER="window.status='Go back to the
conference'; return true" }
Public Const StatusBarMesg$ = { ONMOUSEOVER="window.status='Go to this
message'; return true" }
Public Const StatusBarResp$ = { ONMOUSEOVER="window.status='Respond to this
message'; return true" }
Public Const StatusBarHelp$ = { ONMOUSEOVER="window.status='Go to the
conference Help page'; return true" }
Public Const StatusBarTop$ = { ONMOUSEOVER="window.status='Go to the start of
this page'; return true" }
Public Const StatusBarBtm$ = { ONMOUSEOVER="window.status='Go to the end of
this page'; return true" }

Sub Initialize
' displays a main topic and all its responses as html text in one page, agent
run on demand by web clients
' use a different view if topics are in MORE THAN ONE category or in NONE at all
Dim session As New NotesSession
Dim db As NotesDatabase
Dim hview As NotesView
Dim doc As NotesDocument, nextdoc As NotesDocument
Dim unid As String*32, dbFile As String

' On Error Goto Errhandle

Set db = session.CURRENTDATABASE
dbFile = dbfilepath(db)
Set hview = db.GETVIEW( View$ ) ' a constant, By Category - topics are in
only one category!
Set doc = session.DOCUMENTCONTEXT
unid = Mid$( doc.Query_String(0), Instr( 1, doc.Query_String(0), "unid%" )
+5 )

While Not ( doc Is Nothing )
If ( doc.IsResponse) Then
Set doc = hview.GETNEXTDOCUMENT( doc ) ' for the first topic in
next category
Else ' a Main Topic
If ( unid = doc.UNIVERSALID ) Then ' the start of the thread we
' would be good to be able to use the BODY BACKGROUND tag &
META information here
Print {<!-- Copyright & All rights reserved.
'Thread-on-a-page' version 1.1 March 1999, Author: Mark Bryson, Lancaster
University -->}
linksmenu dbFile, hview.NAME, db.TITLE, "Bottom" '
parameters used as header & footer
StatusMsg ( "Theme: " & doc.categories(0) )
ExtractThread hview, doc, 0, dbFile ' pass object by
reference, recurse to all responses
linksmenu dbFile, hview.NAME, db.TITLE, "Top"
Exit Sub
Else ' last doc was the wrong Main Topic, go direct to next main
Set nextdoc = hview.GETNEXTSIBLING( doc ) ' cant set doc as
loop may end too soon
If nextdoc Is Nothing Then ' end of View or Category
Set doc = hview.GETNEXTDOCUMENT( doc ) ' skip to next
category if present
Set doc = nextdoc
End If
End If

Dig Deeper on Domino Resources - Part 6

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...