Wednesday, June 29, 2011

WhitePaper on Sharepoint 2010 Migration

White paper on Migrating to SharePoint 2010? Ten Things I’ve Learned the Hard Way(So You Don’t Have To)
By Todd Klindt, SharePoint MVP

Tuesday, June 28, 2011

Hiding left Navigation in SharePoint 2010

To hide the left navigation in SharePoint 2010, you still need to follow adding content editor web part which you did in SharePoint 2007 onto the page first and then add the below script.

<style type="text/css">
#s4-leftpanel{
display:none
}
.s4-ca{
margin-left:0px
}
</style>

Friday, June 17, 2011

Migrating Code from MOSS/SharePoint 2007 to SharePoint 2010

I have identified two methods to convert SharePoint 2007 code to SharePoint 2010  using Visual Studio 2010 but sometimes it might not work 100% based on the complexity of your solution and how good  you designed your previous solutions. But one thing  i am sure that it  will make your life easy rather building the solution from scratch.

1) Import SharePoint Solution Package or WSP

Open Visual Studio 2010, Click on File -> New Project and it will open "New Project" Dialog box as shown below. From the list of Installed templates select SharePoint on the left side of navigation and select "Import SharePoint solution package" as shown below ,

1) Provide the solution name and click OK 
2) then provide debugging information such as SharePoint Site, Trust level (sandboxed or full-trust solution) 
3) After that it will ask for WSP to import from. So please browse for the WSP you want to convert and then visual studio will automatically convert the solution and will display the converted project.

2) Import WSPBuilder Project (if its not visible please download here)

Open Visual Studio 2010, Click on File -> New Project and it will open "New Project" Dialog box as shown below. From the list of Installed templates select SharePoint on the left side of navigation and select "Import WSPBuilder Project" as shown below , 


1) Provide the solution name and click OK 
2) then provide debugging information such as SharePoint Site, Trust level (sandboxed or full-trust solution)  and also the path of the existing WSPBuilder Project.
3) once you have given all the information click on Finish and then visual studio will automatically convert the solution and will display the converted project.

You have to verify thoroughly all the features and add the missing features.
Hope it works !!

Tuesday, May 17, 2011

What's New in Microsoft SharePoint 2010 for Developers

Lets start to see what's new ....

1) Sandboxed Solutions for SharePoint 2010
  • SharePoint solutions can be built, assembled, and adapted rapidly to meet changing business objectives. In previous versions of SharePoint, this agility had to be balanced with the requirements to deliver a stable environment. IT departments were often concerned that deploying a solution with badly written code might introduce errors, security issues, or performance degradation. These concerns were magnified in a multi-tenanted infrastructure, where other customers might be affected by poorly designed or malicious code.
  • With SharePoint 2010, you can deploy sandboxed solutions. Consequently, you gain the benefits of building agile solutions without compromising platform stability or security. Because sandboxed solutions are deployed to the Solution gallery, information workers can now assemble their own solutions from safe, prebuilt components without requiring administrator approval. Code in a sandboxed solution is run against a subset of the application programming interfaces (APIs) that are available to a full-trust solution. A special worker process executes your sandboxed code against a subset of the object model. The subset object model contains classes below SPSite, except for security sensitive classes such as SPSecurity, SPSite construction, and auditing. The subset object model explicitly excludes the SPFarm class, which helps protect other Web applications and site collections in the farm.
  • As a developer, you can create sandboxed solutions from Visual Studio 2010, either by selecting the Sandboxed Solution option in the SharePoint Customization Wizard during project creation, or by setting the Sandboxed property in the Properties window for a project after you have created it.
Additionally, the sandboxing architecture has advanced resource monitoring functionality, which helps administrators to monitor the number of resource counters used by a sandboxed solution. Proactive action can be taken against solutions that consume more resources than have been allocated to them. When thresholds are reached, e-mail messages can be sent to the administrator or the sandboxed code can be deactivated.

2) SharePoint 2010 Solution and Feature Packages
  • The integration of Visual Studio 2010 and SharePoint 2010 simplifies the deployment of solutions in development environments. Visual Studio can build and package your solution Features into a Windows SharePoint Package (WSP) file, and can deploy the package to a SharePoint site for easy testing and debugging. Visual Studio 2010 provides feature designers and package designers to help you manage the artifacts in your SharePoint solution.
  • Feature designer: A feature is a SharePoint artifact containing code and other resources that can be activated or deactivated by a site administrator. Features reduce the complexity involved in making modifications to a site and allow and administrator to enable or disable functionality using the SharePoint administration pages.
