Have an updated version of this writeup at https://www.ashishpaliwal.com/blog/2011/07/updating-google-calendar-with-ms-project-revisited/
I am back, as promised. Please read my earlier post Processing Microsoft Project File in Java using MPXJ.
In this post we shall take an mpp and update the Google Calendar with the task details. The question is why would anyone do that?
Lets cook the story. A small team is working and the poor Project Manager share the Schedule with the team. The team is so busy coding that they forget to look at the dates, and the tasks they must be starting on. The poor Project Manager himself loose track unless he keeps MS Project Open on his desktop 🙁 A pretty common situation 🙂
Have faced this situation and decided to organize myself and this post is outcome of that. The driving force was "Out of sight, is out of mind". So my assumption was if the team has a visual of the task dates, the chances of task slippage shall reduce a lot.
In this post, have built upon the my previous post to create an MPP parsing function. Have tried to keep the code in simplest form, so that it can customized later to specific needs. Have created a sample Schedule for this activity and used it for the implementation. Here is how it looks.
The schdule is simple, some date, and tasks with dependencies. The concept shall work for any number of tasks.
Following are the steps that we need to perform:
- Parse the mpp file
- Create a Calendar Service (Lets assume that the Calendar is already there, though it is possible to programmatically create the same)
- Get All tasks from MPP, and create Calendar Entries in Google Calendar
The implementation is fairly simple. We have 3 functions:
- translateTaskToCalendarEventEntry() - Converts an Task into CalendarEventEntry, which can be added to Google Calendar
- updateCalendar() - Takes input of all the Tasks from MPP, translates into CalendarEventEntry (using function translateTaskToCalendarEventEntry) and update the Calendar
- updateGoogleCalendarWithMPP() - Parses the MPP using the util function from my previous post, and calls the API above to update the Calendar.
Google Calendar API usage is described in details on Google's pages, hence won't discuss here.
To use it for yourself, replace User Name and Password at line#70, with your User Credentials. Repace the URL at Line# 71 to point to your calendar.
After running the program, this is how my Calendar looked like
A simple way to keep track of Tasks.