/** * Writes the attribute to XML. * * @param writer the writer * @throws ServiceXmlSerializationException the service xml serialization exception */ @Override public void writeAttributesToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { // The Name attribute is only supported in Exchange 2010 and above. if (writer.getService().getRequestedServerVersion() != ExchangeVersion.Exchange2007_SP1) { writer.writeAttributeValue(XmlAttributeNames.Name, this.name); } writer.writeAttributeValue(XmlAttributeNames.Id, this.id); }
/** * Writes to XML. * * @param writer the writer * @throws XMLStreamException the XML stream exception * @throws ServiceXmlSerializationException the service xml serialization exception */ public void writeToXml(EwsServiceXmlWriter writer) throws XMLStreamException, ServiceXmlSerializationException { if (writer.getService().getRequestedServerVersion() == ExchangeVersion.Exchange2007_SP1) { AppointmentSchema.MeetingTimeZone.writeToXml(writer); } else { super.writeToXml(writer); } }
} else if (dictionaryObject instanceof Date) { dictionaryObjectType = UserConfigurationDictionaryObjectType.DateTime; valueAsString = writer.getService() .convertDateTimeToUniversalDateTimeString( (Date) dictionaryObject);
if (writer.getService().getRequestedServerVersion() != ExchangeVersion.Exchange2007_SP1) { if (this.periods.size() > 0) { writer.writeStartElement(XmlNamespace.Types,
/** * Writes to XML. * * @param writer The writer * @throws Exception the exception */ public void writeToXml(EwsServiceXmlWriter writer) throws Exception { if (this.id == null || this.id.isEmpty()) { throw new Exception("The Id property must be set."); } writer.writeStartElement(XmlNamespace.Types, XmlElementNames.ExchangeImpersonation); writer.writeStartElement(XmlNamespace.Types, XmlElementNames.ConnectingSID); // For 2007 SP1, use PrimarySmtpAddress for type SmtpAddress String connectingIdTypeLocalName = (this.idType == ConnectingIdType.SmtpAddress) && (writer.getService().getRequestedServerVersion() == ExchangeVersion.Exchange2007_SP1) ? XmlElementNames.PrimarySmtpAddress : this.getIdType().toString(); writer.writeElementValue(XmlNamespace.Types, connectingIdTypeLocalName, this.id); writer.writeEndElement(); // ConnectingSID writer.writeEndElement(); // ExchangeImpersonation }
/** * Write property to XML. * * @param writer the writer * @throws Exception the exception */ @Override public void internalWritePropertiesToXml(EwsServiceXmlWriter writer) throws Exception { super.internalWritePropertiesToXml(writer); this.getDaysOfTheWeek().writeToXml(writer, XmlElementNames.DaysOfWeek); if (this.firstDayOfWeek != null) { EwsUtilities .validatePropertyVersion((ExchangeService) writer.getService(), ExchangeVersion.Exchange2010_SP1, "FirstDayOfWeek"); writer.writeElementValue( XmlNamespace.Types, XmlElementNames.FirstDayOfWeek, this.firstDayOfWeek); } }
super.writeElementsToXml(writer); if (writer.getService().getRequestedServerVersion().ordinal() > ExchangeVersion.Exchange2007_SP1 .ordinal()) {
/** * Writes to XML. * * @param writer the writer * @param propertyBag the property bag * @param isUpdateOperation the is update operation * @throws Exception the exception */ public void writePropertyValueToXml(EwsServiceXmlWriter writer, PropertyBag propertyBag, boolean isUpdateOperation) throws Exception { Object value = propertyBag.getObjectFromPropertyDefinition(this); if (value != null) { final ExchangeService service = (ExchangeService) writer.getService(); if (service.getRequestedServerVersion() == ExchangeVersion.Exchange2007_SP1) { if (!service.getExchange2007CompatibilityMode()) { MeetingTimeZone meetingTimeZone = new MeetingTimeZone((TimeZoneDefinition) value); meetingTimeZone.writeToXml(writer, XmlElementNames.MeetingTimeZone); } } else { super.writePropertyValueToXml(writer, propertyBag, isUpdateOperation); } } }
/** * Writes the bag's property to XML. * * @param writer The writer to write the property to. * @throws Exception the exception */ public void writeToXml(EwsServiceXmlWriter writer) throws Exception { writer.writeStartElement(XmlNamespace.Types, this.getOwner() .getXmlElementName()); Iterator<PropertyDefinition> it = this.getOwner().getSchema() .iterator(); while (it.hasNext()) { PropertyDefinition propertyDefinition = it.next(); // The following test should not be necessary since the property bag // prevents // property to be set if they don't have the CanSet flag, but it // doesn't hurt... if (propertyDefinition .hasFlag(PropertyDefinitionFlags.CanSet, writer.getService().getRequestedServerVersion())) { if (this.contains(propertyDefinition)) { propertyDefinition.writePropertyValueToXml(writer, this, false /* isUpdateOperation */); } } } writer.writeEndElement(); }
writer.getService().getRequestedServerVersion(). compareTo(ExchangeVersion.Exchange2010_SP1) >= 0) { writer.writeElementValue(
/** * Writes elements to XML. * * @param writer the writer * @throws Exception the exception */ @Override public void writeElementsToXml(EwsServiceXmlWriter writer) throws Exception { writer.writeElementValue(XmlNamespace.Types, XmlElementNames.Name, this .getName()); writer.writeElementValue(XmlNamespace.Types, XmlElementNames.ContentType, this.getContentType()); writer.writeElementValue(XmlNamespace.Types, XmlElementNames.ContentId, this.getContentId()); writer.writeElementValue(XmlNamespace.Types, XmlElementNames.ContentLocation, this.getContentLocation()); if (writer.getService().getRequestedServerVersion().ordinal() > ExchangeVersion.Exchange2007_SP1 .ordinal()) { writer.writeElementValue(XmlNamespace.Types, XmlElementNames.IsInline, this.getIsInline()); } }
/** * Writes the attribute to XML. * * @param writer accepts EwsServiceXmlWriter * @throws ServiceXmlSerializationException throws ServiceXmlSerializationException */ @Override public void writeAttributesToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { super.writeAttributesToXml(writer); if (writer.getService().getRequestedServerVersion().ordinal() > ExchangeVersion.Exchange2007_SP1 .ordinal()) { writer.writeAttributeValue(XmlAttributeNames.Name, this .getEmailAddress().getName()); writer.writeAttributeValue(XmlAttributeNames.RoutingType, this .getEmailAddress().getRoutingType()); if (this.getEmailAddress().getMailboxType() != MailboxType.Unknown) { writer.writeAttributeValue(XmlAttributeNames.MailboxType, this .getEmailAddress().getMailboxType()); } } }
/** * Writes the attribute to XML. * * @param writer the writer * @throws ServiceXmlSerializationException the service xml serialization exception */ @Override public void writeAttributesToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { // The Name attribute is only supported in Exchange 2010 and above. if (writer.getService().getRequestedServerVersion() != ExchangeVersion.Exchange2007_SP1) { writer.writeAttributeValue(XmlAttributeNames.Name, this.name); } writer.writeAttributeValue(XmlAttributeNames.Id, this.id); }
/** * Writes to XML. * * @param writer the writer * @throws XMLStreamException the XML stream exception * @throws ServiceXmlSerializationException the service xml serialization exception */ public void writeToXml(EwsServiceXmlWriter writer) throws XMLStreamException, ServiceXmlSerializationException { if (writer.getService().getRequestedServerVersion() == ExchangeVersion.Exchange2007_SP1) { AppointmentSchema.MeetingTimeZone.writeToXml(writer); } else { super.writeToXml(writer); } }
/** * Writes to XML. * * @param writer The writer * @throws Exception the exception */ public void writeToXml(EwsServiceXmlWriter writer) throws Exception { if (this.id == null || this.id.isEmpty()) { throw new Exception("The Id property must be set."); } writer.writeStartElement(XmlNamespace.Types, XmlElementNames.ExchangeImpersonation); writer.writeStartElement(XmlNamespace.Types, XmlElementNames.ConnectingSID); // For 2007 SP1, use PrimarySmtpAddress for type SmtpAddress String connectingIdTypeLocalName = (this.idType == ConnectingIdType.SmtpAddress) && (writer.getService().getRequestedServerVersion() == ExchangeVersion.Exchange2007_SP1) ? XmlElementNames.PrimarySmtpAddress : this.getIdType().toString(); writer.writeElementValue(XmlNamespace.Types, connectingIdTypeLocalName, this.id); writer.writeEndElement(); // ConnectingSID writer.writeEndElement(); // ExchangeImpersonation }
/** * Write property to XML. * * @param writer the writer * @throws Exception the exception */ @Override public void internalWritePropertiesToXml(EwsServiceXmlWriter writer) throws Exception { super.internalWritePropertiesToXml(writer); this.getDaysOfTheWeek().writeToXml(writer, XmlElementNames.DaysOfWeek); if (this.firstDayOfWeek != null) { EwsUtilities .validatePropertyVersion((ExchangeService) writer.getService(), ExchangeVersion.Exchange2010_SP1, "FirstDayOfWeek"); writer.writeElementValue( XmlNamespace.Types, XmlElementNames.FirstDayOfWeek, this.firstDayOfWeek); } }
/** * Writes to XML. * * @param writer the writer * @param propertyBag the property bag * @param isUpdateOperation the is update operation * @throws Exception the exception */ public void writePropertyValueToXml(EwsServiceXmlWriter writer, PropertyBag propertyBag, boolean isUpdateOperation) throws Exception { Object value = propertyBag.getObjectFromPropertyDefinition(this); if (value != null) { final ExchangeService service = (ExchangeService) writer.getService(); if (service.getRequestedServerVersion() == ExchangeVersion.Exchange2007_SP1) { if (!service.getExchange2007CompatibilityMode()) { MeetingTimeZone meetingTimeZone = new MeetingTimeZone((TimeZoneDefinition) value); meetingTimeZone.writeToXml(writer, XmlElementNames.MeetingTimeZone); } } else { super.writePropertyValueToXml(writer, propertyBag, isUpdateOperation); } } }
/** * Writes the bag's property to XML. * * @param writer The writer to write the property to. * @throws Exception the exception */ public void writeToXml(EwsServiceXmlWriter writer) throws Exception { writer.writeStartElement(XmlNamespace.Types, this.getOwner() .getXmlElementName()); Iterator<PropertyDefinition> it = this.getOwner().getSchema() .iterator(); while (it.hasNext()) { PropertyDefinition propertyDefinition = it.next(); // The following test should not be necessary since the property bag // prevents // property to be set if they don't have the CanSet flag, but it // doesn't hurt... if (propertyDefinition .hasFlag(PropertyDefinitionFlags.CanSet, writer.getService().getRequestedServerVersion())) { if (this.contains(propertyDefinition)) { propertyDefinition.writePropertyValueToXml(writer, this, false /* isUpdateOperation */); } } } writer.writeEndElement(); }
/** * Writes elements to XML. * * @param writer the writer * @throws Exception the exception */ @Override public void writeElementsToXml(EwsServiceXmlWriter writer) throws Exception { writer.writeElementValue(XmlNamespace.Types, XmlElementNames.Name, this .getName()); writer.writeElementValue(XmlNamespace.Types, XmlElementNames.ContentType, this.getContentType()); writer.writeElementValue(XmlNamespace.Types, XmlElementNames.ContentId, this.getContentId()); writer.writeElementValue(XmlNamespace.Types, XmlElementNames.ContentLocation, this.getContentLocation()); if (writer.getService().getRequestedServerVersion().ordinal() > ExchangeVersion.Exchange2007_SP1 .ordinal()) { writer.writeElementValue(XmlNamespace.Types, XmlElementNames.IsInline, this.getIsInline()); } }
/** * Writes the attribute to XML. * * @param writer accepts EwsServiceXmlWriter * @throws ServiceXmlSerializationException throws ServiceXmlSerializationException */ @Override public void writeAttributesToXml(EwsServiceXmlWriter writer) throws ServiceXmlSerializationException { super.writeAttributesToXml(writer); if (writer.getService().getRequestedServerVersion().ordinal() > ExchangeVersion.Exchange2007_SP1 .ordinal()) { writer.writeAttributeValue(XmlAttributeNames.Name, this .getEmailAddress().getName()); writer.writeAttributeValue(XmlAttributeNames.RoutingType, this .getEmailAddress().getRoutingType()); if (this.getEmailAddress().getMailboxType() != MailboxType.Unknown) { writer.writeAttributeValue(XmlAttributeNames.MailboxType, this .getEmailAddress().getMailboxType()); } } }