Standing on the shoulders of giants.
 Monday, June 23, 2008

One of my projects from last year was nominated for and won the IWS, Search Partner of the Year award. We received the award for a project we did for the Dutch consultancy company Twynstra Gudde.

We created a system which allows the user to search through many different subsystems using the simplest interface we could design:

Homepage

Under the surface the system combines the results from all of their back-end systems to give the user a complete view of all the information available relevant to their search query.

Systems

The search results are presented in way that allows a user to filter the results and find detailed pages (all red text is a link):

 Result page

I am very proud that I was part of the team to build this solution, which the client is very enthusiastic about and the Microsoft chose to honor with the Search Partner of the Year award!

Microsoft press release

Tam Tam press release

23 Jun 2008 18:05 W. Europe Daylight Time  #    Comments [0] - Trackback
General | Sharepoint

 Monday, April 28, 2008

Recently a client wanted to import binary files with metadata into SharePoint 2007 from a directory. Because BizTalk was available and I suspected there would be some scaling issues if I would go the custom NT service route, I decided to prototype the solution in BizTalk first. The prototype was finished in just 2 days, which is a lot faster than a custom solution which is as scalable and reliable.

Customer question

The customer wanted to import scanned documents and metadata from their OCR scanners into a SharePoint document library. A scanned document consists of a PDF file and an XML file with the OCR results, both files have the same name (with a different extension) and are uploaded to a fileshare.

Solution

The solution consists of a BizTalk server which uses a File Receive Adapter to monitor a specific directory for a combination of a PDF and XML file, those are combined in an orchestration and send to a document library using the WSS Adapter.

Import Process 

The BizTalk solution consists of several pieces:

  1. A schema to describe the received XML file,
  2. An orchestration, to receive the files, create the new message and send that to the document library,
  3. A pipeline component to rename the received files (and 2 pipelines to host it),
  4. A custom component to encode the values send in the metadata.

The schema

The schema can be any valid XML-schema, but to make it easier to add the properties to the WSS message I set the type of the nodes to string and promoted them. Note that if some of the fields are nullable, we have to take care when accessing those.

The orchestration

The orchestration consist of 3 steps:

  1. Receiving the file,
  2. Creating the new message,
  3. Sending the message.

Step 1: Receiving the file

 receive

There are 2 receive ports, one for each of the file types, both match to a receive action and are able to start the orchestration. Between the receive actions exists a correlation, which correlates the received messages on their (normalized) filename. The filenames are normalized using a custom pipeline component, see below. Only when both ports have received a file the next step of the orchestration is started.

Step 2: Creating the new message

Create message

Creating the message consists of 2 steps to make it easier to organize the code. In the first step, "SetWssProperties", a global variable is filled with a string containing an XML node with the custom properties send to SharePoint. All values are encoded using a custom component, the PropertyEncoder, see below.

WssProperties = "" 
+ "Team" 
+     ""+ Paulb.PropertyEncoder.Encode( InvoiceXml.fields.Team ) + "" 
+     "Client" 
+     ""+ Paulb.PropertyEncoder.Encode( InvoiceXml.fields.Client )+ "" 
+     "Document_x0020_type" 
+     ""+ Paulb.PropertyEncoder.Encode( InvoiceXml.fields.DocumentType )+ "" 
+    "Gross_x0020_amount" 
+     ""+ Paulb.PropertyEncoder.Encode(InvoiceXml.fields.TotalAmount) + ""; 
if( false == System.String.IsNullOrEmpty(InvoiceXml.fields.InvoiceDate)) {
      WssProperties = WssProperties + "Invoice_x0020_Date" 
      + ""+ InvoiceXml.fields.InvoiceDate + ""; 
}

WssProperties = WssProperties +    "Invoice_x0020_Number" 
+     ""+ Paulb.PropertyEncoder.Encode( InvoiceXml.fields.InvoiceNumber )+ "" 
+    "ScanID" 
+     ""+ Paulb.PropertyEncoder.Encode( InvoiceXml.fields.ScanID )+ "" 
+    "Vat_x0020_number" 
+     ""+ Paulb.PropertyEncoder.Encode ( InvoiceXml.fields.VatNumber )+ "" 
+ ""; 

