Giter Site home page Giter Site logo

kgeis / grails-ic-alender Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saw303/grails-ic-alender

0.0 2.0 0.0 6.28 MB

iCalender Plugin for Grails

Home Page: http://grails.org/plugin/ic-alendar

License: Other

Groovy 85.53% Shell 1.06% Batchfile 13.41%

grails-ic-alender's Introduction

Grails iCalendar Plugin

Build Status

Introduction

class TestController {
  def index = {

    render(contentType: 'text/calendar', filename: '<optional filename>') {
      calendar {
        events {
          event(start: Date.parse('dd.MM.yyyy HH:mm', '31.10.2009 14:00'),
                   end: Date.parse('dd.MM.yyyy HH:mm', '31.10.2009 15:00'),
                   description: 'Events description',
                   summary: 'Short info1') {
            organizer(name: 'Silvio Wangler', email: '[email protected]')
          }
          event(start: Date.parse('dd.MM.yyyy HH:mm', '01.11.2009 14:00'),
                  end: Date.parse('dd.MM.yyyy HH:mm', '01.11.2009 15:00'),
                  description: 'hell yes',
                  summary: 'Short info2',
                  location: '@home',
                  classification: 'private'){
            organizer(name: 'Silvio Wangler', email: '[email protected]')
          }
        }
      }
    }
  }
}

This plugin uses the ical4j API and is therefore iCal RFC compliant. The output has been tested against the Google calendar importer, Microsoft Outlook and Mozilla Sunbird.

The plugin is at the current stage of development limited to events only. That means that you currently can only export VEVENTS.

What else can you do?

This documentation does not claim to cover all the features that are implemented in the iCalendar plugin. But there is a Unit Test Suite that covers the feature set of this plugin and therefore a very good entry point if you are looking for an overview.

Disable the plugin per controller

If you do not want to have this feature injected into every controller you can specify which controllers to be excluded in Config.groovy

grails.plugins.ical.controllers.exclude = ['excludedTest']

This Configuration parameter has to be a list of controller names!

Invite attendees

render(contentType: 'text/calendar') {
    calendar {
        events {
            event(start: new Date(), end: (new Date()).next(), summary: 'We need to talk') {
                organizer(name:"Peter O'Brien", email:'[email protected]')
                reminder(minutesBefore: 5, description: 'Your meeting starts in 5 minutes!')
                attendees {
                    attendee(email:'[email protected]', role: REQ_PARTICIPANT, partstat: NEEDS_ACTION, cutype: INDIVIDUAL, rsvp: TRUE)
                    attendee(email:'[email protected]', role: REQ_PARTICIPANT, partstat: NEEDS_ACTION, cutype: INDIVIDUAL, rsvp: FALSE)
                }
            }
        }
    }
}

Use UTC dates

Since version 0.4.0 the plugin supports UTC dates. Each event accepts an optional parameter called utc. If the parameter is missing UTC is set to false.

render(contentType: 'text/calendar') {
    calendar {
        events {
            event(
                start: new Date(), 
                end: new Date(), 
                description: 'Some large text', 
                summary: 'Project stand up meeting', 
                utc: true // optional parameter (default = false)
            )
        }
    }
}

All day events

Version 0.4.1 introduces DSL support for all day events. You can use a String by defining a date like 12.10.2014.

calendar {
    events {
        allDayEvent(date: '12.04.2013', summary: 'Text') {
            organizer(name: 'Silvio', email: '[email protected]')
            reminder(minutesBefore: 5, description: 'Alarm 123')
        }
    }
}

Currently there is a limitation that the date format has to be DD.MM.YYYY. The fix of this limitation will be address in a future release.

Another way is to simply provide a Date instance

calendar {
    events {
        allDayEvent(date: new java.util.Date(), summary: 'Text') {
            organizer(name: 'Silvio', email: '[email protected]')
            reminder(minutesBefore: 5, description: 'Alarm 123')
        }
    }
}

grails-ic-alender's People

Contributors

saw303 avatar peh avatar dpilafian avatar

Watchers

James Cloos avatar Ken Geis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.