Wednesday, November 17, 2010

How to open a page in SharePoint 2010 Dialog Framework?

SharePoint 2010 provides pretty good dialog framework. Throughout SharePoint sites, Dialog framework has been used to avoid page redirections and keep user in same page. In SharePoint 2007 with help of Lightbox/JQuery, dialog framework can be enabled and used. But it has some limitations and time consuming.
So how to open a page in Dialog framework? Well, It's pretty simple. Just add Content Editor webpart in the page and add the below code.

<Script type="text/javascript"> //User Defined Function to Open Dialog Framework
function OpenDialog(strPageURL) 
{
  dialogOptions.url = strPageURL;
  var dialogOptions = SP.UI.$create_DialogOptions();// URL of the Page
  dialogOptions.width = 500; // Width of the Dialog
  dialogOptions.height = 400; // Height of the Dialog
  options.dialogReturnValueCallback = Function.createDelegate( null, CloseCallback); // Function to capture dialog closed event
  SP.UI.ModalDialog.showModalDialog(options); // Open the Dialog
}
// Dialog close event capture function
function CloseCallback(strReturnValue, target) 
{
  if (strReturnValue === SP.UI.DialogResult.OK) // Perform action on Ok.
    {
   alert("User clicked Ok!");
    }
  if (strReturnValue === SP.UI.DialogResult.cancel) // Perform action on Cancel.
   {
   alert( "User clicked Cancel!");
   }
}

</Script>
Now to open a page just provide link as
Just change the URL and provide as many links required.
<a href="/_Layouts/Project/Service.aspx" onclick="Javascript:OpenDialog('/_Layouts/Project/Service.aspx');">Service</a>

How to Hide Top Bar, Ribbon, Quick Launch in SharePoint 2010?

Top Bar, Ribbon, Quick Launch are come up with Application Pages by default. If you want to open the page in Dialog Framework then those elements will take more space and make the layout cluttered. You can remove these elements by creating new page layout which is cumbersome/time consuming.
One way to hide these controls is by passing a Parameter with the URL. [ ?IsDlg=1 ] SharePoint will hide these elements when It gets IsDlg Parameter on URL.
But every time we can't pass these parameters. Then how to get rid of these elements?
Simple Just add the below css Code in Application Page under PlaceHolderMain section.
<style type="text/css">
    #s4-ribbonrow.ms-cui-topBar2.s4-notdlg.s4-pr s4-ribbonrowhidetitle.s4-notdlg noindex#ms-cui-ribbonTopBars#s4-titlerow#s4-pr s4-notdlg s4-titlerowhidetitle#s4-leftpanel-content {display:none !important;}
    .s4-ca{margin-left:0px !importantmargin-right:0px !important;}
</style>
This will hide the elements and only the content will be shown.
Note : If you use this code in SharePoint Site Pages with Content Editor Webpart then you can't check in the page since the toolbar goes hidden.
If you still want to use this code on Site Pages then add Content Editor Webpart and paste the above code. When you want to make other changes then open the page in browser with parameters [ ?Contents=1 ] which opens the page in WebPart maintenance mode. Remove the content editor webpart and re-open the page. Make the changes and add content editor webpart at last along the CSS Code. To check in the page use Site Pages Library.

What SharePoint Edition I need?

SharePoint 2010 is released and available in 3 Editions.

They are
  1. Microsoft SharePoint Foundation 2010
  2. Microsoft SharePoint Server 2010 Standard Edition
  3. Microsoft SharePoint Server 2010 Enterprise Edition
Before start implementing Sharepoint, its must to select the right edition for given requirement.
When we recommend SharePoint to customers, they first ask what's the cost? Well, it's based on what for SharePoint is going to be used.

1. Microsoft SharePoint Foundation 2010
MSF 2010 is the least feature edition is Microsoft SharePoint Foundation 2010 which is successor of Windows SharePoint services 3.0. It's not actualy least feature! It has features which satisfies all most all requirements for small to medium business units/concerns. The real fruit is MSF 2010 available at free of cost. All it requires is Windows Server 2003 R2 as Operating System. MSF 2010 bundled with Microsoft SQL Server 2008 Compact Edition so no need to buy SQL Server seperately just for SharePoint. However if SQL Server license already presents then can use it without any limitations.

