Sunday 30 June 2013

SharePoint 2010 Installation Requirements

Hardware requirements

The requirements in the following table apply both to installations on a single server with a built-in database and to servers running SharePoint Foundation 2010 in a multiple server farm installation

ComponentMinimum requirement

Processor

64-bit, four cores


RAM
  • 4 GB for developer or evaluation use
  • 8 GB for production use in a single server or multiple server farm
Hard disk
80 GB for system drive
You must have sufficient space for the base installation and sufficient space for
diagnostics such as logging, debugging, creating memory dumps, and so on. For
production use, you also need additional free disk space for day-to-day operations.
 Maintain twice as much free space as you have RAM for production environments.
 For more information, see Capacity management and sizing for SharePoint 
Server 2010.

The preparation tool installs the following prerequisites:
  1. Web Server (IIS) role
  2. Application Server role
  3. Microsoft .NET Framework version 3.5 SP1
  4. SQL Server 2008 Express with SP1
  5. Microsoft Sync Framework Runtime v1.0 (x64)
  6. Microsoft Filter Pack 2.0
  7. Microsoft Chart Controls for the Microsoft .NET Framework 3.5
  8. Windows PowerShell 2.0
  9. SQL Server 2008 Native Client
  10. Microsoft SQL Server 2008 Analysis Services ADOMD.NET
  11. ADO.NET Data Services Update for .NET Framework 3.5 SP1
  12. A hotfix for the .NET Framework 3.5 SP1 that provides a method to support token authentication without transport security or message encryption in WCF.
  13. Windows Identity Foundation (WIF)
Software Requirements

OS : Windows server 2008 R2 / Windows 7
Sharepoint Server 2010  64 bit
Sharepoint Designer 2010 64 bit
SqlServer 2008  / Higher
MS Office 2007 / 2010 [ or Higher but must be 64 bit]

Note : If your laptops are windows 8 enable then you can't install windows server 2008 in that systems.

Then you use virtual machine to install windows server 2008 or windows 7.

Still you have doubt contact me

hanutechvision@gmail.com  



Tuesday 11 June 2013

SharePoint 2010 - Create a Custom Feature

Create a Custom Feature in Site Settings Multiple Group Locations

Go to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES physical location
Create a folder (Ex: ManageLinks)
Create the following two files

                   1. Feature.xml
                   2. Elements.xml

 1. In  Feature.xml   Write the following code

<?xml version="1.0" encoding="utf-8" ?>
<Feature xmlns="http://schemas.microsoft.com/sharepoint/"
         Id="2294626A-735B-4CA7-B371-11848CA40348"
         Description="Manage eMail Links"
         Hidden="False"
         Title="Manage eMails"
         Scope="Web" >
    
    <ElementManifests>
        <ElementManifest Location="Elements.xml" />
    </ElementManifests>
</Feature>
        

    2. In Elements.xml Write the following code

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" >
    <CustomAction Id="B8EA2F40-61A9-4685-9CCE-7CC4D8612B0C"
                  Title="MSN"
                  GroupId="Galleries"
                  Description="Redirecting Hotmail Account"
                  Location="Microsoft.SharePoint.SiteSettings"
                  Sequence="0">
        <UrlAction Url="http://www.microsft.com"/>

    </CustomAction>

    <CustomAction Id="88E02BDD-A84A-47B3-8335-7BD2F16A11A3"
                  Title="Yahoo"
                  GroupId="Customization"
                  Description="Redirecting Yahoo Account"
                  Location="Microsoft.SharePoint.SiteSettings"
                  Sequence="0">
        <UrlAction Url="http://www.Yahoo.com"/>

    </CustomAction>

    <CustomAction Id="158D92D0-4C0C-4B6B-82EC-9DD92C2F4BC5"
                  Title="Gmail"
                  GroupId="SiteCollectionAdmin"
                  Description="Redirecting Gmail Account"
                  Location="Microsoft.SharePoint.SiteSettings"
                  Sequence="0">
        <UrlAction Url="http://www.gmail.com" />

    </CustomAction>

</Elements>

3.  Now go to command prompt in server . of the following location

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Bin

Use the following command to Install the Feature using STSADM.

stsadm -o installfeature -name "ManageLinks"

You will get operation completed message.

Now go site home page, Click on Site Action, Click on Site Settings.


Under Site Actions, Click on Manage Site Features

Find ManageLinks Feature and Click on Activate Button.

Monday 10 June 2013

SharePoint 2010 - Webpart Demo- Emp


Open VS2010 ---> 
New ---> 
Project ---> 
Visual C# --> 
SharePoint ---> 
Empty SharePoint Project ---> 
[WpDemos] ---> OK

