358 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Latest 7 Posts
Mail Merge with XPages
Fri, Dec 12th 2014 217
Command line mail merge
Fri, Dec 12th 2014 153
Application Migration vs. XPage enablement
Mon, Dec 1st 2014 303
Poking around the iNotes HTTP API (Part 3) - retrieve a message
Sun, Nov 30th 2014 152
Poking around the iNotes HTTP API (Part 2) - Fun with Rhino
Thu, Nov 27th 2014 198
Poking around the iNotes HTTP API (Part 1)
Mon, Nov 24th 2014 301
Flashcards - German Version: Die Lernkartei
Sun, Nov 23rd 2014 187
Top 10
Domino Development - Back to Basics - Part 5: Finding data - Collections and Search
Thu, Jan 2nd 2014 715
A peek in my JavaScript Toolbox
Fri, Nov 14th 2014 316
Last usage of a mail file - for all users
Fri, Nov 21st 2014 311
Application Migration vs. XPage enablement
Mon, Dec 1st 2014 303
Poking around the iNotes HTTP API (Part 1)
Mon, Nov 24th 2014 301
Custom REST service in XPages using a service bean
Wed, Oct 22nd 2014 290
Building a shared approval frontend in XPages
Sun, Nov 16th 2014 283
Mustache Helper for Domino
Sun, Nov 16th 2014 279
Dear SingTel, please fix your routing performance!
Wed, Apr 24th 2013 269
Providing user information in JSON
Thu, Nov 20th 2014 228


Importing EML files into Notes (lots of them)
Stephan H Wissel    

My friend and Lotus Champion Weerapong Panpai from Zenith in Thailand asked me "How difficult is it to do a bulk import of eml files into Lotus Notes"? MIME as a format is plain ASCII, so on first look it seems simple.
However on a closer look you might guess where the author of an outstanding movie got his inspiration from. RFC 2045 nicely states:"NOTE: The previous four definitions are clearly circular. This is unavoidable, since the overall structure of a MIME message is indeed recursive." So trying to parse that messages on my own was clearly out of the question. Luckily there is ready code available. On one side there is JavaEE and the the MimeMessage and on the other Apache James. An implementation of the javax.mail.internet classes is hidden somewhere in the Notes client, so that would favour MimeMessage. However I found it easier to work with the mime4j classes. Here is what I came up with:
package com.notessensei.mimeimport;

import java.io.IOException;
import java.io.InputStream;

import lotus.domino.Document;
import lotus.domino.NotesException;
import lotus.domino.Session;

import org.apache.james.mime4j.MimeException;
import org.apache.james.mime4j.parser.ContentHandler;
import org.apache.james.mime4j.parser.MimeStreamParser;


public class Mime2Doc {
   
    public void importMail(Session s, InputStream in, Document doc) throws NotesException, MimeException, IOException {
        doc.replaceItemValue("Form", "Memo");
        MimeStreamParser parser = new MimeStreamParser();
        ContentHandler h = new DocContentHandler(s, doc);
        parser.setContentHandler(h);
        parser.parse(in);
    }
}
The bulk of the work happens inside the ContentHandler. Using a Stack (that works LIFO) I can track Mime entries inside mime entries inside mime entries. Still the code is just below 100 lines.
The final piece in the puzzle is the class that helps to track the MIME Parts that are put onto the Stack and returns MIME-Type and encoding derived from the header fields. You are ready to test.

---------------------
http://feedproxy.google.com/~r/Wisselnet/~3/Go4nOK0XYws/SHWL-8TMJFU
Apr 23, 2012
68 hits



Recent Blog Posts
217


Mail Merge with XPages
Fri, Dec 12th 2014 7:11p   Stephan H Wissel
Being able to have individualized letters based on a template was one of the drivers to make Word processors popular. In the age of mass-communication of one. This tasks falls no longer to the printer, but your eMail processor. For a complete solution, check out Chris Toohey's excellent Mailer application, that is yours for USD 5.00 only. I was wondering what it would take to build something similar, minus the address management, in XPages. I defined a few constraints: I don't want to store [read] Keywords: domino ibm richtext xpages application email java openntf wiki
153


Command line mail merge
Fri, Dec 12th 2014 7:11p   Stephan H Wissel
As shown before mail merging with Notes and {{mustache}} is simple and easy to code. To be able to run merging on the command line, I modified the bean and removed the XPages dependency and added a static main function. Now you can run it off the command line easily. It requires 5 parameters: the database name the CSV file a file with a HTML message including {{mustache}} tags a file with a Text message including {{mustache}} tags The senders eMail [read] Keywords: ibm notes xpages database email
303


