Creating a meeting notice in Outlook from the Notes client

Another task in our migration to Outlook as the mail client is creating Outlook calendar entries and meeting notices directly from the Notes client. Fortunately, it’s been two years since I wrote about how to do this in the UI in Notes, so I don’t feel like that was wasted time. I was exciting to solve the problem and… oddly enough, solving this one was fun as well. It helped that creating an iCal entry is far simpler than the gyrations we had to go through to create one in Notes. As noted previously, there  aren’t a whole lot of required values to generate in order to have an ICS file that you can open in the UI as a meeting notice/calendar invite.

BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20170622T211500
DTEND:20170622T221500
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN="Required Person/Company";RSVP=TRUE:mailto:Required_Person@company.com
ATTENDEE;ROLE=OPT-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:mailto:external_person@SecondCompany.com
SUMMARY:2017 Q2 QPR: Agribusiness Competitiveness Enhancement via file
UID:AC1804D765C782CD8525814500073F3720170620T104326
END:VEVENT
END:VCALENDAR

Now, keep in mind that this iCal file is a mere fragment. If you sent that file to someone, they get the same behaviour you get — it thinks they’re the meeting organizer and doesn’t save it to their calendar unless they send the ‘update’. The key parameter we leave off is that we don’t set METHOD, since setting that to PUBLISH or REQUEST proved problematic in the Outlook client. If we leave it off, Outlook will allow us to treat it like a brand new calendar entry we’ve created, except that the send button will say ‘Send Update’.

So, let’s review those values in our fragment…

Objects

First, the calendar and event objects are encapsulated. Nothing fancy there.

BEGIN:VCALENDAR
BEGIN:VEVENT
END:VEVENT
END:VCALENDAR

Meeting times

Then we have our start and end times, formatted with date first (YYYYMMDD) then a separator (T) and then the time (HHMMSS). You can include time zone information, but we’re creating this in Outlook and allowing the UI to finish everything for us. So, if the user wants to change the time zone, they can do that in Outlook.

DTSTART:20170622T211500
DTEND:20170622T221500

Attendees

The one required value for our needs in the attendees is the mailto value. Without that, it won’t know who to send the invite to and it simply ignores any other item in that list.

ATTENDEE;ROLE=CHAIR;PARTSTAT=ACCEPTED;CN="Meeting Chair/Company";RSVP=TRUE:mailto:Meeting_Chair@company.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN="Required Person/Company";RSVP=TRUE:mailto:Required_Person@company.com
ATTENDEE;ROLE=OPT-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:mailto:external_person@SecondCompany.com

ROLE is not required and can be CHAIR, REQ-PARTICIPANT (required participant), OPT-PARTICIPANT (optional participant) or even NON-PARTICIPANT (for FYI only).

PARTSTAT is not required. There are several values for an attendee in a VEVENT for their participant status, but we’re only concerned with two. Either “NEEDS-ACTION” for attendees that we don’t know when we create the meeting notice whether they’ve agreed to attend or “ACCEPTED” which we’d typically only use for the person creating the meeting notice.

CN is, of course, familiar to us as Notes developers, but it applies here to whatever will be displayed as the attendee name. In my experience, Outlook can parse the abbreviated name and display just the attendee’s common name. That might be our Outlook configuration, but I would assume it’s common.

RSVP would be either true or false, indicating whether you want a response from the attendee. In my case, we always want it from the attendees, other than the current user.

Title and description

I got fooled by this one. In my sample ICS files, I thought there was just an odd carriage return, but the DESCRIPTION value is basically the body or details of the event, while the SUMMARY is what appears in the subject line for the meeting.

SUMMARY:2017 Q2 QPR: Agribusiness Competitiveness Enhancement via file

Meeting ID

I’m guessing that Outlook computes the unique meeting ID itself, but in my code, I generate from the Notes document’s unique ID and then, in order to ensure that subsequent meetings concerning the same document get different IDs, I’m appending a creation time-stamp.

UID:AC1804D765C782CD8525814500073F3720170620T104326

So, the agent I wrote that generates the new meeting notice is pretty straight-forward. The getEmailAddress function was described and detailed in a prior blog post and my Utilities script library only provides the logging functions here. Like my mailto agent, this one relies on the creation of a file in the Notes data directory and opening it using a browser.

The agent

First, you can look over the main part of the agent…

%REM
	Agent (Send Calendar Invites)
	Created Jun 20, 2017 by David Navarre/DAI
	Description: This Agent creates a calendar invite, listing participants and optional participants
%END REM
Option Public
Option Declare
Use "Utilities"

Dim session As NotesSession
Sub Initialize
	Dim ws As New NotesUIWorkspace
