AdvisorEvents.com Building WorkFlow Solutions with Windows SharePoint Services Patrick Tisseghem MVP SharePoint Portal.

Slides:



Advertisements
Similar presentations
Basic SharePoint Workflows
Advertisements

Overview and Demonstration of declarative workflows in SharePoint using Microsoft SharePoint Designer 2007 Kevin Hughes MCT, MCITP, MCSA, MCTS, MCP, Network+,
Msepm.hsquared.be. Eventing Architecture Server-side events and the Queue Creating an Event Handler A statusing example Deploying an Event Handler Event.
June 4-8 Orlando. WSS Object Model Fundamentals Working Remotely with Lists and Document Libraries Cross-Site Data Queries Exploring New WSS Classes.
Welcome to the Minnesota SharePoint User Group. Agenda Quick Intro Announcements and News Document Management Content Types Records Management Q&A.
Designing, Deploying and Managing Workflow in SharePoint Sites Steve Heaney Product Development Manager OBS
Developing for SharePoint with Visual Studio Jason Keicher
For Developers Who Hate SharePoint.  ~5 years web development experience  1 ½ years SharePoint experience  First worked with SharePoint in Dec. 2006,
Programming SharePoint Object Model, Web Services, and Events Michael Morton 4/15/03.
Randy Williams, MOSS MVP Senior Consultant Synergy Corporate Technologies.
SOFTWARE PRESENTATION ODMS (OPEN SOURCE DOCUMENT MANAGEMENT SYSTEM)
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
27. to 28. March 2007 | Geneva, Switzerland. Fabrice Romelard ilem SA Level 200.
St. Louis Day of Dot Net 2011 Jump Start: SharePoint Development Becky Bertram Independent SharePoint Consultant SharePoint MVP, MCSD.NET, MCTS
Windows SharePoint Services 3.0 (WSS v3) Browser Clients MS Word Clients MS Outlook Clients Microsoft Office SharePoint Server 2007 (MOSS) Windows.
Using Microsoft SharePoint to Develop Workflow and Business Process Automation Ted Perrotte National Practice Manager, Quilogy, Microsoft Office SharePoint.
©2011 Quest Software, Inc. All rights reserved. Steve Walch, Senior Product Manager Blog: November, 2011 Partner Training Webcast.
Welcome to the Minnesota SharePoint User Group. Introductions Next User Group Meeting Training / Events WorkFlow in SharePoint Out of the box 3 rd Party.
Welcome to the Minnesota SharePoint User Group. Quick Intro Announcements Personalization in SharePoint Configuring User Profiles Configuring Audiences.
Welcome to Philly Code Camp Russ Basiura SharePoint Consultant RJB Technical Consulting
Workflow and SharePoint Presented by Ben Geers. Overview What is workflow? Windows Workflow Foundation How does workflow apply to SharePoint? WSS v3 vs.
Developing Workflows with SharePoint Designer David Coe Application Development Consultant Microsoft Corporation.
SharePoint and SharePoint Online: Today and what's next? Presented by Luke Abeling – IT Platforms.
Agenda Principal Consultant, SharePoint Development Team Lead John Ramminger Linked In:
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
Basic Developer Knowledge That Every SharePoint Admin Must Have Randy Williams, MVP MOSS Synergy Corporate Technologies
SharePoint Workflows with Visual Studio Stuart Cox RBA Consulting techpunch.wordpress.com.
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Slide 1.NET Development for Project 2003 Samples from the Project 2003 SDK Jim Corbin Programmer Writer Office Developer Documentation Microsoft Corporation.
What’s new in Kentico CMS 5.0 Michal Neuwirth Product Manager Kentico Software.
New & Improved Events List Relationships and Joins Large List Support Field & List Item Validation.
Office Business Applications Workshop Defining Business Process and Workflows.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Search Overview Search Features: WSS and Office Search Architecture Content Sources and.
Welcome to the Minnesota SharePoint User Group. Introductions / Overview SharePoint 101 High level overview of SharePoint Differences between SharePoint.
MPA-GTA: 2005 EPM SCHEDULE and ANNOUNCEMENTS Dave D’Silva Vice President MPA-GTA.
What’s New in SharePoint 2010 SharePoint 2010 Development Primer New Developer Tools for SharePoint 2010 SharePoint 2010 Integration with PowerShell.
Welcome to the Minnesota SharePoint User Group. Develop and support a local community focused on Microsoft SharePoint Technologies Educate user group.
1 © Xchanging 2010 no part of this document may be circulated, quoted or reproduced without prior written approval of Xchanging. MOSS Training – UI customization.
Building an EDRM solution on the Microsoft & Tower Platform Jonny Chambers (Microsoft) & Jason Boswell (Tower Software)
Coding Compliance Components Writing Custom Policies for Auditing, Expiration and More Jason Morrill Program Manager Windows SharePoint Services.
Windows Sharepoint Services , Tracking, And Other Collaboration Applications Mike Ormond Developer & Platform Group, Microsoft Ltd
Extending SharePoint through Web Parts and ASP.NET 최승현 대리 한국마이크로소프트.
NET Development on Microsoft SharePoint Technology Part 4: Templates, Features, and Solution Deployment Mick Badran Breeze Training Consulting Trainer.
Copyright © 2006 Pilothouse Consulting Inc. All rights reserved. Web Parts Overview Web parts in SharePoint 2007 “Hello World” web part Typical deployment.
Windows SharePoint Services Development Part 1: Paul Appleby Application Architect Microsoft Limited.
Back to Basics A Tour of Microsoft SharePoint. Who am I? Kenny Duenke Lead Systems Analyst RGA
Programming the Microsoft SharePoint Products and Technologies Object Model Paul Appleby Developer & Platform Group
SharePoint Workflow Prepared By: Eng. Rasha Farouk.
The 2007 Microsoft Office System Servers Enterprise Content Management, Workflow and Forms Martin Parry Developer and Platform Group, Microsoft Ltd
Programming the Microsoft SharePoint Products and Technologies Object Model Paul Appleby Developer & Platform Group
VITALE, CATURANO & COMPANY LTD Microsoft SharePoint Architecture & Object Model Overview VITALE, CATURANO & COMPANY LTD SharePoint Developer Series – Architecture.
Workflow in Microsoft Office SharePoint Server Jessica Gruber Consultant Microsoft Corporation.
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Microsoft Virtual Academy Jamie McAllister | SharePoint MVP & Solution Architect Rob Latino | Program Manager in Office 365 Support.
Intro to Declarative Workflows in SharePoint Daryl Rasmussen, MCSD (.NET), MSTS (Moss 2007), MCSD (SP 2010) Calgary SharePoint Users Group.
Microsoft Office System 2007: Records Management Wes Preston Inetium.
Project Management: Messages
ArcGIS Workflow Manager: Advanced Workflows and Concepts
Building Dynamic Applications with the SharePoint Client Object Model
Collaboration and Storage with WSS v3
What is SharePoint and why you should care
Programming SharePoint Object Model, Web Services, and Events
Microsoft Dynamics.
SharePoint Essentials Toolkit
Microsoft Office System 2007: Records Management
SharePoint Foundation 2010
Microsoft Office SharePoint 2007 Technical Enablement Tour
SharePoint Workflow: Taking the Manual Out of Your Process
MS Confidential : SharePoint 2010 Developer Workshop (Beta1)
Presentation transcript:

