Niral.Net

Short Life

CHM to ePub Converter

CHM to ePub Converter Ever since I got my Kindle, I am using it more and more to do all kind of reading electronically.  I use Calibre (@ calibre-ebook.com) as my one stop solution to eBook management. Recently I tried to convert CHM to eBook format, and found that it was rather difficult.  Feature rich as it is, Calibre does not have a native CHM conversion function.  One can extract the CHM file and feed it to Calibre, but I found it rather tidious and error prone.  I also missed having a hierarchical Table of Contents, which are always present in CHM files.  I just went ahead and created a converter for myself in C#.  Here is the sample screenshot.

Create a SharePoint 2007 publishing page programmatically

This is a simple code to create a SharePoint (MOSS) 2007 Publishing page with code. Hope this helps // Get the SPSite - getting the current site for examples sake SPSite cursite = SPContext.Current.Site; using (SPWeb curweb = cursite.OpenWeb()) { // Get the Pages library of the web SPList pagelist = curweb.Lists["Pages"]; //content type assigned to the pages library SPContentType contentType = pubSite.ContentTypes["ContentType Name"]; //page layouts for the content type PageLayoutCollection pageLayouts = pubSite.GetPageLayouts(contentType, true); Dictionary<string, PageLayout> dPageLayouts = new Dictionary<string, PageLayout>(); foreach (PageLayout pageLayout in pageLayouts) { dPageLayouts.Add(pageLayout.Title, pageLayout); } //page layout that is required for the new page PageLayout pageLayoutToUse = dPageLayouts["layoutName"]; //publishing web from the currently open web PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(curweb); //add a new page PublishingPage newPubPage = pubWeb.GetPublishingPages().Add("newPageName.aspx", pageLayoutToUse); //put what ever content you want in the page.

Managing Enterprise Content

These are the topics covered in Enterprise Content Management (Keep in mind that Enterprise Content Management (ECM) is not the same as Web Content Management (WCM), but WCM is infact a part of ECM.)   1. Enforce document storage business rules by using Document Policy. 1.1 Create a custom document policy. Check out this posts from Ton Stegeman: Part 1 – introduction and creating the policy feature Part 2 – implementing the handler and submitting to a records center Part 3 – implementing and testing the policy 1.2 Deploy a document policy by using a policy feature.

Study Topics

The following are the topics that needs to be studied in order to cover the complete skill sets requried.

Skills Tested

The Exam is supposed to cover the following skils according to Preparation Guide for Exam 70-542 from Microsoft Learning website. Topic Weight Managing Enterprise Content 15 % Creating Business Intelligence Solutions by Using Office SharePoint Server 2007 15 % Integrating Business Data with Office SharePoint Server 2007 by Using the Business Data Catalog (BDC) 15 % Accessing Office SharePoint Server Application Platform Services 14 % Searching Data by Using the Search Service 17 % Targeting Content Based on Audience Membership 13 % Customizing Functionality by Using Profiles 11 % I will try and divide this skills into number of topics that needs to be studied.

70-542 Study Resources

This is the collection of resources I have gathered over the course of my preparation for the Microsoft Exam 70-542. The primary reason for collection this information is that there is no comprehensive resource for this exam available on the net, unless one opts for a paid resources. After working more or less exclusively on SharePoint 2007 for last 2 years, I see no reason for me to go for paid resources.

Get File Sizes of Document from Sharepoint Database

This is a simple query to get file sizes from a sharepoint database. I know there are multiple ways of doing this, but I found this the easiest and also the fastest. SELECT [filename], SUM(CAST(( CAST(CAST(filesize AS DECIMAL(38, 2)) / 1024 AS DECIMAL(38, 2)) / 1024 ) AS DECIMAL(38, 2))) AS 'Size in MB' FROM (SELECT dirname + '/' + leafname AS [filename], size AS filesize, siteid, webid, extensionforfile FROM

Add choices to Sharepoint Multi-Choice Field

Setting field values of a list item in SharePoint is easy.  But when it comes to Multi-Choice fields, the code is a big different.  The following code shows how values can be added to a multi-choice field. SPFieldMultiChoice choiceField = (SPFieldMultiChoice)myWeb.Fields["choiceFieldName"]; choiceField.Choices.Add("Value"); //Set PushChangesToLists to true if automatic update of List or Content types is required choiceField.PushChangesToLists = false; choiceField.Upate();

Create a SharePoint Content Type programmatically

Sometimes it is necessary to create a Sharepoint Content Type by code, specially when batch creating content types.  The following code snippet shows how a sharepoint content type can be created in C#.  I have also included some not-so-simple field types like choice and lookup. using (SPSite p_site = new SPSite(urlToSite)) { using (SPWeb p_web = p_site.OpenWeb()) { SPContentType CustomContentType = new SPContentType(p_web.AvailableContentTypes["ParentContentType"], p_web.ContentTypes, "MyContentType"); // A string Field p_web.Fields.Add("NumberColumn",