'	Dim thisdb As NotesDatabase declared in Utilities script library '
	Dim uidoc As NotesUIDocument
	Dim qprdoc As NotesDocument
	Dim history As NotesRichTextItem
	Dim chairName As NotesName
	Dim recipientName As NotesName
	Dim projectName As Variant
	Dim fiscalYearAndQuarter As Variant
	Dim participants As Variant
	Dim participantsOptional As Variant
	Dim subject As String
	Dim answer As Variant
	Dim reason As String
	Dim unid As String
	
	On Error GoTo errorhandler
	
	set session = New NotesSession
	Call StartAgentLogging ( session )

	If ( openAddressBooks () ) Then
		agentLog.Logaction("Address books opened")
	End If

	Set thisdb = session.CurrentDatabase
	Set uidoc = ws.CurrentDocument

	reason = "This will create a meeting invite for you to send to participants."
	If uidoc.Editmode Then
		reason = reason + Chr$(10) + "The QPR will switch to read-only mode."
		reason = reason + Chr$(10) + "If you close and re-open it, you can edit it again."
	End If
	reason = reason + Chr$(10) + "Continue?"
	answer = ws.Prompt ( PROMPT_YESNO, "Continue?", reason )
	If answer = 0 Then
		Exit Sub
	End If	
	
	If uidoc.Editmode Then
		Call uidoc.Save()
		uidoc.Editmode = False
		Set qprDoc = uidoc.Document
		unid = qprDoc.Universalid
		Call uidoc.Close(True)
		Set qprDoc = thisdb.Getdocumentbyunid(unid)
		Set uidoc = ws.Editdocument(False, qprDoc, True)
	Else
		Set qprDoc = uidoc.Document
	End If
		
	Dim fileName As String
	Dim dataDirectoryPath As String
	Dim url As String
	Dim fileNumber As Integer
	
	fileNumber = 1
	
	dataDirectoryPath = session.Getenvironmentstring("Directory", True)
	fileName = dataDirectoryPath & "\QPRInvite.ics"
	
	Open fileName For Output As fileNumber
	
	Print # fileNumber, {BEGIN:VCALENDAR}
	Print # fileNumber, {BEGIN:VEVENT}
	Print # fileNumber, {DTSTART:} & getMeetingTime ( "Start", qprDoc ) '20170620T211500
	Print # fileNumber, {DTEND:}  & getMeetingTime ( "End", qprDoc ) '20170620T221500

	' Chair '
	Set chairName = New NotesName ( session.Effectiveusername )
	' when you send the invite from Outlook, it makes you the chair '
	' this line is here to show how you would format an attendee line for the chair '
	' Print # fileNumber, {ATTENDEE;ROLE=CHAIR;PARTSTAT=ACCEPTED;CN="} & chairName.Abbreviated & {";RSVP=TRUE:mailto:} & getEmailAddress ( chairName.Abbreviated ) '
	' Required participants '
	participants = qprDoc.Getitemvalue ( "Participants" )
	ForAll entry In participants
		Set recipientName = New NotesName ( entry )
		If Not ( chairName.Abbreviated = recipientName.Abbreviated ) Then
			Print # fileNumber, {ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN="} & recipientName.Abbreviated & {";RSVP=TRUE:mailto:} & getEmailAddress ( recipientName.Abbreviated )
		End If
	End ForAll
	' Optional participants '
	participantsOptional = qprDoc.Getitemvalue ( "ParticipantsOptional" )
	ForAll entry In participantsOptional
		Set recipientName = New NotesName ( entry )
		Print # fileNumber, {ATTENDEE;ROLE=OPT-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN="} & recipientName.Abbreviated & {";RSVP=TRUE:mailto:} & getEmailAddress ( recipientName.Abbreviated )
	End ForAll

	projectName = qprDoc.Getitemvalue("ProjectName") 
	fiscalYearAndQuarter = qprDoc.Getitemvalue("FiscalYearAndQuarter") 
	subject = fiscalYearAndQuarter(0) & " QPR: " & projectName (0)
	Print # fileNumber, {DESCRIPTION:} & subject ' this is the body of the message
	Print # fileNumber, {SUMMARY:} & subject ' this is the meeting name

	' assign a unique ID to meeting using the unid of the document with the current date-time appended '
	' in case user creates multiple meetings for the same QPR '
	Print # fileNumber, {UID:} & qprdoc.Universalid & getMeetingTime ( "Now", qprDoc ) 

	Print # fileNumber, {END:VEVENT}
	Print # fileNumber, {END:VCALENDAR}
	
	Close # fileNumber
	
	url = "file:///" & fileName
	Call ws.Urlopen(url)
	
	Set history = qprDoc.Getfirstitem("History")
	Call history.Appendtext(Now & " - Meeting notice created by " & session.Commonusername)
	Call history.Addnewline(1, True)
	Call qprDoc.Replaceitemvalue("NoticeFlag", 1)
	Call qprDoc.Save(True, False)

exiting:
	Exit Sub
errorhandler:' report all errors in a messagebox '
	reason = "Error #" & CStr (Err) & " (" & Error & ") on line " & CStr (Erl)
	MessageBox reason, 16, "Error"
	Call agentLog.LogAction ( reason )
	Resume exiting ' transfers control to the exiting label	
End Sub

getMeetingTime

The getMeetingTime function just returns the requested date-time in the format YYYYMMDDTHHMMSS, so it can be included in the creation of the ICS file.

%REM
	Function getMeetingTime
	Description: This Function returns a string in the format YYYYMMDDTHHMMSS
		If it is the start time, the values from the source document are used 		-- 20170622T211500
		If it is the end time, it is adjusted one hour later					 	-- 20170622T221500
		If it is the "Now" time, it returns a string for the current date and time	-- 20170620T094326
