Extending SharePoint through Web Parts and ASP.NET 최승현 대리

25 Slides649.50 KB

Extending SharePoint through Web Parts and ASP.NET 최승현 대리 ([email protected]) 한국마이크로소프트

Built on .Net Framework Windows SharePoint Server (WSS) v2 is built on top of the .Net Framework WSS will ship as part of the OS; SharePoint Portal Server is built on top of WSS WSS has made large investments in developer extensibility By embracing .NET, WSS is positioned to leverage future advances in the platform

Summary of .NET support WSS will use ASP.NET instead of ISAPI for base page execution Web Part Framework Server Object Model for programmatic access to SharePoint data We offer functionality as XML web services for access from remote machines

Web Custom Controls Controls map directly to the XML (CAML) tags used on the WSS site pages: ListViewWebPart A web custom control that will output a SharePoint view ListFormWebPart A web custom control that will output a SharePoint form. ViewSelector A web custom control for representing a view selector. ListProperty A web custom control that returns a property of a list ProjectProperty A web custom control that returns a given web property

Web Part Framework Personalize your SharePoint home page to simplify and focus on the information that is most relevant to you. Authors build custom solutions using Web Parts and Web Part Pages. .NET developers extend SharePoint by encapsulating web services and enterprise data as Web Parts

Extending the Platform Web Part Pages Web Parts Scalable Dashboards v2 Framework for extending SharePoint ASP.NET web custom controls are the building blocks of Web Part Pages Visual display of SharePoint liWSS, web services, corporate information, etc. End users, authors, and developers

Using Web Part Pages Shared View and Personal View allows users to simplify and focus on the most important information. Find and integrate data from many sources. Layout and settings are easy to configure. Catalogs offer new content to add to your page. Information is available on other browsers.

Portable Web Parts Web Part is a .Net web custom control assembly DWP files contain meta-data describing the instance of the part Code doesn’t travel with the part Box administrators must install the assembly

DWP Sample

FrontPage Continues to be a great tool for customizing SharePoint sites Visual presentations on web services without writing code using the DataView Web Part Setting zone properties Editing the Html page layout Link fix-up of base-class parts

Web Parts for Authors DataView Windows SharePoint Server: HTML view of List Content Editor Page Viewer Office: Web Capture Web Part Spreadsheet PivotView ChartView Grid View of List XML/XSL

Connecting Parts Together Parts sending messages to other parts RCA cables Standardized client and server interfaces Web Part interfaces IList IRow ICell IFilter Transforms

Key Features for Developers An extension to the .Net Framework: Installed when you install WSS v2 Web Part Pages are ASP.NET pages Web Parts are ASP.NET web custom controls Scales out for large server farms Use Visual Studio to quickly build, test, and deploy custom Web Parts.

Web Part Zones Stuff on the Page Web Part Zones are embedded directly on the page SmartPages:WebPartZone runat "server" Title “Left ZoneID “ " Orientation "Vertical“ AllowCustomization “true” AllowPersonalization “true”/ Stuff in the db All users and just for me web parts inside zones are stored in the SharePoint WebParts table Personalizations are stored in the SharePoint Personalizations table

Web Part Zones ASP.NET Page Zone 3 Zone 2 Zone 1 ASP.NET Page Web Part Framework Content DB Web Custom Controls

Zone Properties Layout Properties ID Orientation ContainerWidth Title FrameType Lockdown Properties LockLayout AllowCustomization AllowPersonalization

Properties Base class properties Custom Properties Default property sheet for browseable properties with builder infrastructure Use ToolParts for creating custom property UI There are limited types because we are serializing properties: string, bool, int, float, enum, System.DateTime, and System.Drawing.KnownColor

Web Part Properties [Category("Custom Properties")] [WebPartStorage(Storage.PerUser)] [FriendlyNameAttribute("Custom Integer")] [Description("Type an integer value.") ] [Browsable(true)] [XmlElement(ElementName "SuperInt")] public int MyInt { get { return myInt; set { myInt value; } } }

Web Part Caching Using code developers have the ability to cache rendered output Two types of web part application caching ASP.NET web server memory caching Database caching Web.config setting for which type

Other Framework Features Run-time filter enables the ability to turn parts on and off Developers can add and remove Web Part menu items Developers can create custom views of the Task Pane using ToolParts

Web Part Code Access Security Code access security (CAS) allows box administrators grant specific rights to assemblies Goal of CAS is to separate access rights of the user from the access rights of the assembly Admin can deny access to local resources for partial trusted assemblies Admin can allocate trust based on signatures, strong names, and certificates

Rights and Roles WSS has 4 user roles Reader—Cannot change web part properties Contributor Pages in webs—Can make personal changes Pages in document libraries—Can make authoring changes along with personal changes Web Designer—Can make authoring changes for all pages Administrator—Can upload web parts to the web part catalog

Security Only registered set of web custom controls will run in SharePoint pages Inline script in the page will not execute Code behind in pages can be made to work All Executable code (e.g. web custom controls, web parts, and code-behind classes) needs to be installed on physical web server

Web Services Object Model Rich web service support for driving sites. FrontPage uses these public web services for page authoring. Path to web services: http://[servername]/ vti bin/smartpgs.asmx GetSmartPageDocument SaveWebPart GetXmlDataFromDataSource DeleteWebPart GetWebPartCrossPageCompati bility RenderWebPartForEdit GetSmartPageConnectionInfo GetWebPart AddWebPart GetWebPartsForDoc GetWebPartProperties

Back to top button