Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Great Calendar Challenge: Communicate With Us (Nicely)

The Great Calendar Challenge: Communicate With Us (Nicely)

At The University of California, Merced, we found ourselves in need to communicate events with our campus in a much more efficient way. Less spam, less hassle, and in a uniformed way. We researched many calendaring systems, in all directions, to find that Bedework was our answer. In this presentation, we will discuss the challenges to meet our Communications Department?s criteria and what led us to our decision. We will also discuss the work we faced with replacing our homegrown uPortal events portlet with the integration between the Bedework Calendar and the CalendarPortlet in uPortal.
#apereo14

Benito Gonzalez

June 03, 2014
Tweet

More Decks by Benito Gonzalez

Other Decks in Technology

Transcript

  1. Benito Gonzalez Laura McCord 8 years CAS / Portal developer

    Chair of Planning Committee Director at White Whale 7 years CAS / Portal developer Member of Planning Committee IT Manager/Dev at UC Merced
  2. Areas of Interest in the codebase that are new additions

    org.jasig.portlet.calendar.newsletter org.jasig.portlet.calendar.bedework org.jasig.portlet.calendar.dao org.jasig.portlet.calendar.mvc.controller src/main/resources/newsletter.vm src/main/resources/springldap.xml src/main/resources/spring/batch/jobs/job-report.xml src/main/resources/bedeworkCategory.xml
  3. Script used to generate category feeds programmatically Filename: parseJson.groovy Description:

    This script generates a file named, bedeworkCategory.xml. bedework category json feed to obtain all of the available categories builds the feed urls along with other information needed to create a predefined Calendar feed.
  4. var catsObj = {"bwCategories": { "categories": [ { "value" :

    "Academic Calendar", "uid" : "2962ac9d-29fa2ae9-0129-ff78fc3d-00000480", "creator" : "/principals/users/agrp_calsuite-MainCampus" }, { "value" : "Academic Events", "uid" : "ff808181-1fd7389e-011f-d7389f4b-00000018", "creator" : "/principals/users/admin" }, …..
  5. <bwEventList> 2 <tag> 3 <id>2962ac9d-29fa2ae9-0129-ff78fc3d-00000480</id> 4 <title>Academic Calendar</title> 5 <feed>http://dev.merced.edu/webcache/v1.0/rssRange/20140425/20140624/list-rss/

    %28catuid%3D%272962ac9d-29fa2ae9-0129-ff78fc3d-00000480%27%29.rss</feed> 6 <display>true</display> 7 <roles> 8 <role>everyone</role> 9 </roles> 10 </tag> 11 <tag> 12 <id>ff808181-1fd7389e-011f-d7389f4b-00000018</id> 13 <title>Academic Events</title> 14 <feed>http://dev.merced.edu/webcache/v1.0/rssRange/20140425/20140624/list-rss/ %28catuid%3D%27ff808181-1fd7389e-011f-d7389f4b-00000018%27%29.rss</feed> 15 <display>false</display> 16 <roles> 17 <role>everyone</role> 18 </roles> 19 </tag> ….
  6. Newsletter Format File Filename: src/main/resources/ newsletter.vm Description: The newsletter template

    is a simple html type file that contains a loop that displays the event data
  7. <body> <div class="container"> <div class="titleBg"> <div class="ucm">UNIVERSITY OF CALIFORNIA, MERCED</div>

    </div> <div class="currents">CURRENTS</div> ! <div class="hello">Hello $newsletter.user.firstName!<br /><br /> <div>Below are some of the events happening around campus and a summary of important announcements.</div> <hr /> ! <div> <div><h2>TODAY'S EVENTS:</h2></div> <div class="date"> <div class="month">$newsletter.month</div> <div class="day">$newsletter.day</div> </div> #foreach($current in $newsletter.current) <div class="currentEventTitle"><a href="$current.link">$current.title</a></div> <div class="currentEventDesc">Brief summary of the event description here, limited to 250 characters.</div> <div class="clearfix">&nbsp;</div> #end </div> ! <hr /> ! <div> <div><h3>UPCOMING EVENTS:</h3></div> #foreach($upcoming in $newsletter.upcoming) <div class="upcomingDate">$upcoming.pubdate</div> <div class="upcomingTitle"><a href="$upcoming.link">$upcoming.title</a></div> #end </div> ! <hr /> ! <div> <div><h3>ANNOUNCEMENTS</h3></div> #foreach($ann in $newsletter.announcements) <div class="announcement">- <a href="">$ann.title</a></div> #end </div> ! <div class="footer"><a href="https://dev.merced.edu">Change your preferences</a> and what you receive from Currents.</div> </div> </body>
  8. org.jasig.portlet.calen dar.newsletter package Note: This package is for spring batch

    scheduler. Description: This package is used in conjunction with spring batch. There are a series of class files that are used: Gather ldap contact information LDAPContactDao: Uses Spring LdapTemplate to filter Ldap searches ContactAttributeMapper: Maps the selected Ldap Attributes to the User object User: The object used to store user contact information
  9. org.jasig.portlet.calen dar.newsletter package Generating the Newsletter NewsletterGenerator: This is the

    main class that gets called by the spring batch scheduler. It queries ldap for users (User object) and checks the portal database if the user exists. If the user exists in the database it will grab the user's subscriptions, gather the feeds that have been subscribed to and generate a newsletter. Else, if the user does not exist in the portal database then the user will receive default events NewsletterService: This class serves as the service layer that uses performs much of the operations to collect and parses the event feeds and sets the Event object, then it sends the batch of Event objects to the Newsletter template AnnouncementsService: Calls the AnnouncementsStore method is get announcements based on the user's role on campus plus any announcements
  10. org.jasig.portlet.calen dar.newsletter package Spring Batch Component (our scheduler) App: This

    file is your main() which makes the job-report.xml definition file available. RunScheduler: This class executes the jobLauncher bean in the job- report.xml file job-report.xml: triggers the execution of the tasklet that points to our NewsletterGenerator class. You could use the "task:scheduled-tasks" bean to set up the scheduler to run at certain intervals like cron, however, since this portlet is launched onto several servers you don't want the scheduler to launch across the servers multiple times. Instead we use cron to run our job (runJob())
  11. org.jasig.portlet.calen dar.bedework package Note: This package is triggered by portlet

    UI. Description: This package is used to collect Bedework feeds, store feeds into the portal calendar database, and to maintain any changes applied to the feeds made through the Bedework interface. BedeworkService: This class is triggered from the portlet's "edit" link. predefined categories are listed and/or updated in real-time based on the user's action to manage their subscriptions
  12. org.jasig.portlet.calen dar.dao package Note: This package handles the database transactions

    Queries Announcements AnnouncementsStore: interface AnnouncementsStoreDao: holds the sql query needed to gather all the announcements per user Updates/Deletes/Inserts Calendar items HibernateCalendarStore: I added a few additional methods when the hibernate queries wouldn't work. Uses manual hsql queries for the newsletter cron job. usual hibernate persistent methods would not work.
  13. org.jasig.portlet.calenda r.mvc.controller package Note: This package handles the portlet UI

    views *what the user sees" Edit CalendarSubscriptionsController: When a user clicks the "edit" icon on the portlet to change their preferences a call to the method viewSubscriptions() is performed. In this method, I retrieve the latest feeds available and remove any outdated feeds. Upon the user clicking on a green checkmark, the calendar_configuration table is updated triggering the displayed field to turn on/off (1/0).