SharePoint Word automation SERVICES

Slides:



Advertisements
Similar presentations
using SharePoint Automation Services;
Advertisements

Site Collection, Sites and Sub-sites
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
With Folder HelpDesk for Outlook, support centres and other helpdesks can work efficiently with support cases inside Microsoft Outlook. The support tickets.
MS-Word XP Lesson 1.
Microsoft SharePoint 2010 technology for Developers
LH SharePoint SIG - Custom Actions. Custom Actions A custom action represents a Server ribbon, menu, or link customization that a user can see. Custom.
IT Project Management, Third Edition Appendix A1 Appendix A: Guide to Using Microsoft Project 2002.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
1 of 7 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Microsoft SharePoint 2013 SharePoint 2013 as a Developer Platform
Tutorial 11: Connecting to External Data
1 Chapter Overview Introduction to Windows XP Professional Printing Setting Up Network Printers Connecting to Network Printers Configuring Network Printers.
Creating a SharePoint App with Microsoft Access Services
Sharepoint Portal Server Basics. Introduction Sharepoint server belongs to Microsoft family of servers Integrated suite of server capabilities Hosted.
Virtual techdays INDIA │ august 2010 UNDERSTANDING OFFICE WEB APPS Vedant Kulshreshtha │ TSP – Collaboration Platform Microsoft India.
Automation using Selenium Authored & Presented by : Chinmay Sathe & Amit Prabhu Cybage Software Pvt. Ltd.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Customizing the SharePoint 2010 Ribbon Presented By: Ryan McIntyre.
1 ADVANCED MICROSOFT WORD Lesson 15 – Creating Forms and Working with Web Documents Microsoft Office 2003: Advanced.
For SharePoint 2010 In This Presentation: Connect Overview Connect Requirements Connect Installation Connect Initial Launch Explore SharePoint Upload.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Introduction to HP LoadRunner Getting Familiar with LoadRunner >>>>>>>>>>>>>>>>>>>>>>
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
OFC 200 Microsoft Solution Accelerator for Intranets Scott Fynn Microsoft Consulting Services National Practices.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
IT 211 Project Integration and Deployment Lab #11.
Virtual techdays INDIA │ Nov 2010 Developing Office Biz Application using WPF on Windows 7 Sarang Datye │ Sr. Consultant, Microsoft Sridhar Poduri.
ASP.NET Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital.
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,
LOGO Server. Contents Introduction 1 Problem Definition 2 Proposed Solution 3 Architecture Diagram 4 Server Technology 5 Hardware and Software.
1 © 2008 Avaya Inc. All rights reserved. IPOffice Configuration Service Emil Ratnam.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
Module 10 Administering and Configuring SharePoint Search.
What’s new in Kentico CMS 5.0 Michal Neuwirth Product Manager Kentico Software.
Copyright © 2012 UNICOM Systems, Inc. Confidential Information z/Ware Product Overview illustro Systems International A Division of UNICOM Global.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
UNDERSTANDING YOUR OPTIONS FOR CLIENT-SIDE DEVELOPMENT IN OFFICE 365 Mark Rackley
Windows SharePoint Services Installation and Configuration.
Authored by Frank Hamelly, Microsoft MVP Regional Chapters.
Section 10.1 Define scripting
“Information Sharing Portal for Indus Sub-System”
SECTION 1: Add-ons to PowerPoint
Netscape Application Server
z/Ware 2.0 Technical Overview
LOCO Extract – Transform - Load
Data Virtualization Tutorial… CORS and CIS
Microsoft SharePoint Server 2016
Appendix A: Guide to Using Microsoft Project 2002
Lesson 9 Sharing Documents
How to Install Microsoft Office 2013?
Microsoft FrontPage 2003 Illustrated Complete
Customizing your device experience with assigned access
Lesson 9 Sharing Documents
Best Practices for Load Balancing Your GlobalSearch Installation
Microsoft PowerPoint 2007 – Unit 2
SharePoint 2010 – SharePoint 101
Lesson 14 Sharing Documents
Exploring the Power of EPDM Tasks Working with and Developing Tasks in SolidWorks Enterprise PDM (EPDM) By: Marc Young xLM Solutions
Appendix A: Guide to Using Microsoft Project 2002
Mark Quirk Head of Technology Developer & Platform Group
CUSTOMER RETENTION RATE
Presentation transcript:

SharePoint Word automation SERVICES

