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
024package microsoft.exchange.webservices.data.core.service.schema;
025
026import microsoft.exchange.webservices.data.attribute.Schema;
027import microsoft.exchange.webservices.data.core.XmlElementNames;
028import microsoft.exchange.webservices.data.core.service.item.Appointment;
029import microsoft.exchange.webservices.data.core.enumeration.service.calendar.AppointmentType;
030import microsoft.exchange.webservices.data.core.enumeration.misc.ExchangeVersion;
031import microsoft.exchange.webservices.data.core.enumeration.property.LegacyFreeBusyStatus;
032import microsoft.exchange.webservices.data.core.enumeration.property.MeetingResponseType;
033import microsoft.exchange.webservices.data.core.enumeration.property.PropertyDefinitionFlags;
034import microsoft.exchange.webservices.data.property.complex.AttendeeCollection;
035import microsoft.exchange.webservices.data.property.complex.DeletedOccurrenceInfoCollection;
036import microsoft.exchange.webservices.data.property.complex.EmailAddress;
037import microsoft.exchange.webservices.data.property.complex.ICreateComplexPropertyDelegate;
038import microsoft.exchange.webservices.data.property.complex.ItemCollection;
039import microsoft.exchange.webservices.data.property.complex.OccurrenceInfo;
040import microsoft.exchange.webservices.data.property.complex.OccurrenceInfoCollection;
041import microsoft.exchange.webservices.data.property.definition.BoolPropertyDefinition;
042import microsoft.exchange.webservices.data.property.definition.ComplexPropertyDefinition;
043import microsoft.exchange.webservices.data.property.definition.ContainedPropertyDefinition;
044import microsoft.exchange.webservices.data.property.definition.DateTimePropertyDefinition;
045import microsoft.exchange.webservices.data.property.definition.GenericPropertyDefinition;
046import microsoft.exchange.webservices.data.property.definition.IntPropertyDefinition;
047import microsoft.exchange.webservices.data.property.definition.MeetingTimeZonePropertyDefinition;
048import microsoft.exchange.webservices.data.property.definition.PropertyDefinition;
049import microsoft.exchange.webservices.data.property.definition.RecurrencePropertyDefinition;
050import microsoft.exchange.webservices.data.property.definition.StartTimeZonePropertyDefinition;
051import microsoft.exchange.webservices.data.property.definition.StringPropertyDefinition;
052import microsoft.exchange.webservices.data.property.definition.TimeSpanPropertyDefinition;
053import microsoft.exchange.webservices.data.property.definition.TimeZonePropertyDefinition;
054
055import java.util.EnumSet;
056
057/**
058 * Represents the schema for appointment and meeting request.
059 */
060@Schema
061public 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     * Are we the organiser
140     */
141    String IsOrganizer = "calendar:IsOrganizer";
142
143    /**
144     * The Organizer.
145     */
146    String Organizer = "calendar:Organizer";
147
148    /**
149     * The Required attendees.
150     */
151    String RequiredAttendees = "calendar:RequiredAttendees";
152
153    /**
154     * The Optional attendees.
155     */
156    String OptionalAttendees = "calendar:OptionalAttendees";
157
158    /**
159     * The Resources.
160     */
161    String Resources = "calendar:Resources";
162
163    /**
164     * The Conflicting meeting count.
165     */
166    String ConflictingMeetingCount = "calendar:ConflictingMeetingCount";
167
168    /**
169     * The Adjacent meeting count.
170     */
171    String AdjacentMeetingCount = "calendar:AdjacentMeetingCount";
172
173    /**
174     * The Conflicting meetings.
175     */
176    String ConflictingMeetings = "calendar:ConflictingMeetings";
177
178    /**
179     * The Adjacent meetings.
180     */
181    String AdjacentMeetings = "calendar:AdjacentMeetings";
182
183    /**
184     * The Duration.
185     */
186    String Duration = "calendar:Duration";
187
188    /**
189     * The Time zone.
190     */
191    String TimeZone = "calendar:TimeZone";
192
193    /**
194     * The Appointment reply time.
195     */
196    String AppointmentReplyTime = "calendar:AppointmentReplyTime";
197
198    /**
199     * The Appointment sequence number.
200     */
201    String AppointmentSequenceNumber = "calendar:AppointmentSequenceNumber";
202
203    /**
204     * The Appointment state.
205     */
206    String AppointmentState = "calendar:AppointmentState";
207
208    /**
209     * The Recurrence.
210     */
211    String Recurrence = "calendar:Recurrence";
212
213    /**
214     * The First occurrence.
215     */
216    String FirstOccurrence = "calendar:FirstOccurrence";
217
218    /**
219     * The Last occurrence.
220     */
221    String LastOccurrence = "calendar:LastOccurrence";
222
223    /**
224     * The Modified occurrences.
225     */
226    String ModifiedOccurrences = "calendar:ModifiedOccurrences";
227
228    /**
229     * The Deleted occurrences.
230     */
231    String DeletedOccurrences = "calendar:DeletedOccurrences";
232
233    /**
234     * The Meeting time zone.
235     */
236    String MeetingTimeZone = "calendar:MeetingTimeZone";
237
238    /**
239     * The Start time zone.
240     */
241    String StartTimeZone = "calendar:StartTimeZone";
242
243    /**
244     * The End time zone.
245     */
246    String EndTimeZone = "calendar:EndTimeZone";
247
248    /**
249     * The Conference type.
250     */
251    String ConferenceType = "calendar:ConferenceType";
252
253    /**
254     * The Allow new time proposal.
255     */
256    String AllowNewTimeProposal = "calendar:AllowNewTimeProposal";
257
258    /**
259     * The Is online meeting.
260     */
261    String IsOnlineMeeting = "calendar:IsOnlineMeeting";
262
263    /**
264     * The Meeting workspace url.
265     */
266    String MeetingWorkspaceUrl = "calendar:MeetingWorkspaceUrl";
267
268    /**
269     * The Net show url.
270     */
271    String NetShowUrl = "calendar:NetShowUrl";
272
273    /**
274     * The Uid.
275     */
276    String Uid = "calendar:UID";
277
278    /**
279     * The Recurrence id.
280     */
281    String RecurrenceId = "calendar:RecurrenceId";
282
283    /**
284     * The Date time stamp.
285     */
286    String DateTimeStamp = "calendar:DateTimeStamp";
287  }
288
289  // Defines the StartTimeZone property.
290  /**
291   * The Constant StartTimeZone.
292   */
293  public static final PropertyDefinition StartTimeZone =
294      new StartTimeZonePropertyDefinition(
295          XmlElementNames.StartTimeZone, FieldUris.StartTimeZone, EnumSet.of(
296          PropertyDefinitionFlags.CanSet,
297          PropertyDefinitionFlags.CanUpdate,
298          PropertyDefinitionFlags.CanFind),
299          ExchangeVersion.Exchange2007_SP1);
300
301  // Defines the EndTimeZone property.
302  /**
303   * The Constant EndTimeZone.
304   */
305  public static final PropertyDefinition EndTimeZone =
306      new TimeZonePropertyDefinition(
307          XmlElementNames.EndTimeZone, FieldUris.EndTimeZone, EnumSet.of(
308          PropertyDefinitionFlags.CanSet,
309          PropertyDefinitionFlags.CanUpdate,
310          PropertyDefinitionFlags.CanFind),
311          ExchangeVersion.Exchange2010);
312
313  // Defines the Start property.
314  /**
315   * The Constant Start.
316   */
317  public static final PropertyDefinition Start =
318      new DateTimePropertyDefinition(
319          XmlElementNames.Start, FieldUris.Start, EnumSet.of(
320          PropertyDefinitionFlags.CanSet,
321          PropertyDefinitionFlags.CanUpdate,
322          PropertyDefinitionFlags.CanFind),
323          ExchangeVersion.Exchange2007_SP1);
324
325  // Defines the End property.
326  /**
327   * The Constant End.
328   */
329  public static final PropertyDefinition End = new DateTimePropertyDefinition(
330      XmlElementNames.End, FieldUris.End, EnumSet.of(
331      PropertyDefinitionFlags.CanSet,
332      PropertyDefinitionFlags.CanUpdate,
333      PropertyDefinitionFlags.CanFind),
334      ExchangeVersion.Exchange2007_SP1);
335
336  // Defines the OriginalStart property.
337  /**
338   * The Constant OriginalStart.
339   */
340  public static final PropertyDefinition OriginalStart =
341      new DateTimePropertyDefinition(
342          XmlElementNames.OriginalStart, FieldUris.OriginalStart,
343          ExchangeVersion.Exchange2007_SP1);
344
345  // Defines the IsAllDayEvent property.
346  /**
347   * The Constant IsAllDayEvent.
348   */
349  public static final PropertyDefinition IsAllDayEvent =
350      new BoolPropertyDefinition(
351          XmlElementNames.IsAllDayEvent, FieldUris.IsAllDayEvent, EnumSet.of(
352          PropertyDefinitionFlags.CanSet,
353          PropertyDefinitionFlags.CanUpdate,
354          PropertyDefinitionFlags.CanFind),
355          ExchangeVersion.Exchange2007_SP1,
356          true);
357
358  // Defines the LegacyFreeBusyStatus property.
359  /**
360   * The Constant LegacyFreeBusyStatus.
361   */
362  public static final PropertyDefinition LegacyFreeBusyStatus =
363      new GenericPropertyDefinition<LegacyFreeBusyStatus>(
364          LegacyFreeBusyStatus.class,
365          XmlElementNames.LegacyFreeBusyStatus,
366          FieldUris.LegacyFreeBusyStatus, EnumSet.of(
367          PropertyDefinitionFlags.CanSet,
368          PropertyDefinitionFlags.CanUpdate,
369          PropertyDefinitionFlags.CanFind),
370          ExchangeVersion.Exchange2007_SP1);
371
372  // Defines the Location property.
373  /**
374   * The Constant Location.
375   */
376  public static final PropertyDefinition Location =
377      new StringPropertyDefinition(
378          XmlElementNames.Location, FieldUris.Location, EnumSet.of(
379          PropertyDefinitionFlags.CanSet,
380          PropertyDefinitionFlags.CanUpdate,
381          PropertyDefinitionFlags.CanDelete,
382          PropertyDefinitionFlags.CanFind),
383          ExchangeVersion.Exchange2007_SP1);
384
385  // Defines the When property.
386  /**
387   * The Constant When.
388   */
389  public static final PropertyDefinition When = new StringPropertyDefinition(
390      XmlElementNames.When, FieldUris.When, EnumSet.of(
391      PropertyDefinitionFlags.CanSet,
392      PropertyDefinitionFlags.CanUpdate,
393      PropertyDefinitionFlags.CanDelete,
394      PropertyDefinitionFlags.CanFind),
395      ExchangeVersion.Exchange2007_SP1);
396
397  // Defines the IsMeeting property.
398  /**
399   * The Constant IsMeeting.
400   */
401  public static final PropertyDefinition IsMeeting =
402      new BoolPropertyDefinition(
403          XmlElementNames.IsMeeting, FieldUris.IsMeeting, EnumSet
404          .of(PropertyDefinitionFlags.CanFind),
405          ExchangeVersion.Exchange2007_SP1);
406
407  // Defines the IsCancelled property.
408  /**
409   * The Constant IsCancelled.
410   */
411  public static final PropertyDefinition IsCancelled =
412      new BoolPropertyDefinition(
413          XmlElementNames.IsCancelled, FieldUris.IsCancelled, EnumSet
414          .of(PropertyDefinitionFlags.CanFind),
415          ExchangeVersion.Exchange2007_SP1);
416
417  // Defines the IsRecurring property.
418  /**
419   * The Constant IsRecurring.
420   */
421  public static final PropertyDefinition IsRecurring =
422      new BoolPropertyDefinition(
423          XmlElementNames.IsRecurring, FieldUris.IsRecurring, EnumSet
424          .of(PropertyDefinitionFlags.CanFind),
425          ExchangeVersion.Exchange2007_SP1);
426
427  // Defines the IsOrganizer property.
428  /**
429   * The Constant IsOrganizer.
430   */
431  public static final PropertyDefinition IsOrganizer =
432      new BoolPropertyDefinition(
433          XmlElementNames.IsOrganizer, FieldUris.IsOrganizer, EnumSet
434          .of(PropertyDefinitionFlags.CanFind),
435          ExchangeVersion.Exchange2007_SP1);
436
437  // Defines the MeetingRequestWasSent property.
438  /**
439   * The Constant MeetingRequestWasSent.
440   */
441  public static final PropertyDefinition MeetingRequestWasSent =
442      new BoolPropertyDefinition(
443          XmlElementNames.MeetingRequestWasSent,
444          FieldUris.MeetingRequestWasSent, EnumSet
445          .of(PropertyDefinitionFlags.CanFind),
446          ExchangeVersion.Exchange2007_SP1);
447
448  // Defines the IsResponseRequested property.
449  /**
450   * The Constant IsResponseRequested.
451   */
452  public static final PropertyDefinition IsResponseRequested =
453      new BoolPropertyDefinition(
454          XmlElementNames.IsResponseRequested, FieldUris.IsResponseRequested,
455          EnumSet.of(PropertyDefinitionFlags.CanSet,
456              PropertyDefinitionFlags.CanUpdate,
457              PropertyDefinitionFlags.CanFind),
458          ExchangeVersion.Exchange2007_SP1);
459
460  // Defines the AppointmentType property.
461  /**
462   * The Constant AppointmentType.
463   */
464  public static final PropertyDefinition AppointmentType =
465      new GenericPropertyDefinition<AppointmentType>(
466          AppointmentType.class,
467          XmlElementNames.CalendarItemType, FieldUris.CalendarItemType,
468          EnumSet.of(PropertyDefinitionFlags.CanFind),
469          ExchangeVersion.Exchange2007_SP1);
470
471  // Defines the MyResponseType property.
472  /**
473   * The Constant MyResponseType.
474   */
475  public static final PropertyDefinition MyResponseType =
476      new GenericPropertyDefinition<MeetingResponseType>(
477          MeetingResponseType.class,
478          XmlElementNames.MyResponseType, FieldUris.MyResponseType, EnumSet
479          .of(PropertyDefinitionFlags.CanSet,
480              PropertyDefinitionFlags.CanUpdate,
481              PropertyDefinitionFlags.CanFind),
482          ExchangeVersion.Exchange2007_SP1);
483
484  // Defines the Organizer property.
485  /**
486   * The Constant Organizer.
487   */
488  public static final PropertyDefinition Organizer =
489      new ContainedPropertyDefinition<EmailAddress>(
490          EmailAddress.class,
491          XmlElementNames.Organizer, FieldUris.Organizer,
492          XmlElementNames.Mailbox, EnumSet
493          .of(PropertyDefinitionFlags.CanFind),
494          ExchangeVersion.Exchange2007_SP1,
495          new ICreateComplexPropertyDelegate<EmailAddress>() {
496            public EmailAddress createComplexProperty() {
497              return new EmailAddress();
498            }
499          });
500
501  // Defines the RequiredAttendees property.
502
503  /**
504   * The Constant RequiredAttendees.
505   */
506  public static final PropertyDefinition RequiredAttendees =
507      new ComplexPropertyDefinition<AttendeeCollection>(
508          AttendeeCollection.class,
509          XmlElementNames.RequiredAttendees, FieldUris.RequiredAttendees,
510          EnumSet.of(PropertyDefinitionFlags.AutoInstantiateOnRead,
511              PropertyDefinitionFlags.CanSet,
512              PropertyDefinitionFlags.CanUpdate,
513              PropertyDefinitionFlags.CanDelete),
514          ExchangeVersion.Exchange2007_SP1,
515          new ICreateComplexPropertyDelegate<AttendeeCollection>() {
516            public AttendeeCollection createComplexProperty() {
517              return new AttendeeCollection();
518            }
519          });
520
521  // Defines the OptionalAttendees property.
522  /**
523   * The Constant OptionalAttendees.
524   */
525  public static final PropertyDefinition OptionalAttendees =
526      new ComplexPropertyDefinition<AttendeeCollection>(
527          AttendeeCollection.class,
528          XmlElementNames.OptionalAttendees, FieldUris.OptionalAttendees,
529          EnumSet.of(PropertyDefinitionFlags.AutoInstantiateOnRead,
530              PropertyDefinitionFlags.CanSet,
531              PropertyDefinitionFlags.CanUpdate,
532              PropertyDefinitionFlags.CanDelete),
533          ExchangeVersion.Exchange2007_SP1,
534          new ICreateComplexPropertyDelegate<AttendeeCollection>() {
535            public AttendeeCollection createComplexProperty() {
536              return new AttendeeCollection();
537            }
538          });
539
540  // Defines the Resources property.
541
542  /**
543   * The Constant Resources.
544   */
545  public static final PropertyDefinition Resources =
546      new ComplexPropertyDefinition<AttendeeCollection>(
547          AttendeeCollection.class,
548          XmlElementNames.Resources, FieldUris.Resources, EnumSet.of(
549          PropertyDefinitionFlags.AutoInstantiateOnRead,
550          PropertyDefinitionFlags.CanSet,
551          PropertyDefinitionFlags.CanUpdate,
552          PropertyDefinitionFlags.CanDelete),
553          ExchangeVersion.Exchange2007_SP1,
554          new ICreateComplexPropertyDelegate<AttendeeCollection>() {
555            public AttendeeCollection createComplexProperty() {
556              return new AttendeeCollection();
557            }
558          });
559
560  // Defines the ConflictingMeetingCount property.
561  /**
562   * The Constant ConflictingMeetingCount.
563   */
564  public static final PropertyDefinition ConflictingMeetingCount =
565      new IntPropertyDefinition(
566          XmlElementNames.ConflictingMeetingCount,
567          FieldUris.ConflictingMeetingCount,
568          ExchangeVersion.Exchange2007_SP1);
569
570  // Defines the AdjacentMeetingCount property.
571  /**
572   * The Constant AdjacentMeetingCount.
573   */
574  public static final PropertyDefinition AdjacentMeetingCount =
575      new IntPropertyDefinition(
576          XmlElementNames.AdjacentMeetingCount,
577          FieldUris.AdjacentMeetingCount, ExchangeVersion.Exchange2007_SP1);
578
579  // Defines the ConflictingMeetings property.
580  /**
581   * The Constant ConflictingMeetings.
582   */
583  public static final PropertyDefinition ConflictingMeetings =
584      new ComplexPropertyDefinition<ItemCollection<Appointment>>(
585          XmlElementNames.ConflictingMeetings,
586          FieldUris.ConflictingMeetings,
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 AdjacentMeetings property.
596  /**
597   * The Constant AdjacentMeetings.
598   */
599  public static final PropertyDefinition AdjacentMeetings =
600      new ComplexPropertyDefinition<ItemCollection<Appointment>>(
601          XmlElementNames.AdjacentMeetings,
602          FieldUris.AdjacentMeetings,
603          ExchangeVersion.Exchange2007_SP1,
604          new ICreateComplexPropertyDelegate
605              <ItemCollection<Appointment>>() {
606            public ItemCollection<Appointment> createComplexProperty() {
607              return new ItemCollection<Appointment>();
608            }
609          });
610
611  // Defines the Duration property.
612  /**
613   * The Constant Duration.
614   */
615  public static final PropertyDefinition Duration =
616      new TimeSpanPropertyDefinition(
617          XmlElementNames.Duration, FieldUris.Duration, EnumSet
618          .of(PropertyDefinitionFlags.CanFind),
619          ExchangeVersion.Exchange2007_SP1);
620
621  // Defines the TimeZone property.
622  /**
623   * The Constant TimeZone.
624   */
625  public static final PropertyDefinition TimeZone =
626      new StringPropertyDefinition(
627          XmlElementNames.TimeZone, FieldUris.TimeZone, EnumSet
628          .of(PropertyDefinitionFlags.CanFind),
629          ExchangeVersion.Exchange2007_SP1);
630
631  // Defines the AppointmentReplyTime property.
632  /**
633   * The Constant AppointmentReplyTime.
634   */
635  public static final PropertyDefinition AppointmentReplyTime =
636      new DateTimePropertyDefinition(
637          XmlElementNames.AppointmentReplyTime,
638          FieldUris.AppointmentReplyTime, EnumSet
639          .of(PropertyDefinitionFlags.CanFind),
640          ExchangeVersion.Exchange2007_SP1);
641
642  // Defines the AppointmentSequenceNumber property.
643  /**
644   * The Constant AppointmentSequenceNumber.
645   */
646  public static final PropertyDefinition AppointmentSequenceNumber =
647      new IntPropertyDefinition(
648          XmlElementNames.AppointmentSequenceNumber,
649          FieldUris.AppointmentSequenceNumber,
650          ExchangeVersion.Exchange2007_SP1);
651
652  // Defines the AppointmentState property.
653  /**
654   * The Constant AppointmentState.
655   */
656  public static final PropertyDefinition AppointmentState =
657      new IntPropertyDefinition(
658          XmlElementNames.AppointmentState, FieldUris.AppointmentState,
659          EnumSet.of(PropertyDefinitionFlags.CanFind),
660          ExchangeVersion.Exchange2007_SP1);
661
662  // Defines the Recurrence property.
663  /**
664   * The Constant Recurrence.
665   */
666  public static final PropertyDefinition Recurrence =
667      new RecurrencePropertyDefinition(
668          XmlElementNames.Recurrence, FieldUris.Recurrence, EnumSet.of(
669          PropertyDefinitionFlags.CanSet,
670          PropertyDefinitionFlags.CanUpdate,
671          PropertyDefinitionFlags.CanDelete),
672          ExchangeVersion.Exchange2007_SP1);
673
674  // Defines the FirstOccurrence property.
675  /**
676   * The Constant FirstOccurrence.
677   */
678  public static final PropertyDefinition FirstOccurrence =
679      new ComplexPropertyDefinition<OccurrenceInfo>(
680          OccurrenceInfo.class,
681          XmlElementNames.FirstOccurrence, FieldUris.FirstOccurrence,
682          ExchangeVersion.Exchange2007_SP1,
683          new ICreateComplexPropertyDelegate<OccurrenceInfo>() {
684            public OccurrenceInfo createComplexProperty() {
685              return new OccurrenceInfo();
686            }
687          });
688
689  // Defines the LastOccurrence property.
690  /**
691   * The Constant LastOccurrence.
692   */
693  public static final PropertyDefinition LastOccurrence =
694      new ComplexPropertyDefinition<OccurrenceInfo>(
695          OccurrenceInfo.class,
696          XmlElementNames.LastOccurrence, FieldUris.LastOccurrence,
697          ExchangeVersion.Exchange2007_SP1,
698          new ICreateComplexPropertyDelegate<OccurrenceInfo>() {
699            public OccurrenceInfo createComplexProperty() {
700              return new OccurrenceInfo();
701            }
702          });
703
704  // Defines the ModifiedOccurrences property.
705  /**
706   * The Constant ModifiedOccurrences.
707   */
708  public static final PropertyDefinition ModifiedOccurrences =
709      new ComplexPropertyDefinition<OccurrenceInfoCollection>(
710          OccurrenceInfoCollection.class,
711          XmlElementNames.ModifiedOccurrences,
712          FieldUris.ModifiedOccurrences,
713          ExchangeVersion.Exchange2007_SP1,
714          new ICreateComplexPropertyDelegate
715              <OccurrenceInfoCollection>() {
716            public OccurrenceInfoCollection createComplexProperty() {
717              return new OccurrenceInfoCollection();
718            }
719          });
720
721  // Defines the DeletedOccurrences property.
722  /**
723   * The Constant DeletedOccurrences.
724   */
725  public static final PropertyDefinition DeletedOccurrences =
726      new ComplexPropertyDefinition<DeletedOccurrenceInfoCollection>(
727          DeletedOccurrenceInfoCollection.class,
728          XmlElementNames.DeletedOccurrences,
729          FieldUris.DeletedOccurrences,
730          ExchangeVersion.Exchange2007_SP1,
731          new ICreateComplexPropertyDelegate
732              <DeletedOccurrenceInfoCollection>() {
733            public DeletedOccurrenceInfoCollection createComplexProperty() {
734              return new DeletedOccurrenceInfoCollection();
735            }
736          });
737
738  // Defines the MeetingTimeZone property.
739  /**
740   * The Constant MeetingTimeZone.
741   */
742  public static final PropertyDefinition MeetingTimeZone =
743      new MeetingTimeZonePropertyDefinition(
744          XmlElementNames.MeetingTimeZone, FieldUris.MeetingTimeZone, EnumSet
745          .of(PropertyDefinitionFlags.CanSet,
746              PropertyDefinitionFlags.CanUpdate),
747          ExchangeVersion.Exchange2007_SP1);
748
749  // Defines the ConferenceType property.
750  /**
751   * The Constant ConferenceType.
752   */
753  public static final PropertyDefinition ConferenceType =
754      new IntPropertyDefinition(
755          XmlElementNames.ConferenceType, FieldUris.ConferenceType, EnumSet
756          .of(PropertyDefinitionFlags.CanSet,
757              PropertyDefinitionFlags.CanUpdate,
758              PropertyDefinitionFlags.CanFind),
759          ExchangeVersion.Exchange2007_SP1);
760
761  // Defines the AllowNewTimeProposal property.
762  /**
763   * The Constant AllowNewTimeProposal.
764   */
765  public static final PropertyDefinition AllowNewTimeProposal =
766      new BoolPropertyDefinition(
767          XmlElementNames.AllowNewTimeProposal,
768          FieldUris.AllowNewTimeProposal, EnumSet.of(
769          PropertyDefinitionFlags.CanSet,
770          PropertyDefinitionFlags.CanUpdate,
771          PropertyDefinitionFlags.CanFind,
772          PropertyDefinitionFlags.CanDelete),
773          ExchangeVersion.Exchange2007_SP1, true);
774
775  // Defines the IsOnlineMeeting property.
776  /**
777   * The Constant IsOnlineMeeting.
778   */
779  public static final PropertyDefinition IsOnlineMeeting =
780      new BoolPropertyDefinition(
781          XmlElementNames.IsOnlineMeeting, FieldUris.IsOnlineMeeting, EnumSet
782          .of(PropertyDefinitionFlags.CanSet,
783              PropertyDefinitionFlags.CanUpdate,
784              PropertyDefinitionFlags.CanFind),
785          ExchangeVersion.Exchange2007_SP1);
786
787  // Defines the MeetingWorkspaceUrl property.
788  /**
789   * The Constant MeetingWorkspaceUrl.
790   */
791  public static final PropertyDefinition MeetingWorkspaceUrl =
792      new StringPropertyDefinition(
793          XmlElementNames.MeetingWorkspaceUrl, FieldUris.MeetingWorkspaceUrl,
794          EnumSet.of(PropertyDefinitionFlags.CanSet,
795              PropertyDefinitionFlags.CanUpdate,
796              PropertyDefinitionFlags.CanDelete,
797              PropertyDefinitionFlags.CanFind),
798          ExchangeVersion.Exchange2007_SP1);
799
800  // Defines the NetShowUrl property.
801  /**
802   * The Constant NetShowUrl.
803   */
804  public static final PropertyDefinition NetShowUrl =
805      new StringPropertyDefinition(
806          XmlElementNames.NetShowUrl, FieldUris.NetShowUrl, EnumSet.of(
807          PropertyDefinitionFlags.CanSet,
808          PropertyDefinitionFlags.CanUpdate,
809          PropertyDefinitionFlags.CanDelete,
810          PropertyDefinitionFlags.CanFind),
811          ExchangeVersion.Exchange2007_SP1);
812
813  // Defines the iCalendar Uid property.
814  /**
815   * The Constant ICalUid.
816   */
817  public static final PropertyDefinition ICalUid =
818      new StringPropertyDefinition(
819          XmlElementNames.Uid, FieldUris.Uid, EnumSet
820          .of(PropertyDefinitionFlags.CanSet,
821          PropertyDefinitionFlags.CanFind),
822          ExchangeVersion.Exchange2007_SP1);
823
824  // Defines the iCalendar RecurrenceId property.
825  /**
826   * The Constant ICalRecurrenceId.
827   */
828  public static final PropertyDefinition ICalRecurrenceId =
829      new DateTimePropertyDefinition(
830          XmlElementNames.RecurrenceId, FieldUris.RecurrenceId, EnumSet
831          .of(PropertyDefinitionFlags.CanFind),
832          ExchangeVersion.Exchange2007_SP1, true);
833  // Defines the iCalendar DateTimeStamp property.
834  /**
835   * The Constant ICalDateTimeStamp.
836   */
837  public static final PropertyDefinition ICalDateTimeStamp =
838      new DateTimePropertyDefinition(
839          XmlElementNames.DateTimeStamp, FieldUris.DateTimeStamp, EnumSet
840          .of(PropertyDefinitionFlags.CanFind),
841          ExchangeVersion.Exchange2007_SP1, true); // isNullable
842
843  // Instance of schema.
844  // This must be after the declaration of property definitions.
845  /**
846   * The Constant Instance.
847   */
848  public static final AppointmentSchema Instance = new AppointmentSchema();
849
850  /**
851   * Registers property.
852   * <p>
853   * IMPORTANT NOTE: PROPERTIES MUST BE REGISTERED IN SCHEMA ORDER (i.e. the
854   * same order as they are defined in types.xsd)
855   * </p>
856   */
857  @Override
858  protected void registerProperties() {
859    super.registerProperties();
860
861    this.registerProperty(Start);
862    this.registerProperty(End);
863    this.registerProperty(OriginalStart);
864    this.registerProperty(IsAllDayEvent);
865    this.registerProperty(LegacyFreeBusyStatus);
866    this.registerProperty(Location);
867    this.registerProperty(When);
868    this.registerProperty(IsMeeting);
869    this.registerProperty(IsCancelled);
870    this.registerProperty(IsRecurring);
871    this.registerProperty(MeetingRequestWasSent);
872    this.registerProperty(IsResponseRequested);
873    this.registerProperty(AppointmentType);
874    this.registerProperty(MyResponseType);
875    this.registerProperty(Organizer);
876    this.registerProperty(RequiredAttendees);
877    this.registerProperty(OptionalAttendees);
878    this.registerProperty(Resources);
879    this.registerProperty(ConflictingMeetingCount);
880    this.registerProperty(AdjacentMeetingCount);
881    this.registerProperty(ConflictingMeetings);
882    this.registerProperty(AdjacentMeetings);
883    this.registerProperty(Duration);
884    this.registerProperty(TimeZone);
885    this.registerProperty(AppointmentReplyTime);
886    this.registerProperty(AppointmentSequenceNumber);
887    this.registerProperty(AppointmentState);
888    this.registerProperty(Recurrence);
889    this.registerProperty(FirstOccurrence);
890    this.registerProperty(LastOccurrence);
891    this.registerProperty(ModifiedOccurrences);
892    this.registerProperty(DeletedOccurrences);
893    this.registerInternalProperty(MeetingTimeZone);
894    this.registerProperty(StartTimeZone);
895    this.registerProperty(EndTimeZone);
896    this.registerProperty(ConferenceType);
897    this.registerProperty(AllowNewTimeProposal);
898    this.registerProperty(IsOnlineMeeting);
899    this.registerProperty(MeetingWorkspaceUrl);
900    this.registerProperty(NetShowUrl);
901    this.registerProperty(ICalUid);
902    this.registerProperty(ICalRecurrenceId);
903    this.registerProperty(ICalDateTimeStamp);
904    this.registerProperty(IsOrganizer);
905  }
906
907  /**
908   * Instantiates a new appointment schema.
909   */
910  AppointmentSchema() {
911    super();
912  }
913
914}