La presentazione è in caricamento. Aspetta per favore

La presentazione è in caricamento. Aspetta per favore

Fabio Santini.NET Senior Developer Evangelist. 2 SharePoint Customizzazione 4 principali modalità 4 principali modalità  Componenti (Web Parts e Event.

Presentazioni simili


Presentazione sul tema: "Fabio Santini.NET Senior Developer Evangelist. 2 SharePoint Customizzazione 4 principali modalità 4 principali modalità  Componenti (Web Parts e Event."— Transcript della presentazione:

1 Fabio Santini.NET Senior Developer Evangelist

2 2 SharePoint Customizzazione 4 principali modalità 4 principali modalità  Componenti (Web Parts e Event Handler)  Custom Templates  Site Definitions  Web Services

3 Web Parts

4 4 "Hello World" Creare una classe che… Creare una classe che…  Eredita da Microsoft.SharePoint.WebPartPages.WebPart  Overrides del metodo RenderWebPart  Utilizza HtmlTextWriter using Microsoft.SharePoint.WebPartPages; using System.Web.UI; namespace AcmeWebParts { public class WebPart1 : WebPart{ protected override void RenderWebPart(HtmlTextWriter output) { output.Write("Hello, World"); }

5 5 Assembly Deployment Copiare l’assembly nella cartella \bin del virtual server root Copiare l’assembly nella cartella \bin del virtual server root  Solo in ambiente di sviluppo Global Assembly Cache (GAC) Global Assembly Cache (GAC)  Raccomandata in ambiente di produzione

6 6 Web Parts come Safe Controls Web Parts sono eseguite dall’engine di SharePoint Web Parts sono eseguite dall’engine di SharePoint  Web Part vengono eseguite in Safe Mode  Sottosistema di security integrato in WSS  L’amministratore DEVE modificare il web.config per abilitare una nuova Web Part <SafeControl Assembly="AcmeWebParts" Namespace="AcmeWebParts" TypeName="*" Safe="True" />

7 7 Web Parts e CAS Le Web Parts nella GAC sono considerate fidate dalla CAS Le Web Parts nella GAC sono considerate fidate dalla CAS Web Parts nella \bin sono eseguite in sandbox Web Parts nella \bin sono eseguite in sandbox  Sandbox controllata dalla Code Access Security.Net (CAS)  Sandbox configurata nell’elemento del web.config  3 Livelli di sicurezza  1) WSS_Minimum (default)  2) WSS_Medium  3) Full -->

8 8 Importare Web Part Dal menù Modify Shared Web Page Dal menù Modify Shared Web Page  Scegliere Add Web Part >> Import

9 9 Debugging di una Web Part Attach sul worker process di SharePoint (w3wp.exe) Attach sul worker process di SharePoint (w3wp.exe)  importare i break points in Visual Studio.NET

