This project is read-only.
These instructions may be incomplete. Please post questions in the discussions if something needs to be clarified.

Installing

I found installing a custom timer job to be difficult. I do not know how helpful I would be troubleshooting the activation of the timer job.
Part 1:
  1. Download the ImportDataTimerInstaller.bat file from the downloads page.
  2. Put in on your sharepoint server.
  3. Log on with installer or admin permissions
  4. Edit the bat file and change the location's to point to the location of the wsp file.
  5. Edit the bat file and update the url of your sharepoint site
  6. Save and execute the bat file. May need to run as admin.

Part 2:
  1. Log on to your sharepoint site and navigate to your site collection home page.
  2. Click Site Actions > Site Settings
  3. Click on "Manage Site Features" under "Site Actions"
  4. Activate "Bengen Import Data Timer Configuration"
  5. Go back to Site Settings
  6. Click on "Site Collection features" under "Site Collection Administration"
  7. Make sure that Bengen Import Data Timer is activated

Note:
The reason for the two features is that one is specific to the timer job and the other is specific to creating the required lists for storing jobs and log history. THis may change in later releases.

Special thanks to fangdahai's timer job project.

Configuring Timer Job in Central Admin

Job Definitions.png
  1. Log in to your Central Administration site.
  2. Click on "Monitoring"
  3. Click on "Review job definitions"
  4. Click on "Import data timer job"
  5. Change the schedule to suite your needs. Note: Currently the recurrence field in the job settings list does not support less than an hourly schedule.

Creating a Job

Site Settings.png
ImportDataTimerSettings.png
Job View.jpg
  • On your site collection home page, Click Site Actions > Site Settings
  • Under "Site Administration", click on "Import Data Timer Settings" (This location may change to Site Collection Administration later)
  • Click "Add New Item"
    • Job Name is any unique name identifying the job.
    • Description ...should be obvious.
    • Destination List is any of the following: List title, relative list url, or list guid
    • Provider Type is the type connection that will be used to establish a connection to your database.
    • Connection string is the connection string required to connect to your database.
    • SQL is the sql query you wish to execute. Each query column must exist as a field in the destination list and is case sensitive.
    • Recurrence is the frequency the job should run. Please review that project for details.
    • Last Occurrence Result is populated by the timer job and updates it to either Failed, Success, or Running. The link will take you to the history logs for the most recent job ran.
    • Last Occurrence Message is populated by the timer job with a short message on it's last run.
    • Status is either Active, meaning it will run on the next occurrence, or Inactive meaning it will not run at all, or Test meaning it will run in test mode. Test mode will run the job and import only the first record from your results. It will also use a guid in place of the 'UniqueField' or 'Title' column so that existing data is not overwritten. Jobs set to "Test" will run every time the Timer Job runs, regardless of the "Next Occurrence" date and time.
    • Event Logging is the level of detail to log the job's progroess. I like "information" once the job has been tested and works.
    • Event Retntion is the number of days to keep event history.

Job Results

  • Job status will reflect Failed, Success, or Running. Click on the status will take you to that status log detail. Each job run is assigned a guid which is filtered when you click the status link.
  • The history list contains a column "Parent Result" which is allways a link back to the Settings list.
  • History will be deleted based on your retention field.
ImportDataTimerHistory1.png
ImportDataTimerHistory2.png

Updating existing items rather than creating new one

The job will search the list for a field called "UniqueField". Each job that runs on that list should include a "UniqueField" column in its SQL. When the job runs and finds "UniqueField" it will update that list item with any value that is different in the resulting query. If no changes are found then the item is not updated.

Last edited Sep 1, 2012 at 6:28 PM by c_manboy, version 17

Comments

No comments yet.