%END REM
Function getMeetingTime ( startOrEnd As String, qprDoc As NotesDocument ) As String
	Dim thisNotesDateTime As NotesDateTime
	Dim qprDate As Variant
	Dim qprTime As Variant
	Dim timeString, dateString As Variant
	Dim reason As String	

	On Error Goto errorhandler

	Set qprDate = qprDoc.Getfirstitem("QPRDate")
	Set qprTime = qprDoc.Getfirstitem("QPRTime")
	dateString = qprDate.Text
	timeString = qprTime.Text
	Set thisNotesDateTime = New NotesDateTime ( dateString & " " & timeString )
	Select Case startOrEnd
		Case "End"
			Call thisNotesDateTime.AdjustHour (1)
		Case "Now"
			Set thisNotesDateTime = New NotesDateTime ( Now )
		Case else	
			' keep thisNotesDateTime as set on the source document '
	End Select
	dateString = thisNotesDateTime.DateOnly
	timeString = thisNotesDateTime.TimeOnly
	getMeetingTime = CStr ( Year ( dateString ) )
	getMeetingTime = getMeetingTime & Right$ ( "0" & CStr ( Month ( dateString ) ), 2 )
	getMeetingTime = getMeetingTime & Right$ ( "0" & CStr ( Day ( dateString ) ), 2 )
	getMeetingTime = getMeetingTime & "T"
	getMeetingTime = getMeetingTime & Right$ ( "0" & CStr ( Hour ( timeString ) ), 2 )
	getMeetingTime = getMeetingTime & Right$ ( "0" & CStr ( Minute ( timeString ) ), 2 )
	getMeetingTime = getMeetingTime & Right$ ( "0" & CStr ( Second ( timeString ) ), 2 )

exiting:
	Call agentLog.LogAction ( "-------" ) 
	Call agentLog.LogAction ( "-------" ) 
	Exit Function
errorhandler:' report all errors in a messagebox '
	reason = "Function getMeetingTime: "
	reason = reason & "Error #" & Cstr (Err) & " (" & Error & ") on line " & Cstr (Erl)
	Messagebox reason, 16, "Error"
	Call agentLog.LogAction ( reason )
	Resume exiting
End Function

While this did take me a few days to sort out, I’m pretty happy with the result. Our configuration has users sharing one “migration” mail file, so that users who are already on Outlook still retain a mail file and can send email. Unfortunately, that means any email from them that we create in the UI is going to have values pointing back to the “migration” mail file. I spent my first few days on this trying to spoof the mail.box by changing Principal, ReplyTo, $InetAddress and Chair when sending via Notes calendaring. While changing Chair did make it appear to come from the current user, it always displayed the email address from the “migration” mail file. It might have been getting caught in our spam filter on the way to Outlook, as my test user on Notes was still receiving the notices. Nonetheless, by switching to using Outlook as the UI, it not only took away that problem, but was far simpler and future-proofed my application. As I look at these tools I’ve created in LotusScript to generate mail messages and calendar entries, I know that it’s but a short step to doing them in server-side Javascript or maybe in Java.

There is hope for the Notes gurus of old. We just have to keep learning!

iCal RFC (documentation?)

Categories: Old Notes, Utilities | Tags: , , , , , | Leave a comment

Getting email addresses from the Notes address book

As we work to get our Notes applications functioning smoothly with our Outlook mail, I’m finding ways to keep the close binding between Notes applications and the user’s mail. It’s so much easier to click a button to generate an email associated to a particular Notes document than to copy-paste a document link.

We’ve got a Notes form for the Quarterly Project Report. Each quarter, various key members on the project are supposed to have a call to review the project. The form itself is ponderous, having something like 700 fields, but (using hide-whens) can be distilled down to a manageable number for the meeting’s agenda. The Notes names of the expected participants are computed from other documents within the database, though the fields are editable. In switching from using Notes mail to generate the meeting notice to Outlook, I ended up switching to using iCal.

It turns out that iCal is a far simpler way to initiate the meeting notice in the UI. All I need is something like this in an ICS file to have it open in my Outlook client as a meeting notice for me to send (as an update, but more on that in another post)

BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART:20170622T211500
DTEND:20170622T221500
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN="David Navarre/Company";RSVP=TRUE:mailto:David_Navarre@company.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN="Another Person/Company";RSVP=TRUE:mailto:Another_Person@company.com
ATTENDEE;ROLE=OPT-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:mailto:external_person@SecondCompany.com
DESCRIPTION: 
SUMMARY:2017 Q2 QPR: Agribusiness Competitiveness Enhancement via file
UID:AC1804D765C782CD8525814500073F37
END:VEVENT
END:VCALENDAR

One of the hurdles is that we need to have email addresses as well as names for all of the attendees. If you leave the mailto blank or put the Notes name there, it ignores it. Since our address book is still available in Notes and contains everyone’s email address, I thought I’d just google how to do it. Sadly, it wasn’t out there, so I took a few minutes and modified some script in the help documentation (Examples: AddressBooks property) to create a function to do the lookup.

%REM
	Function getEmailAddress
	Description: This Function returns a string that is the email address from the address books

	IMPORTANT: all address books are stored in the NotesDatabase list, addressBookList, which must be called BEFORE calling the getEmailAddress function