You can develop Features by using the Visual Studio 2010 Feature Designer. This tool enables you to specify the scope of the feature along with the items in the solution that should be included or excluded from the Feature. It also enables you to specify Feature activation dependencies.
  • Package designer: You can use Visual Studio 2010 to package one or more features into a WSP file. A WSP file is a specialized installer for SharePoint solutions. Unlike traditional Microsoft Installers (MSI), WSP installers support deployment to SharePoint farms, and automatically ensure that artifacts are deployed to all applicable servers in the farm.
You can use the Package Designer in Visual Studio 2010 to manage how features are deployed. You can also include additional assemblies, such as dynamic link libraries (DLLs), which your features depend upon.

3) Integrating New Development Features in SharePoint 2010 Solutions
  • New Event Capabilities: SharePoint 2010 has introduced new events that provide more functionality when you create workflows. For example, SharePoint 2010 enables you to start one workflow following the completion of another using the WorkflowCompleted event. This enables you to build a set of modular workflows, which, when chained together, satisfy complex process requirements.
  • The ability of a workflow to provide an event that an event receiver can handle enables you to monitor the status of individual workflows. These monitoring receivers can then notify site administrators of the status of a workflow, or start their own set of actions.
Another new event, the WorkflowStarting event, provides you with the option of pre-event handling. This enables you to add logic to intercept schema or serialization errors before the workflow starts.
  •  New Workflow Capabilities: SharePoint 2010 has introduced new workflow events that enable you to build complex business processes without compromising on development time. The WorkflowCompleted event, for example, enables you to build a set of modular workflows in which one workflow can begin where another one ends, and where information can be passed back to the calling workflow.SharePoint 2010 provides the following workflow events:
    • WorkflowStarting
    • WorkflowStarted
    • WorkflowCompleted
    • WorkflowLoading
    • WorkflowUnloading
    • WorkflowPostponed
The workflow concept can be used when working with external systems as well. You can call an external system from a workflow and wait for that external system to complete its work. SharePoint 2010 supports integration with external systems using the pluggable External Data Exchange (EDE) service. The EDE service handles task management and correlates the originating request from a workflow to the response received from the external system

4) Improved application programming interfaces

  • SharePoint 2010 provides new and improved application programming interfaces (APIs). These APIs and their new development features enable you to build compelling solutions that meet your business requirements.
For example, you can use the new and improved event and workflow capabilities to build powerful business processes that are driven by collaborative data. You can also use the new user interface capabilities to build rich compelling user experiences. Furthermore, you can use the new LINQ to SharePoint technologies to manipulate SharePoint data in an efficient and intuitive manner.
  • LINQ to SharePoint:
    • LINQ to SharePoint provides developers with an intuitive and efficient approach for working with SharePoint data. For example, a LINQ to SharePoint tool called SPMetal can generate code-based entities that represent lists, libraries, and their fields. You can then use these entities in your development project so that the LINQ to SharePoint IntelliSense features enable you to early bind to those entities and their fields.
    • LINQ to SharePoint is a new data access technology provided by SharePoint 2010. LINQ to SharePoint provides the ability for you, as a developer, to early-bind to SharePoint data such as list items and their fields, from within Visual Studio 2010.
    • SharePoint 2010 provides a command-line utility called SPMetal that can help you develop solutions based on LINQ to SharePoint. SPMetal generates a code-based file that contains entities to represent each list and its fields in a SharePoint site.
After you have run the SPMetal utility, you can import the generated entities file into your Visual Studio 2010 projects. You can then develop LINQ statements to access SharePoint data from lists and libraries

5) New User Interface Platforms for SharePoint 2010

· SharePoint 2010 provides new user interface concepts that enhance the user's experience when working with SharePoint. For example, the new server ribbon platform provides context-sensitive commands to help information workers and administrators perform specific tasks in SharePoint sites.
· Furthermore, the new client-side dialog platform provides a rich Web experience for information workers and administrators as they work with SharePoint data and objects. From the perspective of the developer, it is important to understand that the new ribbon and dialog platforms run in the Web browser of the end user. This means that the new user interfaces respond very rapidly to user actions, without continually requiring full page post-backs to SharePoint Web servers.

6) Developing Remote Clients for SharePoint 2010

·  In previous versions of SharePoint, it was not an easy task to consume SharePoint objects and data in an application that did not run on a SharePoint server. Essentially, you were required to make Web service calls, and those Web services were not simple to use and did not always provide the required functionality.
· With SharePoint 2010, you can now take advantage of the client object model. This means that you can now develop .NET applications, Silverlight applications, and JavaScript applications that can consume and manipulate SharePoint data very easily, regardless of where they run.
· For example, you can build .NET console applications, Windows Forms applications, and Windows Presentation Foundation applications that run on the desktop of the user, but are still driven by SharePoint data. Similarly, you can use the client object model to create compelling Silverlight applications and ASP.NET Web applications that consume SharePoint data.
· Microsoft .NET applications
.NET applications can interact with SharePoint objects by using the .NET implementation of the client object model.
.NET applications that can use the client object model include:
    • Console applications
    • Windows Forms applications
    • Windows Presentation Foundation applications
    • ASP.NET Web applications and Web services
