Genii Weblog

What have you missed (if you haven't replicated the Sessions db recently)?

Wed 16 Jan 2008, 08:49 AM



by Ben Langhinrichs
If you have downloaded this year's Lotusphere Sessions db earlier, but have not replicated recently with The Turtle Partnership public replica, here are a few tidbits you might have missed...

  • Ed Brill is no longer facilitating at the BOF301 The Lotus Blogging Community (web link), but the public website doesn't list his replacement, and neither does Lotusphere On-Line.  To find out who is taking his place, you need to replicate and see from our Sessions database, or read Ed's blog.
  • When are the lunch breaks at Lotusphere this year?  The public agenda lists them, but Lotusphere On-line doesn't make it easy to find out.  But they are listed in the sessions database if you replicate.
  • Want to know more about Lotusphere Idol?  You can search in vain on the public website, or you can dig around and find out when the auditions are on Lotusphere On-Line, but if you want to find out when the presentation itself is, you have to search the blogoshere... or just look in the sessions database at FUN108 Lotusphere IDOL Presentation and see the time and place included with the other sessions.
  • Finally, are you wondering what your fellow attendees are wondering?  Look in the Questions/Ideas view and see what people are asking about sessions you might want to attend.  Maybe you have those same questions?  Maybe you have others?  Now is the time to participate, but only if you replicate.
  • Are you a speaker?  Did you know that you can now answer or respond to questions/ideas (actually, anybody can - imagine, discussions in Notes!)?  You have to replicate first to see them.

Commercial over.

Copyright © 2008 Genii Software Ltd.

What has been said:


659.1. Lars Berntrop-Bos
(01/17/2008 04:27 AM)

Some sessions mis the items BeginTime and EndTime needed for the copy to calender.

Fix:

Sub Initialize

' Steve Davis

' eWorld Enterprise Solutions

' December 7, 2007

' fixes: Lars Berntrop-Bos, 17-01-2007

' Declare our variables

Dim s As New NotesSession

Dim dbMail As NotesDatabase

Dim dbCurrent As NotesDatabase

Dim dcSelected As NotesDocumentCollection

Dim docSession As NotesDocument

Dim docCalendar As NotesDocument

Dim itmTemp As NotesItem

Dim dtStart As NotesDateTime

Dim dtEnd As NotesDateTime

Dim itmStartDate As NotesItem

Dim itmStartTime As NotesItem

Dim itmStartDateTime As NotesItem

Dim itmEndDate As NotesItem

Dim itmEndTime As NotesItem

Dim itmEndDateTime As NotesItem

Dim itmCalendarDateTime As NotesItem

Dim mustParseDates As Boolean

Dim sessStart As String

Dim sessEnd As String

Dim sessDay As Integer

Dim sessTime As String

Dim adjustZone As Integer

' Set our base variables

Set dbCurrent = s.CurrentDatabase

Set dcSelected = dbCurrent.UnprocessedDocuments

' Set the mail file

Set dbMail = New NotesDatabase("", "")

Call dbMail.OpenMail

' Get the first selected document

Set docSession = dcSelected.GetFirstDocument

Do Until docSession Is Nothing

' Set start and end times

mustParseDates = False

Set itmTemp = docSession.GetFirstItem("BeginTime")

If itmtemp Is Nothing Then

mustParseDates = True

Elseif itmTemp.Type = 1024 Then

Set dtStart = itmTemp.DateTimeValue

Else

mustParseDates = True

End If

Set itmTemp = docSession.GetFirstItem("EndTime")

If itmtemp Is Nothing Then

mustParseDates = True

Elseif itmTemp.Type = 1024 Then

Set dtEnd = itmTemp.DateTimeValue

Else

mustParseDates = True

End If

If mustParsedates Then

Select Case Lcase(Cstr(docsession.GetItemValue("SessionDate")(0)))

Case "sunday"

sessDay = 20

Case "monday"

sessDay = 21

Case "tuesday"

sessDay = 22

Case "wednesday"

sessDay = 23

Case "thursday"

sessDay = 24

Case Else

Msgbox "Skipping: Invalid date encountered in document with noteId: " & docSession.NoteID

Goto NextDoc

End Select

sessTime = Cstr(docSession.GetItemValue("SessionTime")(0))

If sessTime Like "#:##[ap]m [-] 1#:##[ap]m" Or _

sessTime Like "1#:##[ap]m [-] #:##[ap]m" Or _

sessTime Like "#:##[ap]m [-] #:##[ap]m" Or _

sessTime Like "1#:##[ap]m [-] 1#:##[ap]m" Then

Else

Msgbox "Skipping: No valid SessionTime to parse time from in document with noteId: " & docSession.NoteID

Goto NextDoc

End If

sessStart = Strleft(sessTime, " - ")

sessEnd = Strright(sessTime, " - ")

Set dtStart = New NotesDateTime(Now)

Set dtEnd = New NotesDateTime(Now)

adjustZone = dtEnd.TimeZone

dtStart.localTime = Datenumber(2008, 1, sessDay) + _

Timenumber(parseHours(sessStart), Left$(Strright(sessStart, ":"), 2), 0)

dtStart.ConvertToZone 5, False

dtStart.AdjustHour(dtStart.TimeZone - adjustZone)

dtEnd.LocalTime = Datenumber(2008, 1, sessDay) + _

Timenumber(parseHours(sessEnd), Left$(Strright(sessEnd, ":"), 2), 0)

dtEnd.ConvertToZone 5, False

dtEnd.AdjustHour(dtEnd.TimeZone - adjustZone)

End If

' Create calendar document

Set docCalendar = dbMail.CreateDocument

' Set calendar fields

With docCalendar

.Form = "Appointment"

.Chair = s.UserName

.AltChair = s.UserName

.Principal = s.UserName

.Subject = docSession.SessionTitle

.Location = docSession.SessionLocation

.AppointmentType = "0"

.Categories = "Lotusphere 2008"

.StartTimeZone = "Z=5$DO=1$DL=3 2 1 11 1 1$ZX=29$ZN=Eastern"

.EndTimeZone = "Z=5$DO=1$DL=3 2 1 11 1 1$ZX=29$ZN=Eastern"

.ExcludeFromView = Split("D~S", "~")

End With

' Set Calendar Times

Set itmStartDate = New NotesItem(docCalendar, "StartDate", "")

Set itmStartDate.DateTimeValue = GetDateOnly(dtStart)

itmStartDate.IsSummary = True

Set itmStartTime = New NotesItem(docCalendar, "StartTime", "")

Set itmStartTime.DateTimeValue = GetTimeOnly(dtStart)

itmStartTime.IsSummary = True

Set itmStartDateTime = New NotesItem(docCalendar, "StartDateTime", "")

Set itmStartDateTime.DateTimeValue = dtStart

itmStartDateTime.IsSummary = True

Set itmEndDate = New NotesItem(docCalendar, "EndDate", "")

Set itmEndDate.DateTimeValue = GetDateOnly(dtEnd)

itmEndDate.IsSummary = True

Set itmEndTime = New NotesItem(docCalendar, "EndTime", "")

Set itmEndTime.DateTimeValue = GetTimeOnly(dtEnd)

itmEndTime.IsSummary = True

Set itmEndDateTime = New NotesItem(docCalendar, "EndDateTime", "")

Set itmEndDateTime.DateTimeValue = dtEnd

itmEndDateTime.IsSummary = True

Set itmCalendarDateTime = New NotesItem(docCalendar, "CalendarDateTime", "")

Set itmCalendarDateTime.DateTimeValue = dtStart

itmCalendarDateTime.IsSummary = True

' Other fields

Call docCalendar.ReplaceItemValue("$BusyName", s.UserName)

Call docCalendar.ReplaceItemValue("$BusyPriority", "1")

Call docCalendar.ReplaceItemValue("$CSVersion", "2")

Call docCalendar.ReplaceItemValue("$NoPurge", dtEnd)

Call docCalendar.ReplaceItemValue("_ViewIcon", 160)

Call docCalendar.ReplaceItemValue("$CSWISL", Split("$S:1~$L:1~$B:1~$R:1~$E:1~$W:1~$O:1~$M:1", "~"))

' Set body

Set itmTemp = docSession.GetFirstItem("Body")

Call docCalendar.CopyItem(itmTemp, "Body")

Call docCalendar.ComputeWithForm(False, False)

' Save

Call docCalendar.Save(True, False)

' Add ApptUNID after save

docCalendar.ApptUNID = docCalendar.UniversalID

Call docCalendar.Save(True, False)

nextDoc:

Set docSession = dcSelected.GetNextDocument(docSession)

Loop

End Sub


659.2. Ben Langhinrichs
(01/17/2008 04:48 AM)

Replicate now and the sessions should all be fixed. I'll look at your agent fix for addition in the future. Thanks!


659.3. Lars Berntrop-Bos
(01/17/2008 05:58 AM)

Actually, it's the Initialize sub from the Create calendar agent. Lazy and in a hurry...

the changes to the original agent are confined to variale declarations and the stuf between

' Set start and end times

...

...

' Create calendar document

Cheers!


659.4. Lars Berntrop-Bos
(01/17/2008 06:29 AM)

and:

Function parseHours(ampmTime As String) As Integer

Dim h As Integer

h = Val(Strleft(ampmTime, ":"))

If Lcase(Right$(ampmTime, 2)) = "pm" Then h = h + 12

parseHours = h

End Function