%END REM
Function getEmailAddress ( recipientName As String ) As String
	Dim view As NotesView
	Dim doc As NotesDocument
	Dim internetAddress As Variant
	Dim found As Boolean
	Dim reason As String	

	On Error Goto errorhandler

	' if already an internet address, just return that value '
	If ( InStr ( recipientName, "@" ) ) Then
		getEmailAddress = recipientName
		Exit function
	End If

	getEmailAddress = ""
	found = False
	
	ForAll addressBook In addressBookList
		' all address books are stored in the NotesDatabase list, addressBookList, which must be called BEFORE calling the getEmailAddress function '
		' check every Domino Directory, until found '
		If ( addressBook.IsPublicAddressBook ) And ( Not found ) Then
			' look up name in the VIMPeople view of address book '
			Set view = addressBook.GetView( "($VIMPeople)" )
			If not ( view Is Nothing ) Then
				Set doc = view.GetDocumentByKey( recipientName )
				' if person is found, get their internet addrress and stop '
				If Not ( doc Is Nothing ) Then
					internetAddress = doc.Getitemvalue("InternetAddress")
					If ( internetAddress (0) <> "" ) Then
						getEmailAddress = internetAddress (0)
						found = True
						Exit ForAll
					End If
				End If
			End If 
		End If
	End ForAll
	' if found is still False, the person was not found '
	If Not found Then
		MessageBox ( "Unable to locate " & recipientName & " in the address book, using " & recipientName & " as their email addresss" )
		getEmailAddress = recipientName
	End If

exiting:
	Exit Function
errorhandler:' report all errors in a messagebox '
	reason = "Function getEmailAddress: "
	reason = reason & "Error #" & Cstr (Err) & " (" & Error & ") on line " & Cstr (Erl)
	Messagebox reason, 16, "Error"
	Resume exiting
End Function

Hope someone else finds this useful….

Addendum

Dim addressBookList List As NotesDatabase

As Ben pointed out, re-opening every address book every time you want the email address is incredibly inefficient. So, declare a global variable for the address books and use the following function to open them. The code in getEmailAddress now reflects this….

%REM
	Function openAddressBooks
	Description: This Function assigns all address books to a NotesDatabase list and opens them
%END REM
Function openAddressBooks ( ) As Boolean
	Dim reason As String	

	On Error Goto errorhandler

	openAddressBooks = False
	
	ForAll addressBook In session.Addressbooks
		' open every Domino Directory '
		If ( addressBook.IsPublicAddressBook ) Then
			Set addressBookList (addressBook.FileName) = addressBook
			Call addressBookList (addressBook.FileName).Open( "", "" )
		End If
	End ForAll
	
	openAddressBooks = True

exiting:
	Call agentLog.LogAction ( "-------" ) 
	Call agentLog.LogAction ( "-------" ) 
	Exit Function
errorhandler:' report all errors in a messagebox '
	reason = "Error #" & Cstr (Err) & " (" & Error & ") on line " & Cstr (Erl)
	Messagebox reason, 16, "Error"
	Call agentLog.LogAction ( reason )
	Resume exiting
End Function
Categories: Old Notes, Utilities | Tags: , , , , , , | 3 Comments

Progammatically opening a mailto link from the Notes client

Our company has been transitioning from Notes mail to Outlook for a little while. One of the hurdles for me has been getting Notes to send mail when the user no longer has a Notes mail file and also wants to send any editable emails via the Outlook client. Today, I’d like to have a look at my latest solution to opening those editable emails in the Outlook client.

If you try using @URLOpen or ws.URLOpen, you’ll find that despite having set the default email to Outlook, Notes insists on opening a Notes document to send the mail. If you put the mailto link into a browser, it opens in the default mail client, Outlook, formatted properly. If you programmatically open a http link, it opens in the default browser. Yet, frustratingly, it won’t take that same mailto link that works in the browser and open it from LotusScript or a formula. So, we have to cheat.

mailto syntax

As a quick review, mailto links are actually very simple.

There are five components to the link, but none are required.

mailto:person@company.com Simply list the recipients email addresses. Outlook seems to prefer that you separate them with semi-colons, though most syntax guides suggest commas.

The other four are passed as parameters in the query string. So, before you use any of them, you have to use a question mark to separate the query string from the URL, then separate each parameter with an ampersand (&).

cc=joe@company.com or bcc=jill@company.com You can add carbon-copy folks or blind-copy folks in the same way.

subject=That%20issue The subject line should be encoded so that there are no spaces and any unusual characters pass through to the email rather than disrupt the syntax of the query string.

body=The%20contents%20of%20email The body is, of course, the most important thing to us and we can simply compute the values to be used. Links back to Notes documents to be opened in the Notes client can even be used, so long as you provide a proper notes:// URL.

Hard coded example

If we create a HTML document, store it locally and open it programmatically, it will execute any javascript we’ve got on the page as browsers ought to do. So, we can make it open the mailto link if our page has the following:

<script type="text/javascript">
subject = "Change Order for your approval";
body = "Your approval has been requested for changes made... ";
body = body + "%0A%0A";
body = body + "Please review these changes and approve, provide comments, or request more time to review within five business days of this notification. Otherwise, the change will be considered approved as per DAI policy.";
body = body + "%0A%0A";
body = body + "The pending change approval form and links to draft documents can be found here: ";
body = body + "%0A";
body = body + "Notes:///852580E9007624A0/0/B82A2F4ABF0D56818525808400601DBE";
	
