Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Spawned from this question.

I have been able to add a new link to my Central admin page under the Monitoring->Timer Jobs section. My problem is that I have been unable to figure out how to add it to the administration page for a specific timer job. Below is what I have:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="21EC2020-3AEA-1069-A2DD-08002B30309D" GroupId="TimerJobs"
      Location="Microsoft.SharePoint.Administration.Monitoring"
      Sequence="10"
      Title="Social Admin Logging" Description="">
    <UrlAction Url="_admin/SocialAdmin.aspx" />
  </CustomAction>
</Elements>

Does anyone know how I could go a few levels deeper to get to a specific timer job admin page? I made a half baked attempt by changing the location to something like: Microsoft.SharePoint.Administration.Monitoring.Review Job definitions.MyJobName but that didn't work

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted
+50

There's no Ribbon in the Timer Job config area, so that's not an option.

Also, you can't add any custom actions to JobEdit.aspx easily either, so that's out the question, too.

What I would do (and have done before), is add your custom action to the place you already can do, and in your config page have a dropdown box that populates with all instances of your Job, and an OK button to select that job.

On postback of that OK button, you populate a form to configure the job (I used the Properties property bag to store all config settings, just easier that way), with OK/Cancel buttons to set the configuration or return to the previous page without commiting.

Freebie tip!

Also, to replicate the "Return to previous page" behaviour, you'll need to add the current page to the Custom Action's URL as a query string, and this is done with nasty looking javascript, like this:

<UrlAction Url="javascript:window.location= '{SiteUrl}/_admin/YOURTIMERJOB.aspx?Source=' + window.location" />

Then, in your config page, you read the Source param from the Query String, and use SPHttpUtility to redirect to that location, both upon Cancelling and Clicking OK (after you commit the changes).

share|improve this answer
    
you beat me to it. same as my approach :-D! –  Colin Jun 21 '11 at 15:56
    
I hope it works well, I hashed out a whole bunch of code and a couple of pages but haven't had a chance to test it yet :P –  James Love Jun 21 '11 at 15:59
    
I grouped all my custom timerjob settings (schedule + needed proeprties) on a page deployed under a custom group in the central admin's web app settings group. This way the customer can do all changes from 1 group per timerjob –  Colin Jun 21 '11 at 16:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.