24
SHAREPOINT 2010 – DEVELOPER TOOLS

SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

SHAREPOINT 2010 – DEVELOPER TOOLS

Page 2: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

Agenda

• Introduction• Custom Tools for SharePoint 2007• SharePoint Explorer• SharePoint Project Item• Adding a Feature• Adding a Feature Receiver• Working with Mapped Folders

Page 3: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

Introduction• The release of SharePoint 2007 was a significant milestone for SharePoint as a

development platform.

• Microsoft introduced support for features and solution packages.

• There were lack of better developer productivity tools .

• The SharePoint 2010 developer platform increases developer productivity byintroducing the SharePoint Developer Tools in Visual Studio 2010.

• These new tools make developing for SharePoint 2010 much faster and easierbecause they automate complex tasks and hide many of the low-level details thatdevelopers have to worry about when developing for SharePoint 2007.

• The SharePoint Developer Tools also integrate commands into the Visual Studio2010 environment that make it easy to deploy and retract the solution package fora SharePoint project during testing and debugging.

Page 4: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

Before SharePoint Developer Tools1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office

(VSTO), which included two project templates for developing SharePoint 2007workflow templates.– However, these templates include no support for building a project into a .wsp

file, which makes it challenging to distribute a development effort using best-practice techniques.

2. Visual Studio add-in : Visual Studio Extensions for Windows SharePoint Services3.0 (VSeWSS) - Builds support into a Visual Studio project to generate a .wsp filebehind the scenes. The VSeWSS add-in also adds integrated commands intoVisual Studio to deploy and test the project using the generated .wsp file.– VSeWSS project format is hard-coded to a specific version of Visual Studio and

a specific version of the VSeWSS add-in.– Second, VSeWSS doesn’t support team development environments that rely on

the Microsoft Build Engine (MSBuild) or build servers that don’t have VisualStudio installed.

– VSeWSS wasn’t designed with extensibility in mind.

Page 5: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

Custom Tools for SharePoint 2007• WSPBuilder-Experienced the highest adoption rate among professional

developers.

– Adds support to automate building the project into a .wsp file for best-practicedeployment.

– WSPBuilder uses standard library projects, it is much more flexible thanVSeWSS, allowing you to move between different versions of Visual Studio andto automate the solution package build process using MSBuild.

Page 6: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

SharePoint Developer Tools• The SharePoint Developer Tools can be used only to develop

for SharePoint 2010 and future versions.

• Different SharePoint Developer Tools:– SharePoint Explorer– SharePoint Project Items– Feature and Feature Receiver– Deployment– Mapped Folders

Page 7: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

SharePoint Explorer• SharePoint Explorer is a visual component that runs inside the Server

Explorer window of Visual Studio 2010.

• You work with SharePoint Explorer by adding SharePoint connections.

• To create a new SharePoint connection, you must provide a URL to a siterunning in the local SharePoint farm.

• Once created, a SharePoint connection displays a hierarchy of nodes thatallow you to inspect the target site and the elements inside, such as itslists and document libraries.

• When you click the node for a site or a list, the standard Visual Studioproperty sheet shows the properties associated with the SharePointobject.

Page 8: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

SharePoint Explorer (Contd..)

Page 9: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

• SharePoint Explorer doesn’t provide any built-in functionality to modify aSharePoint site or to create new site elements such as a list instance.

• You should think of a SharePoint connection as a read-only view into aSharePoint site.

• You primarily use SharePoint Explorer to inspect the properties andelements of a site using the standard Visual Studio property sheet.

• What makes it powerful is that it was designed to be extensible.Developers can create custom node types that load into a SharePointconnection along with the standard node types. This capability opens upthe possibilities of custom node types that do more than just inspect sites.

• You could write a custom extension for SharePoint Explorer to modify thetarget site, or to add new site elements such as list instances or Web Parts.

SharePoint Explorer (Contd..)

Page 10: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

SharePoint Project Templates• The SharePoint Developer Tools provide several different templates for creating

new SharePoint projects that are available in Visual Basic and C#.