mailtoString = "mailto:david_navarre@company.com?subject=" + subject + "&body=" + body;

window.open(mailtoString)</script>

Sample code

So, all we have to do is generate the mailtoString, put it into a new HTML document and open it via NotesUIWorkspace.URLOpen to get our document to open and popup the Outlook client, populated with the correct information.

Sub Click(Source As Button)
	Dim ws As New NotesUIWorkspace
	Dim session As New NotesSession
	Dim thisdb As NotesDatabase
	Dim uidoc As NotesUIDocument
	Dim approver As Variant
	Dim approverNames As String
	Dim i As Integer

	Set thisdb = session.CurrentDatabase
	Set uidoc = ws.CurrentDocument
	Set doc = uidoc.Document

	For i = 1 To 6
		approver = doc.getItemValue( "Approver"&i )
		If i = 1 Then
			approverNames = approver (0)
		Else
			If ( approver (0) <> "" ) Then
				approverNames = approverNames & ";" & approver (0)
			End If
		End If
	Next
	Dim subject As String
	Dim body As String
	Dim mailtoString As String
	Dim changeOrderNumber As Variant

	changeOrderNumber = doc.getItemValue ("CONum" )
	subject = "Change Order " & changeOrderNumber (0) & " for your approval in " & thisdb.Title
	subject = Replace ( subject, " ", "%20" )
	body = "Your approval has been requested for changes made using " & changeOrderNumber (0) & " in " & thisdb.Title
	body = body & "%0A%0A"
	body = body & "Please review these changes and approve, provide comments, or request more time to review within five business days of this notification. Otherwise, the change will be considered approved as per DAI policy."
	body = body & "%0A%0A"
	body = body & "The pending change approval form and links to draft documents can be found here: "
	body = body & "%0A"
	body = body & "Notes:///" & thisdb.ReplicaID & "/0/" & doc.UniversalID
	body = Replace ( body, " ", "%20" ) 

	mailtoString = "mailto:" & approverNames & "?subject=" & subject & "&body=" & body

	Dim fileName As String
	Dim dataDirectoryPath As String
	Dim url As String
	Dim fileNumber As Integer

	fileNumber = 1

	dataDirectoryPath = session.Getenvironmentstring("Directory", True)
	fileName = dataDirectoryPath & "\mailto.htm"

	Open fileName For Output As fileNumber

	Print # fileNumber, {<script type="text/javascript">}
	Print # fileNumber, {mailtoString = "} & mailtoString {"}
	Print # fileNumber, {window.open(mailtoString)</script>}

	Close # fileNumber

	url = "file:///" & fileName
	Call ws.Urlopen(url)

End Sub
Categories: Client-Side Javascript, Old Notes | Tags: , , , | 3 Comments

What good is the internet of things to people who don’t have internet?

While preparing for a panel discussion this morning, Tami suggested that I check out the blogs by our technology team at DAI. Rob Ryan-Silva wrote an excellent think piece on using the Internet of Things to help people who have no access to the internet. In Cambodia, they relied on human intervention to get out flood warnings. That’s not always reliable, but Rob was able to use IoT to come up with an automated solution….

Categories: General Interest | Tags: , , , | Leave a comment

An apparent theme: application agnosticism

As always, I’m enjoying learning new things and seeing old friends (and some new ones!) at MWLUG. There have been sessions that talked about accessing and displaying data from within Notes without using Notes or XPages and sessions about accessing non-Notes data using XPages. Much of the excitement is about having data exposed via a REST service and using a good front end tool to display it. So, in some senses, we are talking about not needing Notes at all.

Earlier this summer, our company’s Vice President of the Office of Information Management and Technology announced that we’re actually moving away from the Notes client for mail. While I knew that this was a possibility, I’d thought we were still just looking at allowing folks to choose other mail applications to access their mail. Of course, allowing multiple mail applications either tosses some of your users to the wolves of ‘no support’ or complicates things immeasurably for support. So, it does make sense and was not particularly unexpected. Nonetheless, it still surprised me.

The core of our Notes use has always applications anyway. Our business relies on a lot of people working disconnected and, as such, the Notes replication model has been key to our need for Notes. So, we’ll be keeping the Notes client on machines for all those people who work disconnected, but much of our access had already moved to the browser. So, in a sense the work I do was moving in this direction as well.

So, the agnosticism is where we’re all going, it seems. I guess the mantra remains — use the best tool for the job.

Categories: Conferences, General Interest, Xpages | Tags: | Leave a comment

Sessions for #MWLUG2016

Looking over the announced sessions for MWLUG 2016 down in Austin, I’m excited. There’s a good mix of things you can use today and road maps you can apply in the future. I’m a developer, so all the Development and Best Practices sessions look interesting. The tough part will be picking which ones to attend (and record!)

Five sessions that jumped off the page at me are, in no particular order:

Debugging Java In Your Domino Applications with Julian Robichaux — Java just kills me sometimes. Heck, all of XPages does, but learning more about how to debug and troubleshoot is always useful.

