Wednesday, December 19, 2007

Create custom site definitions which include CEWPS and using resource files for their content

Maybe my longest title for a post ever but I think it covers everything what I wanted to share with you..  In a previous post I mentioned a solution for a problem when a site template was being used with activated features that didn't provision very well. This post is about that solution ;)

It's not really difficult to create a new site definition (a lot of bloggers already paved the way for me there) but I had some difficulties adding a Content Editor WebPart (CEWP) with HTML into my definition. Since you have to replace the < and > symbols with &tl; and &gt; and you will have to put CDATA brackets around the whole thing as well. After several attempts to encode my HTML the proper way (and failing miserably), I decided to check how Microsoft put CEWP's in their site templates.. and this is how it looks:

<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2"> <Title>$Resources:spscore,ReportCenterOnet_CEWP_Title;</Title> <FrameType>TitleBarOnly</FrameType> .. <Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly> <TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName> <ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" /> <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor">$Resources:spscore,ReportCenterOnet_CEWP_Content;</Content> <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" /> </WebPart>

"$Resources:spcore, ReportCenterOnet_CEWP_Content", that's all the content they put in there! No encoded HTML with CDATA brackets at all! So what does it mean then? Well.. i'll tell you!

  • $Resources : here they are referring to the fact that the content is placed in the Resources folder (/12 hive/Resources)
  • spcore : here they are referring to which file the content is placed in
  • ReportCenterOnet_CEWP_Content : here they are referring to which value in the file must be used

So when we open up the spcore.xml file and find look for the "ReportCenterOnet_CEWP_Content" value, it looks like this :

<Data Name="ReportCenterOnet_CEWP_Content"> <Value>&lt;DIV class="ms-vb"&gt; &lt;SPAN class="ms-announcementtitle"&gt;Report Center features include:&lt;/SPAN&gt; &lt;UL&gt; &lt;LI&gt;&lt;A title="" href="../Lists/Sample KPIs/KPIListViewPage.aspx" target=""&gt;Key Performance Indicators&lt;/A&gt; (KPIs) enable you to communicate goals, trends and track progress.&lt;/LI&gt; &lt;LI&gt;&lt;A title="" href="../ReportsLibrary/sample dashboard.aspx" target=""&gt;Dashboards&lt;/A&gt; enable you to give a more detailed explanation of your information using Excel workbooks and KPIs. Dashboard filters make it easy to select a range of information to view. To create your own dashboard go to the &lt;A title="" href="../ReportsLibrary/Forms/scsummpg.aspx" target=""&gt;Dashboards&lt;/A&gt; view of the Reports library and click 'New'.&lt;/LI&gt; &lt;LI&gt;The &lt;A title="" href="../ReportsLibrary/forms/current.aspx" target=""&gt;Reports&lt;/A&gt; library is designed to store files containing reports and dashboards and allow easy access to information from previous time periods.&lt;/LI&gt; &lt;/UL&gt; &lt;SPAN class="ms-announcementtitle"&gt;To prepare this Report Center for use, the following actions are suggested:&lt;/SPAN&gt; &lt;UL&gt; &lt;LI&gt;View the sample &lt;A href="../ReportsLibrary/sample dashboard.aspx"&gt;dashboard&lt;/A&gt; and &lt;A title="" href="../ReportsLibrary/sampleworkbook.xlsx" target=""&gt;workbook&lt;/A&gt; to understand some of the capabilities of this Report Center&lt;/LI&gt; &lt;LI&gt;If the samples do not work correctly ask an administrator to ensure that Excel Services are enabled and that this Report Center is a Trusted Location&lt;/LI&gt; &lt;LI&gt;If you plan to use Excel to analyze information from existing data servers, create and upload data connection (ODC) files to the &lt;A title="" href="../Data Connections" target=""&gt;Data Connection Library&lt;/A&gt;. If you want users to create new KPI Lists then add them to the "Owners" group. Users in the "Members" group can edit pages but can not create KPI Lists.&lt;/LI&gt; &lt;LI&gt;Update or remove sample content&lt;/LI&gt; &lt;/UL&gt; &lt;/DIV&gt;</Value> </Data>

