If Properties.ContainsKey(InstallingKey) Then Private Property _installing() As Boolean Private Const InstallingKey As String = "DocIconJob_InstallingKey" Here’s how I store the Boolean property _installing: You can look up a few examples of custom properties objects that do this, or you can just use my method of storing your properties in the JobDefinition’s Properties object (HashTable). There are a couple of different alternatives here, but basically your properties need to serialize down to strings. You may not need properties, but if you’re doing anything even mildly complex you probably will. So I used the SPServiceJobDefinition and specified the Timer Service. For the PDFdocIcon solution, I needed the Timer Job to execute on every server in the farm. Works with the Timer Job to process work items (Pausable)įor simple jobs the SPJobDefinition is the most flexible and is what you’ll generally want to use. Runs on every server in the farm where the service exists (Pausable) – This is the one I chose Timer Job that runs on the first available server where the specified service exists (Pausable)īase Class for Timer Jobs (Generally, this is the one to use) Iterates through all sites in a Web ApplicationĮxecuted per Web Application and each Content Database is processed by individual jobs (Pausable) Invokes the SharePoint Administration Service There are several to choose from, here’s a helpful table: Job Definitions you can inherit from in the namespace: SPAdministrationServiceJobDefinition To make your own Timer Job you’ll want to subclass an exisiting Job Definition object and override the Execute method. ![]() The actual code to change the DOCICON.XML file will be saved for later. This post will focus on the plumbing necessary to setup your own custom timer job that runs on every server in the farm. In order to perform the necessary work on each server in the farm, the PDFdocIcon solution uses a custom Timer Job. I’m going to show some of the code as it currently exists below, but be sure to check out the CodePlex site to ensure you have the latest version. You can download the solution as well as the source for free from CodePlex here: WireBear PDFdocIcon. As mentioned in my previous post, I’ve recently put together a solution for automatically configuring your SharePoint servers to use the Adobe PDF icon for PDF files.
0 Comments
Leave a Reply. |