Extreme Development: Pair Programming with Devin Olson and Mike McGarel — Now that Elvis Lezcano is aboard at DAI, we might have a chance to do some of this. He’s the smartest developer I’ve worked with, which I why this is the third job we’ve had together.

Think Outside The Box with Karl-Henry Martinsson — We’ve just been breaking into using REST services with jQuery and Bootstrap to present data, so getting someone else’s take on it will expand my ability to combine data from multiple databases to dazzle our users. (see Kathy’s session on dashboards for ideas she’s using for us)

Getting Your Hands on Graphs with Nathan Freeman — I have loved all the conceptual sessions and want to learn more. If Nathan can get me to understand, there’s no telling how far we can go!

A Modernized Developer’s Workflow with Domino/XPages with Eric McCormick — Workflow has always been a great strength of Notes, so getting modernized by someone who’s not spouting theory, but displaying methods in practice is exciting.

Now, before anyone complains about me not mentioning their sessions…. I’d like to sit in on about… 27 sessions. Since Marky has made no progress on the time machine and IBM doesn’t have anyone working replication of people instead of just data and design, I think I only get about a dozen sessions.

Categories: Conferences, Java, Xpages | Tags: , , , , , , , , , , , , , , | Leave a comment

Can you hear me now? Life without #HearingLoss

I turned 50 in December, but my ears were already retired. I’d go to corporate events or to happy hours and smile a lot when people talked. I had long ago stopped asking more than once if I couldn’t hear someone in those environments. If I was lying on my right side in bed and my wife said something, I could only tell that she was speaking, not even guess what she’d said. In our kitchen, with little or no background noise, I’d often ask her to repeat herself. When we’d go on walks, it was important that she walk on my right, since I wouldn’t be able to carry on a conversation if she was on my left. Playing baseball (in an over 48 league!) I’d smile and nod when one of the other outfielders would shout some advice that was simply from too far away.

Last year, my mother-in-law asked me to go to a luncheon offered by an audiologist to talk about hearing aids. I assumed it was because she remembered that we shared the problem of hearing loss. She didn’t, so she was surprised when I was excited about it. I’d been asking my doctor each year when they did the hearing test if it was time to get hearing aids. Those problems noted above really bothered me. This year, he said, “Maybe.” The luncheon was marvelously informative and I set up an appointment to have my hearing checked. Due to the price tag, I held off to reconsider getting them. Thousands of dollars requires more than a few minutes of thought. I had in mind about half of the number they cited.

A few months later, they had another luncheon and this time, I took Melissa. They gave me a pair to try. It was a world of difference. You know, I thought the turn signal on my truck didn’t make noise anymore. It does. I just wasn’t hearing it.

While I had the trial hearing aids, a friend of my mother-in-law came into town. We were all sitting the kitchen table discussing hearing aids and especially that someone in particular didn’t want people to think she is “old”. So, her friend who is a several years younger than her says, “I’m wearing mine.” No one had ever noticed. The behind-the-ear hearing aids were about the same color as her hair and you couldn’t notice unless you leaned in close and pushed her hair aside. She also solved my concern over the price. Costco sells hearing aids and for a fraction of the price. However, not every Costco has audiologists on staff – some only have hearing aid technicians. If your local Costco doesn’t have audiologists, you probably are better off going to an independent audiologist, just as you wouldn’t go to someone who wasn’t a surgeon for heart surgery.

Many people worry that people will think they’re old if they see the hearing aids. The truth is, they probably can’t see them and…. people already know you can’t hear them. When you just nod and smile at conversation or bring up topics that have been discussed five minutes ago, people notice. Then, you look old AND stubborn. I’m only 50 and I could care less if people notice. I tell people about them all the time. A couple of the guys in my office who are in their 30s spent too much time in rock-and-roll, so are considering getting them.

If you’re not hearing people, it causes a lot of problems. You don’t hear important things — like what your doctor tells you about your health or medication. Imagine hearing that a “1 in 2” surgeries results in death, instead of “1 or 2%” of surgeries result in death. You may not hear when a loved one says, “I love you”. You answer different questions than people asked. You laugh when everyone else does, even if you didn’t hear the punchline. You miss out on lots of interaction and life gets dull. You may develop a tendency to avoid places where hearing may be difficult, like restaurants, and end up avoiding other social situations. These compound each other and you feel isolated. Isolation can lead to emotional issues, like depression, or even lead to dementia (if you’re the only one you can hear in your world, it gets real hard to connect to reality).

So, if you’re missing conversational bits or find that “people talk too fast”, get yourself checked. People are not talking faster – your ears don’t hear every letter anymore, so it takes you longer to figure out what they actually meant to say. There are some sounds, like the f or ph or s, that I simply can’t hear without my hearing aids because those pitches are simply bad for me. If you miss two or three letters in every word, your brain can’t figure out what the words were. One joke I often told was that “as I got older, people said more interesting things” because I couldn’t hear what they actually said and my brain guessed wrong!

If you don’t think you need them and that nobody has noticed, ask someone.

* While I don’t use Duracell batteries, that’s a great commercial AND they have a portion of their website dedicated to it.

Categories: General Interest | Tags: , , , , , | Leave a comment

Austin, Texas hosts #MWLUG2016 in August

