Tuesday, June 7, 2011

SharePoint Farm

Sharepoint Farm can be defined as collection of one or more Sharepoint server and SQL servers.

but when do we need  a farm? . Small orgnization with limited people, and independent of location doesn't need a farm , they can use Single server system.

SharePoint 2010 developer dashboard

The developer dashboard is an instrumentation framework.Developer Dahsboard contains an extensible mechanism for measuring various performance counters at various scopes.

The developer dashboard records and displays the performance statistics of the code that executed to produce the current page .

Developer Dashboard contains an extensible mechanism for measuring various performance counters at various scopes. Within Developer Dashboard, the following performance counters are used to monitor usage and resource consumption at each stage of the requests.

Per-threaded Counters:
These counters measure values for the current request or timer job:
  • Thread execution time
  • Number, duration, call stack information and query text of each SQL Server query generated by the page
  • Number, duration, and call stack information of each WCF call
  • URL or timer job name
  • Current user
  • Execution start time
The Developer Dashboard can be displayed in the following modes:
  • On
    When enabled in On mode, the Dashboard is viewable on all pages that use the default master page.
  • OnDemand
    When the Developer Dashboard is set to OnDemand mode, an icon is displayed on the top right side of the page. This icon allows the user to toggle the Dashboard on and off.
Run this command in powershell:

PS C:\Users\Administrator > stsadm -o setproperty -pn developer-dashboard -pv on

                                                                                                        read more

Friday, June 3, 2011

Step by Step WCF example

Step by step procedure to create WCF:

A.Creating the service (Server side)

Step 1: Open Visual Studio 2010 and create project ,choose  "Windows Service  Application", and give a name to your project say MyService.

Step 2: Open IService.cs  , in that you can see [ServiceContract] where your intetface name is declared and [OperationContract] here you function contract should be defined here (note: delete the default functions if they are not needed), initialize you addData function here




Step 3: Open Service1.svc.cs and add the code for the addData function, ( note: delete the default functions if they are not needed)

                                  

Step 4: Declare your endpoint in web.config file add the below code which is in  bold and Italics.
                                 
                                   

Step 5:Save the project and run it

                                       
B. Creating the client to consume the service (Client side):

Step 1: Open another Visual studio 2010 , create a new ASP.net web application.right click the project and go to 'Add Service reference' ,copy and paste the service  url and press OK

Step 2: Open Default.aspx , create a simple button and lable controls

Step 3: Double click the button and add this following code

                                         

Ste 4: Build and run the project ,now your client has comsumed the services!!

                                          

read more

msdn :http://msdn.microsoft.com/en-us/library/ms734712.aspx 

Wednesday, June 1, 2011

Creating event receivers for sharepoint list

In sharepoint 2010 the following new event receivers have been added:

What are Sharepoint 2010 Event receivers?
  Event receivers are one of the power feature of sharepoint , the event receiver is in essence a managed-code assembly that is deployed to sharepoint and react to an event such as adding an item to the list,creating new list item..etc

For example , you might also want to log a transaction when a certain lists are updated, prevent the default error page and redirect to your own custom error page.



List Events:
List is being added, deleted

List Item Events:
List received a context event

Workflow:
Workflow in starting ,has started, completed,postended

List Email:
List received an email message

Web:
Site is being provisioned
Site was provisioned

Sharepoint service database tables

How to deploy webpart in Sharepoint 2010

Step by step procedure to install and deploy webpart in Sharepoint 2010

1. Goto Start -> All programs->Microsoft Sharepoint 2010 products - > Sharepoint 2010 Management Shell.
2. Type the following command for adding the solution

  PS C:\Users\Administrator> stssadm -o addsolution -filename D:\hellowroldWebpart.wsp
  Operation completed successfully.    

3.Type the following for deploying the solution

  PS C:\Users\Administrator> stsadm -o deploysolution -name helloworldWebpart.wsp -local -allowGacDeployment -force -url http://servername:40033/

4.Goto Start ->All programs ->Microsoft Sharepoint 2010 products --> Sharepoint 2010 Central Administration

5.Then goto Site actions -> site settings -> site collection features and active the deployed webpart in it.

Sharepoint 2010 Master Page Customization

Master page are files which provide structure and branding across Sharepoint site. To customize the master page follow these steps:

1.Open sharepoint designer and open the site
2.In the navigation pane click master page
3.Click master page and give a name