In the second step, the incoming PDF message is copied to the outgoing WssMessage and it's properties are set. The filename is encoded using the custom ProperytEncoder component to meet the requirements for a filename in a SharePoint Document Library.

InvoicePdfMetaData = InvoicePdf;
InvoicePdfMetaData(WSS.Filename) = "FLT" + Paulb.PropertyEncoder.EncodeFileName(InvoiceXml.fields.ScanID) + ".pdf";

InvoicePdfMetaData(WSS.ConfigPropertiesXml) = WssProperties;

Step 3: Sending the message

Send Message

Sending the message is the final and simplest step: create a Send object and link it to the port. The configuration of the port is done using BizTalk Administration Console after deploying the solution to the BizTalk server.

The Pipeline

The solution involves 2 receive pipelines, one for each of the filetypes (xml and pdf). It is necessary to create 2 pipelines because the pipeline for the xml file requires the XML disassembler to recognize the schema and match it to the receive action. Both pipelines contain the custom FixFileName component, which normalizes the filename for the incoming file (it removes the path and the extension).

The actual work is done in the Execute method of the IComponent interface, the remaining interfaces either must be implemented, but are not used (IPersistPropertyBag) or are used by the designer environment (IComponentUI). The IBaseComponent interface supplies basic information about the component, such as Name and Version.

IBaseMessage IComponent.Execute(IPipelineContext pContext, IBaseMessage pInMsg)
{

    // make sure we have something to work with
    if (pInMsg == null)
    {
        return pInMsg;
    }

    string receivedFileName = pInMsg.Context.Read("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties") as string;
    if (string.IsNullOrEmpty(receivedFileName))
    {
        // nothing we can do
        return pInMsg;
    }

    string newFileName = Path.GetFileNameWithoutExtension(receivedFileName);

    pInMsg.Context.Promote("ReceivedFileName", "http://schemas.microsoft.com/BizTalk/2003/file-properties", newFileName);

    return pInMsg;
}

One thing to remember, is to Promote the property you're writing otherwise you're not able to use it for routing.

Another thing about pipeline components is: BizTalk expects them to be deployed to a specific location on the filesystem, the Pipeline Components directory of the BizTalk installation directory (the default location is: C:\Program Files\Microsoft BizTalk Server 2006\Pipeline Components).

FixFileName.cs

Custom component for encoding properties

The component for encoding the properties is a standard .NET assembly. It is not necessary to implement any interfaces, all assemblies work when they are referenced in the BizTalk orchestration project. The only requirement is that the assembly is deployed to the GAC.

This project required some additional encoding of the XML values, beside the normal HTML encoding, to encode the characters used by BizTalk macros and to strip characters which are illegal in filenames in a document library.

PropertyEncoder.cs

See also:

Information about convoys

Developing pipeline components

28 Apr 2008 22:25 W. Europe Daylight Time  #    Comments [0] - Trackback
BizTalk | Development | Sharepoint

Today we released the 1.0 version of the Euro 2008 Webparts for SharePoint 2007 and 2003.

These webparts allow you to host a Euro 2008 game on your SharePoint portal. The game consists of 2 webparts (there is a version for SharePoint 2003 and 2007), which allow the participants to predict the results of all the matches of the Euro 2008 Championship. The webparts connect to a webservice hosted by Tam Tam where the results of the matches and the scores of the participants is managed.

Other features include:

  • Overview of the next 10 matches.
  • Overview of all Euro 2008 matches.
  • A leaderboard of all users. The top 15 users with the highest points and the points of the current user.
  • View the details of a participating country with all the matches.
  • Multilingual. The web parts can be displayed in the following Languages: English, Dutch, German, French, Portugese and Spanish.
  • The end results of matches are hosted and administered by Tam Tam. You do not have to do anything to update scores.
  • All data stored on the Tam Tam servers is hashed.

Download the webparts from the Euro 2008 Webpart site.

Some screenshots:

Upcoming matches:

View upcoming matches

View a match and enter your prediction:

view match and enter prediction 

View country details:

View country details

28 Apr 2008 13:52 W. Europe Daylight Time  #    Comments [0] - Trackback
Fun | Sharepoint

 Wednesday, December 12, 2007

