Package nl.topicus.onderwijs.dashboard.keys

Examples of nl.topicus.onderwijs.dashboard.keys.AbstractCodeNameKey


        .entrySet()) {
      repository.addDataSource(curSettingEntry.getKey(), Events.class,
          new EventsImpl(curSettingEntry.getKey(), this));

      if (curSettingEntry.getKey() instanceof AbstractCodeNameKey) {
        AbstractCodeNameKey colorkey = ((AbstractCodeNameKey) curSettingEntry
            .getKey());
        if (colorkey.getColor() == null) {
          try {
            Map<String, ?> googleSettingsForProject = curSettingEntry
                .getValue();
            String username = googleSettingsForProject.get(
                "username").toString();
            String password = googleSettingsForProject.get(
                "password").toString();
            String calendarId = googleSettingsForProject.get(
                "calendarId").toString();

            CalendarService service = new CalendarService(
                "Dashboard");
            service.setUserCredentials(username, password);

            CalendarQuery calendarQuery = new CalendarQuery(
                new URL(
                    "https://www.google.com/calendar/feeds/default/owncalendars/full"));
            CalendarFeed calendarFeed = service.query(
                calendarQuery, CalendarFeed.class);
            for (CalendarEntry curCalendar : calendarFeed
                .getEntries()) {
              if (curCalendar.getId().endsWith(
                  calendarId.replaceAll("@", "%40"))
                  && curCalendar.getColor() != null) {
                colorkey.setColor(curCalendar.getColor()
                    .getValue());
                break;
              }
            }
View Full Code Here

TOP

Related Classes of nl.topicus.onderwijs.dashboard.keys.AbstractCodeNameKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.