Application Migration vs. XPage enablement
Mon, Dec 1st 2014 5:12a   Stephan H Wissel
In a recent customer discussion a claim was made: "If Notes client application don't automagically can be converted into XPages applications, then we very well can migrate to another platform, it is just the same". An interesting claim, I'll subject it to a reality check. In any case it is a good idea to revisit your investment in your existing applications first. XPages Enablement A reasonable estimate for the required effort is up to 30% of the initial effort. It very much depends on the [read] Keywords: domino ibm lotus notes notes client xpages application applications bug mobile security
152


Poking around the iNotes HTTP API (Part 3) - retrieve a message
Sun, Nov 30th 2014 9:15p   Stephan H Wissel
So far we learned about the URLs, how to retrieve the Outline that contains folders and views and how to utilize JavaScript to deal with an API tha hadn't been designed for language neutral access. This part will deal with the retrieval of messages. There are quite some formats, strategies and tweaks to consider: A message consists of headers (fields), and message parts that can be plain text, HTML, embedded images, attachments or other stuff (like the JSON used for embedded experiences). When [read] Keywords: ibm inotes notes css java javascript network
198


Poking around the iNotes HTTP API (Part 2) - Fun with Rhino
Thu, Nov 27th 2014 10:15a   Stephan H Wissel
The iNotes HTTP API wasn't designed for consumption outside the iNotes web client. This becomes apparent when looking at Form=l_GetOutline_JSON or Form=l_JSVars that return JavaScript and not JSON! The difference? JSON contains data only, while JavaScript contains function definitions too. To make use of data included in the JavaScript there are 2 possibilities: do some elaborate String operation actually run JavaScript Since Java 6, the JDK contains a JavaScript engine, that originally was de [read] Keywords: ibm inotes notes java javascript
301


Poking around the iNotes HTTP API (Part 1)
Mon, Nov 24th 2014 11:12a   Stephan H Wissel
With the rise of web applications, something interesting happened: applications gained an observable API. Delivered over HTTP(s) with a few commands (GET, POST etc.) it became easier to find out "what is going on". Tools like Wireshark, Fiddler, Charlesproxy or TCPMon sit between your HTTP consuming client and the HTTP generating server. In browser applications the build in developer tools (Ctrl-Shift-I) provide the same level of access. So anything flowing over HTTP is effectively an API. Th [read] Keywords: ibm inotes ldd lotus notes applications google server twitter
187


Flashcards - German Version: Die Lernkartei
Sun, Nov 23rd 2014 6:12a   Stephan H Wissel
The offspring and SWMBO had an argument about the need for Chinese tuition when attending Singapore's oldest school. You can guess who had what position. Disecting the positions and looking at interest (you remember your basic negotiation skills, do you?) it boiled down to the wish of self directed learning vs. fear of failure. Having gone through both (I remember my Latin tuition teacher well. I loathed him and in return he pushed me within 6 month from F to A), I concluded: self direction ne [read] Keywords: application google wiki




311


Last usage of a mail file - for all users
Fri, Nov 21st 2014 8:18a   Stephan H Wissel
My admin is getting a little rusty. When I was asked: "How can I indentify a dormant mailbox?" I couldn't name a place in admin where to look. Of course, there is the NotesDatabase.LastModified property, but that would get updated on a design refresh too. So I asked innocently: "dormant, how?" After an amusing 2 hour discussion between the stake holders (only the popcorn was missing) we concluded that it is either No document has been created for a while (including incoming) No email has [read] Keywords: admin ibm lotusscript notes email
228


Providing user information in JSON
Thu, Nov 20th 2014 5:12a   Stephan H Wissel
In the MUSE project we encountered the need to retrieve user information in JSON format. Easy done one would think. The trouble starts, when you have multiple directories and you need reasonable speed. Sometimes falling back to @Fomulas gives you what you need, fast and easy. @NameLookup knows where to look and you don't need any extra configuration. A simple call to an form will give you all you need: https://yourserver/somedb.nsf/namelookup?Readform for yourself or add &User=John Doe for [read] Keywords: domino dxl ibm email
283


Building a shared approval frontend in XPages
Sun, Nov 16th 2014 8:18p   Stephan H Wissel
The saying goes: "God would not have been able to create the world in 7 days, if there would have been an installed base to take care of". As much as we wish to have divine powers, we need to make with less and look after an installed base. Point in case: You have a set of approval applications in classic Notes client code, like: Travel, Leave, Expenses, Gifts, Training, BoM changes etc. You are challenged to provide a web and/or mobile interface for them. Considering your options you have to [read] Keywords: lotusscript notes notes client policies xpages application applications development interface java mobile wiki




Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - Mobile Edition