Page 11: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

• The SharePoint Customization Wizard prompts you for two pieces of information: the URL to a local site and a trust level.

SharePoint Project Templates (Contd..)

Page 12: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

• All Visual Studio projects contain standard nodes such as Properties and References. • SharePoint projects have two additional nodes that exist only within SharePoint projects:

– the Features node and – the Package node.

• Package command to build a SharePoint project into a solution package. • Deploy command to run a sequence of deployment steps that deploy the solution package in the local

farm so that you can test and debug your work. • Retract command reverses the act of deployment by retracting the solution package from the local farm.

SharePoint Project Templates (Contd..)

Page 13: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

Adding a SharePoint Project Item• The primary way

to extend the functionality in a SharePoint project is by adding new items known as SharePoint project items.

• Choose the List Instance template and then click Add to create a new project item instance.

Page 14: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

Adding a SharePoint Project Item (Contd..)

• Display name : PDC_SP2010

• List Type : Custom List

Page 15: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

• Top-level folder in the project with thesame name as the project item instance iscreated.

• Inside this folder is an elements.xml filewith a ListInstance element.

• You might be required to edit the XML tochange an attribute value or to add newattributes or elements.

Adding a SharePoint Project ItemAdding a SharePoint Project Item (Contd..)

Page 16: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

Adding a SharePoint Project Item

• Deployment Conflict Resolution property value by default is set to a value of Prompt

Adding a SharePoint Project Item (Contd..)

Page 17: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

• SharePoint Developer Tools automatically updated the feature.xml file by adding a reference to the element manifest from the PDC_SP2010 project item.

Adding a SharePoint Project Item (Contd..)

Page 18: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

Creating a Feature• Right-click the Features node and click the Add command.• The SharePoint Developer Tools creates a new feature with a generic name such as Feature1.• The Feature Designer allows you to modify the three feature properties: Title, Description,

and Scope. • The feature in below example has the Title of My SP2010 FEATURE and a Scope of Web.

Page 19: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

Adding a Feature Receiver• Just right-click the feature’s top-level node and click the Add Event

Receiver command.

Page 20: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

• Source file is automatically created for receiver.• If you create a Feature Receiver for the feature named MySP2010Feature, the

created C# source file name is : MySP2010Feature.EventReceiver.cs.• Configuration data is automatically added which built feature.xml that properly

configures the ReceiverClass and ReceiverAssembly attributes.• Class definition for the Feature Receiver are also created with method stubs

that are commented out.

Adding a Feature Receiver (Contd..)

<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="MySP2010Feature" Id="e86669cb-d6f2-44c8-a3ea-3a7d1d5fa900" ReceiverAssembly="SPExplorer1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=861a4099db7f3e23" ReceiverClass="$SharePoint.Type.56a6a2cf-e873-42c9-af79-73f5e3eff91e.FullName$" Scope="Web">

Page 21: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

Working with Mapped Folders

• In certain scenarios, a developer is required to deploy a file into aspecific location inside the SharePoint root directory.

• Deploy a custom image file named FeatureIcon.gif that will appearalongside the Wingtip Product Development feature on the featuremanagement page.

• Mapped folders can be used to deploy custom files inside theSharePointRootFiles folder into standard SharePoint folders such asTEMPLATE, CONTROL TEMPLATES, LAYOUTS, and IMAGES.

• To add SharePoint images folder: Just right-click the top-levelproject node in Solution Explorer, expand the Add menu, and clickthe SharePoint “Images” Mapped Folder command.

Page 22: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

• SharePoint Developer Tools automatically created a child folder with the same name as the current project.

Working with Mapped Folders (Contd..)

Page 23: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

• SharePoint Developer Tools add two extra properties to each source file inside a SharePoint project: – Deployment Location – Deployment Type

Working with Mapped Folders (Contd..)

Page 24: SHAREPOINT 2010 – DEVELOPER TOOLS · Before SharePoint Developer Tools 1. Visual Studio 2008 shipped with a toolset named Visual Studio Tools for Office (VSTO), which included two

Questions ??