Wednesday 12 March 2008

Creating Page Layouts

STEPS TO CREATE PAGE LAYOUTS
1#.Page layouts are templates that define content structure for a page and are always associated with a content type.
2#.A content type contains a document template, data columns, workflows, and other information that completely define a document.
3#.The publishing feature of MOSS uses a single root content type for publishing called Page.
4#.All of the page layouts inherit from this base. Here’s how to create a new page layout in MOSS.

STEP 1: Define Site Columns
The individual content elements that appear in a page layout are derived from site columns. When you create a page layout, you can use any of the site columns already defined or define your own.

STEP 2: Define a Content Type
Page layouts have a direct relationship to a content type defined within the site. The content type is a collection of site columns, a page template, workflows, and other information that determine the appearance and behavior of a page layout. In order to create a page layout, you must create a new content type that derives from the existing Page content type. Inheriting the Page content type allows the new page layout to function correctly within the MOSS content management Feature.

STEP 3: Create the Page Layout
Page layouts are stored in Master Page and Page Layout Gallery. From this gallery, you can create a new page layout and associate it with a content type.This process makes the site columns that are defined for the content type available to the page layout as field controls that you can place on the page with the SharePoint Designer.

STEP 4: Edit the Page Layout in SharePoint Designer
Once you have created the new page layout, you must open it in the SharePoint Designer so that you can add the desired field controls. The site columns you defined as part of the content type become available in the SharePoint Designer as field controls that you can place on the page layout.

STEP 5: Publish the New Page Layout
Once the page layout is created, you must publish and approve it so that it becomes available for content authors. This process is essentially the same as publishing any item in MOSS. First the document is checked in, then it is published, and finally it is approved.

STEP 6: Create a New Page
Once the page layout is published and approved, content authors may use it to create new pages. This is done in the normal way by selecting the Create Page item from the Site Actions menu. After the page is created, the field controls may be edited to develop the actual page content.

Monday 10 March 2008

Preparing a WSP to deploy a webpart as a feature

Steps in creating a WSP
1. After the webpart is built and compiled.

2. Create a folder "Deployment"

3.Prepare manifest.xml with the following content
<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
SolutionId="60AB14A4-975F-4ddc-9314-A4E95BD68B0D" xmlns="http://schemas.microsoft.com/sharepoint/">
<FeatureManifests>
<FeatureManifest Location="MyWebPart9\feature.xml" />
</FeatureManifests>
<Assemblies>
<Assembly Location="MyWebPart9.dll" DeploymentTarget="GlobalAssemblyCache">
<SafeControls>
<SafeControl Assembly="MyWebPart9, Version=1.0.0.0, Culture=neutral, PublicKeyToken=72d040bf09bc4e29" Namespace="MyWebPart9" TypeName="*" Safe="True" />
</SafeControls>
</Assembly>
</Assemblies>

<ApplicationResourceFiles>
<ApplicationResourceFile Location="MyWebPart9.dll" />

</ApplicationResourceFiles>
<RootFiles>
<RootFile Location="TEMPLATE\IMAGES\MyWebPart9\muki.jpg" />
</RootFiles>
<Resources>
<Resource Location="MyWebPart9\MyWebPart9.webpart" />

</Resources>
</Solution>

4.Create folder "MyWebPart9"in Deployment folder -- this should have same name as webpart file.
(Deployment folder should contain the DLL)

5.Prepare feature.xml in same folder with following content
<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
Id="{B8E5AEC5-8DD4-46b2-B066-CDD8651BEBB7}"
Title="My Web Part"
Description="My Web Part getting deployed with a WSP"
Scope="Site"
ImageUrl="muki.jpg"
>

<ElementManifests>
<ElementManifest Location="webpartsmanifest.xml"/>
</ElementManifests>

</Feature>


6. Create "webpartmanifest".xml file with following content in the \Deployment\MyWebPart9 folder
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="MyWebPart9" List="113" Url="_catalogs/wp">
<File Url="MyWebPart9.webpart" Type="GhostableInLibrary">
<Property Name="Group" Value="muki"></Property>
</File>
</Module>

</Elements>

7. Create "MyWebPart9.webpart" in the same folder with the following content
<?xml version="1.0" encoding="utf-8"?>
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="MyWebPart9.MyWebPart9"/>
<importErrorMessage>Cannot import this Web Part. </importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">MyWebPart9 Web Part</property>
<property name="Description" type="string">Sample Web Part that display label.</property>
</properties>
</data>
</webPart>
</webParts>

8.Copy the Image to this same folder, which serves as a Icon to our feature in the activation screen

9.Create "MyWebPartDeploy.ddf"file in the Deployment folder with the following content
;
.OPTION EXPLICIT ; Generate errors
.Set CabinetNameTemplate=MyWebPart9.wsp
.set DiskDirectoryTemplate=CDROM ; All cabinets go in a single directory
.Set CompressionType=MSZIP;** All files are compressed in cabinet files
.Set UniqueFiles="ON"
.Set Cabinet=on
.Set DiskDirectory1=Package
;
; ** CAB Root
manifest.xml
MyWebPart9.dll
;
; ** MyWebPart9
.Set DestinationDir=MyWebPart9
MyWebPart9\Feature.xml
MyWebPart9\webpartsmanifest.xml
MyWebPart9\MyWebPart9.webpart
;
; ** MyImages
.Set DestinationDir=TEMPLATE\IMAGES\MyWebPart9
MyWebPart9\muki.jpg

10. Execute the following command
makecab.exe -f DEPLOYMENT\MyWebPartDeploy.ddf

11. Execute the following command to add the WSP to solution store in portal
stsadm -o addsolution -filename MyWebPart9.wsp

12. Execute the following command to deploy the wsp to portal
stsadm -o deploysolution -name MyWebPart9.wsp -url http://servername:portnumber-immediate -allowGacDeployment

Sunday 2 March 2008

MCTS

I passed out all the MCTS exams for WSS, MOSS
TS : 70-542 - Application developement using MOSS
70-541 - Application developement using WSS
70-630 - Configuring MOSS
70-631 - Configuring WSS