MSF 2010 features can't be explained in few paragraphs. It's a big List and require couple of pages. The features which mainly used in Intranet are Tasks, Announcements, Blogs, Discussion Boards, Wikis, Office Web Apps, Silverlight and etc. Here you may ask "What's Office Web Apps?" It's web version of Microsoft Office with most of Office application's funcationalities. Without installing MS Office on client PC, users can view, edit documents/presentatiosn/spreadsheets. Pretty impressive! Isn't it?

Some organizations were using WSS 3.0 for their intranet and now they can move to MSF 2010 and get Business Connectivity Services (successor of BDC/Business Data Catalog) as OOTB(Out If The Box).

2. Microsoft SharePoint Server 2010 Standard Edition
MSS 2010 Standard Edition is actualy MSF 2010 + Additional Features (ie. MSF 2010 is basement and over it additional features enabled). Even though it is successor of SharePoint 2007, it re-built in more efficient way and it can't be called as Next version of MOSS 2007. Microsoft has been asked to fine tune the existing features effectively than providing new features. Microsoft SharePoint team did that very well.

Now Microsoft re-building the architecture to make use of existing products. This helps users to use same applications rather learn and use new tools. One of such implmentation is Powershell which going to replace stsadm command(stsadm - SharePoint Command Line Admin Tool). It's because Windows Administrators also play role of SharePoint Administrators. stsadmn is new for them to learn and use whereas Powershell is familiar with to manage Windows Servers. Now Administrators can use Powershell to manage SharePoint sites as well. However stsadm command still work in SharePoint 2010.

MSS 2010 Standard Edition has features like Enterprise Wikis, My Content, My Profile, Audience targeting, Search Scopes. Apart from these new features added are Document Sets, Tags, Tag clouds, Rich Media Management and more.

3. Microsoft SharePoint Server 2010 Enterprise Edition
MSS 2010 Enterprise Edition is MSS 2010 Standard Edition + Additional Features. It is recommended for large scale organizations who consider Business Intelligence, Enterprise Search as key features of colloboration. MSS 2010 Enterprise Edition has Business Intelligence feature, Excel Services, Enterprise Search, Infopath forms service. New features provided in this edition are Access Services, Visio Services, PerformancePoint Services(for Business Intelligence).

For full list of features in these SharePoint editions please visit http://sharepoint.microsoft.com/en-us/buy/Pages/Editions-Comparison.aspx

Monday, November 15, 2010

What is SharePoint?

It's a common question very often I've been asked. Well , Microsoft defines "SharePoint is a Business Collaboration Platform for the Enterprise and the Internet". It's a perfect definition or IT Pros (esp. CXOs), but when it comes to Developers it requires more or different definition.

SharePoint first released in the year 2001 as SharePoint Portal 2001. Basically It's a portal which has functionalities for intranet website. The features can be used as it is or can be customized minimum level.

SharePoint 2007 is more refined version which came with bundle of new features likes Wikis, Blogs and more. SharePoint 2010 is more and more refined platform.

Why the term "Portal" changed to "Platform"?
A Portal is a website which has features on it to use whereas Platform is lying behind and on top of it custom applications can be built and make use of it. For Developers SharePoint is a .Net framework based platform. Applications/components developed in .net are come with SharePoint. So no need to develop them from scratch every time. When those built-in components are not sufficient then developers can write .net component and deploy on SharePoint. Components are called as "Webparts" which are customizable, reusable and connect-able. For SAP Enterprise portal developers, a Webpart is similar to SAP EP iView.

Where to start SharePoint 2010?
SharePoint has 2 important faces. It's Administration and Development. Administration is somewhat simpler than development (Again SharePoint administration sometimes requires much effort. Am talking in general). For any one who wish to learn SharePoint, Administration is perfect to start with. Once the SharePoint functionalities and features are well understood then can start learning development. Visual Studio 2010 is tightly integrated with SharePoint 2010 and reduces much effort which required in SharePoint 2007 with Visual Studio 2008.

Well will explain more about SharePoint 2010. Keep watching..