AdvisorEvents.com Building WorkFlow Solutions with Windows SharePoint Services Patrick Tisseghem MVP SharePoint Portal Server 2003 U2U ALS310

AdvisorEvents.com Me.About()  Managing Partner U2U .NET Development Training and Services  MVP SharePoint Portal Server  My work? SharePoint Development Workshops Community Work  SmartPart  CAML Query Builder  SharePoint Application Blocks  Blog – EMEA Ascend Trainings  Office smart client Trainings  Portal Boot camps and Workshops

AdvisorEvents.com Agenda  Workflow out of the box – Is it enough?  Creating a custom workflow solution  SharePoint Workflow Application Block (SWAB)  Summary

AdvisorEvents.com Workflow out of the box  Covers only the basic content approval steps  How it works Turn on content approval at the level of the document library or form library Appoint users the role of approvers Submissions will not be visible until approver comes in and approves or rejects  Limitations No parallel or serial approval routes No actions available

AdvisorEvents.com What do we miss?  Serial or parallel approval routes  Dynamic list of approvers  Notifying approvers via s  Richer support for supplying comments when approving or rejecting  Tracking and logging of the workflow steps

AdvisorEvents.com Creating a Custom WorkFlow Solution  Quick overview of classes within the WSS object model we will use  Preparing the SharePoint-enabled virtual server  Creating a document library event handler.NET class library implementing the IListEventSink interface Adding our code  Signing the assembly and deployment in the GAC  Attaching the assembly to the document library  Testing and debugging

AdvisorEvents.com Sample we will work out Speakers Speaker Document Library 1 2 Public Document Library Reviewers Document Library 6.NET Assembly 3 Reviewers List 4 Reviewers 7 5.NET Assembly Everyone 13 9

AdvisorEvents.com Object Model Refresher  SPSite  SPWeb  SPList  SPDocumentLibrary  SPListItem  SPFolder  SPFileCollection  SPFile

AdvisorEvents.com Time to get into the code…

AdvisorEvents.com Preparing our Virtual Server  SharePoint Central Administration  Configure Virtual Server Settings  Select your Virtual Server  Virtual Server General Settings  Turn on Event Handlers

AdvisorEvents.com Creating the Event Handler  Normal.NET Class Library C# or VB.NET Take care of your namespace  Set Reference to Microsoft.SharePoint.dll