So it seems you still have to encode your HTML but you don't have to worry about CDATA stuff :) The question is, why should you use the same technique as Microsoft does ?

  • Makes the ONET.XML more 'readible' and thus easier to maintain
  • No more messing around where to put the CDATA stuff
  • One place to maintain the content of your CEWPs

Hope this gives you more insight about creating and defining site definitions as it did to me ;)

 

Technorati Tags:

8 comments:

Muhanad said...

Nice post Robin. I actually went through a similar situation where I had to dig into the spscore resource files. And due to my horrible experience lol, I'm blogging about it as well to save other people from going through what I did.

Anyway, keep it up, I love your posts!

Mike said...

Thanks for the information. I followed the tip but I wasn't able to get it to work. The following is what I'm using for the value.

<strong>BEFORE YOU BEGIN! </strong><br>
Please <a href="https://www.domain.net/pages/SiteDesignTutorial.aspx">read instructions</a> to design this page.
Before publishing, REMEMBER to DELETE this web part.

Do you have any suggestions for me? The problem is that it returns a web part error.
Thanks

..it doesn't show up in the comment section of where I used < and > but they all are set correctly. Any ideas?

vsi said...

Just Sit Back and Relax!
Let VisiMigrate do the work

VisiMigrate®

VisiMigrate Enterprise & VisiMigrate Lite Brochure

Microsoft BizTalk Server Download PDF
Acrobat Reader
File Size: 2.16 MB


Lotus Notes® to SharePoint (MOSS)® Migration

Visionet’s VisiMigrate tool provides automated content migration from Lotus Notes to the Microsoft SharePoint platform. VisiMigrate offers out-of-the-box functionality to transform content from common Lotus Notes databases such as document repositories, discussions, and tasks to SharePoint Lists, Document Libraries, and more.
VisiMigrate Overview

Visionet’s VisiMigrate tool provides automated content migration from Lotus Notes to the Microsoft SharePoint platform. VisiMigrate offers out-of-thebox functionality to transform content from common Lotus Notes databases such as document repositories, discussions, and tasks to SharePoint Lists, Document Libraries, and more.



Along with the Enterprise version, Visionet offers a lite version of the VisiMigrate toolset - VisiMigrate Lite – that provides a thin client based solution for Standard Lotus Notes content overthe- web. It provides simplified work management features where the users can select the content to be migrated and VisiMigrate does the rest. Users can even filter for documents and data to be migrated in the process.
VisiMigrate Lite

VisiMigrate Lite is an integrated webbased solution that offers end-to-end migration processing with minimum administrative effort. VisiMigrate Lite provides over-the-web content transformation and migration facilities in a cost effective and efficient fashion. VisiMigrate can connect to a user’s local Lotus Notes environment to analyze content and offers pre-configured SharePoint site and content templates to migrate content to SharePoint.



VisiMigrate allows the user to select and filter available Lotus Notes databases for migration. These selected databases are analyzed and automatically mapped to appropriate SharePoint sites. VisiMigrate automatically creates the target SharePoint site, if one does not exist, or allows the user to select an existing SharePoint target site. The target SharePoint site is extended to accommodate the Lotus Notes document characteristics that do not normally exist in the SharePoint environment. Selected documents and items are extracted from Lotus Notes and are transformed into the SharePoint data formats which are then loaded into the SharePoint site.
Supported Platforms

VisiMigrate Data Conversion Tools from Lotus Notes to Sharepoint Portal Site

Click here to see large view
VisiMigrate Lite Supported Platforms


VisiMigrate Lite supports the following Lotus Notes platforms:



* Lotus Notes/Domino.doc
* Lotus QuickPlace/Quickr



VisiMigrate Lite supports all standard Lotus Notes Content Types and provides automated mapping to compatible SharePoint content types. A brief list of content types is given below:



* Standard Notes Templates

* Document Libraries
* Discussions
* Task Lists
* Memo
* Data Types
* Text, Rich Text, etc.

Work Management Features