SE ---> Right Click ---> Add New Item ---> WebPart ---> EmpWebPart ---> OK

Write the following code 


public class EmpWebPart : WebPart
    {

        Label lblEmpname;
        Label lblEmpId;
        Label lblEmpEmail;
        Label lblProjectName;
        Label lblReult;

        TextBox txtEmpName;
        TextBox txtEmpId;
        TextBox txtEmpEmail;
        DropDownList ddProjectName;

        Button btnGo;

        protected override void CreateChildControls()
        {
            lblEmpname = new Label();
            lblEmpname.Text = " Enter Employee Name : ";
            Controls.Add(lblEmpname);

            lblEmpId = new Label();
            lblEmpId.Text = " Enter Employee Id : ";
            Controls.Add(lblEmpId);

            lblEmpEmail = new Label();
            lblEmpEmail.Text = " Enter Employee Email Id :";           
            Controls.Add(lblEmpEmail);

            lblProjectName = new Label();
            lblProjectName.Text = " Selecte Project Name : ";
            Controls.Add(lblProjectName);

            txtEmpName = new TextBox();
            txtEmpName.Width = 100;
            Controls.Add(txtEmpName);

            txtEmpId = new TextBox();
            txtEmpId.Width = 100;
            txtEmpId.Text = " Enter Id ..";
            Controls.Add(txtEmpId);

            txtEmpEmail = new TextBox();
            txtEmpEmail.Width = 100;
            txtEmpEmail.Text = " Enter Email Id ..";
            Controls.Add(txtEmpEmail);

            ddProjectName = new DropDownList();
            ddProjectName.Items.Add("Project 1");
            ddProjectName.Items.Add("Project 2");
            ddProjectName.Items.Add("Project 3");
            ddProjectName.Items.Add("Project 4");
            ddProjectName.Items.Add("Project 5");
            ddProjectName.Width = 200;
            Controls.Add(ddProjectName);

            btnGo = new Button();
            btnGo.Text = " Get Data ";
            btnGo.Click +=new EventHandler(btnGo_Click);
            Controls.Add(btnGo);

            lblReult = new Label();
            lblReult.Text = "";
            Controls.Add(lblReult);

        }

        public void btnGo_Click(object o, EventArgs e)
        {
            lblReult.Text = " Employee name: " + txtEmpName.Text + "<br> Employee Id :" + txtEmpId.Text + "<br> Employee Email: " + txtEmpEmail.Text + "<br> Project Name : " + ddProjectName.SelectedItem;
        }

        protected override void Render(HtmlTextWriter writer)
        {
            writer.Write("<table><tr><td>");
            lblEmpname.RenderControl(writer);
            writer.Write("</td><td>");
            txtEmpName.RenderControl(writer);
            writer.Write("</td></tr><tr><td>");
            lblEmpId.RenderControl(writer);
            writer.Write("</td><td>");
            txtEmpId.RenderControl(writer);
            writer.Write("</td></tr><tr><td>");
            lblEmpEmail.RenderControl(writer);
            writer.Write("</td><td>");
            txtEmpEmail.RenderControl(writer);
            writer.Write("</td></tr><tr><td>");
            lblProjectName.RenderControl(writer);
            writer.Write("</td><td>");
            ddProjectName.RenderControl(writer);
            writer.Write("</td></tr><tr><td>");
            btnGo.RenderControl(writer);
            writer.Write("</td><td>");
            lblReult.RenderControl(writer);
            writer.Write("</td></tr></table>");
        }
    }

Creating The Poperties with in the WebPart

Creating The Poperties with in the WebPart

Open VS2010 --->
    New ---> 
    Project ---> 
    Visual C# --> 
    SharePoint ---> 
    Empty SharePoint Project ---> 
    [WpDemos] ---> OK

    Solution Explorer ---> Right Click ---> Add New Item ---> WebPart ---> Wp1Sample ---> OK

Write the following code 
1. Add New webpart
2. 
using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls; 
namespace CustomProperties.CustomPropertiesWP
{
[ToolboxItemAttribute(false)]
public class CustomPropertiesWP :WebPart
{
private string  strValue;
Label lblResult;
Button btnClick;

[System.Web.UI.WebControls.WebParts.WebBrowsable(true),
System.Web.UI.WebControls.WebParts.WebDisplayName("Enter the Value"),
System.Web.UI.WebControls.WebParts.WebDescription("Please Enter the Value"),
System.Web.UI.WebControls.WebParts.Personalizable(
System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared),
System.ComponentModel.Category("Madan Custom Properties"),
System.ComponentModel.DefaultValue("")]

public string  propValue
{
get { return strValue; }
set { strValue =value; }
}
protected override void CreateChildControls()
{
       lblResult = new Label();
       btnClick = new Button();
       btnClick.Text = "Click";
       btnClick.Click += new EventHandler(btnClick_Click);
      this.Controls.Add(lblResult);
      this.Controls.Add(btnClick);
}

protected void btnClick_Click(object sender,EventArgs e)
{
      lblResult.Text = propValue.ToString(); 
}       
    }
}

