Tuesday, April 14, 2009

Creation of Site Columns using features

We can add a custom column to the sharepoint list or document library. Suppose if we have column called "Department", and if this need to be present in each and every list or document library. Instead of creating custom column for each and every list/document library, we create site column once and which can be used across all the lists/document libraries. This new feature available only in Moss 2007.

The simplest way of creating site column is navigate to SiteActions->Site Settings->Modify all site settings->click on Site columns under Galleries section, shows the list of all available site columns.

We can create a column with list of available data types.

Creating Site column with feature.

We can create the Site columns with feature.xml.
Create a folder called Moss.Features.SiteColumn
Create two xml files feature.xml and Element.xml as follows.
copy the below code in feature.xml

Id="{8C41689F-F45F-4b28-85B8-44C4B5197D02}"
Title="Moss.Features.SiteColumns"
Description="Custom MySite Columns"
Version="1.0.0.0"
Scope="Site"
Hidden="false"
xmlns="http://schemas.microsoft.com/sharepoint/">

Location="Elements.xml" />



Copy the below code in Elements.xml



ID="{4C67267C-B950-4cd4-8038-DEACA9EC2F74}"
Name="MyTitle"
Group="MyColumns"
DisplayName="MyTitle"
Type="Text"
Required="FALSE"
Sealed="TRUE"
MaxLength="250">



Note: here "Type" data type. You can mention any available datatypes.

Move this folder to 12hive feature folder, and install the feature as

stsadm -o installfeature -name Moss.Features.SiteColumns

Activate the feature as

stsadm -o activatefeature -name Moss.Features.SiteColumns -url http://servername:portno

This creates new site column called "MyTitle".
You can reuse this site columns for lists/document libraries.

stay glued for content types, Page Layouts, Master pages in my next posts.

Get back to me if you have any queries.
shreecanth@gmail.com

Sunday, April 5, 2009

Increasing the performance of Publishing site of Moss 2007 in Mobile Devices

Have you ever been get a chance to look at how much size each page (empty moss pages or custom webpart with no data- pages hosted on moss) takes loading in moss 2007?
It takes nearly 500kb for each page load in moss 2007 site collection.

For each request to the Moss 2007 publishing page loads following basic files

Core.css
Controls.css
Core.js
Init.js
Ie55us.js
Editingmenu.js
Spellcheck.js

and lot more...

The Read access users doesn't require of loading all these files.
These files loaded into the in page, even though if we define our custom master page without any links to the above files.

But this can be a performance problem when the moss 2007 site is requested from the Mobile PDA applications.
We need to make our master page and conent pages lighter weight so that it can be easily accessed in the mobile devices.
To remove these files we need to create one HttpModule, which does the clean up of unneccesary files.

There is a great article available for removing of these files
http://www.ie-soft.de/blog/PermaLink,guid,968b0588-f306-467b-be51-54f7a8f2079d.aspx

Happy coding...

Thanks,
Shreecanth