Typical word Conversion scenario Typical Scenario User request: Please convert 10,000 word documents to PDF by the end of the week. Developer: Time for Ole automation to open the Word document and save the word document as a PDF. Developer After running for 1 Day only 400 document were converted because we ran out of memory! Time for plan B, Adobe distiller or third party. Problem solved! User request I have more documents and I would like users to pick and choose which files they should convert NOOOOOOOOOOOOOOOO!

Word automation services to the recuse What is Word Automation Services? Word Services is functionality in SharePoint 2010 that allows developers to transform Word documents into other document types like PDF, XPS, and other formats Also file operation can be executed on the file without having to open it in a client application Regular Word document types can be converted into different document types OpenXML can be utilized to perform insert, append, update, and delete operations on content within the documents

Right on time! The service runs as a timer job so this allows for the service to take full advantage of the environment Reliability Timer job can run of different machine so if one machine is down another one can take it place Scalability One a farm with adequate size the service can execute jobs on multiple servers distributing the work load Speed In most Production environments the hardware is sized to run thousands or millions of instructions and processes License SharePoint Server 2010 is for standard and enterprise CAL

What’s needed? Nothing BUT SHAREPOINT 2010 and a little code Now solutions can be given to the user without deploying code to their desktop! Word Services OpenXML SDK 2.0

User’s problem/Our solution Problem: User’s want to selectively pick word documents and convert them to different formats like PDF or XPS. Solution: Within a document library allow users to select which documents they want to convert. Utilize the ribbon, it’s a great pluggable interface that can be easily be extended. On the ribbon we will give the user a drop down of document types and two buttons quick and batch convert. Also for our power users sanity provide a third button called Check Status. Use a document library’s ribbon Put controls in ribbon using a custom action Provide a status page

File formats the service can… Read: Office Open XML (DOCX, DOCM, DOTX, DOTM) Word 97-2003 Document (DOC) and Word 97-2003 Template (DOT) We also support older versions of Word as far back as Word 2.0 for Windows (!) Rich Text Format (RTF) Single File Web Page (MHTML) HTML Word 2003 XML Word 2007/2010 XML Write: PDF XPS Office Open XML (DOCX, DOCM) Word 97-2003 Document (DOC)

Word services architecture Object Model The object model resides on a SharePoint Server 2010 Web front-end server; it enables developers to create asynchronous file conversion requests and to monitor file conversions in progress. Document Queue The document queue manager resides on a back-end application server; it moves incoming requests into the document queue database and sends requests to the Word Automation Services engine for processing. A timer job controls the frequency of conversions and the number of files that are actively being converted Word Automation Services Engine The Word Automation Services engine provides an optimized, server-based rendering engine that can use server features, such as the availability of multiple processors. In multiple-server configurations, the Word Automation Services engine balances the load to ensure that no single application server is overloaded by conversion requests. Resource from http://msdn.microsoft.com/en-us/library/ee556832.aspx

environment Virtual Machine (4 GB RAM) Windows 7 x64 Visual Studio 2010 x32 ( no x64 yet) SharePoint 2010 Software Solution Empty SharePoint Project Add an element file - Ribbon Add Application pages – Pages to submit the jobs Add a JavaScript external file – Client side JS to talk to the

Solution SEQUENCE

solution - Ribbon Ribbon <CustomAction Id ="CushWake.WordConversion.Ribbon.Scripts" Location="ScriptLink" ScriptSrc="/_layouts/CushWake/WordConversion/ConversionScript.js" /> <CustomAction Id="CushWake.WordConversion.Ribbon" Location="CommandUI.Ribbon" RegistrationId="101" RegistrationType="List" Title="Word Conversion"> <Tab Id="CushWake.WordConversion.Ribbon.Tab" Title="Word Conversion" Sequence="501"> <MenuSection Id="CushWake.WordConversion.ConversionGroup.Section.Quick" Sequence="10" DisplayMode="Menu32"> <Controls Id="CushWake.WordConversion.ConversionGroup.Controls.Quick"> <Button Id="CushWake.WordConversion.ConversionGroup.Button.Quick.PDF" Command="WordConversionButtonCommand.ConversionQuick.PDF" Image32by32="/_layouts/images/CushWake/WordConversion/clock32.png" LabelText="PDF" Sequence="10" TemplateAlias="cust1" /> … <CommandUIHandlers> <CommandUIHandler Command="WordConversionButtonCommand.JobStatus" CommandAction="/_layouts/CushWake/WordConversion/ConversionJobs.aspx?listId={ListId}" /> <CommandUIHandler Command="WordConversionButtonCommand.ConversionQuick.PDF" CommandAction="javascript:quickConvert('PDF');" EnabledScript="javascript:isItemSelected();" /> <CommandUIHandler Command="WordConversionButtonCommand.ConversionQuick.DOCM" CommandAction="javascript:quickConvert('DOCM');" EnabledScript="javascript:isItemSelected();" /> <CommandUIHandler Command="WordConversionButtonCommand.ConversionQuick.DOTX" CommandAction="javascript:quickConvert('DOTX');" EnabledScript="javascript:isItemSelected();" /> Be very careful the slightest mistake will have you trying to debug for hours or days! Custom Action for adding external references to JavaScript libraries Custom Action for add menu items

