What is this new BizTalk 2006 R2 Adapter Framework

Thought I’d collect a few resources to help you guys along the way with some great
articles from Sonu(PM for the .NET
Adapter Framework) :
Well worth a read.

Here is additional information on creating custom adapters using BizTalk Adapter
Framework-
Developing Adapters Using the Adapter Framework
http://msdn2.microsoft.com/en-us/library/ms944509.aspx

Developing Custom Adapters

http://msdn2.microsoft.com/en-us/library/aa559841.aspx

Writing Effective BizTalk Server Adapters
http://msdn2.microsoft.com/en-us/library/ms942193.aspx

MindJet’s MindManager 7

MindJet’s MindManager 7

I’ve been an (irregular) fan of Mind Mapping for several years, previously using simple flip-charts. and later Visio’s Brainstorming diagram or a simple whiteboard. Recently, one of my associates purchased a license of the brand new MindJet MindManager 7 Pro, and I’ve gone back to using this technique with renewed energy.

I frequently toy with my friends about the best tool of all, CPL 1.0 (in English, this would be translatable as BPP 1.0 — Brain, Paper and Pencil :-)), but this tool is a very close second :-). Basically, MindManager allows you to create diagrams with everything that pops into your mind, organizing concepts or actions or ideas in a hierarchical approach across a central concept. You can do stuff such as create relationships, export to formats such as PowerPoint or Visio or MS Project (including resource usage and task-related information), synchronize with Outlook’s Task List (at last, hierarchically organized tasks!!! — great for GTD fans like myself) or Appointments, etc. Version 7 comes with a Ribbon interface just like Office 2007, which also makes it easy to use and great looking.

I probably sound like a salesman, which I am not, but this is because I ready like this tool. I am the kind of person that pops out a notebook or rushes to a whiteboard to help structure ideas and think/draw things out, and I’ve realized in the few days that I’ve been using this, that it is astonishingly easy doing it in MindManager.

MindJet has a 21-day trial I recommend people try out. The price is not cheap for local standards (299.00 for the Pro version, 79 for the Lite one), but I’d very easily spend the money on this.

To give you some ideas of diagrams we’ve done in the past days: to structure competencies around hiring of non-technical resources, the company’s strengths and weaknesses, at least 2 tactical approaches to projects including action points and things to take into consideration, ideas about an architecture to a project, and my own Outlook task list. 

Great Software: 5 Jota’s out of 5 🙂

 

Disclosure: as an MVP, I have received a free license for MindManager 7 as a 3rd party offer from MindJet.

Sending HTML emails with embedded images in BizTalk

Ever wanted to send emails from BizTalk (using the SMTP adapter) which have images embedded in them? I did recently.

Sending HTML emails (or text emails) in BizTalk without embedded images has been done
to death – all you need is the RawString
message type.

But how do you use the SMTP adapter to send emails with embedded images?
I didn’t want to cheat and write a helper class.

I first looked at using the MIME/SMIME encoder pipeline component.
By default the MIME encoder uses a mime Content-Type of multipart/mixed.

So if you have a multipart message with an HTML body part and a single image as a
second part, this is what the MIME encoder generates:

MIME-Version: 1.0
Content-Type: multipart/mixed;
    boundary=”–=_NextPart_001_000D_01C79667.1A2EEFB0″
Return-Path: [email protected]

This is a multi-part message in MIME format.

—-=_NextPart_001_000D_01C79667.1A2EEFB0
Content-Type: text/html; charset=UTF-8;
    charset=”utf-8″
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/

<html></html>

—-=_NextPart_001_000D_01C79667.1A2EEFB0
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Location: http://localhost/images/logo.gif
Content-ID: <http://localhost/images/logo.gif>

However, multipart/mixed is not how you embed content – you need to use multipart/related,
to indicate that all the parts in the message are related.

(Note: in order to view the output of the SMTP adapter I used the IIS SMTP
service, and configured the SMTP adapter to use an SMTP server of localhost,
and a To Address which matched my local domain. This will generate EML files
in \Inetpub\mailroot\Drop which you can open using Outlook Express (or notepad)).

There’s a little known MIME context property you can set called IsMultipartRelated.
If you use this, and have all your images as parts to the message, with your HTML
part as the body part, then the SMTP adapter will send a message which can be viewed
in a few email clients e.g. Outlook.
If you use this property, this is what the MIME encoder will output:

MIME-Version: 1.0
Content-Type: multipart/related;
    type=”text/html”;
    boundary=”–=_NextPart_001_000D_01C79667.1A2EEFB0″
Return-Path: [email protected]

This is a multi-part message in MIME format.

—-=_NextPart_001_000D_01C79667.1A2EEFB0
Content-Type: text/html; charset=UTF-8;
    charset=”utf-8″
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/

