sharepoint 2003 web parts by sam nasr june 27, 2006
TRANSCRIPT
SharePoint 2003 Web SharePoint 2003 Web PartsParts
ByBy
Sam NasrSam NasrJune 27, 2006June 27, 2006
www.ClevelandDotNet.info
AgendaAgenda
IntroductionIntroduction Web Parts PresentationWeb Parts Presentation Q&A (Open)Q&A (Open) Feedback & raffleFeedback & raffle
What is a Web Part?What is a Web Part?
A modular portion of an ASP.Net web page.A modular portion of an ASP.Net web page.
Visual content consists of:Visual content consists of:– Title barTitle bar– FrameFrame– ContentContent
Provides custom functionality to SharePoint sites and portals.Provides custom functionality to SharePoint sites and portals.– Display Outlook contacts within a frame.Display Outlook contacts within a frame.– Display graphical data within a portion of a page.Display graphical data within a portion of a page.
Based on .Net framework and ASP.NET.Based on .Net framework and ASP.NET.
Integrate with Web Services, Office, and BizTalk Server.Integrate with Web Services, Office, and BizTalk Server.
Web Parts are composed of:Web Parts are composed of:– Description file (.DWP - XML based)Description file (.DWP - XML based)– Assembly (.DLL)Assembly (.DLL)
Web PartsWeb Parts
Static or Dynamic Web PartsStatic or Dynamic Web Parts
Connectable Web Parts (i.e. Customer to Connectable Web Parts (i.e. Customer to Orders)Orders)
Personal or Shared ViewsPersonal or Shared Views
Developed using FrontPage or Visual Developed using FrontPage or Visual StudioStudio
Web Part EvolutionWeb Part Evolution
v1.0: VBScript or JavaScript for v1.0: VBScript or JavaScript for SharePoint 2001.SharePoint 2001.
v2.0: Integrated .Net 1.1 v2.0: Integrated .Net 1.1 functionality for SharePoint 2003.functionality for SharePoint 2003.
v3.0: Built on ASP.Net 2.0 for v3.0: Built on ASP.Net 2.0 for SharePoint 2007 and ASP.Net 2.0.SharePoint 2007 and ASP.Net 2.0.
Creating a Web PartCreating a Web Part
1.1. Download Web Part Template.Download Web Part Template.http://www.microsoft.com/downloads/details.aspx?FamilyId=CAC3E0D2-BEC1-494C-A74E-75936B88http://www.microsoft.com/downloads/details.aspx?FamilyId=CAC3E0D2-BEC1-494C-A74E-75936B88E3B5&displaylang=enE3B5&displaylang=en
2.2. Create a Web Part Project in VSCreate a Web Part Project in VS
3.3. RenderWebPart() is the entry point of RenderWebPart() is the entry point of the code.the code.
Adding a Web PartAdding a Web Part
1.1. Add a <SafeControl> element to Add a <SafeControl> element to the c:\Inetpub\wwwroot\the c:\Inetpub\wwwroot\web.configweb.config
2.2. Import the .DWP fileImport the .DWP file
3.3. Move the web part to a web part Move the web part to a web part zone (or using ‘Add’ button).zone (or using ‘Add’ button).
Web Part GalleryWeb Part Gallery
Web Part Page: web parts already added to Web Part Page: web parts already added to the page (open & closed)the page (open & closed)
<Site Name>: gallery of web parts <Site Name>: gallery of web parts maintained by site Admin.maintained by site Admin.
Virtual Server: web parts added to the root Virtual Server: web parts added to the root directory of the virtual server (i.e. <local directory of the virtual server (i.e. <local drive> \inetpub\wwwroot\wpcatalog)drive> \inetpub\wwwroot\wpcatalog)
Online: web parts available from Online: web parts available from Microsoft.comMicrosoft.com
SecuritySecurity
Role Based:Role Based:– Readers: No WP modification rightsReaders: No WP modification rights– Contributors: can modify in Personal View only.Contributors: can modify in Personal View only.– Administrators: Full rightsAdministrators: Full rights
Server Based: <SafeControl> in web.configServer Based: <SafeControl> in web.config
Web Part Based: Code Access Security (CAS)Web Part Based: Code Access Security (CAS)– Increasing the Virtual Server’s trust levelIncreasing the Virtual Server’s trust level– Installing the Web Part in the GACInstalling the Web Part in the GAC– Creating a custom policy file for the Web Part Creating a custom policy file for the Web Part
AssemblyAssembly
Debugging Web PartsDebugging Web Parts
Enable TracingEnable Tracing
Display messages to UIDisplay messages to UI
Manually attach debugger to Manually attach debugger to w3wp.exew3wp.exe
Debugging TipsDebugging Tips
Re-opening a closed web PartRe-opening a closed web Part– Re-insert from Web GalleryRe-insert from Web Gallery– FrontPageFrontPage
Append “?Contents=1” to URL to view Append “?Contents=1” to URL to view contentscontents
Append “PageView=Shared” or Append “PageView=Shared” or “PageView=Personal”“PageView=Personal”
ResourcesResources
Web Part Template for Visual StudioWeb Part Template for Visual Studiohttp://www.microsoft.com/downloads/details.aspx?FamilyId=CAC3E0D2-http://www.microsoft.com/downloads/details.aspx?FamilyId=CAC3E0D2-BEC1-494C-A74E-75936B88E3B5&displaylang=enBEC1-494C-A74E-75936B88E3B5&displaylang=en
Son of Smart Part Son of Smart Part http://http://www.gotdotnet.com/workspaces/workspace.aspx?idwww.gotdotnet.com/workspaces/workspace.aspx?id=6cfaabc8-db4d-41c3-8a88-3f974a7d0abe=6cfaabc8-db4d-41c3-8a88-3f974a7d0abe
““The Rational Guide to Building SharePoint Web Parts”The Rational Guide to Building SharePoint Web Parts”http://www.amazon.com/gp/product/0972688862/qid=1151515832/sr=1-1/http://www.amazon.com/gp/product/0972688862/qid=1151515832/sr=1-1/ref=sr_1_1/102-1550737-3506543?s=books&v=glance&n=283155ref=sr_1_1/102-1550737-3506543?s=books&v=glance&n=283155
““Microsoft SharePoint Products and Technologies Microsoft SharePoint Products and Technologies Resource Kit”Resource Kit”
http://www.bookpool.com/ss?qs=sharepoint+resource+kit&x=0&y=0 http://www.bookpool.com/ss?qs=sharepoint+resource+kit&x=0&y=0