Translate

Sunday, August 26, 2012

SharePoint Cloud Computing Book

SharePoint Cloud Computing Book

Sharepoint Cloud Computing Book This is one of the good book
"Microsoft Press - SharePoint 2010 Deploying Cloud-Based Solutions"
http://www.amazon.com/Microsoft-SharePoint-2010-Cloud-Based-Organizations/dp/073566210X

Adding file attachment in custom list programmatically

Adding file attachment in custom list programmatically


Code:

SPSecurity.RunWithElevatedPrivileges(delegate()
                {
                    SPSite mySite = new SPSite(“Site Url”); //Mentioned site url
                   SPWeb spweb = mySite.OpenWeb();

                    SPList list = spweb.Lists[“HR Policies”];
                    int ID = Convert.ToInt32(this.Page.Request.QueryString["ItemID"].ToString());
                 SPListItem spNewItem = myList.Items.Add();
                    spWeb.AllowUnsafeUpdates = true;
                    string fileName1 = System.IO.Path.GetFileName(“file Name”);//Mention File name
                    if (fileName1 != "")
                    {
                        Stream fStream = firstinputFile.PostedFile.InputStream;
                        byte[] contents = new byte[fStream.Length];
                        fStream.Read(contents, 0, (int)fStream.Length);
                        fStream.Close();
                        fStream.Dispose();
                        SPAttachmentCollection attachments = myNewItem.Attachments;
                        fileName1 = Path.GetFileName(firstinputFile.PostedFile.FileName);
                        attachments.Add(fileName1, contents);
                        spNewItem.Update();
               }
});


Using RunWithElevatedPrivileges or SPSecurity.RunWithElevatedPrivileges

Using RunWithElevatedPrivileges or SPSecurity.RunWithElevatedPrivileges


"RunWithElevatedPrivileges" method accepts a delegate code which wants to run with administrator’s privileges, actually the code runs under the application pool identity, which is mainly site collection administrator.
The namespace SPSecurity  is required for  RunWithElevatedPrivileges
Sample code shows the item updated code which runs in the SPSecurity.RunWithElevatedPrivileges
Code:
SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                SPSite mySite = new SPSite(“site url”);//mention site url
                 mySite.AllowUnsafeUpdates = true;
                 SPWeb spweb = mySite.OpenWeb();
                 spweb.AllowUnsafeUpdates = true;
                 SPList myList = spweb.Lists[“Demo List”];
                 SPListItem spNewItem = myList.Items.Add();
                 spNewItem["Title"] = “Test Title”;
                 spNewItem.Update();
});

Friday, August 24, 2012

Hardware and Software Requirements for SharePoint 15 or SharePoint 2013

Hardware and Software Requirements for SharePoint 15 or SharePoint 2013


The following requirements is for Web & Application Servers with single server farm
Hardware Requirement

Hardware Requirement
S.No.
Hardware Item
Requirement
1.
Processor
64 bit
2. 
Ram
8 GB
3.
Hard Disk
80 GB


Software Requirements
S.No.
Software Item
Requirement
1.
Windows
Windows Server 2008 R2
2.
SQL Server
Microsoft SQL Server 2008 R2 with Service Pack 1(64 bit)
3.
Web Server
IIS
4.
Sharepoint
Sharepoint 15
5.
.Net Framework
.Net Framework version 4.0
6.
Identity Foundation
Windows Identity foundation WIF 1.0 and 1.1
7.
Updates & other
.NET 4 DGR Update KB 2468871,
Information Protection & Control Client (MSIPC), Open Data Library (ODataLib)


8.
Windows PowerShell
Windows PowerShell 3.0



New Features of SharePoint 15 or SharePoint 2013

SharePoint 2013 New Features


1. Improvements and new capabilities in SharePoint architecture includes
·         Improved in themes
·         Sharing
·         Request Management
·         Cache Service
2. Social networking
Now it allows micro blogging like follow people, site content and be able to share links and content
Improvement in Discussion Board, allows blog integration with client application.

3. Web Content Management
·         Allows cross site publishing
·         Metadata navigation
·         Search engine optimization
4. Search
·         New Search architecture
·         Now user is able to personalized search history result
5. Business Intelligence
Lot of improvements in BI
Enhancement in SharePoint Mobile like automatic mobile browser redirection , allows office mobile apps.

Thursday, August 23, 2012

Sharepoint 2010 Master Pages

Master Pages


In SharePoint  2010 Microsoft has provided different  types of master pages to make sure that application pages and site pages will have same look and feel.
There are 3 default master pages are provided by Microsoft

  1. Default.Master
  2. V4.Master
  3. Minimal.Master

There will be “Master Page Gallery” for each new site created in the SharePoint. The master pages support the changes/customization with the SharePoint designer.
Each master page includes such as breadcrumb, Ribbon, Welcome menu, Site Actions, Quick Launch and TopNav bar.


  1. Default.Master
It contains the standard HTML layout and chrome of a SharePoint 2007 site.It also supports sharepoint 2007 to sharepoint 2010 master page upgardtion.This master page is provisioned in Master Page Gallery for every new SharePoint 2010 site is default.master.

2.V4.Master
The v4.master page contains some basic HTML layout for a page, including standard elements
Such as form, html, head and body, and includes many server-side controls that are used to
encapsulate logic and user interface components into the Microsoft.SharePoint assembly

3. Minimal.Master
This master page is used by several of the standard site page templates and application pages; it does not options which are provided my v4.master.



SharePoint Application and Site Pages

SharePoint Application Pages

Application pages are type of page stored in the path “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS”.
Application pages are “.aspx” pages and it does not run in _layouts virtual directory, it does not allow customization; application page is very good in performance wise because the pages are being compiled in to “. dll”. Application page allows.

SharePoint Site Pages

Site pages are pages which are provided by SharePoint foundation example default.aspx, home.aspx, library.aspx and WebPart pages. These are the pages gets created when the SharePoint is installed.

Deference between Application pages and Site pages

S.No.
Site Page
Application Page
1
Site pages support page customization.
Does not support customization.
2
Example of site page is “default.aspx”.
Example of site page is “settings.aspx”.
3
Each customization is stored in content database.
Very good in performance wise.
4
It does not allow adding any inline code.
It allows inline code.
5
The customization can be done through SharePoint designer.
It cannot be.