Friday, May 29, 2009

Creating New Page Layouts

Usually sharepoint page layouts will work out in most of the requirements but what you will do if it does not meet your requirements you will have to create your own page layouts for use on the site

Creating page layout is accomplished in five steps

1. Define Site Columns
2. Define site Content Type
3. Create Page layout
4. Edit Page Layout
5. Publish and Approve Page Layout

I am going to create a new page layout called Activity page for demo, the main job of this is just to collect activity information from the administrator when it is in Edit mode and it displays data to the end user when it is in publishing mode

First i am going to define site columns these columns are directly mapped to the layout field controls on page

Define Site Columns

Site column is nothing but a reusable column that you can use in mulitple lists across multiple sites

Creating Site Column

1. Open SharePoint Site
2. Got to Site Actions
3. Site Settings
4. Galleries
5. Site Columns
6. Create
7. Enter the Activity Name under Column name textbox
8. Select type of column
9. Create new group called Activity group
10 . Select yes for require that this column contains information
11. i have taken default values for remining two which are Maximum number of charactersa and default value
12. click Ok

Repeat same steps for creating remaining site columns which are listed below

Activity Image - select type to image
Activity Description - select type to multiplie lines
Activity Workflow - select ype to image
Trainings - select type to single text

I hope that you are succesfully created remaining sitecoulmns our next step is creating Site Content Type

1. Open SharePoint Site
2. Got to Site Actions
3. Site Settings
4. Galleries
5. Site Content Types
6. Create

Please have a look into screenshot for remainig steps

Our next step is to create new Page Layout

1. Open SharePoint Site
2. Got to Site Actions
3. Site Settings
4. Galleries
5. Master pages and page layouts
6. Create



Follow the screen shot for remaining steps






Next, we have to edit the page layout using sharepoint designer



Go to Start -> Programs -> Microsoft Office -> Microsoft Office SharePoint Desinger2007 -> File -> Open Site... -> Enter site url


You can see checked-out activity page under master page gallery refer below screen shot






You can see all site coumns under Content Fields Section just drag and drop Activity Name ,Activity Descrption, Activity Workflow, activty Image and Trainings on to activity page


Next, just right click on activity page and click on check-in and select publish a major version


Next, click on yes

After clicking yes you will be automatically redirected to Master Page Gallery there you can find all pending files to approve

For approvning these files you should have a approvel permissons then right click on activity page and click on Approve/Reject link


It will open a new page with approved, rejected and pending options just click approved radio button and give proper comments and clikc on ok

We are successfully created new page layout our next step is to create a new page using this page layout

Site Actions -> Create Page

Now you can see "Activity page layout" under layout drop down list. Fill Title and URL name textboxes and click on create button you will get a new page with place holders just populate with data and click on publish button


Tuesday, May 26, 2009

I found something that when i bind SPGridView using SharePoint object model.
The strange thing is that if I use this code everything works fine

SPDataSource dataSource = GetTravelExpenses();
string sCommand = @"<Query><Where>
<Eq>
<FieldRef Name='Travel_x0020_Request' />
<Value Type='Lookup'>" + ddlTravelRequest.SelectedItem.Text + "</Value> </Eq> </Where></Query>";
dataSource.SelectCommand = sCommand;
spGrid.DataSource = dataSource;
spGrid.DataBind();

But when I use this code the CAML query is failing to get data from Travel Request List

SPDataSource dataSource = GetTravelExpenses();
string sCommand = @"<Where>
<Eq>
<FieldRef Name='Travel_x0020_Request' />
<Value Type='Lookup'>" + ddlTravelRequest.SelectedItem.Text + "</Value> </Eq> </Where>";
dataSource.SelectCommand = sCommand;
spGrid.DataSource = dataSource;
spGrid.DataBind();

I found the reason that the <Query></Query> element is missing in the second scenario finally I decided to check this with SPQuery i was shocked that everything works fine

SPQuery query = new SPQuery();
query.Query = @"<Where>
<Eq>
<FieldRef Name='Travel_x0020_Request' />
<Value Type='Lookup'>" + ddlTravelRequest.SelectedItem.Text + "</Value> </Eq> </Where>";

My question is why SPDataSource.SelectCommand is failing to get data from Travel Request List when i use CAML query without <Query></Query> element

If anybody knows answer please…………. share with me…

Wednesday, May 6, 2009

Microsoft SharePoint Server 2010

Microsoft is going to release Microsoft SharePoint Server 2010 to get more knowledge on this click here

Monday, May 4, 2009

IE Crashes when ever my client check-out a file from document library

Today morning my client has come up with a problem that when he tries to check-out or check-in a document from a document library, he was getting strange error message, the IE was not able to open Word document, that too it was coming only for few employees





After seeing end user environment details i find out that they have installed offcie2003 along with office 2007 on same computer

Usually this problem occurs when you install one or more 2007 Office system programs on the computer along with office2003.

Microsoft provides Hot-fix for this problem you can download it using this link http://support.microsoft.com/kb/938888

After installing this hot-fix everything works fine

SharePoint Media Streaming WebPart

Recently I have implemented media streaming web part (YouTube technology) for one of my client, I would like to share this with you guys

This I have developed for one of my client so, I am not going to share code with you guys.

Media streaming web part uses windows media server for playing media files because It is especially useful for streaming large amounts of data over busy, congested networks and low-bandwidth connections. Streaming uses bandwidth more efficiently than downloading because it sends data over the network only at the speed that is necessary for the client to render it correctly. This helps prevent the network from becoming overloaded and helps maintain system reliability.

If you want to know more about windows media server please refer this article http://learn.iis.net/page.aspx/454/windows-media-server-or-web-server/

I have created two features one is for Media template another one is media steaming webpart.

Media Template

This is just list definition for storing media files

Media steaming web part

The job of this is to read file from windows media server and play it on windows media player

Steps
First install media features and activate it
Go to Site Actions -> Site Settings-> under Site Administration -> Site libraries and lists -> Create new content - > select Media Library template ->Give the name of template and click create

Just upload media files in to media library the Mediamanager class will take care of rest

Then go to media home page and add media streaming webpart, it will automatically plays media file using streaming technique
Mail me if anybody wants get more knowledge on this.