AdvisorEvents.com Implement IListEventSink  OnEvent member to implement  SharePoint provides you context information through the SPListEvent type argument  Common properties we will use Type, Site, PropertiesAfter, URLAfter using System; using Microsoft.SharePoint; namespace Advisor.WorkFlow.Demo { public class SpeakerDocHandler: IListEventSink { public void OnEvent(SPListEvent listEvent) { }

AdvisorEvents.com Checking Type of Event and Item Metadata  SPListEventType Checkin, Checkout, Copy, Delete, Insert, Invalid, Move, Update, UnCheckout  Note: your code gets notified after the event has fired  Use PropertiesAfter to check value of column if((listEvent.Type==SPListEventType.Update) && (listEvent.PropertiesAfter["Status"].ToString()=="Ready For Review")) { }

AdvisorEvents.com Lookup Reviewer  Two possibilities here Object model drill-down CAML query SPWeb web = listEvent.Site.OpenWeb("/advisor"); SPList list = web.Lists["Reviewers"]; SPUser reviewer = null; foreach(SPListItem item in list.Items) { if(item.ID==Convert.ToInt32(listEvent.PropertiesAfter["Track"])) { string[] reviewerTmp = item["Reviewer"].ToString().Split(';'); int reviewerID = int.Parse(reviewerTmp[0]); reviewer = web.Users.GetByID(reviewerID); }

AdvisorEvents.com Lookup Reviewer  CAML Query SPQuery class  U2U CAML Query Builder Utility Build your query in a WYSIWYG way Helper class to execute query U2U.SharePoint.CAML.Server.Helper caml = new U2U.SharePoint.CAML.Server.Helper(camlFile,track) DataTable tbl = caml.ExecuteQuery();

AdvisorEvents.com CAML Query Builder Utility  Free tool available from

AdvisorEvents.com Sending the  Reviewers can subscribe to alerts  Programmatically sending the System.Web.dll System.Web.Mail namespace if(reviewer!=null) { SmtpMail.SmtpServer = SMTPServer; SmtpMail.Send(from , reviewer. ,"Presentation to review", "A new presentation is ready for your review"); }

AdvisorEvents.com Copying Document and Updating MetaData  Using UrlAfter property of SPListEvent to quickly grab the SPFile object  Ways of copying or moving SPFile.CopyTo method SPFile.MoveTo method web.Lists.IncludeRootFolder=true; SPList reviewerLib = web.Lists["Reviewer Library"]; SPFile doc = web.GetFile(listEvent.UrlAfter); doc.CopyTo(reviewerLib.RootFolder.Url + "/" + doc.Name,true); web.Lists.IncludeRootFolder=true; SPList reviewerLib = web.Lists["Reviewer Library"]; SPFile doc = web.GetFile(listEvent.UrlAfter);

AdvisorEvents.com Copying Document and Updating MetaData  Problem: Part of the auditing information is overwritten with CopyTo and MoveTo  Reason: Your code is executed with the account of the worker process!  Solution: Read the file content and add a new SPFile object manually to the SPFileCollection of the destination folder SPFolder fld = reviewerLib.RootFolder; SPFileCollection files = fld.Files; files.Add(fld.Url + "/" + doc.Name, doc.OpenBinary(), doc.Author, doc.ModifiedBy, doc.TimeLastModified, doc.TimeCreated);

AdvisorEvents.com Copying Document and Updating MetaData  Use the Item collection  Don’t forget the Update() method call doc.Item["Status"] = "Currently in Review"; doc.Item.Update();

AdvisorEvents.com Deploying the Event Handler  Strong name the assembly Create a public/private keypair using sn.exe Point to snk file within assemblyinfo file in project  Deploy the assembly in the GAC Drag and drop Gacutil.exe /i  Notes Use fixed version number IISReset is required to test latest copy C# can use postbuildevent in VS.NET

AdvisorEvents.com Activating the Event Handler  Advanced settings of document library  Avoid typing mistakes Use.NET Reflector ( Full Strong Name Full Class Name

AdvisorEvents.com Exceptions and Debugging  SharePoint user is not confronted with unhandled exceptions  Developers need to consult application log in event viewer to get description of exception  Use VS.NET to attach to ASP.NET worker process that runs your code and set breakpoints

AdvisorEvents.com Things to be aware of  Event-handlers can only be attached to document and form libraries, not to lists  Code runs asynchronously in new thread  Events are notified after the action has occurred  Code is executed with account of the application pool Impersonation within code (P/Invoke) Execute your code in COM+ application Execute your code in a Web Service

AdvisorEvents.com WorkFlow Lite  Available for free on GotDotNet  Doing the same things we have done but in a more configurable, generic manner

AdvisorEvents.com Workflow Application Block SharePoint Site SharePoint Doc.Lib. Workflow Engine XML Document Library Event Handler

AdvisorEvents.com Summary  Library Event Handlers are a great way to extend the functionality of a SharePoint document library or form library Not only workflow, also e.g. version pruning, providing undelete functionality, …  Learn the object model before you start  Think about re-usability (e.g. WorkFlow Lite approach)  Many third-party solutions are available K2 WorkFlow Captaris Teamplate Skelta WorkFlow Nintex SmartLibrary

AdvisorEvents.com A DVISOR L IVE Web Update Page AdvisorEvents.com/cmt0506p.nsf/w/cmt0506ud This session WILL NOT have updates.

AdvisorEvents.com Thank you! Please remember to fill out your evaluation.