Solution - Javascript Asynchronous Call function quickConvert(cfmt) { var ctx = SP.ClientContext.get_current(); var myItems = buildDeliminatedKeys(); var listGuid = SP.ListOperation.Selection.getSelectedList(ctx); var url = '/_layouts/XYZ/WordConversion/quickConversion.aspx?cfmt=' + cfmt + '&items=' + myItems + '&listId='+listGuid; var req = new Sys.Net.WebRequest(); req.set_url(url); req.set_httpVerb("POST"); req.add_completed(OnRequestCompleted); req.invoke(); } SharePoint Dialog Box function convert() { var ctx = SP.ClientContext.get_current(); var listGuid = SP.ListOperation.Selection.getSelectedList(ctx); var myItems = buildDeliminatedKeys(); var options = { url: '/_layouts/XYZ/WordConversion/Conversion.aspx?items=' + myItems + '&listId='+listGuid, tite: 'Document Batch Convert', allowMaximize: false, showClose: false, width: 700, height: 400, dialogReturnValueCallback: updateScreenCallback }; SP.UI.ModalDialog.showModalDialog(options);

Solution-calling the Word service public static ConversionJob CreateJob(SPUserToken userToken,SaveFormat fmt,string jobTitle) { ConversionJob job = new ConversionJob("Word Automation Services"); job.UserToken = userToken; job.Settings.UpdateFields = true; job.Settings.OutputFormat = fmt; job.Name = jobTitle; return job; } job.AddFile(SPContext.Current.Site.MakeFullUrl(spiDoc.Url), destFile); Job.Start(); Other methods job.AddFolder Job. AddLibrary

SOLUTION-Monitoring ReadOnlyCollection<ConversionJobInfo> conversionJobs = ConversionJobStatus.GetAllJobs("Word Automation Services", null); var cJob = (from job in conversionJobs orderby job.SubmittedTime descending select job); Guid jobGuid = new Guid(jobGuidString); ConversionJobStatus jobStatus = new ConversionJobStatus("Word Automation Services", jobGuid, null); lblFailed.Text = jobStatus.Failed.ToString(); lblJobCount.Text = jobStatus.Count.ToString(); lblSucceeded.Text = jobStatus.Succeeded.ToString(); lblInProgress.Text = jobStatus.InProgress.ToString();

SOLUTION-Monitoring cont’d JobInfo.JobItemTableDataTable jobItemTable = new JobInfo.JobItemTableDataTable(); List<ItemTypes> jobItemTypes = new List<ItemTypes>() {ItemTypes.Succeeded, ItemTypes.Canceled,ItemTypes.Failed,ItemTypes.InProgress,ItemTypes.NotStarted }; string inputFile, outputFile; bool isJobUrlSet=false; string srcUrl=String.Empty, destUrl=string.Empty; foreach (ItemTypes itemType in jobItemTypes) { foreach (ConversionItemInfo item in jobStatus.GetItems(itemType)) inputFile = item.InputFile.Substring(item.InputFile.LastIndexOf("/")+1); outputFile = item.OutputFile.Substring(item.OutputFile.LastIndexOf("/")+1); jobItemTable.AddJobItemTableRow(inputFile, outputFile, item.ErrorMessage, item.StartTime.ToString(), item.CompleteTime.ToString(), itemType.ToString());

Word automation services - settings

Resources Word Automation Services Architecture http://msdn.microsoft.com/en-us/library/ee556832.aspx Open XML SDK 2.0 for Microsoft Office http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c6e744e5-36e9-45f5-8d8c-331df206e0d0&DisplayLang=en Setting Up the Development Environment for SharePoint 2010 on Windows Vista, Windows 7 http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx

Issue, resolution,& Guidelines Word Automation Services has to be explicitly enabled. Using OpenXml had trouble finding System.IO.Packing for .Net 4.0 add the WindowsBase to your project Word Automation Service Settings Worker processes = #CPU – 1 Max of 90 documents per worker process per minute Invalid document have a high memory cost All memory is reclaim when the process is restarted You can set the # of times to try to convert the document