From a53a5245e16d0a3a715988a50c85327bf226b07b Mon Sep 17 00:00:00 2001 From: Viktor Richter Date: Wed, 11 Jun 2014 16:46:52 +0200 Subject: [PATCH] Added calendar package in sandbox/rst to represent RFC 2445 (iCalendar) data. The current rst definitions contain: * Events (without Alarm) * Todos (without Alarm) * TimeZones Currently not defined types are: * Journal * Freebusy * Alarm --- proto/sandbox/rst/calendar/Attendee.proto | 161 ++++++++++++ .../sandbox/rst/calendar/CalendarComponents.proto | 46 ++++ proto/sandbox/rst/calendar/DateTime.proto | 52 ++++ proto/sandbox/rst/calendar/Duration.proto | 37 +++ proto/sandbox/rst/calendar/Event.proto | 268 ++++++++++++++++++++ proto/sandbox/rst/calendar/Observance.proto | 77 ++++++ proto/sandbox/rst/calendar/Organizer.proto | 46 ++++ proto/sandbox/rst/calendar/Recurrence.proto | 47 ++++ proto/sandbox/rst/calendar/RecurrenceId.proto | 82 ++++++ proto/sandbox/rst/calendar/RecurrenceRule.proto | 224 ++++++++++++++++ proto/sandbox/rst/calendar/Relationship.proto | 50 ++++ proto/sandbox/rst/calendar/RequestStatus.proto | 52 ++++ proto/sandbox/rst/calendar/TimeZone.proto | 57 +++++ proto/sandbox/rst/calendar/Todo.proto | 264 +++++++++++++++++++ 14 files changed, 1463 insertions(+) create mode 100644 proto/sandbox/rst/calendar/Attendee.proto create mode 100644 proto/sandbox/rst/calendar/CalendarComponents.proto create mode 100644 proto/sandbox/rst/calendar/DateTime.proto create mode 100644 proto/sandbox/rst/calendar/Duration.proto create mode 100644 proto/sandbox/rst/calendar/Event.proto create mode 100644 proto/sandbox/rst/calendar/Observance.proto create mode 100644 proto/sandbox/rst/calendar/Organizer.proto create mode 100644 proto/sandbox/rst/calendar/Recurrence.proto create mode 100644 proto/sandbox/rst/calendar/RecurrenceId.proto create mode 100644 proto/sandbox/rst/calendar/RecurrenceRule.proto create mode 100644 proto/sandbox/rst/calendar/Relationship.proto create mode 100644 proto/sandbox/rst/calendar/RequestStatus.proto create mode 100644 proto/sandbox/rst/calendar/TimeZone.proto create mode 100644 proto/sandbox/rst/calendar/Todo.proto diff --git a/proto/sandbox/rst/calendar/Attendee.proto b/proto/sandbox/rst/calendar/Attendee.proto new file mode 100644 index 0000000..e6bce3b --- /dev/null +++ b/proto/sandbox/rst/calendar/Attendee.proto @@ -0,0 +1,161 @@ +package rst.calendar; + +option java_outer_classname = "AttendeeType"; + +/** + * A description of an Attendee of a calendar component. + * + * For a html documentation of the RFC 2445 iCalendar specification visit + * http://www.kanzaki.com/docs/ical/ + * + * @author Viktor Richter + */ +message Attendee { + + /** + * Used to specify a calendar user type. + */ + enum Usertype { + + /** + * An individual. + */ + INDIVIDUAL = 1; + + /** + * A group of individuals. + */ + GROUP = 2; + + /** + * An physical resource. + */ + RESOURCE = 3; + + /** + * A room. + */ + ROOM = 4; + } + + /** + * Used to specify the participation role of an attendee. + */ + enum Role { + + /** + * Chair of the calendar entity. + */ + CHAIR = 1; + + /** + * Someone whose participation is required. + */ + REQ_PARTICIPANT = 2; + + /** + * Someone whose participation is optional. + */ + OPT_PARTICIPANT = 3; + + /** + * Someone whose participation is for information purposes only. + */ + NON_PARTICIPANT = 4; + } + + /** + * Used to specify the participation status of an attendee. + */ + enum Status { + + /** + * The attendee has yet to react. + */ + NEEDS_ACTION = 1; + + /** + * The attendee has accepted the participation. + */ + ACCEPTED = 2; + + /** + * The attendee has declined the participation. + */ + DECLINED = 3; + } + + /** + * Specifies the attendees calendar user address as URI. + * This can for example be a MAILTO + * corresponds to CAL-ADDRESS + */ + required string address = 1; + + /** + * Specifies the CalendarUserTYPE of the attendee. + * corresponds to CUTYPE + */ + optional Usertype cutype = 6 [default = INDIVIDUAL]; + + /** + * Specifies the groups the attendee belongs to via a comma separated list of double quoted URIs. + * corresponds to MEMBER + */ + optional string member = 7; + + /** + * Specifies the participation role of the attendee. + * corresponds to ROLE + */ + optional Role role = 8 [default = REQ_PARTICIPANT]; + + /** + * Specifies the participation status of the attendee. + * corresponds to PARTSTAT + */ + optional Status part_status = 9 [default = NEEDS_ACTION]; + + /** + * Specifies whether the favor of a reply is requested. + * corresponds to RSVP + */ + optional bool reply_requested = 10 [default = false]; + + /** + * An URI specifying a user to whom this participation was delegated. + * corresponds to DELEGATED-TO + */ + optional string delegated_to = 11; + + /** + * An URI specifying a user from which this participation was delegated. + * corresponds to DELEGATED-FROM + */ + optional string delegated_from = 12; + + /** + * Specifies another user that is acting on behalf of the attendee + * corresponds to SENT-BY + */ + optional string sentby = 4; + + /** + * Specifies the common or display name of the attendee. + * corresponds to CN + */ + optional string common_name = 2; + + /** + * Specifies a reference to the directory associated with the attendee. + * corresponds to DIR + */ + optional string directory = 3; + + /** + * Specifies the language. Connected to display_name. + * corresponds to LANGUAGE + */ + optional string language = 5; + +} diff --git a/proto/sandbox/rst/calendar/CalendarComponents.proto b/proto/sandbox/rst/calendar/CalendarComponents.proto new file mode 100644 index 0000000..729f521 --- /dev/null +++ b/proto/sandbox/rst/calendar/CalendarComponents.proto @@ -0,0 +1,46 @@ +package rst.calendar; + +import "rst/calendar/TimeZone.proto"; +import "rst/calendar/Event.proto"; +import "rst/calendar/Todo.proto"; + +option java_outer_classname = "CalendarComponentsType"; + +/** + * A container message for multiple calendar components. + * + * @author Viktor Richter + */ +message CalendarComponents { + + /** + * A set of TimeZones + */ + repeated calendar.TimeZone timezones = 1; + + /** + * A set of Events + */ + repeated calendar.Event events = 2; + + /** + * A set of Todos + */ + repeated calendar.Todo todos = 3; + + /** + * A set of Journals (to be implemented) + */ + //optional calendar.Journal journals = 4; + + /** + * A set of Freebusy time informations/requests (to be implemented) + */ + //optional calendar.Freebusy freebusies = 5; + + /** + * A set of Alarms (to be implemented) + */ + //optional calendar.Alarm alarms = 6; + +} diff --git a/proto/sandbox/rst/calendar/DateTime.proto b/proto/sandbox/rst/calendar/DateTime.proto new file mode 100644 index 0000000..11a7b36 --- /dev/null +++ b/proto/sandbox/rst/calendar/DateTime.proto @@ -0,0 +1,52 @@ +package rst.calendar; + +option java_outer_classname = "DateTimeType"; + +/** + * A description of date and time. + * + * @author Viktor Richter + */ +message DateTime { + + /** + * The year + */ + enum Type { + + /** + * Specifies that this time is meant to be in absolute Coordinated Universal Time + */ + UTC = 1; + + /** + * Used to specify time which is not bound to any timezone. + * example: dinner may be always at 6pm regardless of the current timezone. + */ + FLOATING = 2; + + /** + * Specifies that this time is bound to a specific time zone. + * This requires the timezone_id field to be set. + */ + LOCAL = 3; + + } + + /** + * Specifies whether this time is floating, utc or local. + */ + optional Type type = 1 [default = UTC]; + + /** + * Specifies the timezone to which this time is bound. + * MUST be specified when type is LOCAL. Has no meaning in the other cases. + */ + optional string timezone_id = 2 [default = "UTC"]; + + /** + * The time since epoch (01.01.1970 at 00:00 UTC) in milliseconds. + */ + optional uint64 time = 3 [default = 0]; + +} diff --git a/proto/sandbox/rst/calendar/Duration.proto b/proto/sandbox/rst/calendar/Duration.proto new file mode 100644 index 0000000..9363f8b --- /dev/null +++ b/proto/sandbox/rst/calendar/Duration.proto @@ -0,0 +1,37 @@ +package rst.calendar; + +option java_outer_classname = "DurationType"; + +/** + * A description of duration following ISO 8601. + * + * @author Viktor Richter + */ +message Duration { + + /** + * The amount of weeks in this duration. + */ + optional uint32 weeks = 3 [default = 0]; + + /** + * The amount of days in this duration. + */ + optional uint32 days = 4 [default = 0]; + + /** + * The amount of hours in this duration. + */ + optional uint32 hours = 5 [default = 0]; + + /** + * The amount of minutes in this duration. + */ + optional uint32 minutes = 6 [default = 0]; + + /** + * The amount of seconds in this duration. + */ + optional uint32 seconds = 7 [default = 0]; + +} diff --git a/proto/sandbox/rst/calendar/Event.proto b/proto/sandbox/rst/calendar/Event.proto new file mode 100644 index 0000000..330c222 --- /dev/null +++ b/proto/sandbox/rst/calendar/Event.proto @@ -0,0 +1,268 @@ +package rst.calendar; + +import "rst/calendar/TimeZone.proto"; +import "rst/calendar/DateTime.proto"; +import "rst/calendar/RecurrenceId.proto"; +import "rst/calendar/Duration.proto"; +import "rst/calendar/Attendee.proto"; +import "rst/calendar/Organizer.proto"; +import "rst/calendar/Recurrence.proto"; +import "rst/calendar/RequestStatus.proto"; +import "rst/calendar/Relationship.proto"; + +option java_outer_classname = "EventType"; + +/** + * A description of an calendar event following the icalendar definitions. + * + * For a html documentation of the RFC 2445 iCalendar specification visit + * http://www.kanzaki.com/docs/ical/ + * + * @author Viktor Richter + */ +message Event { + + /** + * This is used to restrict viewability of of the event + */ + enum Viewability { + + /** + * The event entry can be seen by public. + */ + PUBLIC = 1; + + /** + * The event entry is private. + */ + PRIVATE = 2; + + /** + * The event entry can be is confidential. + */ + CONFIDENTIAL = 3; + } + + /** + * The overall status of an event + */ + enum Status { + + /** + * Used for tentative events + */ + TENTATIVE = 1; + + /** + * Used for confirmed events + */ + CONFIRMED = 2; + + /** + * Used for cancelled events + */ + CANCELLED = 3; + } + + /** + * The transparency of an event + */ + enum Transparency { + + /** + * Used for events which do not consume time in the calendar. + */ + TRANSPARENT = 1; + + /** + * Used for events which actually consume time in the calendar. + */ + OPAQUE = 2; + } + + /** + * Specifies the privacy classification of this event. + * corresponds to CLASS + */ + optional Viewability viewability = 1 [default = PUBLIC]; + + /** + * Specifies when the entry was created. + * more precisely: tells when this calendar data was first created in the calendar store + * corresponds to CREATED and must be in UTC-time + */ + //@constraint(value.type == DateTime.Type.UTC) + optional calendar.DateTime created_utc = 2; + + /** + * A more complete description of the event. + * corresponds to DESCRIPTION + */ + optional string description = 3; + + /** + * Specifies when the event begins + * corresponds to DTSTART + */ + optional calendar.DateTime dtstart = 4; + + /** + * Specifies the global position of the associated activity. + * corresponds to the latitude part of GEO + */ + optional double geo_latitude = 5 [default = 0.]; + + /** + * Specifies the global position of the associated activity. + * corresponds to the longitude part of GEO + */ + optional double geo_longitude = 31 [default = 0.]; + + /** + * Specifies when the entry was modified the last time. + * more precisely: tells when this calendar data was last modified in the calendar store + * corresponds to LAST-MODIFIED and must be in UTC-time + */ + //@constraint(value.type == DateTime.Type.UTC) + optional calendar.DateTime last_mod = 6; + + /** + * Specifies where the event will take place. + * corresponds to LOCATION + */ + optional string location = 7; + + /** + * Defines the organizer for the event. + * corresponds to ORGANIZER + */ + optional calendar.Organizer organizer = 8; + + /** + * The priority of the event + * corresponds to PRIORITY + * 0 means not defined, 1 ist highest, 9 is lowest priority. + */ + //@constraint(0 <= value <= 9) + optional uint32 priority = 9 [default = 0]; + + /** + * Specifies when the entry was created. + * more precise: when the iCalendar object representation of the + * calendar service information was created or last modified + * corresponds to DTSTAMP + */ + optional calendar.DateTime dtstamp = 10; + + /** + * This is incremented every time the event is changed significantly. + * corresponds to SEQUENCE + */ + optional uint32 seq = 11 [default = 0]; + + + /** + * The overall status of the event. + * corresponds to STATUS + */ + optional Status status = 12 [default = CONFIRMED]; + + /** + * A short summary or the subject of the event. + * corresponds to SUMMARY + */ + optional string summary = 13; + + /** + * Specifies whether this event is transparent to busy-time searches or not. + * corresponds to TRANSP + */ + optional Transparency transp = 14 [default = OPAQUE]; + + /** + * The globally unique id of the event + * corresponds to UID + */ + optional string uid = 15; + + /** + * The Uniform Resource Locator associated with ehis event. + * corresponds to URL + */ + optional string url = 16; + + /** + * Combined with uid and sequence, this can be used to reference a specific event in a recurrence set. + * corresponds to RECURRENCE-ID + */ + optional calendar.RecurrenceId recurid = 17; + + /** + * Specifies when the event ends + * either dtend or duration can be specified but not both at the same time. + * corresponds to DTEND + */ + optional calendar.DateTime dtend = 18; + + /** + * Specifies the duration of the event. + * either dtend or duration can be specified but not both at the same time. + * corresponds to DURATION + */ + optional calendar.Duration duration = 19; + + /** + * This provides a means to attach a document via URI or binary attachment as string. + * corresponds to ATTACH + */ + repeated string attach = 20; + + /** + * Specifies attendees to this event. + * corresponds to ATTENDEE + */ + repeated calendar.Attendee attendee = 21; + + /** + * A list of categories, this event is associated with. + * corresponds to CATEGORIES + */ + repeated string categories = 22; + + /** + * Provides a comment to this event. + * corresponds to COMMENT + */ + repeated string comment = 23; + + /** + * Contact information or reference to contact information. + * corresponds to CONTACT + */ + repeated string contact = 24; + + /** + * Specifies a set of dates when the Event gets occures + * corresponds to RDATE, RRULE, EXDATE & EXRULE + */ + optional calendar.Recurrence recurrence = 25; + + /** + * Holds the status code of a sceduling request. + * corresponds to REQUEST-STATUS + */ + repeated calendar.RequestStatus rstatus = 26; + + /** + * Represents relationships to other calendar components. + * corresponds to RELATED-TO + */ + repeated calendar.Relationship related = 27; + + /** + * Specifies the equipment or resources needed for this event. + * corresponds to RESOURCES + */ + repeated string resources = 28; + +} diff --git a/proto/sandbox/rst/calendar/Observance.proto b/proto/sandbox/rst/calendar/Observance.proto new file mode 100644 index 0000000..eb4fc3b --- /dev/null +++ b/proto/sandbox/rst/calendar/Observance.proto @@ -0,0 +1,77 @@ +package rst.calendar; + +import "rst/calendar/DateTime.proto"; +import "rst/calendar/Recurrence.proto"; + +option java_outer_classname = "ObservanceType"; + +/** + * A description of a shift in a timezone following the icalendar definitions. + * Observances are used to describe standard-daylight changes for a timezone. + * + * For a html documentation of the RFC 2445 iCalendar specification visit + * http://www.kanzaki.com/docs/ical/ + * corresponds to tzprop + * + * @author Viktor Richter + */ +message Observance { + + /** + * Tells whether the observance describes a daylight or standard time + */ + enum ShiftType { + + /** + * An observance setting the timezone to standard (winter) time + */ + STANDARD = 1; + + /** + * An observance setting the timezone to daylight (summer) time + */ + DAYLIGHT = 2; + } + + /** + * The type of this observance. + * STANDARD for winter + * DAYLIGHT for summer + */ + required ShiftType type = 3 [default = STANDARD]; + + /** + * Specifies when the Observance begins + * corresponds to DTSTART and shoud be in UTC + * + * To get all occurences of the observance create a set of dates + * from recurrence_dates and recurrence_rules between start_utc and end_utc + * and substract the set of dates produced by exclude_dates and exclude rules. + */ + required calendar.DateTime start_utc = 4; + + /** + * Specifies the name of the observance + * corresponds to TZNAME + */ + optional string name = 6; + + /** + * Specifies a set of dates when the observance gets active + * corresponds to RDATE, RRULE. (EXDATE & EXRULE should be ignored.) + */ + optional calendar.Recurrence recurrence = 7; + + /** + * Specifies the time offset in use before the observance is active in milliseconds + * corresponds to TZOFFSETFROM + */ + required sint64 offset_from = 8 [default = 0]; + + /** + * Specifies the time offset in use while observance is active in milliseconds + * corresponds to TZOFFSETTO + */ + required sint64 offset_to = 9 [default = 0]; + +} diff --git a/proto/sandbox/rst/calendar/Organizer.proto b/proto/sandbox/rst/calendar/Organizer.proto new file mode 100644 index 0000000..3c7cff7 --- /dev/null +++ b/proto/sandbox/rst/calendar/Organizer.proto @@ -0,0 +1,46 @@ +package rst.calendar; + +option java_outer_classname = "OrganizerType"; + +/** + * A description of a organizer of a calendar component. + * + * For a html documentation of the RFC 2445 iCalendar specification visit + * http://www.kanzaki.com/docs/ical/ + * + * @author Viktor Richter + */ +message Organizer { + + /** + * Specifies the organizers calendar user address as URI. + * This can for example be a MAILTO + * corresponds to CAL-ADDRESS + */ + required string address = 1; + + /** + * Specifies the common or display name of the organizer. + * corresponds to CN + */ + optional string common_name = 2; + + /** + * Specifies a reference to the directory associated with the organizer. + * corresponds to DIR + */ + optional string directory = 3; + + /** + * Specifies another user that is acting on behalf of the organizer + * corresponds to SENT-BY + */ + optional string sentby = 4; + + /** + * Specifies the language. Connected to display_name. + * corresponds to LANGUAGE + */ + optional string language = 5; + +} diff --git a/proto/sandbox/rst/calendar/Recurrence.proto b/proto/sandbox/rst/calendar/Recurrence.proto new file mode 100644 index 0000000..27cac6c --- /dev/null +++ b/proto/sandbox/rst/calendar/Recurrence.proto @@ -0,0 +1,47 @@ +package rst.calendar; + +import "rst/calendar/DateTime.proto"; +import "rst/calendar/RecurrenceRule.proto"; + +option java_outer_classname = "RecurrenceType"; + +/** + * A description of a recurrence following the icalendar definitions. + * can be used to generate a set of dates. + * + * The final set of dates is created by combining all dates from recurrence_dates + * and recurrence_rules and removing all dates generated by exclude_dates and + * exclude_rules. + * + * For a html documentation of the RFC 2445 iCalendar specification visit + * http://www.kanzaki.com/docs/ical/ + * + * @author Viktor Richter + */ +message Recurrence { + + /** + * Specifies a set of specific dates to include + * corresponds to RDATE + */ + repeated calendar.DateTime recurrence_dates = 1; + + /** + * Specifies a set of rules that generate dates to include + * corresponds to RRULE + */ + repeated calendar.RecurrenceRule recurrence_rules = 2; + + /** + * Specifies a set of dates to exclude + * corresponds to EXDATE + */ + repeated calendar.DateTime exclude_dates = 3; + + /** + * Specifies a set of rules that generate dates to exclude + * corresponds to EXRULE + */ + repeated calendar.RecurrenceRule exclude_rules = 4; + +} diff --git a/proto/sandbox/rst/calendar/RecurrenceId.proto b/proto/sandbox/rst/calendar/RecurrenceId.proto new file mode 100644 index 0000000..1772873 --- /dev/null +++ b/proto/sandbox/rst/calendar/RecurrenceId.proto @@ -0,0 +1,82 @@ +package rst.calendar; + +import "rst/calendar/DateTime.proto"; + +option java_outer_classname = "RecurrenceIdType"; + +/** + * The recurrence id can be used to reference a single component out of a + * recurring component set. + * + * While the UID of a component references its whole recurrence set the + * combination of the UID with a RecurrenceId can be used to point to a + * specific instance whithin a set. + * + * For a html documentation of the RFC 2445 iCalendar specification visit + * http://www.kanzaki.com/docs/ical/ + * this corresponds to RECURRENCE-ID + * + * @author Viktor Richter + */ +message RecurrenceId { + + /** + * Specifies whether this RecurrenceId uses a date or a date-time + */ + enum Type { + + /** + * Specifies a date and time. + */ + DATE_TIME = 1; + + /** + * Specifies a date without time. + */ + DATE = 2; + } + + + /** + * Specifies whether this RecurrenceId references a single instance + * a set with all prior/future instances + * corresponds to RANGE + */ + enum Range { + + /** + * Specifies a single instance. + */ + SINGLE = 1; + + /** + * Specifies an instance and all instances after it. + */ + THISANDFUTURE = 2; + + /** + * Specifies a instance and all instances prior to it. + */ + THISANDPRIOR = 3; + } + + /** + * Specifies whether the id should be interpreted as a date with time or to ignore time. + * corresponds to ridparam.VALUE + */ + optional Type type = 1 [default = DATE_TIME]; + + /** + * Specifies whether a single date or set is referenced. + * corresponds to RANGE + */ + optional Range range = 2 [default = SINGLE]; + + /** + * Specifies ReferenceId value as a calendar.DateTime this should match the date value + * of an instance in the recurrence set. + * corresponds to ridval + */ + optional calendar.DateTime rid = 3; + +} diff --git a/proto/sandbox/rst/calendar/RecurrenceRule.proto b/proto/sandbox/rst/calendar/RecurrenceRule.proto new file mode 100644 index 0000000..6416186 --- /dev/null +++ b/proto/sandbox/rst/calendar/RecurrenceRule.proto @@ -0,0 +1,224 @@ +package rst.calendar; + +import "rst/calendar/DateTime.proto"; + +option java_outer_classname = "RecurrenceRuleType"; + +/** + * Specifies a rule for dates to reaccur. + * + * For a html documentation of the RFC 2445 iCalendar specification visit + * http://www.kanzaki.com/docs/ical/ + * + * @author Viktor Richter + */ +message RecurrenceRule { + + /** + * Tells the frequence of the occurance + */ + enum Frequence { + + /** + * Every second + */ + SECONDLY = 1; + + /** + * Every minute + */ + MINUTELY = 2; + + /** + * Every hour + */ + HOURLY = 3; + + /** + * Every day + */ + DAILY = 4; + + /** + * Every week + */ + WEEKLY = 5; + + /** + * Every month + */ + MONTHLY = 6; + + /** + * Every year + */ + YEARLY = 7; + + } + + /** + * Defines a day in within the week + */ + enum Weekday { + + /** + * Sunday + */ + SU = 1; + + /** + * Monday + */ + MO = 2; + + /** + * Tuesday + */ + TU = 3; + + /** + * Wednesday + */ + WE = 4; + + /** + * Thursday + */ + TH = 5; + + /** + * Friday + */ + FR = 6; + + /** + * Saturday + */ + SA = 7; + } + + /** + * The stop condition type of the reccurance set + */ + enum Type { + + /** + * Creates an exact number of occurances + */ + COUNT = 1; + + /** + * Stop condition is an end date + */ + UNTIL = 2; + } + + /** + * The stop condition type of this RecurrenceRule + */ + optional Type type = 1 [default = COUNT]; + + /** + * Specifies the end date of the recurrence. + * corresponds to UNTIL and should only be set when type is UNTIL + */ + optional DateTime until_date_utc = 2; + + /** + * Specifies the recurrence count. + * corresponds to COUNT and should only be set when type is COUNT + */ + optional uint32 count = 3 [default = 0]; + + /** + * Specifies the frequence of the reccurance. + * corresponds to FREQ + */ + required Frequence frequence = 4 [default = YEARLY]; + + /** + * Tells how often the rule repeats. + * example: interval = n and frequence = weekly means every n'th week + * corresponds to INTERVAL + */ + optional uint32 interval = 5 [default = 1]; + + /** + * A list of occurance seconds. + * corresponds to BYSECOND + */ + //@constraint(0 <= value < 60) + repeated uint32 by_second = 6; + + /** + * A list of occurance minutes. + * corresponds to BYMINUTE + */ + //@constraint(0 <= value < 60) + repeated uint32 by_minute = 7; + + /** + * A list of occurance hours. + * corresponds to BYHOUR + */ + //@constraint(0 <= value < 24) + repeated uint32 by_hour = 8; + + /** + * A list of occurance weekdays. + * corresponds to BYDAY + */ + repeated Weekday by_day = 9; + + /** + * A list of occurance weekdays. + * corresponds to BYDAY with preceding integer + * example: frequence = MONTHLY, by_day = MO and by_day_n = -1 means the last monday of the month + */ + repeated sint32 by_day_n = 10; + + /** + * A list of occurance days of the month. + * corresponds to BYMONTHDAY + * negative integers count from the end of the month + */ + //@constraint(-31 <= value <= 31) + repeated sint32 by_month_day = 11; + + /** + * A list of occurance days of the year. + * corresponds to BYYEARDAY + * negative integers count from the end of the year + */ + //@constraint(-366 <= value <= 366) + repeated sint32 by_year_day = 12; + + /** + * A list of occurance weeks of the year. + * corresponds to BYWEEKNO + * negative integers count backwards + */ + //@constraint(-53 <= value <= 53) + repeated sint32 by_week_number = 13; + + /** + * A list of occurance months. + * corresponds to BYMONTH + */ + //@constraint(1 <= value <= 31) + repeated uint32 by_month = 14; + + /** + * Further filters the set by specifying which occurance to use. + * corresponds to BYSETPOS + * example: frequence = MONTHLY, by_day=MO,TU,WE,TH,FR and by_set_pos = -1 specifies the last workday of the month + */ + repeated sint32 by_set_pos = 15; + + /** + * Specifies which day is the first day of the week + * corresponds to WKST + */ + optional Weekday week_start = 16 [default = MO]; + +} diff --git a/proto/sandbox/rst/calendar/Relationship.proto b/proto/sandbox/rst/calendar/Relationship.proto new file mode 100644 index 0000000..c363b88 --- /dev/null +++ b/proto/sandbox/rst/calendar/Relationship.proto @@ -0,0 +1,50 @@ +package rst.calendar; + +option java_outer_classname = "RelationshipType"; + +/** + * This is used to specify relationships between calendar components. + * corresponds to RELATED-TO + * + * For a html documentation of the RFC 2445 iCalendar specification visit + * http://www.kanzaki.com/docs/ical/ + * + * @author Viktor Richter + */ +message Relationship { + + /** + * Specifies the type of the relationship. + */ + enum Type { + + /** + * The component is a subordinate of the referenced component. + */ + PARENT = 1; + + /** + * The component is a superior of the referenced component. + */ + CHILD = 2; + + /** + * The component is a peer of the referenced component. + */ + SIBLING = 3; + } + + /** + * The type of the referenced component. + * corresponds to RELTYPE + */ + optional Type reltype = 1 [default = PARENT]; + + /** + * The unique identifier of the related component. This should + * typically be its uid. + * corresponds to the text part of RELATED-TO + */ + required string uid = 2; + +} diff --git a/proto/sandbox/rst/calendar/RequestStatus.proto b/proto/sandbox/rst/calendar/RequestStatus.proto new file mode 100644 index 0000000..6c6d902 --- /dev/null +++ b/proto/sandbox/rst/calendar/RequestStatus.proto @@ -0,0 +1,52 @@ +package rst.calendar; + +option java_outer_classname = "RequestStatusType"; + +/** + * A description of a status code used in scheduling requests. + * + * For a html documentation of the RFC 2445 iCalendar specification visit + * http://www.kanzaki.com/docs/ical/ + * + * @author Viktor Richter + */ +message RequestStatus { + + /** + * Specifies the language of the status code. + * corresponds to LANGUAGE + */ + optional string language = 1; + + /** + * A hierarchical numeric status code as string. + * 3-tuple of integers separated by a period character. + * example: "3.1.2" + * + * The level of the integer corresponds to the level of status code + * granularity (least granularity to highest from left to right). + * + * The return status interpretation of the leftmost integer is following: + * 1.xx preliminary success, completition is pending + * 2.xx completed successfully + * 3.xx not successful, error in the syntax or semantic of the request + * 4.xx scheduling error, an error occured whithin the calendaring service not directly related to the request- + * + * corresponds to REQUEST-STATUS.statcode + */ + required string status_code = 2; + + /** + * A status description text. + * corresponds to REQUEST-STATUS.stardesc + */ + required string status_description = 3; + + /** + * Exception data as text. Can be the offending property name and + * value or a complete property line. + * corresponds to REQUEST-STATUS.extdata + */ + required string exception_text_data = 4; + +} diff --git a/proto/sandbox/rst/calendar/TimeZone.proto b/proto/sandbox/rst/calendar/TimeZone.proto new file mode 100644 index 0000000..15bf032 --- /dev/null +++ b/proto/sandbox/rst/calendar/TimeZone.proto @@ -0,0 +1,57 @@ +package rst.calendar; + +import "rst/calendar/DateTime.proto"; +import "rst/calendar/Observance.proto"; + +option java_outer_classname = "TimeZoneType"; + +/** + * A description of a timezone following the icalendar definitions. + * + * For a html documentation of the RFC 2445 iCalendar specification visit + * http://www.kanzaki.com/docs/ical/ + * + * @author Viktor Richter + */ +//@constraint(len(.standards) + len(.daylights) > 0) +message TimeZone { + + /** + * The id of the timezone. This should be unique. + * corresponds to TZID + */ + required string tz_id = 1; + + /** + * Specifies when the timezone was modified the last time. + * more precisely: tells when this timezone data was last modified in the calendar store + * corresponds to LAST-MODIFIED and must be in UTC-time + */ + //@constraint(value.type == calendar.DateTime.Type.UTC) + optional calendar.DateTime last_mod = 2; + + /** + * Specifies a network location where an up to date version of this timezone can be retrieved. + * corresponds to TZURL + */ + optional string tz_url = 3; + + /** + * The location to which this timezone applies + * corresponds to X-LIC-LOCATION (non standard) + */ + optional string x_location = 4; + + /** + * a collection of standard-observances for this timezone + * corresponds to STANDARD + */ + repeated calendar.Observance standards = 5; + + /** + * a collection of daylight-observances for this timezone + * corresponds to DAYLIGHT + */ + repeated calendar.Observance daylights = 6; + +} diff --git a/proto/sandbox/rst/calendar/Todo.proto b/proto/sandbox/rst/calendar/Todo.proto new file mode 100644 index 0000000..3eefbc6 --- /dev/null +++ b/proto/sandbox/rst/calendar/Todo.proto @@ -0,0 +1,264 @@ +package rst.calendar; + +import "rst/calendar/TimeZone.proto"; +import "rst/calendar/DateTime.proto"; +import "rst/calendar/RecurrenceId.proto"; +import "rst/calendar/Duration.proto"; +import "rst/calendar/Attendee.proto"; +import "rst/calendar/Organizer.proto"; +import "rst/calendar/Recurrence.proto"; +import "rst/calendar/RequestStatus.proto"; +import "rst/calendar/Relationship.proto"; + +option java_outer_classname = "TodoType"; + +/** + * A description of an calendar todo following the icalendar definitions. + * + * For a html documentation of the RFC 2445 iCalendar specification visit + * http://www.kanzaki.com/docs/ical/ + * + * @author Viktor Richter + */ +message Todo { + + /** + * This is used to restrict viewability of of the todo + */ + enum Viewability { + + /** + * The todo entry can be seen by public. + */ + PUBLIC = 1; + + /** + * The todo entry is private. + */ + PRIVATE = 2; + + /** + * The todo entry can be is confidential. + */ + CONFIDENTIAL = 3; + } + + /** + * The overall status of a todo + */ + enum Status { + + /** + * Used for todos that need an action. + */ + NEEDS_ACTION = 1; + + /** + * Used for completed todos. + */ + COMPLETED = 2; + + /** + * Used for todos that are currently in process of. + */ + IN_PROCESS = 3; + + /** + * Used for cancelled todos. + */ + CANCELLED = 4; + } + + /** + * Specifies the privacy classification of this todo. + * corresponds to CLASS + */ + optional Viewability viewability = 1 [default = PUBLIC]; + + /** + * Specifies the date and time this todo was completed. + * corresponds to COMPLETED + */ + //@constraint(value.type == DateTime.Type.UTC) + optional calendar.DateTime completed_utc = 29; + + /** + * Specifies when the entry was created. + * more precisely: tells when this calendar data was first created in the calendar store + * corresponds to CREATED and must be in UTC-time + */ + //@constraint(value.type == DateTime.Type.UTC) + optional calendar.DateTime created_utc = 2; + + /** + * A more complete description of the todo. + * corresponds to DESCRIPTION + */ + optional string description = 3; + + /** + * Specifies when the entry was created. + * more precise: when the iCalendar object representation of the + * calendar service information was created or last modified + * corresponds to DTSTAMP + */ + optional calendar.DateTime dtstamp = 10; + + /** + * Specifies when the todo begins + * corresponds to DTSTART + */ + optional calendar.DateTime dtstart = 4; + + /** + * Specifies the global position of the associated activity. + * corresponds to the latitude part of GEO + */ + optional double geo_latitude = 5 [default = 0.]; + + /** + * Specifies the global position of the associated activity. + * corresponds to the longitude part of GEO + */ + optional double geo_longitude = 31 [default = 0.]; + + /** + * Specifies when the entry was modified the last time. + * more precisely: tells when this calendar data was last modified in the calendar store + * corresponds to LAST-MODIFIED and must be in UTC-time + */ + //@constraint(value.type == DateTime.Type.UTC) + optional calendar.DateTime last_mod = 6; + + /** + * Specifies where the todo will take place. + * corresponds to LOCATION + */ + optional string location = 7; + + /** + * Defines the organizer for the todo. + * corresponds to ORGANIZER + */ + optional calendar.Organizer organizer = 8; + + /** + * Specifies the completition status of the todo as positive integer (0-100) + * corresponds to PERCENT-COMPLETE + */ + //@constraint(0 <= value <= 100) + optional uint32 percent = 30 [default = 0]; + + /** + * The priority of the todo + * corresponds to PRIORITY + * 0 means not defined, 1 ist highest, 9 is lowest priority. + */ + //@constraint(0 <= value <= 9) + optional uint32 priority = 9 [default = 0]; + + /** + * Combined with uid and sequence, this can be used to reference a specific todo in a recurrence set. + * corresponds to RECURRENCE-ID + */ + optional calendar.RecurrenceId recurid = 17; + + /** + * This is incremented every time the todo is changed significantly. + * corresponds to SEQUENCE + */ + optional uint32 seq = 11 [default = 0]; + + + /** + * The overall status of the todo. + * corresponds to STATUS + */ + optional Status status = 12 [default = NEEDS_ACTION]; + + /** + * A short summary or the subject of the todo. + * corresponds to SUMMARY + */ + optional string summary = 13; + + /** + * The globally unique id of the todo + * corresponds to UID + */ + optional string uid = 15; + + /** + * The Uniform Resource Locator associated with ehis todo. + * corresponds to URL + */ + optional string url = 16; + + /** + * Specifies when the todo ends + * either dtend or duration can be specified but not both at the same time. + * corresponds to DTEND + */ + optional calendar.DateTime dtend = 18; + + /** + * Specifies the duration of the todo. + * either dtend or duration can be specified but not both at the same time. + * corresponds to DURATION + */ + optional calendar.Duration duration = 19; + + /** + * This provides a means to attach a document via URI or binary attachment as string. + * corresponds to ATTACH + */ + repeated string attach = 20; + + /** + * Specifies attendees to this todo. + * corresponds to ATTENDEE + */ + repeated calendar.Attendee attendee = 21; + + /** + * A list of categories, this todo is associated with. + * corresponds to CATEGORIES + */ + repeated string categories = 22; + + /** + * Provides a comment to this todo. + * corresponds to COMMENT + */ + repeated string comment = 23; + + /** + * Contact information or reference to contact information. + * corresponds to CONTACT + */ + repeated string contact = 24; + + /** + * Specifies a set of dates when the todo gets occures + * corresponds to RDATE, RRULE, EXDATE & EXRULE + */ + optional calendar.Recurrence recurrence = 25; + + /** + * Holds the status code of a sceduling request. + * corresponds to REQUEST-STATUS + */ + repeated calendar.RequestStatus rstatus = 26; + + /** + * Represents relationships to other calendar components. + * corresponds to RELATED-TO + */ + repeated calendar.Relationship related = 27; + + /** + * Specifies the equipment or resources needed for this todo. + * corresponds to RESOURCES + */ + repeated string resources = 28; +} -- 1.7.9.5