10 10 Custom Properties Le proprietà sono aggiunte alla definizione della Web Part Le proprietà sono aggiunte alla definizione della Web Part  sono usate per memorizzare informazioni  hanno un valore di default  possono essere modificate direttamente dal designer di Web Part in Sharepoint  vengono persisite in due modi : shared o per-user [ XmlRoot(Namespace="AcmeWebParts") ] public class WeatherReportWebPart : WebPart { protected string _ZipCode = s trin g.Empty; [ WebPartStorage(Storage.Personal), DefaultValue(""), Browsable(true), FriendlyName("Zip Code"), Category("Acme Custom Props") ] public string ZipCode { get { return _ZipCode; } set { _ZipCode = value; } }

11 11 Impostare le Custom Properties L’utente può modificare le custom property L’utente può modificare le custom property  WSS fornisce un interfaccia all’interno del browser  L’interfaccia può essere estesa scrivendo dei custom tool

12 12 File.DWP Contiene i metadati necessari alla configurazione Contiene i metadati necessari alla configurazione First AcmeCorp WebPart AcmeCorp's very first Web Part AcmeWebParts AcmeWebParts.WebPart1 98052

13 Event Handler

14 14 Document Library Events (1) Posso essere avvertito quando cambia un documento in WSS? Posso essere avvertito quando cambia un documento in WSS? Creare un Assembly.NET Creare un Assembly.NET  Implementare IListEventSink  Registrare nella Global Assembly Cache (GAC) In WSS In WSS  Abilitare la notifica degli eventi a livello di server  Configurare la Document Library per inviare le notifiche al nostro assembly  Specificare il fully qualified name

15 15 Document Library Events (2) IListEventSink Interface IListEventSink Interface  OnEvent method al cambiamento di un doc  Gli eventi sono asincroni Events  No delegates / callbacks Notifiche Notifiche Edited Edited Moved Moved Renamed Renamed Uploaded Uploaded Checked in Checked in Checked out Checked out Check-out cancelled Check-out cancelled Copied Copied Deleted Deleted

16 16 Object Model List Data List Data  SPField  SPFieldCollection  SPListCollection  SPList  SPListItemCollection  SPListItem  SPView Administration Administration  SPGlobalAdmin  SPQuota  SPVirtualServer Security Security  SPGroup  SPGroupCollection  SPSite  SPUser  SPUserCollection Documents Documents  SPDocumentLibrary  SPFile  SPFileCollection  SPFolder

17 Site definitions

18 18 Site Definition Files C:\Program Files \Common Files \Microsoft Shared \web server extensions \60\template C:\Program Files \Common Files \Microsoft Shared \web server extensions \60\template File Scopes File Scopes  Server Language  E.g., \1033  Site Definition  E.g., \1033\STS  List Definition  E.g., \1033\STS\LISTS\DOCLIB Enumeration of site definitions Site definition List definition Minimalist site definition

19 19 Site Definition Files WEBTEMP*.XML WEBTEMP*.XML  Per lingua  Definisce i tipi di sito  Contiene i puntatori a più ONET.XML ONET.XML ONET.XML  Definisce un sito  Definisce proprietà e navigazione  Contiene i puntatori a più SCHEMA.XML SCHEMA.XML SCHEMA.XML  Definisce una lista  Definisce proprietà, schema e viste

20 Custom Templates

21 21 Custom Templates Una customizzazione di una site definition Una customizzazione di una site definition Scopo Scopo  Creare nuovi template senza modificare il server  Impostare nuovi template e contenuti per la creazione di Site  Meno “pericolosi” dei Custom Site Da considerarsi il delta tra un Site Definition ed il risultato utente Da considerarsi il delta tra un Site Definition ed il risultato utente Sono legati ad un paritcolare Site Definition Sono legati ad un paritcolare Site Definition Integrati in FrontPage 2003 Integrati in FrontPage 2003

22 Web Service

23 23 I WebServices espongono il modello a oggetti lato server I WebServices espongono il modello a oggetti lato server Consentono il controllo completo di liste, siti, viste, ecc… Consentono il controllo completo di liste, siti, viste, ecc… Le funzionalità sono state ottimizzate per minimizzare le transazioni Le funzionalità sono state ottimizzate per minimizzare le transazioni Microsoft Office 2003 (Microsoft Excel, DataSheet, Microsoft Word, Microsoft Outlook ®, Microsoft FrontPage ®, etc.) Sono stati integrati utilizzando I Web Service esposti Microsoft Office 2003 (Microsoft Excel, DataSheet, Microsoft Word, Microsoft Outlook ®, Microsoft FrontPage ®, etc.) Sono stati integrati utilizzando I Web Service esposti Web Services in WSS

24 24 Web Service GetListCollection GetListCollection GetListItems GetListItems GetWebCollection GetWebCollection UpdateList UpdateList UpdateListItems UpdateListItems GetWebInfo GetWebInfo GetWebPart GetWebPart GetSmartPageDocument GetSmartPageDocument And more… And more…

25 25 Getting Started with Web Services Creare una Windows application Creare una Windows application Microsoft Visual Studio ®, “Add Web Reference” Microsoft Visual Studio ®, “Add Web Reference” http://localhost/_vti_bin/ http://localhost/_vti_bin/  lists.asmx - Lists  UserGroup.asmx – users and groups  Webs.asmx – Web information  Views.asmx – view information  Subscription.asmx – subscriptions

26 26 Approfondimenti SharePoint Products and Technologies Developer Center SharePoint Products and Technologies Developer Center http://msdn.microsoft.com/SharePoint GotDotNet GotDotNet http://gotdotnet.com/team/sharepoint MSD2D MSD2D http://www.sharepointd2d.com/ WSS FAQ WSS FAQ http://wss.collutions.com/ SharePoint customization SharePoint customization http://www.sharepointcustomization.com/default.aspx Barry's Blog Barry's Blog http://Barracuda.net/BarrysBlog.aspx

27 27 © 2002 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.


Scaricare ppt "Fabio Santini.NET Senior Developer Evangelist. 2 SharePoint Customizzazione 4 principali modalità 4 principali modalità  Componenti (Web Parts e Event."

Presentazioni simili


Annunci Google