While the definition of “Midwest” may be getting broader, there is no denying the huge value of the largest Notes user conference in the US, MWLUG. This year, we venture to Texas, holding our conference in one of the premier hotels in Austin, while keeping lodging affordable.

We are please to officially announce that MWLUG 2016 will be held on August 17-19, 2016 at the Four Seasons in Austin, Texas. We have secured a special rate for this premier ICS conference. With all the new innovations that IBM and IBM Business Partners are creating with our favorite technologies, we are “Defining the Art of Collaboration” which is our theme for MWLUG 2016.

We are expecting an even greater turnout this year at MWLUG 2016. We are planning many activities and new formats to make this a special event. For attendees that are interesting in coming earlier, we are also working on a special event on Tuesday, August 16, 2016. We will need to determine if there is enough interest before we book this event. More information will be coming soon.

The Four Seasons location in downtown Austin is rated as one of the best hotels in the United States. We have made special arrangements with the Four Seasons for a special discount of $189.00/night for attendees of MWLUG 2016.

If you are interested in being a sponsor of MWLUG 2016, sponsorship will start next week. Stay tuned for announcements.

Ready to share your knowledge and skills, abstract submission for MWLUG 2016 will start on April 15, 2016 so get your ideas ready. As always, we reserve 25% of the speaking slots to new speakers. So don’t be shy.

Registration for MWLUG 2016 will start on May 1, 2016.

MWLUG 2016 session tracks include:

  • Application Development
  • Best Practices in Social Collaboration
  • Customer Business Cases
  • Innovation
  • System Administration

MWLUG 2016 is made possible by the generous MWLUG 2016 sponsors whom not only pay for the majority of the cost for MWLUG 2016, but also donate their time in organizing and providing technical sessions on critical topics that are important to our ICS community.

  • Close to 50 business and technical sessions
  • Breakfast and Lunch for Thursday and Friday
  • Wednesday Evening Showcase Reception that include drinks and hors d’oeuvres
  • Thursday Evening Social Event
  • Networking with your colleagues in the ICS community
  • And a whole lot more

While I will again be videotaping the session I attend (like my videos from MWLUG 2014 and MWLUG 2015) but it’s nothing like seeing it in person. Your session choices might be different from mine and there’s really no substitute for seeing it in person. Additionally, all of us also end up learning from each other in between sessions, over meals and in the evenings. You get to make connections that will be useful when you hit a roadblock or…. when you’re looking for a new job or trying to find a new employee. Since the cost of the conference itself is nominal and lodging is reasonable, I can’t see a reason you wouldn’t attend.

Note that session proposals can be pitched starting April 15th!

Categories: Conferences | Tags: | Leave a comment

Orphan #Java class files in the Local folder in #XPages

Every once in a while, when I do a design refresh for one of my XPages databases, I notice it adding .class files for XPages that I’ve already deleted.

So, I do another clean & build on the template, but they’re still there. Annoyed, I console myself that the files are never referenced, so I don’t need to worry about it. Of course, I worry anyway.

Vestigal Java FilesSo, in my quest to figure out what was going on, I continued poking around. I checked in the Local folder while looking at the Navigator Eclipse view and saw that the .java files were still sitting there as orphans, with no XPage in the design any more. So, I did just a ‘Clean’ and it eliminated all the files except for those. According to “Mastering XPages”, this doesn’t happen. In warning you not to create Java files in the Local folder, it states that

the incremental builder in Domino Designer would then flush the contents of the Local folder before recompiling all the XPages again. Your custom Java source files would be permanently deleted in this case.

Yet, those files stubbornly remain. Fortunately, when I create a new copy of the template, none of those Local files copy into the new database. So, my habit of creating new files for new versions of the template has helped me by dodging this little, harmless bug.

 

Categories: Java, Xpages | Tags: , , | Leave a comment

An agent to change field values to help in #XPages

With our transition to XPages, I’ve been finding more and more often that I don’t have a form interface in the Notes client to just change one field value on the back end. Too often, on the front end, in XPages, there’s a value I simply haven’t exposed for editing or don’t even display. I often don’t add the fields to the back end Notes form because it really doesn’t add much value. So, when I want to change one field, or change one field on multiple documents, I do it with an agent. Heck, over the years, we all have. We just usually did it in a very static manner – writing a quick @formula to change the value of a specific field. That requires changing the design to create the agent and then delete the agent – or leaving a mess behind that slowly grows your agent list with more and more single-use agents.

So, I wrote an agent that allowed me to replace a text field by naming the field and the value. Then, I found I wanted one for numbers as well. So, for a few weeks, I had two agents. Then, I realized the folly and wrote an agent that detects the field being updated (or asking you if the field doesn’t exist). I only did it for text, numbers and dates, so I imagine it could be extended. It’s enough for me. Since I had occasion to share it this week with another developer, I thought I’d also post it here to share via the blogosphere.

While there’s nothing brilliant about it, it sure is useful.

%REM
	Agent Change Field Value
	Created Jun 19, 2015 by David Navarre/DAI
	Description: This Agent allows the user to name a field and change the value
		It checks the field type on the first document selected and
		handles strings, numbers and dates differently