VisiMigrate Lite provides simplified work management features where users only have to select the content to be migrated. During the process, users can even filter for documents and data to be migrated while VisiMigrate does the rest.



* Lotus Notes Content Selection

* Allows the user to migrate all Lotus Notes database contents or to filter for documents/data selection
* SharePoint site templates selection

* Users can override the automatically selected SharePoint template for selected Lotus Notes database

* Job Monitoring

* Web-based progress and error reporting

* Automatic restart and recovery

In the case that a migration job fails, VisiMigrate can perform automated error recovery and resume the data transfer to seamlessly complete the migration process.


VisiMigrate Enterprise



VisiMigrate Enterprise extends the basic Lotus Notes to SharePoint content migration functions offered by VisiMigrate Lite to include features that require granular control over the data and documents migration process. VisiMigrate Enterprise contains a suite of tools that can be used by IT professionals individually to accomplish an atomic task such as extracting user security information from the Lotus Notes platform, or strung together using a script to automate the steps required for migration.

VisiMigrate Enterprise Architecture

Click here to see large view
VisiMigrate Enterprise Architecture


Architecture

VisiMigrate Enterprise tools/components are completely installed in the customer’s environment using automated setup. These tools can then be utilized by the IT professionals to define and run content migration jobs in their environment.
VisiMigrate Enterprise features

* Support Platforms

* Lotus Notes/Domino.doc
* Lotus QuickPlace/Quickr
* Windows File System

In addition to Lotus Notes documents and data, the enterprise edition also supports content migration from standard Windows based file servers and network shares. Migration of security information from theses document shares is also supported.

* Supported Content Types

* Standard Notes Templates

* Document Libraries
* Discussions
* Task Lists
* Memo

Customized Notes Templates

One of the vexing issues with migrating Lotus Notes content to the SharePoint environment is the existence of customized Lotus Notes databases that either do not use standard Lotus Notes database templates or considerably extend their functionality. Such Lotus Notes applications range from small departmental applications that interface with Enterprise transaction systems to organization wide utility applications. Most of these applications are built using the initial version of Lotus Notes and employ legacy technology that is not Internet enabled and often do not make use of the workflow concept.



With the advent of Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007 (MOSS 2007), the SharePoint Designer tool and the .Net based extensible architecture of SharePoint lends itself to developing user friendly, web-based and workflow enabled applications that can take advantage of the Microsoft toolsets to integrate these applications with the Enterprise transaction systems.



VisiMigrate provides extensive data selection and migration features that allow the users to create and extend SharePoint Lists that will house the transactional data migrated from Lotus Notes and also allows the users to select from available SharePoint form templates so that the user interface components also get migrated to the SharePoint platform.



Some custom applications require customized business logic and rich GUI controls to properly offer a usable screen interface to the users. Visionet provides cost effective SharePoint forms customization services to accommodate migration of such complex Lotus Notes applications. Visionet has successfully utilized HTML 2.0 features such as AJAX to offer contemporary user interfaces for legacy Lotus Notes applications that use the full power of native SharePoint applications and contain legacy business logic resulting in easier and cost effective platform migration.
Advanced Work Management Features

Role Based Access

Allows role definition of system administrators and program operators where systems administrators have the capability to define migration scripts, create form templates and control data mappings between the Lotus Notes and SharePoint platforms, and the operators can only execute migration jobs.



Batch and On-Demand Modes

VisiMigrate allows the system administrator to define batch jobs that can be run multiple times based on a schedule. Job specifications allow the administrators to configure data mappings to be used for content migration.



VisiMigrate also allows testing and ondemand execution of migration jobs.

Anonymous said...

Hi

I like this post:

You create good material for community.

Please keep posting.

Let me introduce other material that may be good for net community.

Source: Call center KPIs

Best rgs
Peter

sbobet said...

sip bro...langsung ke TKP..
mo cek harsbobetganya nih

sbobet said...

sip bro...langsung ke TKP..
mo cek harsboganya nih

sbo said...

It's cooooool man nice topic !
sbo

electronic signature software said...

Nice post! Provides some good info for people evaluating different approaches.