These applications instantiate a ClientContext object and use the URL of a SharePoint site in the constructor of that object. Typically, applications then make use of the Site objects, Web objects, and List objects to interact with SharePoint. These objects are client-side versions of the SPSite, SPWeb, and SPList objects that are available on in the server-side object model.
The communication between the client application and the SharePoint server takes place over Extensible Markup Language (XML) and JavaScript Object Notation (JSON).
Silverlight applications offer a rich user interface that can be hosted in a Web page within the SharePoint site, or even in a non-SharePoint site. Furthermore, Silverlight applications can run outside of the browser environment completely.
With any of the deployment environments, Silverlight applications actually run in their own local .NET environment.
· Silverlight applications, therefore, use the Silverlight implementation of the client object model to communicate with SharePoint objects and data. The objects, methods, properties, and events in the Silverlight implementation of the client object model are extremely similar to those in the .NET implementation of the client object model.
· JavaScript applications can also make use of a similar client object model approach to .NET and Silverlight applications. However, the actual implementation details differ. The capability to communicate with the server-side service that handles client requests is contained in the following files:
    • SP.js
    • SPCore.js
    • SP.Runtime.js
These files have been compressed for performance reasons, but corresponding uncompressed versions are available to help you debug your solutions.

7) Microsoft Silverlight and SharePoint 2010

· The integration between Microsoft Silverlight and SharePoint 2010 provides you with opportunities to create rich, compelling user interfaces for working with SharePoint data and objects. For example, while the Silverlight implementation of the client object model enables you to consume and manipulate SharePoint data in Silverlight, the new Silverlight Web Part enables you to host Silverlight applications on Web Part pages
· Silverlight offers you the opportunity to build rich, compelling user interfaces for your SharePoint solutions. Your Silverlight applications can use the client object model to retrieve, manipulate, and update SharePoint data in an engaging and useful manner.
·  Typically, you may choose to run your Silverlight applications in SharePoint using the Silverlight Web Part provided by SharePoint 2010, but you can also choose to create your own Web Parts to host your Silverlight application. Furthermore, you can still use the client object model to consume and manipulate SharePoint data even if your Silverlight application runs outside the browser environment.
·   Although using the client object model from Silverlight is very similar to using it from a .NET application, you must ensure that you reference the correct DLLs from the ClientBin folder. Furthermore, you cannot communicate with SharePoint in a synchronous manner on the main user interface (UI) thread from Silverlight. Instead, you are required to execute SharePoint queries asynchronously and to provide callback methods where the results from the query are returned to your Silverlight application

8) Incorporating External Data in SharePoint 2010 Solutions (BCS)

· SharePoint 2010 provides Business Connectivity Services that enable you to connect to external data sources, such as databases, Web services, and other LOB systems.
· You can use Business Connectivity Services to enable users to view, insert, update, and delete data from external data sources directly from SharePoint solutions. You can use SharePoint Designer 2010 to create connections to the external data sources and to generate the data retrieval and modification operations without requiring you to develop code. Furthermore, you can use Visual Studio 2010 to create .NET solutions that interact with external data sources and make the data in those sources available in Business Connectivity Services. 
· Business Connectivity Services provides built-in functionality that enables you to rapidly build solutions that make use of external data by representing that data as an external content type and then using it within SharePoint as if it were a standard list. When you define a connection to external data by using the Business Connectivity Services wizard, the create, read, update, and delete commands can be created for you, thereby enabling a full read-write experience for users with minimal development effort.
· With the data represented in SharePoint as a list, users can access it using the SharePoint interface and familiar tools, such as drop-down menus on list items and the controls on the server ribbon.
· When you define a connection to external data, you can use it with other functionality that is available in SharePoint 2010. You can, for example, integrate the external data into the business intelligence reports, or have it indexed and made available for search.
· Another powerful capability is being able to use the external data that is managed by SharePoint in Microsoft Office client applications. For example, users can take the external content offline using the SharePoint Workspace application just as if it was any other SharePoint content, or they can export it to Microsoft Office Outlook.
· You can build simple Business Connectivity Services solutions directly in SharePoint Designer, and you can make use of the built-in user experience and functionality. These solution types are typically suited to simple data models with a few external content types and simple associations.
· You can also build advanced solutions by using Visual Studio 2010. Advanced solutions can provide custom user interfaces, and custom features and behaviors for interacting with the external data.