<html></html>

—-=_NextPart_001_000D_01C79667.1A2EEFB0
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Location: http://localhost/images/logo.gif
Content-ID: <http://localhost/images/logo.gif>

However this doesn’t work for any web based browsers e.g. Hotmail, Yahoo, SquirrelMail,
or LotusNotes.

Reading the RFC for Multipart
HTML messages
showed me what I was missing: The Content-Type for the complete
message needs to be multipart/related, but the first (body) part needs to consist
of two parts, and have a Content-Type of multipart/alternative. – that is,
the first part is actually another multi-part message!
The reason for this is the body part contains a Text part, and an HTML part – so that
browsers which don’t understand HTML can still display the message.
It appears that a lot of email browsers won’t display messages unless they are in
this format and, in fact, this is what the RFC recommends.

Problem is, the MIME encoder does not support this (as far as I can make out – there’s
a promising property called PartContentTypeSecondaryHeader but I couldn’t get
it to work for me, plus IBaseMessagePart doesn’t act as a container for other
parts, so it’s unclear how you’d represent it in a message anyway).

So I wrote a pipeline component which takes an HTML stream as input, parses it and
downloads all the resources, and then does the correct MIME encoding.
This is the output from my component:

MIME-Version: 1.0
Content-Type: multipart/related;
    type=”multipart/alternative”;
    boundary=”–=_NextPart_001_000D_01C79667.1A2EEFB0″
Return-Path: [email protected]

This is a multi-part message in MIME format.

—-=_NextPart_001_000D_01C79667.1A2EEFB0
Content-Type: multipart/alternative;
    boundary=”–=_NextPart_001_000E_01C79667.1A2EEFB0″

—-=_NextPart_001_000E_01C79667.1A2EEFB0
Content-Type: text/plain;
    charset=”iso-8859-1″
Content-Transfer-Encoding: 8bit

Plain text version of the email

—-=_NextPart_001_000E_01C79667.1A2EEFB0
Content-Type: text/html;
    charset=”utf-8″
Content-Transfer-Encoding: quoted-printable
Content-Location: http://localhost/

<html></html>

—-=_NextPart_001_000E_01C79667.1A2EEFB0–

—-=_NextPart_001_000D_01C79667.1A2EEFB0
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Location: http://localhost/images/logo.gif
Content-ID: <http://localhost/images/logo.gif>

The next trick was trying to get the SMTP adapter to accept the output from my component:
In BizTalk, there are two ways of MIME encoding content: simple encoding is performed
by the SMTP adapter (e.g. if you don’t use the MIME encoder); more advanced encoding
is performed by the MIME encoder.

So obviously the MIME encoder sets a property which indicates that the message is
already MIME encoded so the SMTP adapter doesn’t need to bother.
If you look at the list of context properties which the MIME encoder supports, you see
there’s one called IsMIMEEncoded.
Seems pretty obvious.


Except that the property doesn’t work.

