1 / 73

Welcome

Welcome. 12/19 SharePoint Server 2007 技術深入探討 – 進階開發篇. 敦群數位科技有限公司 vanGene Digital Inc 游家德 Jade Yu. Agenda. Platform technical overview SharePoint Site UI Customization SharePoint Content API introduction Web Part in SharePoint Event Handling in SharePoint Feature in SharePoint.

eugene
Télécharger la présentation

Welcome

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Welcome

  2. 12/19 SharePoint Server 2007 技術深入探討 – 進階開發篇 敦群數位科技有限公司 vanGene Digital Inc 游家德 Jade Yu

  3. Agenda • Platform technical overview • SharePoint Site UI Customization • SharePoint Content API introduction • Web Part in SharePoint • Event Handling in SharePoint • Feature in SharePoint

  4. Platform technical overview

  5. Pictures of SharePoint Platform Business Intelligence Collaboration BusinessProcesses Portal Content Management Search Next generation e-mail, project management, workflow, blog and wiki support Server-based spreadsheets plus BI portals built on SQL Server Analysis Services Windows SharePoint Services“V3” Server-based forms and workflow with smart client and browser interfaces Enhanced SharePoint Portal aggregation and personalization Great relevance with rich people and business data search Integrated document, records and Web content management workspace foundation for scalability and extensibility

  6. Role of WSS3.0 in SharePoint Framework Office 12 Solutions Built On WSS V3 Collaboration Portal ECM BI Search BPM Project Core Workspace Services APIs Fields/Forms OM and SOAP Events Deployment Storage Repository Metadata Versioning Backup Security Rights/Roles Pluggable Auth Per Item Rights Trimming Management Admin UX Delegation Provisioning Monitoring Topology Config Mgmt Farm Services Feature Policy Extranet Site Model Rendering Templates Navigation Visual Blueprint Operating System Services ASP.NET (Web Parts, Personalization, Master Pages, Provider Model for navigation, security, etc.) Database Workflow Search • Windows SharePoint Services V3 • Core Service platform • High level components

  7. WSS3.0 Core Functions Data Infrastructure Object Model, Web Services, Events Document Management, Workflow Provisioning System Page and Rendering Model

  8. WSS vs .NET Framework Windows SharePoint Services “Version 2” Windows SharePoint Services “v2” ASP.NET 1.1 ASP.NET 2.0 Windows SharePoint Services “Version 3” Windows SharePoint Services “v3”

  9. Why move WSS3.0 to .Net20 • Goals Build more directly on top of ASP.NET Move core functionality to ASP.NET • Benefits Leverage ASP.NET skills for WSS development • More consistency, less “SharePointisms” Use more ASP.NET facilities Provide & consume more ASP.NET interfaces • Web Parts, Membership, Site Map Providers, etc.

  10. Handling of SharePoint Request Windows SharePoint Services “Version 2” Windows SharePoint Services “Version 3”

  11. Based on IIS Web Applications • WSS now creates its own application Does not “take over” the default app • No need for “exclusions”(排除路徑) • Unified application domains • Centralized Web configuration management object model

  12. SharePoint Site UI Customization

  13. What do you want to customize? • List Fields / View • Cascading Style Sheets • UI Look and Feel • Workflow

  14. Tools for Customization Office SharePoint Designer + Browser Microsoft Visual Studio Web site construction Custom Coding (if necessary) Create lists and doclibs Web Controls and Parts Design Web pages ASP.NET page coding No-code data view/forms Workflow actions No-code workflows Event handlers Web part hookup

  15. Impacts and scope of Customization • List • Site • SiteCollection • Site Definition

  16. Master Page of Site Definition • C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\Master.page

  17. Folder of Site Definition

  18. Folder of CSS • C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1028\STYLES\core.css

  19. Supports by SharePoint Designer • Use custom Master Pages for application chrome • Quick global changes • CSS tools for customizing SharePoint styles • “Core.css” automatically copied to local site • New safety nets • Users can restore original contents of site template pages, i.e. “re-ghost” pages • Versioning and Recycle Bin • “Contributor Mode” for fine-grained restrictions • Deep support for ASP.NET

  20. Application Customization Changing the application look and feel using CSS and Master Pages

  21. Development Deliverables

  22. Types of Development Deliverables Data Metadata Behavior ASP.NET extensions Packaged Feature and Site Solutions

  23. Data • Programmatic access to data and documents • Custom (or customized) lists, libraries, views Calendars / Contacts / Announcements / Links / Surveys / Discussions … • Content Migration APIs • Change logs

  24. Metadata • Column Templates Centralized Field Management E.g., all “Priority” fields should have 3 choices: 1, 2, 3 • Content Types Reusable definition of a list schema Hierarchical Associate Behaviors • Events • Document Templates • Workflows

  25. Behavior – Events • Before and after events • List schema events • SPWeb deletion events • Events on lists and libraries • Pre-synchronous with cancellation and filtering • Multiple event receivers • Event Receivers per-list Item • Attach events at web or item level

  26. Behavior – Workflow • Windows Workflow Foundation is embedded • Projects Workflow activities Workflow assemblies Workflow metadata Workflow UI • Tools Visual Studio SharePoint Designer

  27. ASP.NET Extensions • It’s never “should I use ASP.NET or SharePoint sites?,” it’s “should I use ASP.NET to write from scratch or to extend SharePoint sites?” • Web Parts • Custom controls • Custom pages • Master pages • User/role providers

  28. Features • Combination of list/view/Web Part/Event Handler/workflow component/etc. • Can be packaged and deployed as a single set • Site Definitions are now largely sets of features • Sharable across site definitions

  29. Site Definitions • Low-level instructions and resources for creating, rendering sites All sites are based on a site definition Created with XML and ASP.NET resources Can execute code during site creation • Whole new kinds of sites Team software development University courses Specialized project management Blogs/Wikis Activity monitors

  30. Customization Issues: • Store Enhancements • Event Receivers • Workflows • Field Types • Content Migration • Security Policies • Site Metadata • Site Columns • Content Types • List Definitions • UI Enhancements • Web Parts • Master Pages • View Definitions • Smart Clients • SOAP • WebDAV • FrontPage RPCs • Provisioning • Site Definitions • Feature Definitions • Provisioning Assemblies

  31. SharePoint Content API introduction

  32. Terms of WSS3.0/MOSS2007 • Server Farm • Web Application(Virtual Server) • Site Collection(SPSite) • Site(Web)

  33. Logical Architecture of SharePoint

  34. Object Model about SharePoint Content Access

  35. Scenarios for using Content API • Web Page / Window Form / Console Aps. • Retrieve Data in WSS for customized use • Update Data in WSS

  36. How to get the root object for SPSite • Web Page • SPSite oSite=SPControl.GetContextSite(httpcontext.current);or • SPSite oSite=new SPSite(“http://MOSS”)); • Non-Web Form • SPSite oSite=new SPSite(“http://MOSS”));

  37. Codes to Get SPWeb object SPSite oSite=new SPSite(“http://MOSS”)); SPWeb oWeb=SPSite.AllWebs[“/WebURL”];

  38. Codes to get SPLISTCollection/SPList SPSite oSite=new SPSite(“http://MOSS”)); SPWeb oWeb=SPSite.AllWebs[“/WebURL”]; SPListCollection oLists = oWeb.Lists; foreach(SPList oList in oLists) { console.write(oList.Title); }

  39. Codes to get SPListItemCollection/SPListItem SPSite oSite=new SPSite(“http://MOSS”)); SPWeb oWeb=SPSite.AllWebs[“/WebURL”]; SPList oList = oWeb[“listname”]; foreach(SPListItem oListItem in oList.Items) { console.write(oListItem[“Title”]); }

  40. Create a new ListItem SPSite oSite=new SPSite(“http://MOSS”)); SPWeb oWeb=SPSite.AllWebs[“/WebURL”]; oWeb.AllowUnsafeUpdate=true; SPList oList = oWeb[“listname”]; SPListItem oli = oList.Items.Add(); oli[“Field”]=“Field_value”; oli.update();

  41. Recommendations about using API • Reduce the SQL pass through between using SharePoint Object. • Get root object as early as possible, and release as late as possible. • You should use object loaded from previous API call in memory

  42. Sample of bad / good coding • Bad Coding oWeb.List[“name”][0][“Title”]=“new title”; oWeb.List[“name”][0][“start_date”]=“2007/7/7”; oWeb.List[“name”][0][“start_date”]=“2007/7/31”; oWeb.List[“name”][0].update();

  43. Sample of bad / good coding • Good Coding oListItem=oWeb.List[“name”][0]; oListItem[“Title”]=“new title”; oListItem[“start_date”]=“2007/7/7”; oListItem[“End_date”]=“2007/7/31”; oListItem.update();

  44. Using SharePoint Content API Write Console to access data in SharePoint

  45. Implementation of SharePoint Web Part

  46. WebPart in SharePoint • Web Parts are now in ASP.NET 2.0 • ASP.NET 2.0 Web Parts supported • Full Compatibility for WSS “v2” Web Parts • WSS “v2” Web Part class rebased on .NET 2.0 web parts MyV2WebPart -> Microsoft.SharePoint.WebPartPages.WebPart -> Microsoft.Web.UI.WebControls.WebParts.WebPart • Improved user interface for Web Parts

  47. Types of WebPart in SharePoint • SharePoint WebPart(WSS WebPart) • ASP.NET WebPart • Hybrid WebPart

  48. How to implement and deploy Web Part in SharePoint • Create a WebPart Project in VS.NET 2005 • Assign Strong Name and version information • Copy Dll to bin folder and add SafeControl section in web.config • Add web part to WebPart Gallery • Add web part to WebPage Page

  49. Implementation of WebPart Implement a “Hello World” Web Part

More Related