Monday, June 29, 2009

New NotesUI-bug found in Notes 8.5 (includes workaround)

Update: The bug(?) isn't as serious as I first thought. The settings document wasn't closed, but it was sent to a frameset of another application. In the other application, an action calls NotesUIWorkspace.SetTargetFrame. I'm not sure if it is a bug, that a document from another application ends up in this frameset. For all I know this is just Notes' quirky way of doing things. If I call setTargetFrame("someRandomValue") before NotesUIWorkspace.EditDocument, the code works as designed.


I'm back working in the client again. It seems every time I'm working on client code, I discover a new NotesUI-bug. :-\

Purpose: When user tries to create a settings doc, check to see if one already exists. If yes, open the existing doc (by static unid), else set static unid, continue.

I'd have thought it would be as easy as (in PostOpen) Source.Close, NotesUIWorkspace.EditDocument. And it would, if the user was running Notes 8.0.X. In Notes 8.5, the client closes both the "Create Settings" instance, and the LS instance if the user opens the Settings-form when a settings doc already exists (see code below).

The workaround is easy: Source.Close, NotesUIWorkspace.URLOpen

Even though it's easy to make the code work in 8.5, I shudder to think about how many existing applications that's going to misbehave if the user upgrades to Notes 8.5.

Sub Postopen(Source As Notesuidocument)
On Error Goto handleError

Print Source.IsNewDoc 'True then False when settings doc exists

'// If new doc, check for existing settings doc
If Source.IsNewDoc Then
Dim settingsDoc As NotesDocument
Set settingsDoc = s.currentDatabase.GetDocumentByUNID( UNID_SETTINGS )

'// Set static unid on new settings doc
If settingsDoc Is Nothing Then
Source.Document.UniversalID = UNID_SETTINGS
'// Open existing settings doc
Dim ws As New NotesUIWorkspace()
Call ws.URLOpen( settingsdoc.NotesURL ) 'Works
'Call ws.EditDocument( False, settingsDoc ) 'Does not work
Source.Close True
End If
End If

Exit Sub
If Err = 4091 Then Resume Next 'Invalid UNID
End Sub

>> Bugreport

Friday, June 12, 2009

Serving correct MIME-types for Office 2007 attachments on the web

Several of our users had problems with opening Office 2007-attachments in Internet Explorer. The browser identified the attachments as zip files.

The workaround for this is to set up the Domino server to send the appropriate MIME-type header.

The correct headers

Then you need to configure the Domino Server. We hoped it would be as easy as adding config documents to the "File Identifications" view. Alas, this didn't work.

What did work was modifying the httpd file in the data-directory of the server/refreshing http
(tell http refresh).

#   Office 2007
AddType .docm application/
AddType .docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
AddType .dotm application/
AddType .dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template
AddType .potm application/
AddType .potx application/vnd.openxmlformats-officedocument.presentationml.template
AddType .ppam application/
AddType .ppsm application/
AddType .ppsx application/vnd.openxmlformats-officedocument.presentationml.slideshow
AddType .pptm application/
AddType .pptx application/vnd.openxmlformats-officedocument.presentationml.presentation
AddType .xlam application/
AddType .xlsb application/
AddType .xlsm application/
AddType .xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
AddType .xltm application/
AddType .xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template

Not sure if it is a bug that the "File Identifications" solution didn't work..? The server-version is Domino 8.5.

Thursday, June 11, 2009

Great tool to test web applications in IE 5.5 -> 8

A colleague of mine discovered this great application, IETester. It seems to be able to run four versions of IE at once (IE 5.5, 6, 7 and IE 8).

There have been tools like this before, but all previous tools I've tried have not supported cookies, so no go for Domino login. This one does.

It's currently in early beta, but seems quite stable.

Friday, June 5, 2009

Mail from Outlook to Notes/Domino applications without Notes installed

I'm sorry to say that this post will be words only. No juicy code or bug ridden demo applications. Hopefully it will give you ideas on how to make use of this concept in your own applications.

Backstory: A customer of ours needed to get mails from Outlook into a Domino CRM web application. The prerequisite was that the users shouldn't need to install the Notes client.

This was presented to me by my boss over a couple of beers. I more or less immediately thought of the great functionality the Domino server has, that you can set up any NSF as the receiver of mails. If you could tag the mail with values inside Outlook, an agent could process the forwarded mails (add Readers/Authors fields based on customer id/etc.).

I started out with a POP3 Gmail account inside Outlook. I went through most of the writable properties of the mail-object, and struck gold. :)

The mail-object has a property called Category. When the mail is received inside Notes, this field is called Keywords. The field seems to be restricted to ASCII characters (or Gmail/Domino converts it to that). Therefore, the values need to be URL-encoded. From my small tests, everything seems to go through the wire. Line break, international characters, etc.

I send the values in a URL parameter pattern, so they're more readable, but formats like XML, CSV and JSON should work just as well. The only restriction I can think of is the ridiculous 32k limit on fields.

To let the user select the customer ID, I use the WebBrowser control inside a dialog in Outlook. The user interface is more or less a view with some DHTML code. When a user click a table row, I add a class on the row so that the user sees which customer is selected. I collect all the values from the selected table row, and put them inside a hidden field (comma separated). When the user clicks OK in the Outlook-dialog, I use VBA to collect the values from the hidden field. A second dialog is used for some custom fields (document type, date and description). That's about it.

Share and enjoy!

Thursday, June 4, 2009

UserCss: Cleaning up the Google Reader interface

I finally had enough with Bloglines. The RSS-robots are extremely slow, the page has a fair amount of downtime, the site has a lot of problems, etc.

I started using Google Reader today. The only thing I didn't like about it was all the clutter. Bloglines wastes little space.

I've known about the posibility for site-specific CSS in Opera for several years, but never had the need for it. This was the perfect occasion to try it out. I used Opera Dragonfly to identify the spots that needed to go/the items that needed to be moved.

This is the result:

(Screenshot from Opera 10 Beta1. Looking forward to being able to have the thumbnails on the left. Not usable as is.)

The stylesheet if you're interested.

In Opera, you're only able to set site-specific CSS per domain. Therefore the above CSS influences all google sites. Opera only stylesheet that doesn't affect (from what little I've tested) other google sites.