Build and Deploy

SharePoint - Add CSS Registration to a Master Page

Add CSS Registration to a Master Page

1.    Open the site in SPD 2010

2.    Select the master pages from site objects

3.    Create the master page (copy and paste the existing master page) , Name it as style.master

4.    Edit in advanced mode, add the following code at the end of <head> tag.
<SharePoint:CssRegistration name=”<% $SPUrl:~sitecollection/Style Library/MohanDemo/css/mynav.css %>” After=”corev4.css” runat=”server”/>

5.    Open the top-level site in SPD 2010, in Site Objects , select All files, Click on Style Library.

6.    Add New folder (MohanDemo), With in this, Create another folder(css), in this create a new mynav.css file and add the following code.

/*----Top Nav---------------- */
.s4-tn {min-height:34px;}

/*allow nav item to be taller than 15px*/
.s4-tn LI.static > .menu-item{height:auto;}

/*Transform top nav links to uppercase
and give top links bg color */
body #s4-topheader2{
background:#fff repeat-x left 0px;
border-bottom:transparent;border-top:transparent;
}

/*bottom border of nav bar*/
.s4-tn {border-bottom: 5px solid #016c9b;}
.s4-tn > .horizontal {
/*move horizontal nav to the right by 20 px*/
margin-left:20px;
}

/*keep nav from wrapping */
.menu-horizontal{min-width:790px;}

/*If you define nav styles and don’t define them in dynamic children selectors,
dynamic will inherit the style */
.s4-tn li.static > .menu-item{
border:0;
border:none;
color:#efefef;
display:inline-block;
min-width:70px;
height:36px;
padding:0px;
margin:0px;
vertical-align:middle;
white-space:nowrap;
text-align:center;
font-size:19px;
white-space:nowrap;
padding-top:12px;
}

.s4-toplinks .s4-tn > .menu-item.text {
padding:6px 24px 0 24px;}

/*nav link hover and nav header hover*/
.s4-tn li.static > a:hover,
.s4-tn li.static > .dynamic-children:hover{
display:block;
background:transparent none;
color:#fff;
text-decoration:none;
}

/*rounded nav*/
.s4-toplinks .s4-tn .static > li {
background:url(“../images/tl.png”)
no-repeat scroll 0 0 #79BBEC;
color:#efefef
}

.s4-toplinks .s4-tn .static > li > .menu-item{
background:url(“../images/tr.png”)
no-repeat scroll top right ;
}

/*Rounded nav selected (left) background color goes here*/
.s4-toplinks .s4-tn .static > li.selected {
background:url(“../images/tl.png”)
no-repeat scroll 0 0 #efefef;
color:#5893CF
}

/*Rounded nav selected (right)*/
.s4-toplinks .s4-tn .static > li.selected > .menu-item{
background:url(“../images/tr.png”)
no-repeat scroll top right ;
color:#5893CF
}

.s4-toplinks .s4-tn .static > li.selected > a:hover {
color:#fff;
}

.s4-toplinks .s4-tn ul.static >
li.dynamic-children .menu-item-text ,
.s4-toplinks .s4-tn ul.static >
li.static .menu-item-text{
padding: 0 33px;
}

/*arrows in tabs with dynamic children*/
.menu-horizontal span.dynamic-children
SPAN.additional-background {
background-position:90% ;
}

.menu-horizontal a.dynamic-children
SPAN.additional-background {
background-position:90%;
}

/*flyout navigation */
.s4-tn ul.dynamic{
background:#A2CFEC;
margin:5px 0 0 10px;
background-color:#A2CFEC;
border:1px solid #44A0E5;
}

.s4-tn li.dynamic a{padding:5px;color:#1987DC;}
.s4-toplinks .s4-tn ul.dynamic .menu-item .menu-item-text {
padding: 5px 8px!important;
}

.s4-tn li.dynamic > .menu-item{
padding:3px 12px;
font-size:12px;
white-space:nowrap;
border-bottom:none;
font-weight:normal;
color:#003B55;
font-family:Verdana;
min-width:150px;
}

.s4-tn li.dynamic {border-bottom:1px #88C7F0 solid;}
.s4-tn li.dynamic > a:hover{
font-weight:400;
display:block;
background-color:#C7E2F3;
color:#1E6592;
}

7.    Save, Check in, Publish.
8.   Set as default master page.

SharePoint 2010 - Master Page

Master Pages
There are many master pages available in SharePoint Foundation Server 2010. SharePoint provides a variety of master pages
1.    v4.master
2.    default.master
3.    minimal.master
4.    simple.master
5.    MWSDefaultv4.master
6.    nightandday.master

The v4.master  is the default master page for most non-publishing sites in SharePoint 2010. It is also the default system master page in both SharePoint Foundation and SharePoint Server.
           The v4.master page is included in every site in both SharePoint Foundation and SharePoint Server 2010. It can be used with publishing sites and non-publishing sites. You learned earlier that master pages contain HTML, CSS, SharePoint controls, and ContentPlaceholder controls.

The default.master page in SharePoint 2010 should look familiar to you if you worked with SharePoint 2007.

The minimal.master page is best suited for pages with minimal branding and navigation. The minimal.master is used with search pages and Office web applications. Because this master page does not include the ribbon or navigation, you should use it for pages that require a lot of real estate.

The simple.master is the master page used for error and login pages. It lives in the fi le system and is not available in the master page gallery. If you are creating a custom login or error page, you will want to use the simple.master page.

The MWSDefaultv4.master is found in the master page gallery of meeting workspace sites. It is almost identical to the v4.master with the exception of a couple of content placeholders such as the MeetingNavigator.

The nightandday.master page, is only available in SharePoint Server 2010. It contains controls specialized for publishing web content management.

Importing and Exporting Master Pages

1.    Open the site in SharePointDesigner 2010
2.    Under site objects Select Master Pages
3.    Select the v4.master so that it is highlighted by clicking once on it.
4.    Click the Export File button on the ribbon, A Save dialog box appears, save the file as v4Test.master in physical location.
5.    Now click on Import file on ribbon, click on Add file, Browse, select v4Test.master, click on Ok.


Applying a New Master Page

6.    Click Master Pages in Site Objects.
7.    Locate the Master Page you want to use (v4Test.master)
8.    Right-click the Master Page and select Set as Default Master Page on the context menu.

Fix the Width of a Master Page

1.    Open a team site in SharePoint Designer.
2.    Select the Master Pages section of Site Objects.
3.    Create a new master page by following the steps you used to create v4Test.master.
4.    Instead of naming the fi le v4Test.master, name it FixedWidthv4.master.
5.    Right-click on the fi le and select “Set as Default Master Page.”
6.    Right click on the fi le and select “Edit File in Advanced Mode.” Add the following embedded style sheet into the master page just before the closing </head> tag

<style type=”text/css”>
/*fixed width */
#s4-workspace > div,#s4-bodyContainer > div,body #s4-titlerow > div{
width:1000px;
margin:0 auto;
float:none;
padding:0;
}

body #s4-mainarea{
/*make main area have background of white and add a border */
background:#fff;
border:1px solid #ddd;
border-top:0px;
min-height:580px;
/*contain content in all browsers but IE7 */
display:table;
}

/*add padding back to title table*/
.s4-title-inner{
padding:0 0 0 5px;
}
/*background color of site*/
#s4-workspace {
background:#efefef /*none*/;
}
/*body container */
#s4-bodyContainer{
position:relative;
width:100%;
}
/*fix overhanging tables*/
.ms-v4propertysheetspacing
{margin:0;}
</style>

