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

Is it possible to manage properties for a custom job definition using central admin?

The code I have in a feature receiver sets the property like this:

myJobDefinition.Properties.Add("ConnectionString", "My connection string"); 

Now that the job definition is installed. I would like the administrator to be able to change this connection string property as required.

I checked Central Admin, but it seems I may have overlooked something.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I think you cannot configure Custom Timer Jobs from Central Admin. If you look at AC's blog posts and How To:

http://msdn2.microsoft.com/en-us/library/cc427068.aspx

http://msdn2.microsoft.com/en-us/library/cc406686.aspx

Various options to store configuration for custom timer job is explored. I would suggest to store it via SPPersistedObject object because that does not involve web.config etc. Also, you can attach your config to a SPFarm object which is more logical for a timer job.

Below is an example: http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=271

As far as allowing admins to configure it, you can deploy a custom application page in the _Admin folder and have a link to it specified (via CustomAction) somehere in Central Admin.

share|improve this answer
    
Agreed, SPPersisted objects is the way to go. It's worth noting, the SPWebApplication object is an SPPersisted object, and it has a Properties hashtable. I've always stored settings for my jobs in that, and put a configuration page into Central Admin –  Andy Burns Dec 9 '10 at 10:59
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.