'Create RSS Feed:
Option Public
Option Explicit
Sub Initialize
'** Create an RSS feed containing the Lotusphere sessions.
'** If you've marked any sessions with a primary or alternate
'** interest (in the "Session Interest" view, you can also choose
'** to just export the sessions that you (or someone else) is
'** interested in.
'** This contains almost all the session-related information in each
'** entry, so if you dump all the sessions you'll have a pretty
'** "heavyweight" feed. Just so you know...
On Error Goto processError
Dim categoryViewName As String
categoryViewName = "Session Interest\By Day and Time"
'** figure out which category to export (if there's more than one)
Dim workspace As New NotesUIWorkspace
Dim catList As Variant
Dim category As String
Dim dbColumn As String
dbColumn = |@Unique(@DbColumn(""; ""; "| & ReplaceSubstring(categoryViewName, "\", "\\") & |"; 1))|
catList = Evaluate( dbColumn )
If (Ubound(catList) > 0) Then
category = workspace.Prompt(PROMPT_OKCANCELLIST, "Choose A Category", _
"Please choose the category of sessions you would like to export to RSS:", _
catList(Ubound(catList)), catList)
Else
category = catList(0)
End If
If (category = "") Then
Exit Sub
End If
'** prompt for a file name
Dim fileName As String
Dim fileNum As Integer
Dim fileArray As Variant
fileArray = workspace.SaveFileDialog(False, "Export File Name", "RSS Files|*.rss", "", "LSSessions.rss")
If Isempty(fileArray) Then
Exit Sub
Else
fileName = fileArray(0)
End If
'** open the categorized view and the file, and start exporting
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim view As NotesView
Dim crlf As String
Dim desc As String
Dim speakers As Variant
Dim dateTime As String
Dim lastDateTime As String
Dim gotItems As Integer
Set db = session.CurrentDatabase
Set view = db.GetView(categoryViewName)
Set doc = view.GetDocumentByKey(category)
crlf = Chr(13) & Chr(10)
lastDateTime = "This is a bogus value"
fileNum = Freefile()
Open fileName For Output As fileNum
Print #fileNum, GetRSSHeader("Lotusphere Sessions: " & category)
'** here's a little trick to figure out when we've hit the next category
Dim nextCatDoc As NotesDocument
Dim idx As Variant
idx = Arraygetindex(catList, category)
If (idx < Ubound(catList)) Then
Set nextCatDoc = view.GetDocumentByKey(catList(idx+1))
End If
Do Until (doc Is nextCatDoc)
speakers = Evaluate(|@Implode(Speaker; ", ")|, doc)
desc = "" & doc.SessionTitle(0) & "
" & crlf & _
"Speaker: " & speakers(0) & "
" & crlf & _
doc.SessionID(0) & " - " & doc.SessionDate(0) & " " & doc.SessionTime(0) & "
" & crlf & _ "
" & doc.SessionAbstract(0) & "
" & crlf '** hack to make < and > references work in many feedreaders desc = ReplaceSubstring(desc, "<", "<") desc = ReplaceSubstring(desc, ">", ">") '** we're going to cram all the sessions for a common day and time into one entry, '** to try to keep things under control dateTime = GetDateTime(doc) If (dateTime = lastDateTime) Then '** same as before, so just append the description Print #fileNum, "
at the start of the CDATA block for stupid newsreaders that don't recognize
'** CDATA blocks
Print #fileNum, "