7.    Save and check in your changes.
8.    Navigate to your browser and preview your changes in the browser to see your site is fi xed-width

Changing the Location of the Search Box

1.    Open site in SharePoint Designer
2.    Select Master Pages from the Site Objects.
3.    Copy and paste the v4.master, Name it as Search.master.
4.    Right-click the fi le and select Edit File in Advanced Mode.
5.    Locate <td class=”s4-titletext”>.
6.    Add the following code after the closing tag of <td class=”s4-titletext”>:
<td class=”customSearch” valign=”middle” style=”padding:0 5px;”> </td>
7.    To find the search content control (Use the shortcut key Ctrl+F to open the Find and Replace dialog) type the word “search” in the “Find What” field and click the Find All button.
8.    The results of your search are displayed below the page editor in the Find1 window.
9.    Double-click on the ContentPlaceHolder control whose ID attribute is set to PlaceholderSearchArea in the Find1 box and your cursor will jump to the location of the search control in the code window
10.  Select the following code and copy with Ctrl+C.
 <asp:ContentPlaceHolder id=”PlaceHolderSearchArea” runat=”server”>
<SharePoint:DelegateControl runat=”server” ControlId=”SmallSearchInputBox” Version=”4”/> </asp:ContentPlaceHolder>
11.  Paste the copied code inside the <td class=”customSearch”> tag
12.  Save and Check in the file.
     13. Navigate to the site’s URL and preview your changes in the browser.