The documentation for the DoesUserHavePermissions method starts hopeful:

"The DoesUserHavePermissions method of the SPPermissionCollection class returns a value that indicates whether the current user has the specified permissions."

But it goes downhill in the "return value" section:

"true if the current user has the specified permissions; otherwise, raises an access denied exception and prompts the user for authentication."

It is not exceptional for a user to not have permissions, so raising an exception in those cases is not something you would expect to happen; especially since the method returns a boolean, which does support the false value.

A general design guideline for .Net development as described in the Framework design guidelines (p183-188) is: "DO NOT use exceptions for the normal flow of control, if possible."

12 Dec 2007 14:58 W. Europe Standard Time  #    Comments [0] - Trackback
BCL | Sharepoint

 Saturday, August 19, 2006

Frank just started his new blog and his first post details how to work with control adapters in SPS2007. Very good stuff.

19 Aug 2006 14:18 W. Europe Daylight Time  #    Comments [0] - Trackback
Development | Sharepoint

 Wednesday, August 03, 2005

Daniel McPherson points to a number of templates for Windows Sharepoint Services, available on Micorsoft downloads, to help with common tasks in every organization.

Windows SharePoint Services Applications Template: Room And Equipment
Windows SharePoint Services Applications Template: Expense Report Portal
Windows SharePoint Services Applications Template: Event Planning
Windows SharePoint Services Applications Template: RFP Management
Windows SharePoint Services Applications Template: HR InfoPath Forms
Windows SharePoint Services Applications Template: Professional Services Contractual Setup
Windows SharePoint Services Applications Template: Loan Initiation Management
Windows SharePoint Services Applications Template: Change Management
Windows SharePoint Services Applications Template: Meeting Management
Windows SharePoint Services Applications Template: Classroom Management
Windows SharePoint Services Applications Template: Legal Document Review
Windows SharePoint Services Applications Template: Employee Scheduling
Windows SharePoint Services Applications Template: Marketing Communications Campaign Site
Windows SharePoint Services Applications Template: Employee Training
Windows SharePoint Services Applications Template: IT Developer
Windows SharePoint Services Applications Template: HelpDesk Dashboard
Windows SharePoint Services Applications Template: Board of Directors
Windows SharePoint Services Applications Template: Project Team Management
Windows SharePoint Services Applications Template: Absence Request and Vacation Schedule Management
Windows SharePoint Services Applications Template: Competitive Intelligence

03 Aug 2005 19:05 W. Europe Daylight Time  #    Comments [0] - Trackback
Sharepoint

 Tuesday, March 08, 2005

Bart has resurrected his blog and is focusing on using portal technology in real-life applications. Allthough not as technical as Mart's Sharepoint blog, but certainly worth the reading, if you're implementing portal technology for your (internal) customers.

His first post, "Clients demand sharepoint, but sometimes lack portalvision..." , discusses the dissapointment some customers will feel, when they realise Sharepoint will not solve all their problems and world hunger, without a clear understanding what their problems are or without support from the entire organisation. 

08 Mar 2005 19:00 W. Europe Standard Time  #    Comments [0] - Trackback
Office 2003 | Sharepoint

 Thursday, November 25, 2004
This is something Mart will like, the sharepoint MSDN RSS feed.
25 Nov 2004 21:31 W. Europe Standard Time  #    Comments [1] - Trackback
Sharepoint

 Monday, February 02, 2004

Microsoft® Content Management Server 2002 Connector for SharePoint™ Technologies enables you to integrate Microsoft Office® SharePoint Portal Server 2003 and Windows® SharePoint Services 2.0 technologies with Microsoft Content Management Server (MCMS) 2002 to create an end-to-end solution for document publishing.

I saw a demo a couple of months ago, built on the beta which looked very nice.

MS CMS 2002 Connector for SharePoint download

02 Feb 2004 21:04 W. Europe Standard Time  #    Comments [0] - Trackback
Development | CMS | Sharepoint

Subscribe
About
newtelligence dasBlog 2.1.7309.765
Admin
All Content © Copyright 2008, Paul van Brenk
DasBlog theme 'Business' created by Christoph De Baene (delarou)