Live aus Amsterdam von der SharePoint Connections 2010. Meine erste Session zum Thema Sandbox Solutions von Wesley Bakker.
Hauptprobleme im SharePoint:
- ·GAC Deployment
- SPSecurity.RunWithElevatedPrivileges
- SPSite site = new SPSite(“url”) //dispose??
- SPWeb web = site.RootWeb //dispose??
Durch die Sandbox Solutions werden im SharePoint 2010 die Rollen von Administratoren, Entwickler und Site Collection Owner verschoben.
Sandbox Solutions:
- Allow a subset of full solution features
- Code executes in sandbox
- Are deployed by a site collection administrator
- Stored in the solution gallery
Gründe dafür:
- löst SharePoint Hosting Probleme
- Schnellere Entwicklungszyklen
- Verbessert Stabilität von SharePoint Servern
Warum Sandbox?
- Es ist nur ein Subset des SharePoint API’s verfügbar
- SPSite and below
- No SPSecurity
- No SPSite construction
- Man kann aber mittels SPProxyOperation definieren welche in Full Trust laufen (z.B. Webservices invoken oder Emails versenden)
- Wichtig: kompiliert wird immer gegen das komplette Objektmodell, d.h. während der Entwicklung erkennt man nicht ob man Dinge verwendet, die eigentlich nicht erlaubt sind
- Sicherheit
Lifecycle (alles über Site Collection Administrator):
- Installation (Upload into solution gallery)
- Activation (solution is validated)
- Deactivation
- Deinstallation
Was ist möglich:
- Web Parts
- Lists Instanced
- List Templates
- Custom Actions
- Workflows
- Event Receivers
- Content Types
- Site Columns
- ….
Sandbox Solution Monitoring ->Man kann Site Collection Quotas definieren (Standard 300), wie viel Ressourcen die Sandbox Solutions verbrauchen dürfen. Berechnet wird das über z.B. CPUExecutionTime, SQLQueries, … z.B. sind 20 SQL Queries = 1 RessourcePoint
Man kann Solution Validators definieren und als Farm-Solution installieren, z.B. um nur Sandbox-Solutions von einem bestimmten Lieferanten zu erlauben (Check against the Public-Key-Token)
Wehrmutstropfen:
- Visual Webparts sind nicht erlaubt!
Thanx God to the community gibt es schon diesbzgl. eine Lösung: http://sharepointdevtools.codeplex.com/documentation
Das werden wir doch gleich mal ausprobieren :). - In der Beta 30% langsamer als normale Solutions – sollte in der Release nur mehr 10% sein.
Tips and Tricks:
- Compile time check with \UserCode\Assemblies\Microsoft.SharePoint.dll
- Mit PowerShell können alle Ressourcen-Limit Einstellungen konfiguriert werden
Weiter geht’s mit SharePoint BI Overview…