Registering External CSS

Add CSS Registration to a Master Page

1.    Open the site in SPD 2010
2.    Select the master pages from site objects
3.    Create the master page (copy and paste the existing master page) , Name it as style.master
4.    Edit in advanced mode, add the following code at the end of <head> tag.
<SharePoint:CssRegistration name=”<% $SPUrl:~sitecollection/Style Library/MyDemo/css/mynav.css %>” After=”corev4.css” runat=”server”/>
5.    Save, set as default master page.

6.    Open the top-level site in SPD 2010, in Site Objects , select All files, Click on Style Library.
7.    Add New folder (MyDemo), With in this, Create another folder(css), in this create a new mynav.css file and add the following code.

/*----Top Nav---------------- */
.s4-tn {min-height:34px;}
/*allow nav item to be taller than 15px*/
.s4-tn LI.static > .menu-item{height:auto;}
/*Transform top nav links to uppercase
and give top links bg color */
body #s4-topheader2{
background:#fff repeat-x left 0px;
border-bottom:transparent;border-top:transparent;
}
/*bottom border of nav bar*/
.s4-tn {border-bottom: 5px solid #016c9b;}
.s4-tn > .horizontal {
/*move horizontal nav to the right by 20 px*/
margin-left:20px;
}
/*keep nav from wrapping */
.menu-horizontal{min-width:790px;}
/*If you define nav styles and don’t define them
in dynamic children selectors,
dynamic will inherit the style */
.s4-tn li.static > .menu-item{
border:0;
border:none;
color:#efefef;
display:inline-block;
min-width:70px;
height:36px;
padding:0px;
margin:0px;
vertical-align:middle;
white-space:nowrap;
text-align:center;
font-size:19px;
white-space:nowrap;
padding-top:12px;
}
.s4-toplinks .s4-tn > .menu-item.text {
padding:6px 24px 0 24px;}
/*nav link hover and nav header hover*/
.s4-tn li.static > a:hover,
.s4-tn li.static > .dynamic-children:hover{
display:block;
background:transparent none;
color:#fff;
text-decoration:none;
}
/*rounded nav*/
.s4-toplinks .s4-tn .static > li {
background:url(“../images/tl.png”)
no-repeat scroll 0 0 #79BBEC;
color:#efefef
}
.s4-toplinks .s4-tn .static > li > .menu-item{
background:url(“../images/tr.png”)
no-repeat scroll top right ;
}
/*Rounded nav selected (left) background color goes here*/
.s4-toplinks .s4-tn .static > li.selected {
background:url(“../images/tl.png”)
no-repeat scroll 0 0 #efefef;
color:#5893CF
}
/*Rounded nav selected (right)*/
.s4-toplinks .s4-tn .static > li.selected > .menu-item{
background:url(“../images/tr.png”)
no-repeat scroll top right ;
color:#5893CF
}
.s4-toplinks .s4-tn .static > li.selected > a:hover {
color:#fff;
}
.s4-toplinks .s4-tn ul.static >
li.dynamic-children .menu-item-text ,
.s4-toplinks .s4-tn ul.static >
li.static .menu-item-text{
padding: 0 33px;
}
/*arrows in tabs with dynamic children*/
.menu-horizontal span.dynamic-children
SPAN.additional-background {
background-position:90% ;
}
.menu-horizontal a.dynamic-children
SPAN.additional-background {
background-position:90%;
}
/*flyout navigation */
.s4-tn ul.dynamic{
background:#A2CFEC;
margin:5px 0 0 10px;
background-color:#A2CFEC;
border:1px solid #44A0E5;
}
.s4-tn li.dynamic a{padding:5px;color:#1987DC;}
.s4-toplinks .s4-tn ul.dynamic .menu-item .menu-item-text {
padding: 5px 8px!important;
}
.s4-tn li.dynamic > .menu-item{
padding:3px 12px;
font-size:12px;
white-space:nowrap;
border-bottom:none;
font-weight:normal;
color:#003B55;
font-family:Verdana;
min-width:150px;
}
.s4-tn li.dynamic {border-bottom:1px #88C7F0 solid;}
.s4-tn li.dynamic > a:hover{
font-weight:400;
display:block;
background-color:#C7E2F3;
color:#1E6592;
}

8.    Save, Check in, Publish.
9.    Now refresh the browser.