16
(NON) SharePoint Deployment Mart Muller [email protected] http://blog.martmuller.nl/

Non SharePoint Deployment

  • Upload
    sparked

  • View
    1.351

  • Download
    0

Embed Size (px)

DESCRIPTION

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.

Citation preview

Page 1: Non SharePoint Deployment

(NON) SharePoint Deployment

Mart [email protected]

http://blog.martmuller.nl/

Page 2: Non SharePoint Deployment

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

Page 3: Non SharePoint Deployment

(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

Page 4: Non SharePoint Deployment

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

Page 5: Non SharePoint Deployment

LEVEL 1: NATIVE SHAREPOINT ELEMENTS

Deploy native SharePoint elements

Solution for deployment Features Assemblies Resources

SharePoint provides installation and deployment of solutions

Page 6: Non SharePoint Deployment

LEVEL 2: CUSTOM CODE IN FARM

Execute custom code using features and the SPFeatureReceiver class

scope = within the SharePoint farm!

Page 7: Non SharePoint Deployment

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) {

}}

Page 8: Non SharePoint Deployment

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.

Page 9: Non SharePoint Deployment

public override void Provision(){

Dictionary<string, bool> options = new Dictionary<string, bool>(1);options.Add(SPDatabase.SqlDatabaseOption[2], false);SPDatabase.Provision(this.DatabaseConnectionString, @"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SQL\custom.sql", options);this.Update();

}

Page 10: Non SharePoint Deployment

LEVEL 4: OUTSIDE SHAREPOINT SCOPE

Page 11: Non SharePoint Deployment
Page 12: Non SharePoint Deployment
Page 13: Non SharePoint Deployment

LEVEL 4: OUTSIDE SHAREPOINT SCOPE

Code initiated by timerjob Code Console Application Scripting Etc.

Page 14: Non SharePoint Deployment

// inherit from SPJobDefinition class// override execute methodpublic override void Execute(Guid targetInstanceId){

// Execute test.batSystem.Diagnostics.ProcessStartInfo psi = new

System.Diagnostics.ProcessStartInfo(@"c:\test.bat");System.Diagnostics.Process.Start(psi);

}

SPJobDefinition

Page 15: Non SharePoint Deployment

// on FeatureActivated, deploy timer jobSPSite site = properties.Feature.Parent as SPSite;// make sure the job isn't already registeredforeach (SPJobDefinition job in site.WebApplication.JobDefinitions){ if (job.Name == CustomTimerJob.TimerJobName) job.Delete();}// install the jobCustomTimerJob custJob = new CustomTimerJob(site.WebApplication);// create scheduleSPOneTimeSchedule schedule = new SPOneTimeSchedule();schedule.Time = DateTime.Now;custJob.Schedule = schedule;custJob.Update();

SPFeatureReceiver

Page 16: Non SharePoint Deployment

RESOURCESDevelopment 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