001    /*
002     * The MIT License
003     * Copyright (c) 2012 Microsoft Corporation
004     *
005     * Permission is hereby granted, free of charge, to any person obtaining a copy
006     * of this software and associated documentation files (the "Software"), to deal
007     * in the Software without restriction, including without limitation the rights
008     * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
009     * copies of the Software, and to permit persons to whom the Software is
010     * furnished to do so, subject to the following conditions:
011     *
012     * The above copyright notice and this permission notice shall be included in
013     * all copies or substantial portions of the Software.
014     *
015     * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
016     * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
017     * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
018     * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
019     * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
020     * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
021     * THE SOFTWARE.
022     */
023    
024    package microsoft.exchange.webservices.data.core.service.schema;
025    
026    import microsoft.exchange.webservices.data.attribute.Schema;
027    import microsoft.exchange.webservices.data.core.XmlElementNames;
028    import microsoft.exchange.webservices.data.core.service.item.Appointment;
029    import microsoft.exchange.webservices.data.core.enumeration.service.calendar.AppointmentType;
030    import microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion;
031    import microsoft.exchange.webservices.data.core.enumeration.property.LegacyFreeBusyStatus;
032    import microsoft.exchange.webservices.data.core.enumeration.property.MeetingResponseType;
033    import microsoft.exchange.webservices.data.core.enumeration.property.PropertyDefinitionFlags;
034    import microsoft.exchange.webservices.data.property.complex.AttendeeCollection;
035    import microsoft.exchange.webservices.data.property.complex.DeletedOccurrenceInfoCollection;
036    import microsoft.exchange.webservices.data.property.complex.EmailAddress;
037    import microsoft.exchange.webservices.data.property.complex.ICreateComplexPropertyDelegate;
038    import microsoft.exchange.webservices.data.property.complex.ItemCollection;
039    import microsoft.exchange.webservices.data.property.complex.OccurrenceInfo;
040    import microsoft.exchange.webservices.data.property.complex.OccurrenceInfoCollection;
041    import microsoft.exchange.webservices.data.property.definition.BoolPropertyDefinition;
042    import microsoft.exchange.webservices.data.property.definition.ComplexPropertyDefinition;
043    import microsoft.exchange.webservices.data.property.definition.ContainedPropertyDefinition;
044    import microsoft.exchange.webservices.data.property.definition.DateTimePropertyDefinition;
045    import microsoft.exchange.webservices.data.property.definition.GenericPropertyDefinition;
046    import microsoft.exchange.webservices.data.property.definition.IntPropertyDefinition;
047    import microsoft.exchange.webservices.data.property.definition.MeetingTimeZonePropertyDefinition;
048    import microsoft.exchange.webservices.data.property.definition.PropertyDefinition;
049    import microsoft.exchange.webservices.data.property.definition.RecurrencePropertyDefinition;
050    import microsoft.exchange.webservices.data.property.definition.StartTimeZonePropertyDefinition;
051    import microsoft.exchange.webservices.data.property.definition.StringPropertyDefinition;
052    import microsoft.exchange.webservices.data.property.definition.TimeSpanPropertyDefinition;
053    import microsoft.exchange.webservices.data.property.definition.TimeZonePropertyDefinition;
054    
055    import java.util.EnumSet;
056    
057    /**
058     * Represents the schema for appointment and meeting request.
059     */
060    @Schema
061    public class AppointmentSchema extends ItemSchema {
062    
063      /**
064       * Field URIs for Appointment.
065       */
066      private static interface FieldUris {
067    
068        /**
069         * The Start.
070         */
071        String Start = "calendar:Start";
072    
073        /**
074         * The End.
075         */
076        String End = "calendar:End";
077    
078        /**
079         * The Original start.
080         */
081        String OriginalStart = "calendar:OriginalStart";
082    
083        /**
084         * The Is all day event.
085         */
086        String IsAllDayEvent = "calendar:IsAllDayEvent";
087    
088        /**
089         * The Legacy free busy status.
090         */
091        String LegacyFreeBusyStatus = "calendar:LegacyFreeBusyStatus";
092    
093        /**
094         * The Location.
095         */
096        String Location = "calendar:Location";
097    
098        /**
099         * The When.
100         */
101        String When = "calendar:When";
102    
103        /**
104         * The Is meeting.
105         */
106        String IsMeeting = "calendar:IsMeeting";
107    
108        /**
109         * The Is cancelled.
110         */
111        String IsCancelled = "calendar:IsCancelled";
112    
113        /**
114         * The Is recurring.
115         */
116        String IsRecurring = "calendar:IsRecurring";
117    
118        /**
119         * The Meeting request was sent.
120         */
121        String MeetingRequestWasSent = "calendar:MeetingRequestWasSent";
122    
123        /**
124         * The Is response requested.
125         */
126        String IsResponseRequested = "calendar:IsResponseRequested";
127    
128        /**
129         * The Calendar item type.
130         */
131        String CalendarItemType = "calendar:CalendarItemType";
132    
133        /**
134         * The My response type.
135         */
136        String MyResponseType = "calendar:MyResponseType";
137    
138        /**
139         * The Organizer.
140         */
141        String Organizer = "calendar:Organizer";
142    
143        /**
144         * The Required attendees.
145         */
146        String RequiredAttendees = "calendar:RequiredAttendees";
147    
148        /**
149         * The Optional attendees.
150         */
151        String OptionalAttendees = "calendar:OptionalAttendees";
152    
153        /**
154         * The Resources.
155         */
156        String Resources = "calendar:Resources";
157    
158        /**
159         * The Conflicting meeting count.
160         */
161        String ConflictingMeetingCount = "calendar:ConflictingMeetingCount";
162    
163        /**
164         * The Adjacent meeting count.
165         */
166        String AdjacentMeetingCount = "calendar:AdjacentMeetingCount";
167    
168        /**
169         * The Conflicting meetings.
170         */
171        String ConflictingMeetings = "calendar:ConflictingMeetings";
172    
173        /**
174         * The Adjacent meetings.
175         */
176        String AdjacentMeetings = "calendar:AdjacentMeetings";
177    
178        /**
179         * The Duration.
180         */
181        String Duration = "calendar:Duration";
182    
183        /**
184         * The Time zone.
185         */
186        String TimeZone = "calendar:TimeZone";
187    
188        /**
189         * The Appointment reply time.
190         */
191        String AppointmentReplyTime = "calendar:AppointmentReplyTime";
192    
193        /**
194         * The Appointment sequence number.
195         */
196        String AppointmentSequenceNumber = "calendar:AppointmentSequenceNumber";
197    
198        /**
199         * The Appointment state.
200         */
201        String AppointmentState = "calendar:AppointmentState";
202    
203        /**
204         * The Recurrence.
205         */
206        String Recurrence = "calendar:Recurrence";
207    
208        /**
209         * The First occurrence.
210         */
211        String FirstOccurrence = "calendar:FirstOccurrence";
212    
213        /**
214         * The Last occurrence.
215         */
216        String LastOccurrence = "calendar:LastOccurrence";
217    
218        /**
219         * The Modified occurrences.
220         */
221        String ModifiedOccurrences = "calendar:ModifiedOccurrences";
222    
223        /**
224         * The Deleted occurrences.
225         */
226        String DeletedOccurrences = "calendar:DeletedOccurrences";
227    
228        /**
229         * The Meeting time zone.
230         */
231        String MeetingTimeZone = "calendar:MeetingTimeZone";
232    
233        /**
234         * The Start time zone.
235         */
236        String StartTimeZone = "calendar:StartTimeZone";
237    
238        /**
239         * The End time zone.
240         */
241        String EndTimeZone = "calendar:EndTimeZone";
242    
243        /**
244         * The Conference type.
245         */
246        String ConferenceType = "calendar:ConferenceType";
247    
248        /**
249         * The Allow new time proposal.
250         */
251        String AllowNewTimeProposal = "calendar:AllowNewTimeProposal";
252    
253        /**
254         * The Is online meeting.
255         */
256        String IsOnlineMeeting = "calendar:IsOnlineMeeting";
257    
258        /**
259         * The Meeting workspace url.
260         */
261        String MeetingWorkspaceUrl = "calendar:MeetingWorkspaceUrl";
262    
263        /**
264         * The Net show url.
265         */
266        String NetShowUrl = "calendar:NetShowUrl";
267    
268        /**
269         * The Uid.
270         */
271        String Uid = "calendar:UID";
272    
273        /**
274         * The Recurrence id.
275         */
276        String RecurrenceId = "calendar:RecurrenceId";
277    
278        /**
279         * The Date time stamp.
280         */
281        String DateTimeStamp = "calendar:DateTimeStamp";
282      }
283    
284      // Defines the StartTimeZone property.
285      /**
286       * The Constant StartTimeZone.
287       */
288      public static final PropertyDefinition StartTimeZone =
289          new StartTimeZonePropertyDefinition(
290              XmlElementNames.StartTimeZone, FieldUris.StartTimeZone, EnumSet.of(
291              PropertyDefinitionFlags.CanSet,
292              PropertyDefinitionFlags.CanUpdate,
293              PropertyDefinitionFlags.CanFind),
294              ExchangeVersion.Exchange2007_SP1);
295    
296      // Defines the EndTimeZone property.
297      /**
298       * The Constant EndTimeZone.
299       */
300      public static final PropertyDefinition EndTimeZone =
301          new TimeZonePropertyDefinition(
302              XmlElementNames.EndTimeZone, FieldUris.EndTimeZone, EnumSet.of(
303              PropertyDefinitionFlags.CanSet,
304              PropertyDefinitionFlags.CanUpdate,
305              PropertyDefinitionFlags.CanFind),
306              ExchangeVersion.Exchange2010);
307    
308      // Defines the Start property.
309      /**
310       * The Constant Start.
311       */
312      public static final PropertyDefinition Start =
313          new DateTimePropertyDefinition(
314              XmlElementNames.Start, FieldUris.Start, EnumSet.of(
315              PropertyDefinitionFlags.CanSet,
316              PropertyDefinitionFlags.CanUpdate,
317              PropertyDefinitionFlags.CanFind),
318              ExchangeVersion.Exchange2007_SP1);
319    
320      // Defines the End property.
321      /**
322       * The Constant End.
323       */
324      public static final PropertyDefinition End = new DateTimePropertyDefinition(
325          XmlElementNames.End, FieldUris.End, EnumSet.of(
326          PropertyDefinitionFlags.CanSet,
327          PropertyDefinitionFlags.CanUpdate,
328          PropertyDefinitionFlags.CanFind),
329          ExchangeVersion.Exchange2007_SP1);
330    
331      // Defines the OriginalStart property.
332      /**
333       * The Constant OriginalStart.
334       */
335      public static final PropertyDefinition OriginalStart =
336          new DateTimePropertyDefinition(
337              XmlElementNames.OriginalStart, FieldUris.OriginalStart,
338              ExchangeVersion.Exchange2007_SP1);
339    
340      // Defines the IsAllDayEvent property.
341      /**
342       * The Constant IsAllDayEvent.
343       */
344      public static final PropertyDefinition IsAllDayEvent =
345          new BoolPropertyDefinition(
346              XmlElementNames.IsAllDayEvent, FieldUris.IsAllDayEvent, EnumSet.of(
347              PropertyDefinitionFlags.CanSet,
348              PropertyDefinitionFlags.CanUpdate,
349              PropertyDefinitionFlags.CanFind),
350              ExchangeVersion.Exchange2007_SP1);
351    
352      // Defines the LegacyFreeBusyStatus property.
353      /**
354       * The Constant LegacyFreeBusyStatus.
355       */
356      public static final PropertyDefinition LegacyFreeBusyStatus =
357          new GenericPropertyDefinition<LegacyFreeBusyStatus>(
358              LegacyFreeBusyStatus.class,
359              XmlElementNames.LegacyFreeBusyStatus,
360              FieldUris.LegacyFreeBusyStatus, EnumSet.of(
361              PropertyDefinitionFlags.CanSet,
362              PropertyDefinitionFlags.CanUpdate,
363              PropertyDefinitionFlags.CanFind),
364              ExchangeVersion.Exchange2007_SP1);
365    
366      // Defines the Location property.
367      /**
368       * The Constant Location.
369       */
370      public static final PropertyDefinition Location =
371          new StringPropertyDefinition(
372              XmlElementNames.Location, FieldUris.Location, EnumSet.of(
373              PropertyDefinitionFlags.CanSet,
374              PropertyDefinitionFlags.CanUpdate,
375              PropertyDefinitionFlags.CanDelete,
376              PropertyDefinitionFlags.CanFind),
377              ExchangeVersion.Exchange2007_SP1);
378    
379      // Defines the When property.
380      /**
381       * The Constant When.
382       */
383      public static final PropertyDefinition When = new StringPropertyDefinition(
384          XmlElementNames.When, FieldUris.When, EnumSet.of(
385          PropertyDefinitionFlags.CanSet,
386          PropertyDefinitionFlags.CanUpdate,
387          PropertyDefinitionFlags.CanDelete,
388          PropertyDefinitionFlags.CanFind),
389          ExchangeVersion.Exchange2007_SP1);
390    
391      // Defines the IsMeeting property.
392      /**
393       * The Constant IsMeeting.
394       */
395      public static final PropertyDefinition IsMeeting =
396          new BoolPropertyDefinition(
397              XmlElementNames.IsMeeting, FieldUris.IsMeeting, EnumSet
398              .of(PropertyDefinitionFlags.CanFind),
399              ExchangeVersion.Exchange2007_SP1);
400    
401      // Defines the IsCancelled property.
402      /**
403       * The Constant IsCancelled.
404       */
405      public static final PropertyDefinition IsCancelled =
406          new BoolPropertyDefinition(
407              XmlElementNames.IsCancelled, FieldUris.IsCancelled, EnumSet
408              .of(PropertyDefinitionFlags.CanFind),
409              ExchangeVersion.Exchange2007_SP1);
410    
411      // Defines the IsRecurring property.
412      /**
413       * The Constant IsRecurring.
414       */
415      public static final PropertyDefinition IsRecurring =
416          new BoolPropertyDefinition(
417              XmlElementNames.IsRecurring, FieldUris.IsRecurring, EnumSet
418              .of(PropertyDefinitionFlags.CanFind),
419              ExchangeVersion.Exchange2007_SP1);
420    
421      // Defines the MeetingRequestWasSent property.
422      /**
423       * The Constant MeetingRequestWasSent.
424       */
425      public static final PropertyDefinition MeetingRequestWasSent =
426          new BoolPropertyDefinition(
427              XmlElementNames.MeetingRequestWasSent,
428              FieldUris.MeetingRequestWasSent, EnumSet
429              .of(PropertyDefinitionFlags.CanFind),
430              ExchangeVersion.Exchange2007_SP1);
431    
432      // Defines the IsResponseRequested property.
433      /**
434       * The Constant IsResponseRequested.
435       */
436      public static final PropertyDefinition IsResponseRequested =
437          new BoolPropertyDefinition(
438              XmlElementNames.IsResponseRequested, FieldUris.IsResponseRequested,
439              EnumSet.of(PropertyDefinitionFlags.CanSet,
440                  PropertyDefinitionFlags.CanUpdate,
441                  PropertyDefinitionFlags.CanFind),
442              ExchangeVersion.Exchange2007_SP1);
443    
444      // Defines the AppointmentType property.
445      /**
446       * The Constant AppointmentType.
447       */
448      public static final PropertyDefinition AppointmentType =
449          new GenericPropertyDefinition<AppointmentType>(
450              AppointmentType.class,
451              XmlElementNames.CalendarItemType, FieldUris.CalendarItemType,
452              EnumSet.of(PropertyDefinitionFlags.CanFind),
453              ExchangeVersion.Exchange2007_SP1);
454    
455      // Defines the MyResponseType property.
456      /**
457       * The Constant MyResponseType.
458       */
459      public static final PropertyDefinition MyResponseType =
460          new GenericPropertyDefinition<MeetingResponseType>(
461              MeetingResponseType.class,
462              XmlElementNames.MyResponseType, FieldUris.MyResponseType, EnumSet
463              .of(PropertyDefinitionFlags.CanSet,
464                  PropertyDefinitionFlags.CanUpdate,
465                  PropertyDefinitionFlags.CanFind),
466              ExchangeVersion.Exchange2007_SP1);
467    
468      // Defines the Organizer property.
469      /**
470       * The Constant Organizer.
471       */
472      public static final PropertyDefinition Organizer =
473          new ContainedPropertyDefinition<EmailAddress>(
474              EmailAddress.class,
475              XmlElementNames.Organizer, FieldUris.Organizer,
476              XmlElementNames.Mailbox, EnumSet
477              .of(PropertyDefinitionFlags.CanFind),
478              ExchangeVersion.Exchange2007_SP1,
479              new ICreateComplexPropertyDelegate<EmailAddress>() {
480                public EmailAddress createComplexProperty() {
481                  return new EmailAddress();
482                }
483              });
484    
485      // Defines the RequiredAttendees property.
486    
487      /**
488       * The Constant RequiredAttendees.
489       */
490      public static final PropertyDefinition RequiredAttendees =
491          new ComplexPropertyDefinition<AttendeeCollection>(
492              AttendeeCollection.class,
493              XmlElementNames.RequiredAttendees, FieldUris.RequiredAttendees,
494              EnumSet.of(PropertyDefinitionFlags.AutoInstantiateOnRead,
495                  PropertyDefinitionFlags.CanSet,
496                  PropertyDefinitionFlags.CanUpdate,
497                  PropertyDefinitionFlags.CanDelete),
498              ExchangeVersion.Exchange2007_SP1,
499              new ICreateComplexPropertyDelegate<AttendeeCollection>() {
500                public AttendeeCollection createComplexProperty() {
501                  return new AttendeeCollection();
502                }
503              });
504    
505      // Defines the OptionalAttendees property.
506      /**
507       * The Constant OptionalAttendees.
508       */
509      public static final PropertyDefinition OptionalAttendees =
510          new ComplexPropertyDefinition<AttendeeCollection>(
511              AttendeeCollection.class,
512              XmlElementNames.OptionalAttendees, FieldUris.OptionalAttendees,
513              EnumSet.of(PropertyDefinitionFlags.AutoInstantiateOnRead,
514                  PropertyDefinitionFlags.CanSet,
515                  PropertyDefinitionFlags.CanUpdate,
516                  PropertyDefinitionFlags.CanDelete),
517              ExchangeVersion.Exchange2007_SP1,
518              new ICreateComplexPropertyDelegate<AttendeeCollection>() {
519                public AttendeeCollection createComplexProperty() {
520                  return new AttendeeCollection();
521                }
522              });
523    
524      // Defines the Resources property.
525    
526      /**
527       * The Constant Resources.
528       */
529      public static final PropertyDefinition Resources =
530          new ComplexPropertyDefinition<AttendeeCollection>(
531              AttendeeCollection.class,
532              XmlElementNames.Resources, FieldUris.Resources, EnumSet.of(
533              PropertyDefinitionFlags.AutoInstantiateOnRead,
534              PropertyDefinitionFlags.CanSet,
535              PropertyDefinitionFlags.CanUpdate,
536              PropertyDefinitionFlags.CanDelete),
537              ExchangeVersion.Exchange2007_SP1,
538              new ICreateComplexPropertyDelegate<AttendeeCollection>() {
539                public AttendeeCollection createComplexProperty() {
540                  return new AttendeeCollection();
541                }
542              });
543    
544      // Defines the ConflictingMeetingCount property.
545      /**
546       * The Constant ConflictingMeetingCount.
547       */
548      public static final PropertyDefinition ConflictingMeetingCount =
549          new IntPropertyDefinition(
550              XmlElementNames.ConflictingMeetingCount,
551              FieldUris.ConflictingMeetingCount,
552              ExchangeVersion.Exchange2007_SP1);
553    
554      // Defines the AdjacentMeetingCount property.
555      /**
556       * The Constant AdjacentMeetingCount.
557       */
558      public static final PropertyDefinition AdjacentMeetingCount =
559          new IntPropertyDefinition(
560              XmlElementNames.AdjacentMeetingCount,
561              FieldUris.AdjacentMeetingCount, ExchangeVersion.Exchange2007_SP1);
562    
563      // Defines the ConflictingMeetings property.
564      /**
565       * The Constant ConflictingMeetings.
566       */
567      public static final PropertyDefinition ConflictingMeetings =
568          new ComplexPropertyDefinition<ItemCollection<Appointment>>(
569              XmlElementNames.ConflictingMeetings,
570              FieldUris.ConflictingMeetings,
571              ExchangeVersion.Exchange2007_SP1,
572              new ICreateComplexPropertyDelegate
573                  <ItemCollection<Appointment>>() {
574                public ItemCollection<Appointment> createComplexProperty() {
575                  return new ItemCollection<Appointment>();
576                }
577              });
578    
579      // Defines the AdjacentMeetings property.
580      /**
581       * The Constant AdjacentMeetings.
582       */
583      public static final PropertyDefinition AdjacentMeetings =
584          new ComplexPropertyDefinition<ItemCollection<Appointment>>(
585              XmlElementNames.AdjacentMeetings,
586              FieldUris.AdjacentMeetings,
587              ExchangeVersion.Exchange2007_SP1,
588              new ICreateComplexPropertyDelegate
589                  <ItemCollection<Appointment>>() {
590                public ItemCollection<Appointment> createComplexProperty() {
591                  return new ItemCollection<Appointment>();
592                }
593              });
594    
595      // Defines the Duration property.
596      /**
597       * The Constant Duration.
598       */
599      public static final PropertyDefinition Duration =
600          new TimeSpanPropertyDefinition(
601              XmlElementNames.Duration, FieldUris.Duration, EnumSet
602              .of(PropertyDefinitionFlags.CanFind),
603              ExchangeVersion.Exchange2007_SP1);
604    
605      // Defines the TimeZone property.
606      /**
607       * The Constant TimeZone.
608       */
609      public static final PropertyDefinition TimeZone =
610          new StringPropertyDefinition(
611              XmlElementNames.TimeZone, FieldUris.TimeZone, EnumSet
612              .of(PropertyDefinitionFlags.CanFind),
613              ExchangeVersion.Exchange2007_SP1);
614    
615      // Defines the AppointmentReplyTime property.
616      /**
617       * The Constant AppointmentReplyTime.
618       */
619      public static final PropertyDefinition AppointmentReplyTime =
620          new DateTimePropertyDefinition(
621              XmlElementNames.AppointmentReplyTime,
622              FieldUris.AppointmentReplyTime, EnumSet
623              .of(PropertyDefinitionFlags.CanFind),
624              ExchangeVersion.Exchange2007_SP1);
625    
626      // Defines the AppointmentSequenceNumber property.
627      /**
628       * The Constant AppointmentSequenceNumber.
629       */
630      public static final PropertyDefinition AppointmentSequenceNumber =
631          new IntPropertyDefinition(
632              XmlElementNames.AppointmentSequenceNumber,
633              FieldUris.AppointmentSequenceNumber,
634              ExchangeVersion.Exchange2007_SP1);
635    
636      // Defines the AppointmentState property.
637      /**
638       * The Constant AppointmentState.
639       */
640      public static final PropertyDefinition AppointmentState =
641          new IntPropertyDefinition(
642              XmlElementNames.AppointmentState, FieldUris.AppointmentState,
643              EnumSet.of(PropertyDefinitionFlags.CanFind),
644              ExchangeVersion.Exchange2007_SP1);
645    
646      // Defines the Recurrence property.
647      /**
648       * The Constant Recurrence.
649       */
650      public static final PropertyDefinition Recurrence =
651          new RecurrencePropertyDefinition(
652              XmlElementNames.Recurrence, FieldUris.Recurrence, EnumSet.of(
653              PropertyDefinitionFlags.CanSet,
654              PropertyDefinitionFlags.CanUpdate,
655              PropertyDefinitionFlags.CanDelete),
656              ExchangeVersion.Exchange2007_SP1);
657    
658      // Defines the FirstOccurrence property.
659      /**
660       * The Constant FirstOccurrence.
661       */
662      public static final PropertyDefinition FirstOccurrence =
663          new ComplexPropertyDefinition<OccurrenceInfo>(
664              OccurrenceInfo.class,
665              XmlElementNames.FirstOccurrence, FieldUris.FirstOccurrence,
666              ExchangeVersion.Exchange2007_SP1,
667              new ICreateComplexPropertyDelegate<OccurrenceInfo>() {
668                public OccurrenceInfo createComplexProperty() {
669                  return new OccurrenceInfo();
670                }
671              });
672    
673      // Defines the LastOccurrence property.
674      /**
675       * The Constant LastOccurrence.
676       */
677      public static final PropertyDefinition LastOccurrence =
678          new ComplexPropertyDefinition<OccurrenceInfo>(
679              OccurrenceInfo.class,
680              XmlElementNames.LastOccurrence, FieldUris.LastOccurrence,
681              ExchangeVersion.Exchange2007_SP1,
682              new ICreateComplexPropertyDelegate<OccurrenceInfo>() {
683                public OccurrenceInfo createComplexProperty() {
684                  return new OccurrenceInfo();
685                }
686              });
687    
688      // Defines the ModifiedOccurrences property.
689      /**
690       * The Constant ModifiedOccurrences.
691       */
692      public static final PropertyDefinition ModifiedOccurrences =
693          new ComplexPropertyDefinition<OccurrenceInfoCollection>(
694              OccurrenceInfoCollection.class,
695              XmlElementNames.ModifiedOccurrences,
696              FieldUris.ModifiedOccurrences,
697              ExchangeVersion.Exchange2007_SP1,
698              new ICreateComplexPropertyDelegate
699                  <OccurrenceInfoCollection>() {
700                public OccurrenceInfoCollection createComplexProperty() {
701                  return new OccurrenceInfoCollection();
702                }
703              });
704    
705      // Defines the DeletedOccurrences property.
706      /**
707       * The Constant DeletedOccurrences.
708       */
709      public static final PropertyDefinition DeletedOccurrences =
710          new ComplexPropertyDefinition<DeletedOccurrenceInfoCollection>(
711              DeletedOccurrenceInfoCollection.class,
712              XmlElementNames.DeletedOccurrences,
713              FieldUris.DeletedOccurrences,
714              ExchangeVersion.Exchange2007_SP1,
715              new ICreateComplexPropertyDelegate
716                  <DeletedOccurrenceInfoCollection>() {
717                public DeletedOccurrenceInfoCollection createComplexProperty() {
718                  return new DeletedOccurrenceInfoCollection();
719                }
720              });
721    
722      // Defines the MeetingTimeZone property.
723      /**
724       * The Constant MeetingTimeZone.
725       */
726      public static final PropertyDefinition MeetingTimeZone =
727          new MeetingTimeZonePropertyDefinition(
728              XmlElementNames.MeetingTimeZone, FieldUris.MeetingTimeZone, EnumSet
729              .of(PropertyDefinitionFlags.CanSet,
730                  PropertyDefinitionFlags.CanUpdate),
731              ExchangeVersion.Exchange2007_SP1);
732    
733      // Defines the ConferenceType property.
734      /**
735       * The Constant ConferenceType.
736       */
737      public static final PropertyDefinition ConferenceType =
738          new IntPropertyDefinition(
739              XmlElementNames.ConferenceType, FieldUris.ConferenceType, EnumSet
740              .of(PropertyDefinitionFlags.CanSet,
741                  PropertyDefinitionFlags.CanUpdate,
742                  PropertyDefinitionFlags.CanFind),
743              ExchangeVersion.Exchange2007_SP1);
744    
745      // Defines the AllowNewTimeProposal property.
746      /**
747       * The Constant AllowNewTimeProposal.
748       */
749      public static final PropertyDefinition AllowNewTimeProposal =
750          new BoolPropertyDefinition(
751              XmlElementNames.AllowNewTimeProposal,
752              FieldUris.AllowNewTimeProposal, EnumSet.of(
753              PropertyDefinitionFlags.CanSet,
754              PropertyDefinitionFlags.CanUpdate,
755              PropertyDefinitionFlags.CanFind),
756              ExchangeVersion.Exchange2007_SP1);
757    
758      // Defines the IsOnlineMeeting property.
759      /**
760       * The Constant IsOnlineMeeting.
761       */
762      public static final PropertyDefinition IsOnlineMeeting =
763          new BoolPropertyDefinition(
764              XmlElementNames.IsOnlineMeeting, FieldUris.IsOnlineMeeting, EnumSet
765              .of(PropertyDefinitionFlags.CanSet,
766                  PropertyDefinitionFlags.CanUpdate,
767                  PropertyDefinitionFlags.CanFind),
768              ExchangeVersion.Exchange2007_SP1);
769    
770      // Defines the MeetingWorkspaceUrl property.
771      /**
772       * The Constant MeetingWorkspaceUrl.
773       */
774      public static final PropertyDefinition MeetingWorkspaceUrl =
775          new StringPropertyDefinition(
776              XmlElementNames.MeetingWorkspaceUrl, FieldUris.MeetingWorkspaceUrl,
777              EnumSet.of(PropertyDefinitionFlags.CanSet,
778                  PropertyDefinitionFlags.CanUpdate,
779                  PropertyDefinitionFlags.CanDelete,
780                  PropertyDefinitionFlags.CanFind),
781              ExchangeVersion.Exchange2007_SP1);
782    
783      // Defines the NetShowUrl property.
784      /**
785       * The Constant NetShowUrl.
786       */
787      public static final PropertyDefinition NetShowUrl =
788          new StringPropertyDefinition(
789              XmlElementNames.NetShowUrl, FieldUris.NetShowUrl, EnumSet.of(
790              PropertyDefinitionFlags.CanSet,
791              PropertyDefinitionFlags.CanUpdate,
792              PropertyDefinitionFlags.CanDelete,
793              PropertyDefinitionFlags.CanFind),
794              ExchangeVersion.Exchange2007_SP1);
795    
796      // Defines the iCalendar Uid property.
797      /**
798       * The Constant ICalUid.
799       */
800      public static final PropertyDefinition ICalUid =
801          new StringPropertyDefinition(
802              XmlElementNames.Uid, FieldUris.Uid, EnumSet
803              .of(PropertyDefinitionFlags.CanFind),
804              ExchangeVersion.Exchange2007_SP1);
805    
806      // Defines the iCalendar RecurrenceId property.
807      /**
808       * The Constant ICalRecurrenceId.
809       */
810      public static final PropertyDefinition ICalRecurrenceId =
811          new DateTimePropertyDefinition(
812              XmlElementNames.RecurrenceId, FieldUris.RecurrenceId, EnumSet
813              .of(PropertyDefinitionFlags.CanFind),
814              ExchangeVersion.Exchange2007_SP1, true);
815      // Defines the iCalendar DateTimeStamp property.
816      /**
817       * The Constant ICalDateTimeStamp.
818       */
819      public static final PropertyDefinition ICalDateTimeStamp =
820          new DateTimePropertyDefinition(
821              XmlElementNames.DateTimeStamp, FieldUris.DateTimeStamp, EnumSet
822              .of(PropertyDefinitionFlags.CanFind),
823              ExchangeVersion.Exchange2007_SP1, true); // isNullable
824    
825      // Instance of schema.
826      // This must be after the declaration of property definitions.
827      /**
828       * The Constant Instance.
829       */
830      public static final AppointmentSchema Instance = new AppointmentSchema();
831    
832      /**
833       * Registers property.
834       * <p>
835       * IMPORTANT NOTE: PROPERTIES MUST BE REGISTERED IN SCHEMA ORDER (i.e. the
836       * same order as they are defined in types.xsd)
837       * </p>
838       */
839      @Override
840      protected void registerProperties() {
841        super.registerProperties();
842    
843        this.registerProperty(Start);
844        this.registerProperty(End);
845        this.registerProperty(OriginalStart);
846        this.registerProperty(IsAllDayEvent);
847        this.registerProperty(LegacyFreeBusyStatus);
848        this.registerProperty(Location);
849        this.registerProperty(When);
850        this.registerProperty(IsMeeting);
851        this.registerProperty(IsCancelled);
852        this.registerProperty(IsRecurring);
853        this.registerProperty(MeetingRequestWasSent);
854        this.registerProperty(IsResponseRequested);
855        this.registerProperty(AppointmentType);
856        this.registerProperty(MyResponseType);
857        this.registerProperty(Organizer);
858        this.registerProperty(RequiredAttendees);
859        this.registerProperty(OptionalAttendees);
860        this.registerProperty(Resources);
861        this.registerProperty(ConflictingMeetingCount);
862        this.registerProperty(AdjacentMeetingCount);
863        this.registerProperty(ConflictingMeetings);
864        this.registerProperty(AdjacentMeetings);
865        this.registerProperty(Duration);
866        this.registerProperty(TimeZone);
867        this.registerProperty(AppointmentReplyTime);
868        this.registerProperty(AppointmentSequenceNumber);
869        this.registerProperty(AppointmentState);
870        this.registerProperty(Recurrence);
871        this.registerProperty(FirstOccurrence);
872        this.registerProperty(LastOccurrence);
873        this.registerProperty(ModifiedOccurrences);
874        this.registerProperty(DeletedOccurrences);
875        this.registerInternalProperty(MeetingTimeZone);
876        this.registerProperty(StartTimeZone);
877        this.registerProperty(EndTimeZone);
878        this.registerProperty(ConferenceType);
879        this.registerProperty(AllowNewTimeProposal);
880        this.registerProperty(IsOnlineMeeting);
881        this.registerProperty(MeetingWorkspaceUrl);
882        this.registerProperty(NetShowUrl);
883        this.registerProperty(ICalUid);
884        this.registerProperty(ICalRecurrenceId);
885        this.registerProperty(ICalDateTimeStamp);
886      }
887    
888      /**
889       * Instantiates a new appointment schema.
890       */
891      AppointmentSchema() {
892        super();
893      }
894    
895    }