I had to add a Debug pipeline component which would dump all the context properties
attached to a message after the MIME encoder had finished with it to find the answer.
Turns out there’s another context property called MimeEncoded (note the lack
of capitalisation), which is in the System namespace (not the MIME namespace) and
can only be set from code.
And this is the one that the SMTP adapter looks for. You can set it like this:
    inmsg.Context.Write(“MimeEncoded”,
   “http://schemas.microsoft.com/BizTalk/2003/system-properties”, true);

And now it works: I get email with embedded resources which can viewed correctly in
all mail browsers (except Lotus Notes, which occasionally doesn’t show images – but
that’s Notes for you!)

As an aside, whenever I write a pipeline component, I always try and have it work
in a streaming fashion (check out Christof
Claessens’ great article about this).
However when I reflected over the source of the MIME encoder, I noticed that it doesn’t
chain the streams – during the IComponent.Execute()call,
the encoder reads the streams of all parts and returns a new message with a single
part. So it’s not implemented in a streaming fashion (i.e. you can’t chain together
all the streams from all components).

What I haven’t covered in this post is how to use Content-ID and the cid: prefix
(in your html) to link the embedded resources to the parts in your mime message –
you can see examples of this in the RFC.

I’ve stolen some MOSS 2007 Bootcamp seats

Hey guys, I’ve got a couple of seats left for some MOSS 2007 training at the end
of this month
.

If you’re wondering what all this WSS/MOSS stuff is all about, I’ll be running an equally
focused MOSS developer and administration
course very soon 🙂

What do I ned to say about moss? (if you’re using/developing/designing
and implementing – come along and fine out what works and what doesnt. Save you a
whole lot of head banging later – unless you’re at AC/DC 🙂

Who should go:
– If you have a SPS V2 site you’re thinking of upgrading, deployment, farms
structures and capacity planning.

– developers – if you’re currently building/designing Web based solutions, spend a
couple of days looking at what WSS gives you for free! (it’s just like another framework
within the .NET System space – use what ever parts you want)

– you’re curious about what is WSS V3/MOSS/FormsServices/Excel/Infopath web based
solutions and must be fluent in 3 languages (that part I made up 🙂 – reminded me
of a job description I saw one day)

Check it out – I’ve managed to reserve a couple of seats.

Course details:
When: Jun 25th – Jun 28th
Where: Sydney

Further Details
http://www.breezetraining.com.au/site/Default.aspx?tabid=49

p.s. we run the course in conjunction with Dimension
Data Learning Solutions
to give you the best experience possible.

BBC and Photosynth

The BBC is using Microsoft’s Photosynth 3D imaging software to provide views of prominent British buildings in conjunction with a new TV show, How We Built Britain.


Check it out!, blog post here.


The Photosynth images will be updated with new photos submitted by the public. The BBC is using Flickr for image uploads.


VERY COOL!


Photosynth was one of the technologies that blew me away when I first saw it at last years Microsoft Global Exchange event that I attended in Orlando.

June 19, 2007 – Next Melbourne BizTalk User Group Meeting

From Bill Chesnut – user group organiser…

We will be holding the next Melbourne BizTalk User Group Meeting on Tuesday 19th June 2007 at 5:30pm

The venue and sponsor for the meeting will be Microsoft at Level 5, 4 Freshwater Place, Southbank Click here for a Map

The topics will be:

Anthony Bettanin, Business Development Manager, RuleBurst

RuleBurst are one of ten global partners in the Microsoft Business Process Alliance. RuleBurst have a world leading natural language rules technology based on authoring rules in Microsoft Word, Excel & Visio. RuleBurst rules can be executed in the RuleBurst inference engine (including SOA and .NET API integration options) or compiled to a Microsoft BizTalk policy to import into the Business Rule Composer for execution in BizTalk. In contrast to BizTalk rule authoring which is intended for technical rather than business users, RuleBurst empowers business users to directly author and maintain their own rules in the Microsoft Office tools they are already familiar with, while retaining the broader advantages of the BizTalk middleware platform for execution of their rules. If you work with BizTalk deployments where non-technical users would like more control over their rules, this demonstration will be of interest to you. For more background information, see the attached one page brochure or Richard Seroter’s blog for a Microsoft perspective on RuleBurst rule authoring.

Bill Chesnut, Senior Consultant, Readify

Changes to the Business Rules Engine in BizTalk 2006.

Please note we are starting the meeting at 5:30pm and there will be pizza and drinks supplied

Please rsvp for [email protected] if you plan on attending the meeting.

Microsoft XPS format

During a web demonstration of the Rule Manager I had to go for a full OS reboot. Not very pretty for a product demonstration. What happened? Not really sure, but it seems that the latest version of Adobe Acrobat (8.1.0) started to lock the generated Rule PDF report.

Few days later I started to get the forced updates from Adobe. Considering I have many VM installations to test all different platforms and configurations, you can imagine I’m not too happy with these forced downloads.

Finally the free PDF viewer started to contain advertisement to FedEx. These ‘convenient’ link buttons are always a big annoyance to me.

It was time to provide an alternative to the PDF format. The latest release of the Rule Manager (1.5.0.17) supports now the Microsoft XPS as an alternative.

The good part of this is that an XPS viewer comes pre-installed on Microsoft Vista. I’m not really sure if it is part of .NET 3.0 framework, but on my XP SP2 box I could use the XPS viewer as well.

Currently the Adobe PDF format is still the default report format, but you can easily change that (and we will store your preferences in your user settings)

The main shortcoming I currently see with the XPS viewer is that you can not rotate a page.

Summer Reading List

I’m fortunate that my company does a summer shutdown during the July 4th week. I plan on taking a day or so of that “free” time off to learn a new technology or go deeper in something that I’ve only touched at a cursory level.

I’ve recently read a few books (below) that were quite […]

MDC 2007…

I’ll be doing two talks on Team Foundation Server at the upcoming Minnesota Developers Conference (MDC
2007
) on August 22nd, 2007.  One talk will be on release management (branching
strategies, deployment, etc.) and another on options for using Scrum with TFS. 
Should be a great conference all around – four great tracks and what looks to
be a great keynote on BizTalk RFID solutions.

MDC 2007…

I’ll be doing two talks on Team Foundation Server at the upcoming Minnesota Developers Conference (MDC
2007
) on August 22nd, 2007.  One talk will be on release management (branching
strategies, deployment, etc.) and another on options for using Scrum with TFS. 
Should be a great conference all around – four great tracks and what looks to
be a great keynote on BizTalk RFID solutions.