Many Notes applications were designed primarily to publish rich content to a wide audience. These often included some type of approval process, management of draft content, version control, etc. These are great examples of applications that may well to the “publishing” site templates available in SharePoint Server 2010 and MOSS 2007. Here, for example, is a rich text Notes document (with embedded images, attachments and doc links) that has been migrated to a 2010 “Publishing Portal” using Notes Migrator for SharePoint.
If we put this page into edit mode, we can see that a great deal of out-of the-box functionality is available with no development required.
Notes Migrator for SharePoint supports migrating any Notes content to publishing pages. This is a little more complex than doing other wiki pages or basic pages and uses the tool’s unique capability to create pages using custom ASPX template code. The remainder of this walkthrough will use screen shots from SharePoint 2007, but the process is nearly identical for SharePoint 2010.
If you do not already have a publishing site, create one using SharePoint Central Administration and specify one of the “Publishing” templates.
Next, we need to create a “template” for generating pages from your Notes documents. Go to your new SharePoint publishing site site and create a sample page by selecting Create Page from the Site Actions menu.
Select the page layout you want for your new pages. The list of layouts may vary depending on the site template you started with and may include custom layouts designed by your site owners.
Now populate the page with a little sample data and save it.
Feel free to experiment with checking the page in and out, versioning it, scheduling it’s release or submitting it for approval. These are all powerful features of the SharePoint publishing templates, but you actually do not need to use them for the task at hand.
For designing a migration job, we need to extract the page to a local file so we can example the ASPX layout. Select View All Site Content from the Site Actions men and then go to the “Pages” document library.
In the Pages library locate the test page you just created and pick Send To –> Download a Copy from the drop down menu for that page.
Save the ASPX file to your computer and edit in any text editor. I like Visual Studio or SharePoint Designer, because it gives me nice color coding and formatting, but Notepad also works just fine. Keep this ASPX file handy, because will be using it later.
Digression: ASPX developer’s may be interested in how this page is constructed. It inherits from a class in the Microsoft.SharePoint.Publishing namespace, but does not actually specify any HTML markup. Instead the code behind the pages uses the data in an XML data island to render the page. Notice that the XML parts specify not only content properties such as PublishingPageContent but also the page layout in the PublishingPageLayout property.
Now you have what you need to create your Notes Migrator for SharePoint migration job. You can start from scratch or customize an existing job if you prefer, but you might prefer to start with an existing job that I created. I suggest downloading one of the following jobs, depending on which version of SharePoint you are targeting:
[DocLibrary to Publishing Page 2007.pmjob]
[DocLibrary to Publishing Page 2010.pmjob]
If you are starting with the above jobs, should first change the source Notes database to refer to the your database and you may need to customize the source data definition to extract different Notes data items than the default ones specified (“Subject”, “Body”, etc.).
You should also change and target SharePoint URL to point to your publishing site. Both jobs are already configured to create new pages in the “Pages” library, place any embedded objects in the “Images” library, and place any attachments or embedded objects in the “Documents” library. This is consistent with the way things work normally when a SharePoint user created content in a publishing site, so you probably do not need to change those parts.
If you open the target data definition in the migration jobs, you will notice that there is a target field of type PageName and that the PageType property of this field is set to “Template”. This PageType allows you to specify your own custom ASPX code in the PageTemplate field.
Remember that ASPX code we looked at when we downloaded a sample ASPX page from the server? That is the code we need to put into the PageTemplate field. But we don’t want all of it, just the bits that describe the page structure. We can leave out the content parts and, as you will see shortly, we will specify the content in a different way (mapping the data dynamically from Notes). Your ASPX page may be different than the one I showed above, but generally you want the ASPX tags at the top (which start with “<%@”) and the <html> tag. In my example, I am going to grab the first four lines and paste it into the little drop down editor for the PageTemplate.
Notice that the target data definition also specifies several fields that allow data to be mapped as content in the generated pages. Some of these you may recognize as the properties that were specified in the XML data island (the green part) in the above example. We included PublishingPageContent for mapping the Notes rich text and PublishingPageLayout for specifying the page layout. Other page types may require additional properties but you will find that many of them can be omitted as the defaults are acceptable for migrations. Title and ApprovalCode allow setting of metadata on the page. ExternalImages and ExternalAttachments allow mapping of additional files to the appropriate SharePoint libraries.
Press OK to save the target data definition. Next go to the Mapping tab to review how various fields are set from the dynamic Notes data. Most of these mappings will make sense to an experienced Notes Migrator for SharePoint user, but two deserve special attention.
The PublishingPageLayout is set to a constant value, which is the URL of the appropriate layout page. It is critical that you replace this value with the the address of a layout page on your SharePoint server. Recall that when I created a test page in the example above, I selected the page layout “Article page with body only”. In the resulting ASPX file, this translated to the PublishingPageLayout property in the XML data island (the green bit) set to “
” This is the URL that you need to use here. If you do not get this part right, your pages will not open.
The jobs are also designed to set any migrated content to the “Approved” state. This is accomplished by mapping a constant value to the ApprovalCode field. Of course you can change this to a different constant value or even make it dynamic depending on the state of your Notes document.
Depending on the page layout you selected, you may need to map other properties as well. When you are ready, press the Run Job button and start migrating!
Upcoming releases of Notes Migrator for SharePoint will add a few things to make the above process a bit easier, but there is really no need to wait. You can generate great looking publishing pages now.