%END REM
Option Public
Option Declare
Use "Utilities"
Dim ws As NotesUIWorkspace
Dim newDate As NotesDateTime
Dim newvalue As Variant
Dim fieldname As Variant
Dim change As String
Sub Initialize
	Dim session As New NotesSession
	' thisdb declared in Utilities '
	Dim ndc As NotesDocumentCollection
	Dim itemdoc As NotesDocument
	Dim itemToChange As NotesItem
	Dim numericValue As Double
	Dim itemType As Long
	Dim selectedType (2) As String
	Dim choice As Variant
	Dim reason As String

	On Error GoTo errorhandler

	Set ws = New NotesUIWorkspace
	Set thisdb = session.CurrentDatabase

	selectedType (0) = "Date"
	selectedType (1) = "Text"
	selectedType (2) = "Numbers"

	Call StartAgentLogging (session )

	fieldname = ws.Prompt ( PROMPT_OKCANCELEDIT, "Field Name", "Enter the name of the field to change" )
	If IsEmpty ( fieldname ) Then
		Exit Sub
	End If

	newvalue = ws.Prompt ( PROMPT_OKCANCELEDIT, fieldname, "Enter the new value for " & fieldname )
	If IsEmpty ( newvalue ) Then
		Exit Sub
	End If

	' get the collection before issuing the confirmation, so we can determine field type '
	' from the first document selected, assuming it is the same on the rest '
	Set ndc = thisdb.UnprocessedDocuments
	Set itemdoc = ndc.GetFirstDocument
	Call agentLog.LogAction ( "Items: " & ndc.Count )

	If ( itemdoc.Hasitem(fieldname) ) Then
		Set itemToChange = itemdoc.Getfirstitem(fieldname)
		itemType = itemToChange.Type
	Else
		choice = ws.Prompt(PROMPT_OKCANCELLIST, "Select field type", "Field " & fieldname & " does not exist on the first document. Select field type to create", "Text", selectedType )
		If IsEmpty ( choice ) Then
			MessageBox "Action cancelled"
			Exit Sub
		End If
		Select Case choice
		Case "Date"
			itemType = 1024
		Case "Text"
			itemType = 1280
		Case "Number"
			itemType = 768
		End Select
	End If	

	If Confirm ( itemType ) Then
		While Not itemdoc Is Nothing
			Select Case itemType
			Case 1024  ' DATETIMES '
				Call itemdoc.ReplaceItemValue ( fieldname, newDate )
			Case 1280  ' TEXT '
				Call itemdoc.ReplaceItemValue ( fieldname, newValue )
			Case 768  ' NUMBERS '
				' if the value supplied is an integer, save it that way '
				If ( CInt ( CDbl ( newValue ) ) = CInt ( newValue ) ) Then
					Call itemdoc.ReplaceItemValue ( fieldname, CInt ( newValue ) )
				else
					Call itemdoc.ReplaceItemValue ( fieldname, CDbl ( newValue ) )
				End If
			End Select

			Call agentLog.LogAction ( change )
			Call itemdoc.Save ( True, False )

			Set itemdoc = ndc.GetNextDocument ( itemdoc )
		Wend
		MessageBox change & Chr$(10) & "Successful on " & ndc.Count & " documents"
	End If

exiting:
	Call agentLog.LogAction ( "-------" )
	Call agentLog.LogAction ( "-------" )
	Exit Sub
errorhandler:' report all errors in a messagebox '
	reason = "Error #" & CStr (Err) & " (" & Error & ") on line " & CStr (Erl)
	MessageBox reason, 16, "Error"
	Call agentLog.LogAction ( reason )
	Resume exiting

End Sub
%REM
	Function ConfirmValue
	Description: This function displays a confirmation dialog based on the field type
%END REM
Function Confirm ( itemType As Long ) As Boolean

	Select Case itemType
		Case 1024  ' DATETIMES '
			Set newDate = New NotesDateTime ( newValue )
			change = "Change date in " & fieldname & " to " & newDate.Dateonly
		Case 1280  ' TEXT '
			change = "Change text in " & fieldname & " to " & newValue
		Case 768  ' NUMBERS '
			change = "Change number in " & fieldname & " to " & newValue
		Case 1  ' RICHTEXT '
			Confirm = False
			MessageBox "Cannot change rich text using this agent"
			Exit Function
		Case Else
			Confirm = False
			MessageBox "Cannot change " & fieldname & " using this agent" & Chr$(10) & "Field type: " & itemType
			Exit Function
	End Select 

	Confirm = ws.Prompt ( PROMPT_YESNO, "Confirmation", change & "?" )

End Function

Oh, and the relevant snippet of the Utilities script library….

%REM
    Library Utilities
    Created Mar 29, 2012 by David Navarre/DAI
    Description: Some database utilities
%END REM
Option Public
Option Declare

Dim thisdb As NotesDatabase
Dim agentLog As NotesLog
Sub Initialize

End Sub

Sub StartAgentLogging ( session As NotesSession )
    ' this module starts agent logging '
    ' 29 Mar 12, David Navarre '
    Dim title As String
    Dim agent As NotesAgent

    Set agentLog = session.CreateLog ("Agent log")
    Set agent = session.Currentagent
    Call agentLog.OpenAgentLog
    Call agentLog.LogAction ( "Log Open" )

End Sub
Categories: Old Notes, Utilities | Tags: , , , , , | 2 Comments

Create a free website or blog at WordPress.com.

%d bloggers like this: