Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Non SharePoint Deployment

1,667 views

Published on

This presentation was given by Mart Muller of Wizzix as part of the Sparked Toolkit Session: SharePoint Nightmares.

It discusses the problems that Mart has found when it comes to non-SharePoint deployment, and ofcourse, his solution to the challenges he faced.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Non SharePoint Deployment

  1. 1. (NON) SharePoint Deployment Mart Muller mart@wizzix.nl http://blog.martmuller.nl/
  2. 2. CASE  Application built on WSS 3.0  Besides SharePoint elements deployment (lists, content types, etc), …  … also non-SharePoint elements, like  A custom SQL Database  Backup scheduling custom database  Specific IIS settings (MIME Type)  IIS virtual directory
  3. 3. (SOME) REQUIREMENTS  1-click remote site deployment (fully automated)  Multiple web applications per server  Admin users must be able to backup their own site & (custom) database  Remote updates to custom database
  4. 4. DEPLOYMENT LEVELS  Level 1: Native SharePoint Elements  Level 2: Custom Code in SharePoint Farm  (Level 3: Exotic SharePoint Classes)  Level 4: Everything outside SharePoint Farm
  5. 5. LEVEL 1: NATIVE SHAREPOINT ELEMENTS  Deploy native SharePoint elements  Solution for deployment  Features  Assemblies  Resources  SharePoint provides installation and deployment of solutions
  6. 6. LEVEL 2: CUSTOM CODE IN FARM  Execute custom code using features and the SPFeatureReceiver class scope = within the SharePoint farm!
  7. 7. public class MyFeatureReceiver: SPFeatureReceiver { public override void FeatureActivated(SPFeatureReceiverProperties properties) { } public override void FeatureDeactivating(SPFeatureReceiverProperties properties) { } public override void FeatureInstalled(SPFeatureReceiverProperties properties) { } public override void FeatureUninstalling(SPFeatureReceiverProperties properties) { } }
  8. 8. LEVEL 3: USE ‘EXOTIC’ CLASSES IN THE SHAREPOINT PLATFORM  Take a deep dive into the SDK!  Example: Custom Database SPDataBase SharePoint provides full deployment of SQL files, including updates, connectionstrings, etc.
  9. 9. public override void Provision() { Dictionary<string, bool> options = new Dictionary<string, bool>(1); options.Add(SPDatabase.SqlDatabaseOption[2], false); SPDatabase.Provision(this.DatabaseConnectionString, @quot;C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATESQLcustom.sqlquot;, options); this.Update(); }
  10. 10. LEVEL 4: OUTSIDE SHAREPOINT SCOPE
  11. 11. LEVEL 4: OUTSIDE SHAREPOINT SCOPE  Code initiated by timerjob  Code  Console Application  Scripting  Etc.
  12. 12. SPJobDefinition // inherit from SPJobDefinition class // override execute method public override void Execute(Guid targetInstanceId) { // Execute test.bat System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(@quot;c:test.batquot;); System.Diagnostics.Process.Start(psi); }
  13. 13. SPFeatureReceiver // on FeatureActivated, deploy timer job SPSite site = properties.Feature.Parent as SPSite; // make sure the job isn't already registered foreach (SPJobDefinition job in site.WebApplication.JobDefinitions) { if (job.Name == CustomTimerJob.TimerJobName) job.Delete(); } // install the job CustomTimerJob custJob = new CustomTimerJob(site.WebApplication); // create schedule SPOneTimeSchedule schedule = new SPOneTimeSchedule(); schedule.Time = DateTime.Now; custJob.Schedule = schedule; custJob.Update();
  14. 14. RESOURCES Development Tools and Techniques for Working with Code in Windows SharePoint Services 3.0 (Part 1 of 2) http://msdn.microsoft.com/en-us/library/bb530302.aspx Development Tools and Techniques for Working with Code in Windows SharePoint Services 3.0 (Part 2 of 2) http://msdn.microsoft.com/en-us/library/bb530301.aspx Creating Custom Timer Jobs in Windows SharePoint Services 3.0 http://msdn.microsoft.com/en-us/library/cc406686.aspx

×