#import "FileCatalyst.h" #ifndef DEF_FILECATALYSTFAULTReasonCode_M #define DEF_FILECATALYSTFAULTReasonCode_M /** * Reason. */ @implementation FILECATALYSTFAULTReasonCode /** * Reason for fault. */ - (NSString *) reason { return _reason; } /** * Reason for fault. */ - (void) setReason: (NSString *) newReason { [newReason retain]; [_reason release]; _reason = newReason; } - (void) dealloc { [self setReason: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTFAULTReasonCode *_fILECATALYSTFAULTReasonCode; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTFAULTReasonCode = (FILECATALYSTFAULTReasonCode *) [FILECATALYSTFAULTReasonCode readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTFAULTReasonCode; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTFAULTReasonCode */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTFAULTReasonCode (JAXB) @end /*interface FILECATALYSTFAULTReasonCode (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTFAULTReasonCode (JAXB) /** * Read an instance of FILECATALYSTFAULTReasonCode from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTFAULTReasonCode defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTFAULTReasonCode *_fILECATALYSTFAULTReasonCode = [[FILECATALYSTFAULTReasonCode alloc] init]; NS_DURING { [_fILECATALYSTFAULTReasonCode initWithReader: reader]; } NS_HANDLER { _fILECATALYSTFAULTReasonCode = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTFAULTReasonCode autorelease]; return _fILECATALYSTFAULTReasonCode; } /** * Initialize this instance of FILECATALYSTFAULTReasonCode according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTFAULTReasonCode to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTFAULTReasonCode from an XML reader. The element to be read is * "{http://filecatalyst.com/fault}reason". * * @param reader The XML reader. * @return The FILECATALYSTFAULTReasonCode. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTFAULTReasonCode *_reasonCode = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/fault}reason."]; } } if (xmlStrcmp(BAD_CAST "reason", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/fault", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/fault}reason."); #endif _reasonCode = (FILECATALYSTFAULTReasonCode *)[FILECATALYSTFAULTReasonCode readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/fault}reason."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTFAULTReasonCode. Expected element {http://filecatalyst.com/fault}reason. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTFAULTReasonCode. Expected element {http://filecatalyst.com/fault}reason. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _reasonCode; } /** * Writes this FILECATALYSTFAULTReasonCode to XML under element name "{http://filecatalyst.com/fault}reason". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _reasonCode The ReasonCode to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTFAULTReasonCode to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "fault", BAD_CAST "reason", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/fault}reason. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/fault}reason..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:fault", BAD_CAST "http://filecatalyst.com/fault"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:fault' on '{http://filecatalyst.com/fault}reason'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/fault}reason..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/fault}reasonCode for root element {http://filecatalyst.com/fault}reason..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/fault}reasonCode for root element {http://filecatalyst.com/fault}reason..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/fault}reason. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "text", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}text of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}text of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setReason: __child]; return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self reason]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "text", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}text."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}text..."); #endif [[self reason] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}text..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}text."]; } } } @end /* implementation FILECATALYSTFAULTReasonCode (JAXB) */ #endif /* DEF_FILECATALYSTFAULTReasonCode_M */ #ifndef DEF_FILECATALYSTFAULTValueCode_M #define DEF_FILECATALYSTFAULTValueCode_M /** * Subcode. */ @implementation FILECATALYSTFAULTValueCode /** * Code value. */ - (NSString *) value { return _value; } /** * Code value. */ - (void) setValue: (NSString *) newValue { [newValue retain]; [_value release]; _value = newValue; } - (void) dealloc { [self setValue: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTFAULTValueCode *_fILECATALYSTFAULTValueCode; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTFAULTValueCode = (FILECATALYSTFAULTValueCode *) [FILECATALYSTFAULTValueCode readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTFAULTValueCode; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTFAULTValueCode */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTFAULTValueCode (JAXB) @end /*interface FILECATALYSTFAULTValueCode (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTFAULTValueCode (JAXB) /** * Read an instance of FILECATALYSTFAULTValueCode from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTFAULTValueCode defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTFAULTValueCode *_fILECATALYSTFAULTValueCode = [[FILECATALYSTFAULTValueCode alloc] init]; NS_DURING { [_fILECATALYSTFAULTValueCode initWithReader: reader]; } NS_HANDLER { _fILECATALYSTFAULTValueCode = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTFAULTValueCode autorelease]; return _fILECATALYSTFAULTValueCode; } /** * Initialize this instance of FILECATALYSTFAULTValueCode according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTFAULTValueCode to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTFAULTValueCode from an XML reader. The element to be read is * "{http://filecatalyst.com/fault}subcode". * * @param reader The XML reader. * @return The FILECATALYSTFAULTValueCode. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTFAULTValueCode *_valueCode = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/fault}subcode."]; } } if (xmlStrcmp(BAD_CAST "subcode", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/fault", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/fault}subcode."); #endif _valueCode = (FILECATALYSTFAULTValueCode *)[FILECATALYSTFAULTValueCode readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/fault}subcode."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTFAULTValueCode. Expected element {http://filecatalyst.com/fault}subcode. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTFAULTValueCode. Expected element {http://filecatalyst.com/fault}subcode. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _valueCode; } /** * Writes this FILECATALYSTFAULTValueCode to XML under element name "{http://filecatalyst.com/fault}subcode". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _valueCode The ValueCode to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTFAULTValueCode to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "fault", BAD_CAST "subcode", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/fault}subcode. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/fault}subcode..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:fault", BAD_CAST "http://filecatalyst.com/fault"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:fault' on '{http://filecatalyst.com/fault}subcode'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/fault}subcode..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/fault}valueCode for root element {http://filecatalyst.com/fault}subcode..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/fault}valueCode for root element {http://filecatalyst.com/fault}subcode..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/fault}subcode. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "value", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}value of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}value of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setValue: __child]; return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self value]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "value", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}value."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}value..."); #endif [[self value] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}value..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}value."]; } } } @end /* implementation FILECATALYSTFAULTValueCode (JAXB) */ #endif /* DEF_FILECATALYSTFAULTValueCode_M */ #ifndef DEF_FILECATALYSTMODELFieldModel_M #define DEF_FILECATALYSTMODELFieldModel_M /** * Field model class */ @implementation FILECATALYSTMODELFieldModel /** * Help Text - additional text shown to the end user next to the input field. * This text may contain HTML */ - (NSString *) description { return _description; } /** * Help Text - additional text shown to the end user next to the input field. * This text may contain HTML */ - (void) setDescription: (NSString *) newDescription { [newDescription retain]; [_description release]; _description = newDescription; } /** * Display Format - additional formatting information to the generated HTML field * for example: 'ROWS=25 COLS=80' to a textarea field. This field can also be used to set custom * CSS definitions.
* This field can also be used to control the functionality of certain fields: *
    *
  • For date field the display format may also contain 'allowpastdate' keyword * which will allow the user to select dates in the past.
    *
*/ - (NSString *) displayFormat { return _displayFormat; } /** * Display Format - additional formatting information to the generated HTML field * for example: 'ROWS=25 COLS=80' to a textarea field. This field can also be used to set custom * CSS definitions.
* This field can also be used to control the functionality of certain fields: *
    *
  • For date field the display format may also contain 'allowpastdate' keyword * which will allow the user to select dates in the past.
    *
*/ - (void) setDisplayFormat: (NSString *) newDisplayFormat { [newDisplayFormat retain]; [_displayFormat release]; _displayFormat = newDisplayFormat; } /** * The user friendly label displayed on the Job entry form. */ - (NSString *) header { return _header; } /** * The user friendly label displayed on the Job entry form. */ - (void) setHeader: (NSString *) newHeader { [newHeader retain]; [_header release]; _header = newHeader; } /** * Help Button Text - when this field is set the following icon will be shown to the user: * help button * any text entered here will be shown when a user hovers over the question icon. */ - (NSString *) helpButtonText { return _helpButtonText; } /** * Help Button Text - when this field is set the following icon will be shown to the user: * help button * any text entered here will be shown when a user hovers over the question icon. */ - (void) setHelpButtonText: (NSString *) newHelpButtonText { [newHelpButtonText retain]; [_helpButtonText release]; _helpButtonText = newHelpButtonText; } /** * Field Name - used to identify this field in the system. * This value is never visible by the user and must not contain any non-alpha numeric characters. */ - (NSString *) name { return _name; } /** * Field Name - used to identify this field in the system. * This value is never visible by the user and must not contain any non-alpha numeric characters. */ - (void) setName: (NSString *) newName { [newName retain]; [_name release]; _name = newName; } /** * Tax amount. */ - (double *) taxAmount { return _taxAmount; } /** * Tax amount. */ - (void) setTaxAmount: (double *) newTaxAmount { if (_taxAmount != NULL) { free(_taxAmount); } _taxAmount = newTaxAmount; } /** * Type specific. Operand to use for certain field types. * See fieldOperandActionType. */ - (enum FILECATALYSTMODELFieldOperandActionType *) operand { return _operand; } /** * Type specific. Operand to use for certain field types. * See fieldOperandActionType. */ - (void) setOperand: (enum FILECATALYSTMODELFieldOperandActionType *) newOperand { if (_operand != NULL) { free(_operand); } _operand = newOperand; } /** * Flag indicating if this fields should be shown on the Job Summary. */ - (BOOL) showOnJobSummary { return _showOnJobSummary; } /** * Flag indicating if this fields should be shown on the Job Summary. */ - (void) setShowOnJobSummary: (BOOL) newShowOnJobSummary { _showOnJobSummary = newShowOnJobSummary; } /** * Flag indicating if this fields should be shown on the report. */ - (BOOL) showOnReport { return _showOnReport; } /** * Flag indicating if this fields should be shown on the report. */ - (void) setShowOnReport: (BOOL) newShowOnReport { _showOnReport = newShowOnReport; } /** *

Each field can be one of these types: *

    *
  • text
  • *
  • number (number only)
  • *
  • quantity (must be a number it also has special meaning for price calculations. * There can only be one quantity field per form)
  • *
  • textarea (multi-line text field)
  • *
  • date (enables date-picker button and enforces correct date format) * The selected date MUST be in the future unless keyword 'allowpastdate' is present in the "Display Format" section. * The format for the date and other properties related to the date picker can be configured via the language file.
  • *
  • select (list of possible options provided)
  • *
  • email address
  • *
  • recipient (list of possible recipients for the uploaded files). If a recipient field is added to an order form, * the system administrator is not notified of a new Job, only the selected recipient.
  • *
  • tax (used in systems where pricing is automatically calculated)
  • *
  • ftpserver - this field is used to customize the list of FTP/FC servers a user can upload to. This will override the value of preferred server under * the user's profile
  • *
  • expireupload - this field is used to specify when an upload expires. Field is only used when RecipeintEmail is on the order form.
  • *
  • password (used to set a password to download the files) the password is not sent in the email notification to the recipient, it has to be * communicated via a different mean like telephone or another email message
  • *
  • pin (used to set a pin to download the files. The pin is generated automatically by the system and is sent in the email to the recipient.)
  • *
  • emailAuth (Used for secure downloads. If this field is in use, the recipient will receive a secure ID * after visiting the first link they get and this ID will be valid for only 15mins.)
  • *
  • download_method (This is a drop down which allows the user to specify a method for which the recipients will be able to download the file(s). * When this field is added to the Field list, two fields(xSecurePin and xSecurePassword) will be automatically added, and when the field is removed, * these fields will be removed also.)
  • *
  • notification (This is another drop down which will allow users to specify whether or not they would like to be notified when one or all the * recipients have downloaded the file(s) and status changes.)
  • *
* * See fieldType. */ - (enum FILECATALYSTMODELFieldType *) fieldType { return _fieldType; } /** *

Each field can be one of these types: *

    *
  • text
  • *
  • number (number only)
  • *
  • quantity (must be a number it also has special meaning for price calculations. * There can only be one quantity field per form)
  • *
  • textarea (multi-line text field)
  • *
  • date (enables date-picker button and enforces correct date format) * The selected date MUST be in the future unless keyword 'allowpastdate' is present in the "Display Format" section. * The format for the date and other properties related to the date picker can be configured via the language file.
  • *
  • select (list of possible options provided)
  • *
  • email address
  • *
  • recipient (list of possible recipients for the uploaded files). If a recipient field is added to an order form, * the system administrator is not notified of a new Job, only the selected recipient.
  • *
  • tax (used in systems where pricing is automatically calculated)
  • *
  • ftpserver - this field is used to customize the list of FTP/FC servers a user can upload to. This will override the value of preferred server under * the user's profile
  • *
  • expireupload - this field is used to specify when an upload expires. Field is only used when RecipeintEmail is on the order form.
  • *
  • password (used to set a password to download the files) the password is not sent in the email notification to the recipient, it has to be * communicated via a different mean like telephone or another email message
  • *
  • pin (used to set a pin to download the files. The pin is generated automatically by the system and is sent in the email to the recipient.)
  • *
  • emailAuth (Used for secure downloads. If this field is in use, the recipient will receive a secure ID * after visiting the first link they get and this ID will be valid for only 15mins.)
  • *
  • download_method (This is a drop down which allows the user to specify a method for which the recipients will be able to download the file(s). * When this field is added to the Field list, two fields(xSecurePin and xSecurePassword) will be automatically added, and when the field is removed, * these fields will be removed also.)
  • *
  • notification (This is another drop down which will allow users to specify whether or not they would like to be notified when one or all the * recipients have downloaded the file(s) and status changes.)
  • *
* * See fieldType. */ - (void) setFieldType: (enum FILECATALYSTMODELFieldType *) newFieldType { if (_fieldType != NULL) { free(_fieldType); } _fieldType = newFieldType; } /** * Hyperlink reference to the resource */ - (NSURL *) href { return _href; } /** * Hyperlink reference to the resource */ - (void) setHref: (NSURL *) newHref { [newHref retain]; [_href release]; _href = newHref; } /** * Items associated with this field type. */ - (FILECATALYSTMODELItemsModel *) items { return _items; } /** * Items associated with this field type. */ - (void) setItems: (FILECATALYSTMODELItemsModel *) newItems { [newItems retain]; [_items release]; _items = newItems; } /** * Discount levels. */ - (FILECATALYSTMODELDiscountLevelsModel *) discountLevels { return _discountLevels; } /** * Discount levels. */ - (void) setDiscountLevels: (FILECATALYSTMODELDiscountLevelsModel *) newDiscountLevels { [newDiscountLevels retain]; [_discountLevels release]; _discountLevels = newDiscountLevels; } - (void) dealloc { [self setDescription: nil]; [self setDisplayFormat: nil]; [self setHeader: nil]; [self setHelpButtonText: nil]; [self setName: nil]; [self setTaxAmount: NULL]; [self setOperand: NULL]; [self setFieldType: NULL]; [self setHref: nil]; [self setItems: nil]; [self setDiscountLevels: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELFieldModel *_fILECATALYSTMODELFieldModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELFieldModel = (FILECATALYSTMODELFieldModel *) [FILECATALYSTMODELFieldModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELFieldModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELFieldModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELFieldModel (JAXB) @end /*interface FILECATALYSTMODELFieldModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELFieldModel (JAXB) /** * Read an instance of FILECATALYSTMODELFieldModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELFieldModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELFieldModel *_fILECATALYSTMODELFieldModel = [[FILECATALYSTMODELFieldModel alloc] init]; NS_DURING { [_fILECATALYSTMODELFieldModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELFieldModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELFieldModel autorelease]; return _fILECATALYSTMODELFieldModel; } /** * Initialize this instance of FILECATALYSTMODELFieldModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELFieldModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELFieldModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}field". * * @param reader The XML reader. * @return The FILECATALYSTMODELFieldModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELFieldModel *_fieldModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}field."]; } } if (xmlStrcmp(BAD_CAST "field", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}field."); #endif _fieldModel = (FILECATALYSTMODELFieldModel *)[FILECATALYSTMODELFieldModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}field."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELFieldModel. Expected element {http://filecatalyst.com/model}field. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELFieldModel. Expected element {http://filecatalyst.com/model}field. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _fieldModel; } /** * Writes this FILECATALYSTMODELFieldModel to XML under element name "{http://filecatalyst.com/model}field". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _fieldModel The FieldModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELFieldModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "field", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}field. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}field..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}field'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}field..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}fieldModel for root element {http://filecatalyst.com/model}field..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}fieldModel for root element {http://filecatalyst.com/model}field..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}field. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "description", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}description..."); #endif [self setDescription: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}description..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "displayFormat", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}displayFormat..."); #endif [self setDisplayFormat: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}displayFormat..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "header", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}header..."); #endif [self setHeader: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}header..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "helpButtonText", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}helpButtonText..."); #endif [self setHelpButtonText: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}helpButtonText..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}name..."); #endif [self setName: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}name..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "taxAmount", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}taxAmount..."); #endif _child_accessor = xmlTextReaderReadDoubleType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}taxAmount."]; } [self setTaxAmount: ((double*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}taxAmount..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "operand", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}operand..."); #endif _child_accessor = xmlTextReaderReadFILECATALYSTMODELFieldOperandActionTypeType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}operand."]; } [self setOperand: ((enum FILECATALYSTMODELFieldOperandActionType*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}operand..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "showOnJobSummary", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}showOnJobSummary..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}showOnJobSummary."]; } [self setShowOnJobSummary: *((BOOL*) _child_accessor)]; free(_child_accessor); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}showOnJobSummary..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "showOnReport", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}showOnReport..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}showOnReport."]; } [self setShowOnReport: *((BOOL*) _child_accessor)]; free(_child_accessor); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}showOnReport..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "fieldType", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}fieldType..."); #endif _child_accessor = xmlTextReaderReadFILECATALYSTMODELFieldTypeType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}fieldType."]; } [self setFieldType: ((enum FILECATALYSTMODELFieldType*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}fieldType..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "href", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}href..."); #endif [self setHref: (NSURL*) [NSURL readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}href..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "items", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}items of type {http://filecatalyst.com/model}itemsModel."); #endif __child = [FILECATALYSTMODELItemsModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}items of type {http://filecatalyst.com/model}itemsModel."); #endif [self setItems: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "discountLevels", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}discountLevels of type {http://filecatalyst.com/model}discountLevelsModel."); #endif __child = [FILECATALYSTMODELDiscountLevelsModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}discountLevels of type {http://filecatalyst.com/model}discountLevelsModel."); #endif [self setDiscountLevels: __child]; return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self description]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "description", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}description."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}description..."); #endif [[self description] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}description..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}description."]; } } if ([self displayFormat]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "displayFormat", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}displayFormat."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}displayFormat..."); #endif [[self displayFormat] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}displayFormat..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}displayFormat."]; } } if ([self header]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "header", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}header."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}header..."); #endif [[self header] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}header..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}header."]; } } if ([self helpButtonText]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "helpButtonText", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}helpButtonText."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}helpButtonText..."); #endif [[self helpButtonText] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}helpButtonText..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}helpButtonText."]; } } if ([self name]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}name."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}name..."); #endif [[self name] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}name..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}name."]; } } if ([self taxAmount] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "taxAmount", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}taxAmount."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}taxAmount..."); #endif status = xmlTextWriterWriteDoubleType(writer, [self taxAmount]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}taxAmount."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}taxAmount..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}taxAmount."]; } } if ([self operand] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "operand", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}operand."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}operand..."); #endif status = xmlTextWriterWriteFILECATALYSTMODELFieldOperandActionTypeType(writer, [self operand]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}operand."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}operand..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}operand."]; } } if (YES) { //always write the primitive attributes... status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "showOnJobSummary", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}showOnJobSummary."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}showOnJobSummary..."); #endif status = xmlTextWriterWriteBooleanType(writer, &_showOnJobSummary); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}showOnJobSummary."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}showOnJobSummary..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}showOnJobSummary."]; } } if (YES) { //always write the primitive attributes... status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "showOnReport", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}showOnReport."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}showOnReport..."); #endif status = xmlTextWriterWriteBooleanType(writer, &_showOnReport); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}showOnReport."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}showOnReport..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}showOnReport."]; } } if ([self fieldType] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "fieldType", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}fieldType."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}fieldType..."); #endif status = xmlTextWriterWriteFILECATALYSTMODELFieldTypeType(writer, [self fieldType]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}fieldType."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}fieldType..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}fieldType."]; } } if ([self href]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "href", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}href."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}href..."); #endif [[self href] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}href..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}href."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self items]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "items", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}items."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}items..."); #endif [[self items] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}items..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}items."]; } } if ([self discountLevels]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "discountLevels", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}discountLevels."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}discountLevels..."); #endif [[self discountLevels] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}discountLevels..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}discountLevels."]; } } } @end /* implementation FILECATALYSTMODELFieldModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELFieldModel_M */ #ifndef DEF_FILECATALYSTMODELFileFieldsModel_M #define DEF_FILECATALYSTMODELFileFieldsModel_M /** * File fields model class */ @implementation FILECATALYSTMODELFileFieldsModel /** *

The fields can be shown on the form either:

*
    *
  • vertically (Fields Per Row = 1)
  • *
  • horizontally (Fields Per Row >= the number of fields to be shown)
  • *
  • in a table (Fields Per Row > 1 and < the number of fields to be shown)
  • *
*/ - (int *) fieldsPerRow { return _fieldsPerRow; } /** *

The fields can be shown on the form either:

*
    *
  • vertically (Fields Per Row = 1)
  • *
  • horizontally (Fields Per Row >= the number of fields to be shown)
  • *
  • in a table (Fields Per Row > 1 and < the number of fields to be shown)
  • *
*/ - (void) setFieldsPerRow: (int *) newFieldsPerRow { if (_fieldsPerRow != NULL) { free(_fieldsPerRow); } _fieldsPerRow = newFieldsPerRow; } /** * List of form fields. */ - (NSArray *) formField { return _formField; } /** * List of form fields. */ - (void) setFormField: (NSArray *) newFormField { [newFormField retain]; [_formField release]; _formField = newFormField; } - (void) dealloc { [self setFieldsPerRow: NULL]; [self setFormField: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELFileFieldsModel *_fILECATALYSTMODELFileFieldsModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELFileFieldsModel = (FILECATALYSTMODELFileFieldsModel *) [FILECATALYSTMODELFileFieldsModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELFileFieldsModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELFileFieldsModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELFileFieldsModel (JAXB) @end /*interface FILECATALYSTMODELFileFieldsModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELFileFieldsModel (JAXB) /** * Read an instance of FILECATALYSTMODELFileFieldsModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELFileFieldsModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELFileFieldsModel *_fILECATALYSTMODELFileFieldsModel = [[FILECATALYSTMODELFileFieldsModel alloc] init]; NS_DURING { [_fILECATALYSTMODELFileFieldsModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELFileFieldsModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELFileFieldsModel autorelease]; return _fILECATALYSTMODELFileFieldsModel; } /** * Initialize this instance of FILECATALYSTMODELFileFieldsModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELFileFieldsModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELFileFieldsModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}fileFields". * * @param reader The XML reader. * @return The FILECATALYSTMODELFileFieldsModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELFileFieldsModel *_fileFieldsModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}fileFields."]; } } if (xmlStrcmp(BAD_CAST "fileFields", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}fileFields."); #endif _fileFieldsModel = (FILECATALYSTMODELFileFieldsModel *)[FILECATALYSTMODELFileFieldsModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}fileFields."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELFileFieldsModel. Expected element {http://filecatalyst.com/model}fileFields. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELFileFieldsModel. Expected element {http://filecatalyst.com/model}fileFields. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _fileFieldsModel; } /** * Writes this FILECATALYSTMODELFileFieldsModel to XML under element name "{http://filecatalyst.com/model}fileFields". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _fileFieldsModel The FileFieldsModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELFileFieldsModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "fileFields", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}fileFields. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}fileFields..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}fileFields'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}fileFields..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}fileFieldsModel for root element {http://filecatalyst.com/model}fileFields..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}fileFieldsModel for root element {http://filecatalyst.com/model}fileFields..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}fileFields. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "fieldsPerRow", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}fieldsPerRow..."); #endif _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}fieldsPerRow."]; } [self setFieldsPerRow: ((int*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}fieldsPerRow..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "formField", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}formField of type {http://filecatalyst.com/model}formFieldModel."); #endif __child = [FILECATALYSTMODELFormFieldModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}formField of type {http://filecatalyst.com/model}formFieldModel."); #endif if ([self formField]) { [self setFormField: [[self formField] arrayByAddingObject: __child]]; } else { [self setFormField: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self fieldsPerRow] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "fieldsPerRow", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}fieldsPerRow."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}fieldsPerRow..."); #endif status = xmlTextWriterWriteIntType(writer, [self fieldsPerRow]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}fieldsPerRow."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}fieldsPerRow..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}fieldsPerRow."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self formField]) { __enumerator = [[self formField] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "formField", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}formField."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}formField..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}formField..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}formField."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELFileFieldsModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELFileFieldsModel_M */ #ifndef DEF_FILECATALYSTMODELDiscountLevelsModel_M #define DEF_FILECATALYSTMODELDiscountLevelsModel_M /** * Discounts level model class */ @implementation FILECATALYSTMODELDiscountLevelsModel /** * List of discount amounts. */ - (NSArray *) discountLevel { return _discountLevel; } /** * List of discount amounts. */ - (void) setDiscountLevel: (NSArray *) newDiscountLevel { [newDiscountLevel retain]; [_discountLevel release]; _discountLevel = newDiscountLevel; } - (void) dealloc { [self setDiscountLevel: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELDiscountLevelsModel *_fILECATALYSTMODELDiscountLevelsModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELDiscountLevelsModel = (FILECATALYSTMODELDiscountLevelsModel *) [FILECATALYSTMODELDiscountLevelsModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELDiscountLevelsModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELDiscountLevelsModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELDiscountLevelsModel (JAXB) @end /*interface FILECATALYSTMODELDiscountLevelsModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELDiscountLevelsModel (JAXB) /** * Read an instance of FILECATALYSTMODELDiscountLevelsModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELDiscountLevelsModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELDiscountLevelsModel *_fILECATALYSTMODELDiscountLevelsModel = [[FILECATALYSTMODELDiscountLevelsModel alloc] init]; NS_DURING { [_fILECATALYSTMODELDiscountLevelsModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELDiscountLevelsModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELDiscountLevelsModel autorelease]; return _fILECATALYSTMODELDiscountLevelsModel; } /** * Initialize this instance of FILECATALYSTMODELDiscountLevelsModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELDiscountLevelsModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELDiscountLevelsModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}discountLevels". * * @param reader The XML reader. * @return The FILECATALYSTMODELDiscountLevelsModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELDiscountLevelsModel *_discountLevelsModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}discountLevels."]; } } if (xmlStrcmp(BAD_CAST "discountLevels", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}discountLevels."); #endif _discountLevelsModel = (FILECATALYSTMODELDiscountLevelsModel *)[FILECATALYSTMODELDiscountLevelsModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}discountLevels."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELDiscountLevelsModel. Expected element {http://filecatalyst.com/model}discountLevels. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELDiscountLevelsModel. Expected element {http://filecatalyst.com/model}discountLevels. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _discountLevelsModel; } /** * Writes this FILECATALYSTMODELDiscountLevelsModel to XML under element name "{http://filecatalyst.com/model}discountLevels". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _discountLevelsModel The DiscountLevelsModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELDiscountLevelsModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "discountLevels", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}discountLevels. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}discountLevels..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}discountLevels'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}discountLevels..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}discountLevelsModel for root element {http://filecatalyst.com/model}discountLevels..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}discountLevelsModel for root element {http://filecatalyst.com/model}discountLevels..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}discountLevels. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "discountLevel", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}discountLevel of type {http://filecatalyst.com/model}discountLevelModel."); #endif __child = [FILECATALYSTMODELDiscountLevelModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}discountLevel of type {http://filecatalyst.com/model}discountLevelModel."); #endif if ([self discountLevel]) { [self setDiscountLevel: [[self discountLevel] arrayByAddingObject: __child]]; } else { [self setDiscountLevel: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self discountLevel]) { __enumerator = [[self discountLevel] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "discountLevel", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}discountLevel."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}discountLevel..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}discountLevel..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}discountLevel."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELDiscountLevelsModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELDiscountLevelsModel_M */ #ifndef DEF_FILECATALYSTMODELDiscountLevelModel_M #define DEF_FILECATALYSTMODELDiscountLevelModel_M /** * Discount level model class */ @implementation FILECATALYSTMODELDiscountLevelModel /** * Discount amount. */ - (int *) amount { return _amount; } /** * Discount amount. */ - (void) setAmount: (int *) newAmount { if (_amount != NULL) { free(_amount); } _amount = newAmount; } - (void) dealloc { [self setAmount: NULL]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELDiscountLevelModel *_fILECATALYSTMODELDiscountLevelModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELDiscountLevelModel = (FILECATALYSTMODELDiscountLevelModel *) [FILECATALYSTMODELDiscountLevelModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELDiscountLevelModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELDiscountLevelModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELDiscountLevelModel (JAXB) @end /*interface FILECATALYSTMODELDiscountLevelModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELDiscountLevelModel (JAXB) /** * Read an instance of FILECATALYSTMODELDiscountLevelModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELDiscountLevelModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELDiscountLevelModel *_fILECATALYSTMODELDiscountLevelModel = [[FILECATALYSTMODELDiscountLevelModel alloc] init]; NS_DURING { [_fILECATALYSTMODELDiscountLevelModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELDiscountLevelModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELDiscountLevelModel autorelease]; return _fILECATALYSTMODELDiscountLevelModel; } /** * Initialize this instance of FILECATALYSTMODELDiscountLevelModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELDiscountLevelModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELDiscountLevelModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}discountLevel". * * @param reader The XML reader. * @return The FILECATALYSTMODELDiscountLevelModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELDiscountLevelModel *_discountLevelModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}discountLevel."]; } } if (xmlStrcmp(BAD_CAST "discountLevel", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}discountLevel."); #endif _discountLevelModel = (FILECATALYSTMODELDiscountLevelModel *)[FILECATALYSTMODELDiscountLevelModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}discountLevel."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELDiscountLevelModel. Expected element {http://filecatalyst.com/model}discountLevel. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELDiscountLevelModel. Expected element {http://filecatalyst.com/model}discountLevel. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _discountLevelModel; } /** * Writes this FILECATALYSTMODELDiscountLevelModel to XML under element name "{http://filecatalyst.com/model}discountLevel". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _discountLevelModel The DiscountLevelModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELDiscountLevelModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "discountLevel", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}discountLevel. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}discountLevel..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}discountLevel'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}discountLevel..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}discountLevelModel for root element {http://filecatalyst.com/model}discountLevel..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}discountLevelModel for root element {http://filecatalyst.com/model}discountLevel..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}discountLevel. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "amount", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}amount..."); #endif _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}amount."]; } [self setAmount: ((int*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}amount..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self amount] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "amount", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}amount."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}amount..."); #endif status = xmlTextWriterWriteIntType(writer, [self amount]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}amount."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}amount..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}amount."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; } @end /* implementation FILECATALYSTMODELDiscountLevelModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELDiscountLevelModel_M */ #ifndef DEF_FILECATALYSTFAULTRESTFault_M #define DEF_FILECATALYSTFAULTRESTFault_M /** * This holds return error data { "fault": { "code": { "value": "Sender", "subcode": { "value": "InternalError" } }, "reason": { "text": "Internal Error Detected." } } */ @implementation FILECATALYSTFAULTRESTFault /** * Fault code. */ - (FILECATALYSTFAULTFaultCode *) faultCode { return _faultCode; } /** * Fault code. */ - (void) setFaultCode: (FILECATALYSTFAULTFaultCode *) newFaultCode { [newFaultCode retain]; [_faultCode release]; _faultCode = newFaultCode; } /** * Fault reason. */ - (FILECATALYSTFAULTReasonCode *) reasonCode { return _reasonCode; } /** * Fault reason. */ - (void) setReasonCode: (FILECATALYSTFAULTReasonCode *) newReasonCode { [newReasonCode retain]; [_reasonCode release]; _reasonCode = newReasonCode; } - (void) dealloc { [self setFaultCode: nil]; [self setReasonCode: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTFAULTRESTFault *_fILECATALYSTFAULTRESTFault; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTFAULTRESTFault = (FILECATALYSTFAULTRESTFault *) [FILECATALYSTFAULTRESTFault readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTFAULTRESTFault; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTFAULTRESTFault */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTFAULTRESTFault (JAXB) @end /*interface FILECATALYSTFAULTRESTFault (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTFAULTRESTFault (JAXB) /** * Read an instance of FILECATALYSTFAULTRESTFault from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTFAULTRESTFault defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTFAULTRESTFault *_fILECATALYSTFAULTRESTFault = [[FILECATALYSTFAULTRESTFault alloc] init]; NS_DURING { [_fILECATALYSTFAULTRESTFault initWithReader: reader]; } NS_HANDLER { _fILECATALYSTFAULTRESTFault = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTFAULTRESTFault autorelease]; return _fILECATALYSTFAULTRESTFault; } /** * Initialize this instance of FILECATALYSTFAULTRESTFault according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTFAULTRESTFault to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTFAULTRESTFault from an XML reader. The element to be read is * "{http://filecatalyst.com/fault}fault". * * @param reader The XML reader. * @return The FILECATALYSTFAULTRESTFault. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTFAULTRESTFault *_rESTFault = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/fault}fault."]; } } if (xmlStrcmp(BAD_CAST "fault", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/fault", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/fault}fault."); #endif _rESTFault = (FILECATALYSTFAULTRESTFault *)[FILECATALYSTFAULTRESTFault readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/fault}fault."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTFAULTRESTFault. Expected element {http://filecatalyst.com/fault}fault. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTFAULTRESTFault. Expected element {http://filecatalyst.com/fault}fault. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _rESTFault; } /** * Writes this FILECATALYSTFAULTRESTFault to XML under element name "{http://filecatalyst.com/fault}fault". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _rESTFault The RESTFault to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTFAULTRESTFault to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "fault", BAD_CAST "fault", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/fault}fault. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/fault}fault..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:fault", BAD_CAST "http://filecatalyst.com/fault"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:fault' on '{http://filecatalyst.com/fault}fault'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/fault}fault..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/fault}RESTFault for root element {http://filecatalyst.com/fault}fault..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/fault}RESTFault for root element {http://filecatalyst.com/fault}fault..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/fault}fault. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "code", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}code of type {http://filecatalyst.com/fault}faultCode."); #endif __child = [FILECATALYSTFAULTFaultCode readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}code of type {http://filecatalyst.com/fault}faultCode."); #endif [self setFaultCode: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "reason", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}reason of type {http://filecatalyst.com/fault}reasonCode."); #endif __child = [FILECATALYSTFAULTReasonCode readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}reason of type {http://filecatalyst.com/fault}reasonCode."); #endif [self setReasonCode: __child]; return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self faultCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "code", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}code."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}code..."); #endif [[self faultCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}code..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}code."]; } } if ([self reasonCode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "reason", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}reason."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}reason..."); #endif [[self reasonCode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}reason..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}reason."]; } } } @end /* implementation FILECATALYSTFAULTRESTFault (JAXB) */ #endif /* DEF_FILECATALYSTFAULTRESTFault_M */ #ifndef DEF_FILECATALYSTMODELFormFieldModel_M #define DEF_FILECATALYSTMODELFormFieldModel_M /** * Form field model class */ @implementation FILECATALYSTMODELFormFieldModel /** * Flag to indicate if this field type is a builtin_html type. */ - (BOOL *) builtinHtmlType { return _builtinHtmlType; } /** * Flag to indicate if this field type is a builtin_html type. */ - (void) setBuiltinHtmlType: (BOOL *) newBuiltinHtmlType { if (_builtinHtmlType != NULL) { free(_builtinHtmlType); } _builtinHtmlType = newBuiltinHtmlType; } /** * Set a default value for the field type. */ - (NSString *) defaultValue { return _defaultValue; } /** * Set a default value for the field type. */ - (void) setDefaultValue: (NSString *) newDefaultValue { [newDefaultValue retain]; [_defaultValue release]; _defaultValue = newDefaultValue; } /** * If set then the field is not shown on the order form. * This option can be useful if it is desired to set a field to a default value as above, but * not show the value to the customer - this information for use when the order arrives for processing, or to set * default pricing. */ - (BOOL *) hidden { return _hidden; } /** * If set then the field is not shown on the order form. * This option can be useful if it is desired to set a field to a default value as above, but * not show the value to the customer - this information for use when the order arrives for processing, or to set * default pricing. */ - (void) setHidden: (BOOL *) newHidden { if (_hidden != NULL) { free(_hidden); } _hidden = newHidden; } /** * When set, the customer cannot change the value . */ - (BOOL *) locked { return _locked; } /** * When set, the customer cannot change the value . */ - (void) setLocked: (BOOL *) newLocked { if (_locked != NULL) { free(_locked); } _locked = newLocked; } /** * Name of the user defined field or a builtin_html field. */ - (NSString *) name { return _name; } /** * Name of the user defined field or a builtin_html field. */ - (void) setName: (NSString *) newName { [newName retain]; [_name release]; _name = newName; } /** * When set, the customer must enter a value. */ - (BOOL *) required { return _required; } /** * When set, the customer must enter a value. */ - (void) setRequired: (BOOL *) newRequired { if (_required != NULL) { free(_required); } _required = newRequired; } /** * Hyperlink reference to the resource */ - (NSURL *) href { return _href; } /** * Hyperlink reference to the resource */ - (void) setHref: (NSURL *) newHref { [newHref retain]; [_href release]; _href = newHref; } - (void) dealloc { [self setBuiltinHtmlType: NULL]; [self setDefaultValue: nil]; [self setHidden: NULL]; [self setLocked: NULL]; [self setName: nil]; [self setRequired: NULL]; [self setHref: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELFormFieldModel *_fILECATALYSTMODELFormFieldModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELFormFieldModel = (FILECATALYSTMODELFormFieldModel *) [FILECATALYSTMODELFormFieldModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELFormFieldModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELFormFieldModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELFormFieldModel (JAXB) @end /*interface FILECATALYSTMODELFormFieldModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELFormFieldModel (JAXB) /** * Read an instance of FILECATALYSTMODELFormFieldModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELFormFieldModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELFormFieldModel *_fILECATALYSTMODELFormFieldModel = [[FILECATALYSTMODELFormFieldModel alloc] init]; NS_DURING { [_fILECATALYSTMODELFormFieldModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELFormFieldModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELFormFieldModel autorelease]; return _fILECATALYSTMODELFormFieldModel; } /** * Initialize this instance of FILECATALYSTMODELFormFieldModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELFormFieldModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELFormFieldModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}formField". * * @param reader The XML reader. * @return The FILECATALYSTMODELFormFieldModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELFormFieldModel *_formFieldModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}formField."]; } } if (xmlStrcmp(BAD_CAST "formField", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}formField."); #endif _formFieldModel = (FILECATALYSTMODELFormFieldModel *)[FILECATALYSTMODELFormFieldModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}formField."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELFormFieldModel. Expected element {http://filecatalyst.com/model}formField. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELFormFieldModel. Expected element {http://filecatalyst.com/model}formField. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _formFieldModel; } /** * Writes this FILECATALYSTMODELFormFieldModel to XML under element name "{http://filecatalyst.com/model}formField". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _formFieldModel The FormFieldModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELFormFieldModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "formField", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}formField. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}formField..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}formField'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}formField..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}formFieldModel for root element {http://filecatalyst.com/model}formField..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}formFieldModel for root element {http://filecatalyst.com/model}formField..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}formField. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "builtinHtmlType", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}builtinHtmlType..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}builtinHtmlType."]; } [self setBuiltinHtmlType: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}builtinHtmlType..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "defaultValue", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}defaultValue..."); #endif [self setDefaultValue: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}defaultValue..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "hidden", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}hidden..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}hidden."]; } [self setHidden: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}hidden..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "locked", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}locked..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}locked."]; } [self setLocked: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}locked..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}name..."); #endif [self setName: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}name..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "required", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}required..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}required."]; } [self setRequired: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}required..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "href", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}href..."); #endif [self setHref: (NSURL*) [NSURL readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}href..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self builtinHtmlType] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "builtinHtmlType", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}builtinHtmlType."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}builtinHtmlType..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self builtinHtmlType]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}builtinHtmlType."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}builtinHtmlType..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}builtinHtmlType."]; } } if ([self defaultValue]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "defaultValue", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}defaultValue."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}defaultValue..."); #endif [[self defaultValue] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}defaultValue..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}defaultValue."]; } } if ([self hidden] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "hidden", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}hidden."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}hidden..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self hidden]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}hidden."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}hidden..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}hidden."]; } } if ([self locked] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "locked", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}locked."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}locked..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self locked]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}locked."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}locked..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}locked."]; } } if ([self name]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}name."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}name..."); #endif [[self name] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}name..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}name."]; } } if ([self required] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "required", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}required."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}required..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self required]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}required."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}required..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}required."]; } } if ([self href]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "href", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}href."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}href..."); #endif [[self href] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}href..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}href."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; } @end /* implementation FILECATALYSTMODELFormFieldModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELFormFieldModel_M */ #ifndef DEF_FILECATALYSTMODELFtpsiteModel_M #define DEF_FILECATALYSTMODELFtpsiteModel_M /** * FTP site model class */ @implementation FILECATALYSTMODELFtpsiteModel /** * Flag to indicate if users should be added to the FTP server. */ - (BOOL *) addUserToFCServer { return _addUserToFCServer; } /** * Flag to indicate if users should be added to the FTP server. */ - (void) setAddUserToFCServer: (BOOL *) newAddUserToFCServer { if (_addUserToFCServer != NULL) { free(_addUserToFCServer); } _addUserToFCServer = newAddUserToFCServer; } /** * Company contact address. */ - (NSString *) address { return _address; } /** * Company contact address. */ - (void) setAddress: (NSString *) newAddress { [newAddress retain]; [_address release]; _address = newAddress; } /** * Administrator's email */ - (NSString *) adminEmail { return _adminEmail; } /** * Administrator's email */ - (void) setAdminEmail: (NSString *) newAdminEmail { [newAdminEmail retain]; [_adminEmail release]; _adminEmail = newAdminEmail; } /** * FTP backup directory location. */ - (NSString *) backupDirectory { return _backupDirectory; } /** * FTP backup directory location. */ - (void) setBackupDirectory: (NSString *) newBackupDirectory { [newBackupDirectory retain]; [_backupDirectory release]; _backupDirectory = newBackupDirectory; } /** * Company contact cell phone carrier. * See cellPhoneCarrierType. */ - (enum FILECATALYSTMODELCellPhoneCarrierType *) cellPhoneCarrier { return _cellPhoneCarrier; } /** * Company contact cell phone carrier. * See cellPhoneCarrierType. */ - (void) setCellPhoneCarrier: (enum FILECATALYSTMODELCellPhoneCarrierType *) newCellPhoneCarrier { if (_cellPhoneCarrier != NULL) { free(_cellPhoneCarrier); } _cellPhoneCarrier = newCellPhoneCarrier; } /** * Company contact cell phone number. */ - (NSString *) cellPhoneNumber { return _cellPhoneNumber; } /** * Company contact cell phone number. */ - (void) setCellPhoneNumber: (NSString *) newCellPhoneNumber { [newCellPhoneNumber retain]; [_cellPhoneNumber release]; _cellPhoneNumber = newCellPhoneNumber; } /** * Company name. */ - (NSString *) company { return _company; } /** * Company name. */ - (void) setCompany: (NSString *) newCompany { [newCompany retain]; [_company release]; _company = newCompany; } /** * Flag to enable remote administration of a FileCatalyst server. */ - (BOOL *) enableRemoteAdmin { return _enableRemoteAdmin; } /** * Flag to enable remote administration of a FileCatalyst server. */ - (void) setEnableRemoteAdmin: (BOOL *) newEnableRemoteAdmin { if (_enableRemoteAdmin != NULL) { free(_enableRemoteAdmin); } _enableRemoteAdmin = newEnableRemoteAdmin; } /** * Company fax number. */ - (NSString *) fax { return _fax; } /** * Company fax number. */ - (void) setFax: (NSString *) newFax { [newFax retain]; [_fax release]; _fax = newFax; } /** * This is the actual text that will appear to the end users for the site name. * Default Site ID will be used if this text is not set. */ - (NSString *) friendlyName { return _friendlyName; } /** * This is the actual text that will appear to the end users for the site name. * Default Site ID will be used if this text is not set. */ - (void) setFriendlyName: (NSString *) newFriendlyName { [newFriendlyName retain]; [_friendlyName release]; _friendlyName = newFriendlyName; } /** * FTP host DNS name or IP address. */ - (NSString *) host { return _host; } /** * FTP host DNS name or IP address. */ - (void) setHost: (NSString *) newHost { [newHost retain]; [_host release]; _host = newHost; } /** * Unique FTP site ID. */ - (NSString *) identifier { return _identifier; } /** * Unique FTP site ID. */ - (void) setIdentifier: (NSString *) newIdentifier { [newIdentifier retain]; [_identifier release]; _identifier = newIdentifier; } /** * Initial Directory. */ - (NSString *) initdir { return _initdir; } /** * Initial Directory. */ - (void) setInitdir: (NSString *) newInitdir { [newInitdir retain]; [_initdir release]; _initdir = newInitdir; } /** * Flag to indicate if this is the default server. */ - (BOOL *) isDefault { return _isDefault; } /** * Flag to indicate if this is the default server. */ - (void) setIsDefault: (BOOL *) newIsDefault { if (_isDefault != NULL) { free(_isDefault); } _isDefault = newIsDefault; } /** * Flag to indicate if this is a FileCatalyst server. */ - (BOOL *) isFileCatalystServer { return _isFileCatalystServer; } /** * Flag to indicate if this is a FileCatalyst server. */ - (void) setIsFileCatalystServer: (BOOL *) newIsFileCatalystServer { if (_isFileCatalystServer != NULL) { free(_isFileCatalystServer); } _isFileCatalystServer = newIsFileCatalystServer; } /** * Specifies the location where to store the job files. */ - (NSString *) jobFilesLocation { return _jobFilesLocation; } /** * Specifies the location where to store the job files. */ - (void) setJobFilesLocation: (NSString *) newJobFilesLocation { [newJobFilesLocation retain]; [_jobFilesLocation release]; _jobFilesLocation = newJobFilesLocation; } /** * Specifies the location where to store the PDF files. */ - (NSString *) jobPDFLocation { return _jobPDFLocation; } /** * Specifies the location where to store the PDF files. */ - (void) setJobPDFLocation: (NSString *) newJobPDFLocation { [newJobPDFLocation retain]; [_jobPDFLocation release]; _jobPDFLocation = newJobPDFLocation; } /** * FTP user password. */ - (NSString *) pass { return _pass; } /** * FTP user password. */ - (void) setPass: (NSString *) newPass { [newPass retain]; [_pass release]; _pass = newPass; } /** * Flag to indicate if the FTP server uses passive mode. */ - (BOOL *) passive { return _passive; } /** * Flag to indicate if the FTP server uses passive mode. */ - (void) setPassive: (BOOL *) newPassive { if (_passive != NULL) { free(_passive); } _passive = newPassive; } /** * FTP server port. Usually 21. */ - (int *) port { return _port; } /** * FTP server port. Usually 21. */ - (void) setPort: (int *) newPort { if (_port != NULL) { free(_port); } _port = newPort; } /** * Remote administration password for a FileCatalyst server. */ - (NSString *) remoteAdminPass { return _remoteAdminPass; } /** * Remote administration password for a FileCatalyst server. */ - (void) setRemoteAdminPass: (NSString *) newRemoteAdminPass { [newRemoteAdminPass retain]; [_remoteAdminPass release]; _remoteAdminPass = newRemoteAdminPass; } /** * Remote administration port for a FileCatalyst server. */ - (int *) remoteAdminPort { return _remoteAdminPort; } /** * Remote administration port for a FileCatalyst server. */ - (void) setRemoteAdminPort: (int *) newRemoteAdminPort { if (_remoteAdminPort != NULL) { free(_remoteAdminPort); } _remoteAdminPort = newRemoteAdminPort; } /** * Remote administration user for a FileCatalyst server. */ - (NSString *) remoteAdminUser { return _remoteAdminUser; } /** * Remote administration user for a FileCatalyst server. */ - (void) setRemoteAdminUser: (NSString *) newRemoteAdminUser { [newRemoteAdminUser retain]; [_remoteAdminUser release]; _remoteAdminUser = newRemoteAdminUser; } /** * FTP server type. */ - (NSString *) serverType { return _serverType; } /** * FTP server type. */ - (void) setServerType: (NSString *) newServerType { [newServerType retain]; [_serverType release]; _serverType = newServerType; } /** * Company contact telephone number. */ - (NSString *) telephone { return _telephone; } /** * Company contact telephone number. */ - (void) setTelephone: (NSString *) newTelephone { [newTelephone retain]; [_telephone release]; _telephone = newTelephone; } /** * Connection Type can be set to regular FTP or FTPS (Implicit). * Some FTP server can accept secure FTPS connections, set your connection type if your FTPS server can accept secure connections * via FTPS (Implicit mode). * See ftpTransferType. */ - (enum FILECATALYSTMODELFtpTransferType *) transferMode { return _transferMode; } /** * Connection Type can be set to regular FTP or FTPS (Implicit). * Some FTP server can accept secure FTPS connections, set your connection type if your FTPS server can accept secure connections * via FTPS (Implicit mode). * See ftpTransferType. */ - (void) setTransferMode: (enum FILECATALYSTMODELFtpTransferType *) newTransferMode { if (_transferMode != NULL) { free(_transferMode); } _transferMode = newTransferMode; } /** * This option will toggle the use of the internal FTP server. * If you would like to use the default internal FTP server, please check the "Use Internal Server" field. * This will automatically overwrite the entries in the host, username, password, and port fields to those of the internal server. * To use the internal server, please ensure it is enabled from the "Edit Internal FTP" menu within the Administration Control Panel. */ - (BOOL *) useInternal { return _useInternal; } /** * This option will toggle the use of the internal FTP server. * If you would like to use the default internal FTP server, please check the "Use Internal Server" field. * This will automatically overwrite the entries in the host, username, password, and port fields to those of the internal server. * To use the internal server, please ensure it is enabled from the "Edit Internal FTP" menu within the Administration Control Panel. */ - (void) setUseInternal: (BOOL *) newUseInternal { if (_useInternal != NULL) { free(_useInternal); } _useInternal = newUseInternal; } /** * FTP user credentials. */ - (NSString *) user { return _user; } /** * FTP user credentials. */ - (void) setUser: (NSString *) newUser { [newUser retain]; [_user release]; _user = newUser; } /** * Post script command */ - (NSString *) postScript { return _postScript; } /** * Post script command */ - (void) setPostScript: (NSString *) newPostScript { [newPostScript retain]; [_postScript release]; _postScript = newPostScript; } /** * Hyperlink reference to the resource */ - (NSURL *) href { return _href; } /** * Hyperlink reference to the resource */ - (void) setHref: (NSURL *) newHref { [newHref retain]; [_href release]; _href = newHref; } - (void) dealloc { [self setAddUserToFCServer: NULL]; [self setAddress: nil]; [self setAdminEmail: nil]; [self setBackupDirectory: nil]; [self setCellPhoneCarrier: NULL]; [self setCellPhoneNumber: nil]; [self setCompany: nil]; [self setEnableRemoteAdmin: NULL]; [self setFax: nil]; [self setFriendlyName: nil]; [self setHost: nil]; [self setIdentifier: nil]; [self setInitdir: nil]; [self setIsDefault: NULL]; [self setIsFileCatalystServer: NULL]; [self setJobFilesLocation: nil]; [self setJobPDFLocation: nil]; [self setPass: nil]; [self setPassive: NULL]; [self setPort: NULL]; [self setRemoteAdminPass: nil]; [self setRemoteAdminPort: NULL]; [self setRemoteAdminUser: nil]; [self setServerType: nil]; [self setTelephone: nil]; [self setTransferMode: NULL]; [self setUseInternal: NULL]; [self setUser: nil]; [self setPostScript: nil]; [self setHref: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELFtpsiteModel *_fILECATALYSTMODELFtpsiteModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELFtpsiteModel = (FILECATALYSTMODELFtpsiteModel *) [FILECATALYSTMODELFtpsiteModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELFtpsiteModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELFtpsiteModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELFtpsiteModel (JAXB) @end /*interface FILECATALYSTMODELFtpsiteModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELFtpsiteModel (JAXB) /** * Read an instance of FILECATALYSTMODELFtpsiteModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELFtpsiteModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELFtpsiteModel *_fILECATALYSTMODELFtpsiteModel = [[FILECATALYSTMODELFtpsiteModel alloc] init]; NS_DURING { [_fILECATALYSTMODELFtpsiteModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELFtpsiteModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELFtpsiteModel autorelease]; return _fILECATALYSTMODELFtpsiteModel; } /** * Initialize this instance of FILECATALYSTMODELFtpsiteModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELFtpsiteModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELFtpsiteModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}ftpsite". * * @param reader The XML reader. * @return The FILECATALYSTMODELFtpsiteModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELFtpsiteModel *_ftpsiteModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}ftpsite."]; } } if (xmlStrcmp(BAD_CAST "ftpsite", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}ftpsite."); #endif _ftpsiteModel = (FILECATALYSTMODELFtpsiteModel *)[FILECATALYSTMODELFtpsiteModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}ftpsite."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELFtpsiteModel. Expected element {http://filecatalyst.com/model}ftpsite. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELFtpsiteModel. Expected element {http://filecatalyst.com/model}ftpsite. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _ftpsiteModel; } /** * Writes this FILECATALYSTMODELFtpsiteModel to XML under element name "{http://filecatalyst.com/model}ftpsite". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _ftpsiteModel The FtpsiteModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELFtpsiteModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "ftpsite", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}ftpsite. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}ftpsite..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}ftpsite'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}ftpsite..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}ftpsiteModel for root element {http://filecatalyst.com/model}ftpsite..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}ftpsiteModel for root element {http://filecatalyst.com/model}ftpsite..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}ftpsite. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "addUserToFCServer", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}addUserToFCServer..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}addUserToFCServer."]; } [self setAddUserToFCServer: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}addUserToFCServer..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "address", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}address..."); #endif [self setAddress: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}address..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "adminEmail", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}adminEmail..."); #endif [self setAdminEmail: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}adminEmail..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "backupDirectory", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}backupDirectory..."); #endif [self setBackupDirectory: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}backupDirectory..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "cellPhoneCarrier", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}cellPhoneCarrier..."); #endif _child_accessor = xmlTextReaderReadFILECATALYSTMODELCellPhoneCarrierTypeType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}cellPhoneCarrier."]; } [self setCellPhoneCarrier: ((enum FILECATALYSTMODELCellPhoneCarrierType*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}cellPhoneCarrier..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "cellPhoneNumber", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}cellPhoneNumber..."); #endif [self setCellPhoneNumber: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}cellPhoneNumber..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "company", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}company..."); #endif [self setCompany: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}company..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "enableRemoteAdmin", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}enableRemoteAdmin..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}enableRemoteAdmin."]; } [self setEnableRemoteAdmin: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}enableRemoteAdmin..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "fax", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}fax..."); #endif [self setFax: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}fax..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "friendlyName", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}friendlyName..."); #endif [self setFriendlyName: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}friendlyName..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "host", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}host..."); #endif [self setHost: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}host..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "id", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}id..."); #endif [self setIdentifier: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}id..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "initdir", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}initdir..."); #endif [self setInitdir: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}initdir..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "isDefault", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}isDefault..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}isDefault."]; } [self setIsDefault: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}isDefault..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "isFileCatalystServer", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}isFileCatalystServer..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}isFileCatalystServer."]; } [self setIsFileCatalystServer: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}isFileCatalystServer..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "jobFilesLocation", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}jobFilesLocation..."); #endif [self setJobFilesLocation: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}jobFilesLocation..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "jobPDFLocation", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}jobPDFLocation..."); #endif [self setJobPDFLocation: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}jobPDFLocation..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "pass", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}pass..."); #endif [self setPass: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}pass..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "passive", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}passive..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}passive."]; } [self setPassive: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}passive..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "port", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}port..."); #endif _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}port."]; } [self setPort: ((int*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}port..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "remoteAdminPass", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}remoteAdminPass..."); #endif [self setRemoteAdminPass: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}remoteAdminPass..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "remoteAdminPort", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}remoteAdminPort..."); #endif _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}remoteAdminPort."]; } [self setRemoteAdminPort: ((int*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}remoteAdminPort..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "remoteAdminUser", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}remoteAdminUser..."); #endif [self setRemoteAdminUser: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}remoteAdminUser..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "serverType", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}serverType..."); #endif [self setServerType: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}serverType..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "telephone", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}telephone..."); #endif [self setTelephone: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}telephone..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "transferMode", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}transferMode..."); #endif _child_accessor = xmlTextReaderReadFILECATALYSTMODELFtpTransferTypeType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}transferMode."]; } [self setTransferMode: ((enum FILECATALYSTMODELFtpTransferType*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}transferMode..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "useInternal", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}useInternal..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}useInternal."]; } [self setUseInternal: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}useInternal..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "user", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}user..."); #endif [self setUser: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}user..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "postScript", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}postScript..."); #endif [self setPostScript: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}postScript..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "href", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}href..."); #endif [self setHref: (NSURL*) [NSURL readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}href..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self addUserToFCServer] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "addUserToFCServer", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}addUserToFCServer."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}addUserToFCServer..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self addUserToFCServer]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}addUserToFCServer."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}addUserToFCServer..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}addUserToFCServer."]; } } if ([self address]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "address", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}address."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}address..."); #endif [[self address] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}address..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}address."]; } } if ([self adminEmail]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "adminEmail", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}adminEmail."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}adminEmail..."); #endif [[self adminEmail] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}adminEmail..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}adminEmail."]; } } if ([self backupDirectory]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "backupDirectory", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}backupDirectory."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}backupDirectory..."); #endif [[self backupDirectory] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}backupDirectory..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}backupDirectory."]; } } if ([self cellPhoneCarrier] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "cellPhoneCarrier", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}cellPhoneCarrier."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}cellPhoneCarrier..."); #endif status = xmlTextWriterWriteFILECATALYSTMODELCellPhoneCarrierTypeType(writer, [self cellPhoneCarrier]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}cellPhoneCarrier."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}cellPhoneCarrier..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}cellPhoneCarrier."]; } } if ([self cellPhoneNumber]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "cellPhoneNumber", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}cellPhoneNumber."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}cellPhoneNumber..."); #endif [[self cellPhoneNumber] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}cellPhoneNumber..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}cellPhoneNumber."]; } } if ([self company]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "company", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}company."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}company..."); #endif [[self company] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}company..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}company."]; } } if ([self enableRemoteAdmin] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "enableRemoteAdmin", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}enableRemoteAdmin."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}enableRemoteAdmin..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self enableRemoteAdmin]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}enableRemoteAdmin."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}enableRemoteAdmin..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}enableRemoteAdmin."]; } } if ([self fax]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "fax", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}fax."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}fax..."); #endif [[self fax] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}fax..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}fax."]; } } if ([self friendlyName]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "friendlyName", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}friendlyName."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}friendlyName..."); #endif [[self friendlyName] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}friendlyName..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}friendlyName."]; } } if ([self host]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "host", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}host."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}host..."); #endif [[self host] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}host..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}host."]; } } if ([self identifier]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "id", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}id."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}id..."); #endif [[self identifier] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}id..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}id."]; } } if ([self initdir]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "initdir", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}initdir."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}initdir..."); #endif [[self initdir] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}initdir..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}initdir."]; } } if ([self isDefault] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "isDefault", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}isDefault."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}isDefault..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self isDefault]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}isDefault."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}isDefault..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}isDefault."]; } } if ([self isFileCatalystServer] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "isFileCatalystServer", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}isFileCatalystServer."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}isFileCatalystServer..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self isFileCatalystServer]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}isFileCatalystServer."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}isFileCatalystServer..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}isFileCatalystServer."]; } } if ([self jobFilesLocation]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "jobFilesLocation", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}jobFilesLocation."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}jobFilesLocation..."); #endif [[self jobFilesLocation] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}jobFilesLocation..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}jobFilesLocation."]; } } if ([self jobPDFLocation]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "jobPDFLocation", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}jobPDFLocation."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}jobPDFLocation..."); #endif [[self jobPDFLocation] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}jobPDFLocation..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}jobPDFLocation."]; } } if ([self pass]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "pass", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}pass."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}pass..."); #endif [[self pass] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}pass..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}pass."]; } } if ([self passive] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "passive", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}passive."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}passive..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self passive]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}passive."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}passive..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}passive."]; } } if ([self port] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "port", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}port."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}port..."); #endif status = xmlTextWriterWriteIntType(writer, [self port]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}port."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}port..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}port."]; } } if ([self remoteAdminPass]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "remoteAdminPass", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}remoteAdminPass."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}remoteAdminPass..."); #endif [[self remoteAdminPass] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}remoteAdminPass..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}remoteAdminPass."]; } } if ([self remoteAdminPort] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "remoteAdminPort", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}remoteAdminPort."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}remoteAdminPort..."); #endif status = xmlTextWriterWriteIntType(writer, [self remoteAdminPort]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}remoteAdminPort."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}remoteAdminPort..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}remoteAdminPort."]; } } if ([self remoteAdminUser]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "remoteAdminUser", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}remoteAdminUser."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}remoteAdminUser..."); #endif [[self remoteAdminUser] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}remoteAdminUser..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}remoteAdminUser."]; } } if ([self serverType]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "serverType", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}serverType."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}serverType..."); #endif [[self serverType] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}serverType..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}serverType."]; } } if ([self telephone]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "telephone", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}telephone."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}telephone..."); #endif [[self telephone] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}telephone..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}telephone."]; } } if ([self transferMode] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "transferMode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}transferMode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}transferMode..."); #endif status = xmlTextWriterWriteFILECATALYSTMODELFtpTransferTypeType(writer, [self transferMode]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}transferMode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}transferMode..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}transferMode."]; } } if ([self useInternal] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "useInternal", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}useInternal."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}useInternal..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self useInternal]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}useInternal."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}useInternal..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}useInternal."]; } } if ([self user]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "user", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}user."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}user..."); #endif [[self user] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}user..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}user."]; } } if ([self postScript]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "postScript", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}postScript."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}postScript..."); #endif [[self postScript] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}postScript..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}postScript."]; } } if ([self href]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "href", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}href."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}href..."); #endif [[self href] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}href..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}href."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; } @end /* implementation FILECATALYSTMODELFtpsiteModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELFtpsiteModel_M */ #ifndef DEF_FILECATALYSTMODELGroupModel_M #define DEF_FILECATALYSTMODELGroupModel_M /** * User Group model class */ @implementation FILECATALYSTMODELGroupModel /** * Hyperlink reference to the resource */ - (NSURL *) href { return _href; } /** * Hyperlink reference to the resource */ - (void) setHref: (NSURL *) newHref { [newHref retain]; [_href release]; _href = newHref; } /** * Group name. */ - (NSString *) groupName { return _groupName; } /** * Group name. */ - (void) setGroupName: (NSString *) newGroupName { [newGroupName retain]; [_groupName release]; _groupName = newGroupName; } /** * If this flag is set, users within the group will be able to view each other's jobs. */ - (BOOL *) jobsShared { return _jobsShared; } /** * If this flag is set, users within the group will be able to view each other's jobs. */ - (void) setJobsShared: (BOOL *) newJobsShared { if (_jobsShared != NULL) { free(_jobsShared); } _jobsShared = newJobsShared; } /** * Flag to enabled Group File Area for the all the users of the group. * This is separate from "My File Area," which is the individual user's personal space. */ - (BOOL *) sharedFolder { return _sharedFolder; } /** * Flag to enabled Group File Area for the all the users of the group. * This is separate from "My File Area," which is the individual user's personal space. */ - (void) setSharedFolder: (BOOL *) newSharedFolder { if (_sharedFolder != NULL) { free(_sharedFolder); } _sharedFolder = newSharedFolder; } /** * Flag to enabled My File Area for the all the users of the group. */ - (BOOL *) myFileArea { return _myFileArea; } /** * Flag to enabled My File Area for the all the users of the group. */ - (void) setMyFileArea: (BOOL *) newMyFileArea { if (_myFileArea != NULL) { free(_myFileArea); } _myFileArea = newMyFileArea; } /** * Will be the server assigned to host the Group Folder. * The server can be defined in FTP/FC Locations. * Only Enterprise version allows for multiple FTP/FC Sites. */ - (FILECATALYSTMODELNameHrefModel *) ftpSite { return _ftpSite; } /** * Will be the server assigned to host the Group Folder. * The server can be defined in FTP/FC Locations. * Only Enterprise version allows for multiple FTP/FC Sites. */ - (void) setFtpSite: (FILECATALYSTMODELNameHrefModel *) newFtpSite { [newFtpSite retain]; [_ftpSite release]; _ftpSite = newFtpSite; } /** * Read permission will allow all user to download files from the group folder. */ - (BOOL *) readOnly { return _readOnly; } /** * Read permission will allow all user to download files from the group folder. */ - (void) setReadOnly: (BOOL *) newReadOnly { if (_readOnly != NULL) { free(_readOnly); } _readOnly = newReadOnly; } /** * Will allow all users to upload to the group folder. * * Overwriting the path of a group folder, allows to create 2 groups pointing to the same group folder but with different permissions. * One group could only have READ access while a different group could have both READ and WRITE access. */ - (BOOL *) writeOnly { return _writeOnly; } /** * Will allow all users to upload to the group folder. * * Overwriting the path of a group folder, allows to create 2 groups pointing to the same group folder but with different permissions. * One group could only have READ access while a different group could have both READ and WRITE access. */ - (void) setWriteOnly: (BOOL *) newWriteOnly { if (_writeOnly != NULL) { free(_writeOnly); } _writeOnly = newWriteOnly; } /** * If left blank the path to the share folder will be: //public_folders/ * The path can be overwritten, to point to any directory under FTPRoot of the server. */ - (NSString *) folderPathFromRoot { return _folderPathFromRoot; } /** * If left blank the path to the share folder will be: //public_folders/ * The path can be overwritten, to point to any directory under FTPRoot of the server. */ - (void) setFolderPathFromRoot: (NSString *) newFolderPathFromRoot { [newFolderPathFromRoot retain]; [_folderPathFromRoot release]; _folderPathFromRoot = newFolderPathFromRoot; } /** * List of order forms associated with this group. */ - (NSArray *) orderform { return _orderform; } /** * List of order forms associated with this group. */ - (void) setOrderform: (NSArray *) newOrderform { [newOrderform retain]; [_orderform release]; _orderform = newOrderform; } /** * List of users associated with this group. */ - (NSArray *) groupUser { return _groupUser; } /** * List of users associated with this group. */ - (void) setGroupUser: (NSArray *) newGroupUser { [newGroupUser retain]; [_groupUser release]; _groupUser = newGroupUser; } - (void) dealloc { [self setHref: nil]; [self setGroupName: nil]; [self setJobsShared: NULL]; [self setSharedFolder: NULL]; [self setMyFileArea: NULL]; [self setFtpSite: nil]; [self setReadOnly: NULL]; [self setWriteOnly: NULL]; [self setFolderPathFromRoot: nil]; [self setOrderform: nil]; [self setGroupUser: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELGroupModel *_fILECATALYSTMODELGroupModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELGroupModel = (FILECATALYSTMODELGroupModel *) [FILECATALYSTMODELGroupModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELGroupModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELGroupModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELGroupModel (JAXB) @end /*interface FILECATALYSTMODELGroupModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELGroupModel (JAXB) /** * Read an instance of FILECATALYSTMODELGroupModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELGroupModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELGroupModel *_fILECATALYSTMODELGroupModel = [[FILECATALYSTMODELGroupModel alloc] init]; NS_DURING { [_fILECATALYSTMODELGroupModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELGroupModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELGroupModel autorelease]; return _fILECATALYSTMODELGroupModel; } /** * Initialize this instance of FILECATALYSTMODELGroupModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELGroupModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELGroupModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}group". * * @param reader The XML reader. * @return The FILECATALYSTMODELGroupModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELGroupModel *_groupModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}group."]; } } if (xmlStrcmp(BAD_CAST "group", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}group."); #endif _groupModel = (FILECATALYSTMODELGroupModel *)[FILECATALYSTMODELGroupModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}group."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELGroupModel. Expected element {http://filecatalyst.com/model}group. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELGroupModel. Expected element {http://filecatalyst.com/model}group. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _groupModel; } /** * Writes this FILECATALYSTMODELGroupModel to XML under element name "{http://filecatalyst.com/model}group". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _groupModel The GroupModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELGroupModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "group", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}group. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}group..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}group'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}group..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}groupModel for root element {http://filecatalyst.com/model}group..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}groupModel for root element {http://filecatalyst.com/model}group..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}group. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "href", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}href..."); #endif [self setHref: (NSURL*) [NSURL readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}href..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "groupName", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}groupName of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}groupName of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setGroupName: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "jobsShared", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setJobsShared: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "sharedFolder", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setSharedFolder: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "myFileArea", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setMyFileArea: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "ftpSite", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}ftpSite of type {http://filecatalyst.com/model}nameHrefModel."); #endif __child = [FILECATALYSTMODELNameHrefModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}ftpSite of type {http://filecatalyst.com/model}nameHrefModel."); #endif [self setFtpSite: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "readOnly", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setReadOnly: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "writeOnly", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setWriteOnly: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "folderPathFromRoot", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}folderPathFromRoot of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}folderPathFromRoot of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setFolderPathFromRoot: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "orderform", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}orderform of type {http://filecatalyst.com/model}nameHrefModel."); #endif __child = [FILECATALYSTMODELNameHrefModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}orderform of type {http://filecatalyst.com/model}nameHrefModel."); #endif if ([self orderform]) { [self setOrderform: [[self orderform] arrayByAddingObject: __child]]; } else { [self setOrderform: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "user", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}user of type {http://filecatalyst.com/model}nameHrefModel."); #endif __child = [FILECATALYSTMODELNameHrefModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}user of type {http://filecatalyst.com/model}nameHrefModel."); #endif if ([self groupUser]) { [self setGroupUser: [[self groupUser] arrayByAddingObject: __child]]; } else { [self setGroupUser: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self href]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "href", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}href."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}href..."); #endif [[self href] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}href..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}href."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self groupName]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "groupName", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}groupName."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}groupName..."); #endif [[self groupName] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}groupName..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}groupName."]; } } if ([self jobsShared] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "jobsShared", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}jobsShared."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}jobsShared..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self jobsShared]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}jobsShared..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}jobsShared."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}jobsShared."]; } } if ([self sharedFolder] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "sharedFolder", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}sharedFolder."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}sharedFolder..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self sharedFolder]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}sharedFolder..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}sharedFolder."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}sharedFolder."]; } } if ([self myFileArea] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "myFileArea", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}myFileArea."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}myFileArea..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self myFileArea]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}myFileArea..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}myFileArea."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}myFileArea."]; } } if ([self ftpSite]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "ftpSite", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}ftpSite."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}ftpSite..."); #endif [[self ftpSite] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}ftpSite..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}ftpSite."]; } } if ([self readOnly] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "readOnly", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}readOnly."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}readOnly..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self readOnly]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}readOnly..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}readOnly."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}readOnly."]; } } if ([self writeOnly] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "writeOnly", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}writeOnly."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}writeOnly..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self writeOnly]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}writeOnly..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}writeOnly."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}writeOnly."]; } } if ([self folderPathFromRoot]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "folderPathFromRoot", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}folderPathFromRoot."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}folderPathFromRoot..."); #endif [[self folderPathFromRoot] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}folderPathFromRoot..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}folderPathFromRoot."]; } } if ([self orderform]) { __enumerator = [[self orderform] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "orderform", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}orderform."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}orderform..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}orderform..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}orderform."]; } } //end item iterator. } if ([self groupUser]) { __enumerator = [[self groupUser] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "user", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}user."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}user..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}user..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}user."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELGroupModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELGroupModel_M */ #ifndef DEF_FILECATALYSTMODELItemModel_M #define DEF_FILECATALYSTMODELItemModel_M /** * Item model class */ @implementation FILECATALYSTMODELItemModel /** * Item description */ - (NSString *) description { return _description; } /** * Item description */ - (void) setDescription: (NSString *) newDescription { [newDescription retain]; [_description release]; _description = newDescription; } /** * Type specific. Operand to use for certain field types. * See fieldOperandActionType. */ - (enum FILECATALYSTMODELFieldOperandActionType *) operand { return _operand; } /** * Type specific. Operand to use for certain field types. * See fieldOperandActionType. */ - (void) setOperand: (enum FILECATALYSTMODELFieldOperandActionType *) newOperand { if (_operand != NULL) { free(_operand); } _operand = newOperand; } /** * List of prices. */ - (NSArray *) prices { return _prices; } /** * List of prices. */ - (void) setPrices: (NSArray *) newPrices { [newPrices retain]; [_prices release]; _prices = newPrices; } - (void) dealloc { [self setDescription: nil]; [self setOperand: NULL]; [self setPrices: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELItemModel *_fILECATALYSTMODELItemModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELItemModel = (FILECATALYSTMODELItemModel *) [FILECATALYSTMODELItemModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELItemModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELItemModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELItemModel (JAXB) @end /*interface FILECATALYSTMODELItemModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELItemModel (JAXB) /** * Read an instance of FILECATALYSTMODELItemModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELItemModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELItemModel *_fILECATALYSTMODELItemModel = [[FILECATALYSTMODELItemModel alloc] init]; NS_DURING { [_fILECATALYSTMODELItemModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELItemModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELItemModel autorelease]; return _fILECATALYSTMODELItemModel; } /** * Initialize this instance of FILECATALYSTMODELItemModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELItemModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELItemModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}item". * * @param reader The XML reader. * @return The FILECATALYSTMODELItemModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELItemModel *_itemModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}item."]; } } if (xmlStrcmp(BAD_CAST "item", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}item."); #endif _itemModel = (FILECATALYSTMODELItemModel *)[FILECATALYSTMODELItemModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}item."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELItemModel. Expected element {http://filecatalyst.com/model}item. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELItemModel. Expected element {http://filecatalyst.com/model}item. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _itemModel; } /** * Writes this FILECATALYSTMODELItemModel to XML under element name "{http://filecatalyst.com/model}item". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _itemModel The ItemModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELItemModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "item", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}item. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}item..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}item'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}item..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}itemModel for root element {http://filecatalyst.com/model}item..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}itemModel for root element {http://filecatalyst.com/model}item..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}item. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "description", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}description..."); #endif [self setDescription: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}description..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "operand", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}operand..."); #endif _child_accessor = xmlTextReaderReadFILECATALYSTMODELFieldOperandActionTypeType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}operand."]; } [self setOperand: ((enum FILECATALYSTMODELFieldOperandActionType*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}operand..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "prices", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}prices of type {http://filecatalyst.com/model}pricesModel."); #endif __child = [FILECATALYSTMODELPricesModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}prices of type {http://filecatalyst.com/model}pricesModel."); #endif if ([self prices]) { [self setPrices: [[self prices] arrayByAddingObject: __child]]; } else { [self setPrices: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self description]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "description", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}description."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}description..."); #endif [[self description] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}description..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}description."]; } } if ([self operand] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "operand", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}operand."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}operand..."); #endif status = xmlTextWriterWriteFILECATALYSTMODELFieldOperandActionTypeType(writer, [self operand]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}operand."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}operand..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}operand."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self prices]) { __enumerator = [[self prices] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "prices", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}prices."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}prices..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}prices..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}prices."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELItemModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELItemModel_M */ #ifndef DEF_FILECATALYSTMODELJobFieldsModel_M #define DEF_FILECATALYSTMODELJobFieldsModel_M /** * Job fields model class */ @implementation FILECATALYSTMODELJobFieldsModel /** *

The fields can be shown on the form either:

*
    *
  • vertically (Fields Per Row = 1)
  • *
  • horizontally (Fields Per Row >= the number of fields to be shown)
  • *
  • in a table (Fields Per Row > 1 and < the number of fields to be shown)
  • *
*/ - (int *) fieldsPerRow { return _fieldsPerRow; } /** *

The fields can be shown on the form either:

*
    *
  • vertically (Fields Per Row = 1)
  • *
  • horizontally (Fields Per Row >= the number of fields to be shown)
  • *
  • in a table (Fields Per Row > 1 and < the number of fields to be shown)
  • *
*/ - (void) setFieldsPerRow: (int *) newFieldsPerRow { if (_fieldsPerRow != NULL) { free(_fieldsPerRow); } _fieldsPerRow = newFieldsPerRow; } /** * List of form fields. */ - (NSArray *) formField { return _formField; } /** * List of form fields. */ - (void) setFormField: (NSArray *) newFormField { [newFormField retain]; [_formField release]; _formField = newFormField; } - (void) dealloc { [self setFieldsPerRow: NULL]; [self setFormField: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELJobFieldsModel *_fILECATALYSTMODELJobFieldsModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELJobFieldsModel = (FILECATALYSTMODELJobFieldsModel *) [FILECATALYSTMODELJobFieldsModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELJobFieldsModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELJobFieldsModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELJobFieldsModel (JAXB) @end /*interface FILECATALYSTMODELJobFieldsModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELJobFieldsModel (JAXB) /** * Read an instance of FILECATALYSTMODELJobFieldsModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELJobFieldsModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELJobFieldsModel *_fILECATALYSTMODELJobFieldsModel = [[FILECATALYSTMODELJobFieldsModel alloc] init]; NS_DURING { [_fILECATALYSTMODELJobFieldsModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELJobFieldsModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELJobFieldsModel autorelease]; return _fILECATALYSTMODELJobFieldsModel; } /** * Initialize this instance of FILECATALYSTMODELJobFieldsModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELJobFieldsModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELJobFieldsModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}jobFields". * * @param reader The XML reader. * @return The FILECATALYSTMODELJobFieldsModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELJobFieldsModel *_jobFieldsModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}jobFields."]; } } if (xmlStrcmp(BAD_CAST "jobFields", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}jobFields."); #endif _jobFieldsModel = (FILECATALYSTMODELJobFieldsModel *)[FILECATALYSTMODELJobFieldsModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}jobFields."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELJobFieldsModel. Expected element {http://filecatalyst.com/model}jobFields. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELJobFieldsModel. Expected element {http://filecatalyst.com/model}jobFields. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _jobFieldsModel; } /** * Writes this FILECATALYSTMODELJobFieldsModel to XML under element name "{http://filecatalyst.com/model}jobFields". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _jobFieldsModel The JobFieldsModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELJobFieldsModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "jobFields", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}jobFields. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}jobFields..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}jobFields'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}jobFields..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}jobFieldsModel for root element {http://filecatalyst.com/model}jobFields..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}jobFieldsModel for root element {http://filecatalyst.com/model}jobFields..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}jobFields. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "fieldsPerRow", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}fieldsPerRow..."); #endif _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}fieldsPerRow."]; } [self setFieldsPerRow: ((int*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}fieldsPerRow..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "formField", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}formField of type {http://filecatalyst.com/model}formFieldModel."); #endif __child = [FILECATALYSTMODELFormFieldModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}formField of type {http://filecatalyst.com/model}formFieldModel."); #endif if ([self formField]) { [self setFormField: [[self formField] arrayByAddingObject: __child]]; } else { [self setFormField: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self fieldsPerRow] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "fieldsPerRow", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}fieldsPerRow."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}fieldsPerRow..."); #endif status = xmlTextWriterWriteIntType(writer, [self fieldsPerRow]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}fieldsPerRow."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}fieldsPerRow..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}fieldsPerRow."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self formField]) { __enumerator = [[self formField] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "formField", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}formField."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}formField..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}formField..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}formField."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELJobFieldsModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELJobFieldsModel_M */ #ifndef DEF_FILECATALYSTMODELOrderFormModel_M #define DEF_FILECATALYSTMODELOrderFormModel_M /** * Order form model class */ @implementation FILECATALYSTMODELOrderFormModel /** *

At Least One File

*

If this option is set, a Job will require at least one file to be uploaded before the job can be submitted. * The 'Finish' button to submit the job * will only be shown to the user once there is at least one file added to the Job. *
Don't use this option if you wish to receive jobs without any files. *

*/ - (BOOL *) atLeastOneFile { return _atLeastOneFile; } /** *

At Least One File

*

If this option is set, a Job will require at least one file to be uploaded before the job can be submitted. * The 'Finish' button to submit the job * will only be shown to the user once there is at least one file added to the Job. *
Don't use this option if you wish to receive jobs without any files. *

*/ - (void) setAtLeastOneFile: (BOOL *) newAtLeastOneFile { if (_atLeastOneFile != NULL) { free(_atLeastOneFile); } _atLeastOneFile = newAtLeastOneFile; } /** *

Days before upload expires:

*

* This field will set the number of days before a package expires. * This field is only used when RecipientEmail field and expireupload field are part of the order form.
* Scenarios: *

*
    *
  1. Admin leaves Days before upload expires field blank and has expireupload field on the order form: * This will give full control to the user to specify the days before the Job expires. The user can enter any date in the future
  2. *
  3. Admin specifies Days before upload expires but hides expireupload field on the order form: * Jobs will expire after the number of days specified by the admin
  4. *
  5. Admin specifies Days before upload expires and shows expireupload field on the order form: * User will be allowed to specify a date which the Job expires provided it does not exceed the number of days specified by the admin from job submission.
  6. *
  7. Admin leaves Days before upload expires field blank and doesn't add expireupload field to the order form: * Job will never expire
  8. *
*/ - (int *) daysBeforeUploadExpires { return _daysBeforeUploadExpires; } /** *

Days before upload expires:

*

* This field will set the number of days before a package expires. * This field is only used when RecipientEmail field and expireupload field are part of the order form.
* Scenarios: *

*
    *
  1. Admin leaves Days before upload expires field blank and has expireupload field on the order form: * This will give full control to the user to specify the days before the Job expires. The user can enter any date in the future
  2. *
  3. Admin specifies Days before upload expires but hides expireupload field on the order form: * Jobs will expire after the number of days specified by the admin
  4. *
  5. Admin specifies Days before upload expires and shows expireupload field on the order form: * User will be allowed to specify a date which the Job expires provided it does not exceed the number of days specified by the admin from job submission.
  6. *
  7. Admin leaves Days before upload expires field blank and doesn't add expireupload field to the order form: * Job will never expire
  8. *
*/ - (void) setDaysBeforeUploadExpires: (int *) newDaysBeforeUploadExpires { if (_daysBeforeUploadExpires != NULL) { free(_daysBeforeUploadExpires); } _daysBeforeUploadExpires = newDaysBeforeUploadExpires; } /** * Unique form name. */ - (NSString *) formName { return _formName; } /** * Unique form name. */ - (void) setFormName: (NSString *) newFormName { [newFormName retain]; [_formName release]; _formName = newFormName; } /** *

Display Name

*

* This is the actual text that will appear to the end user. The text will appear if the user can access more * than one order form and when they click on "New Job" from the main menu. * The text will appear in the drop down immediately below the "New Job" button. *
Default Form ID will be used if this text is not set. *

*/ - (NSString *) formNameAlias { return _formNameAlias; } /** *

Display Name

*

* This is the actual text that will appear to the end user. The text will appear if the user can access more * than one order form and when they click on "New Job" from the main menu. * The text will appear in the drop down immediately below the "New Job" button. *
Default Form ID will be used if this text is not set. *

*/ - (void) setFormNameAlias: (NSString *) newFormNameAlias { [newFormNameAlias retain]; [_formNameAlias release]; _formNameAlias = newFormNameAlias; } /** * Flag to indicate if this is a template. */ - (BOOL *) isTemplate { return _isTemplate; } /** * Flag to indicate if this is a template. */ - (void) setIsTemplate: (BOOL *) newIsTemplate { if (_isTemplate != NULL) { free(_isTemplate); } _isTemplate = newIsTemplate; } /** *

Items Per Page

*

* This setting is for file form and edit file properties page. This will allow the specified number of files to be * shown per page before confirming the Job. If no number is specified or if a * number entered is 0, all the uploaded files are shown on one page with no previous or next links. *

*/ - (int *) itemsPerPage { return _itemsPerPage; } /** *

Items Per Page

*

* This setting is for file form and edit file properties page. This will allow the specified number of files to be * shown per page before confirming the Job. If no number is specified or if a * number entered is 0, all the uploaded files are shown on one page with no previous or next links. *

*/ - (void) setItemsPerPage: (int *) newItemsPerPage { if (_itemsPerPage != NULL) { free(_itemsPerPage); } _itemsPerPage = newItemsPerPage; } /** * Minimum cost to use. */ - (double *) minimumCost { return _minimumCost; } /** * Minimum cost to use. */ - (void) setMinimumCost: (double *) newMinimumCost { if (_minimumCost != NULL) { free(_minimumCost); } _minimumCost = newMinimumCost; } /** *

Private Order Form (Group Only) - Enterprise Only

*

* By default all users that are NOT members of any group will see all * the order forms defined in the system. Use this setting if you wish to * make certain forms private and only visible to group members. *

*/ - (BOOL *) privateGroupOnly { return _privateGroupOnly; } /** *

Private Order Form (Group Only) - Enterprise Only

*

* By default all users that are NOT members of any group will see all * the order forms defined in the system. Use this setting if you wish to * make certain forms private and only visible to group members. *

*/ - (void) setPrivateGroupOnly: (BOOL *) newPrivateGroupOnly { if (_privateGroupOnly != NULL) { free(_privateGroupOnly); } _privateGroupOnly = newPrivateGroupOnly; } /** *

Calculate Price

*

* If set, this option will cause the price of the order to be calculated using * the price fields set in Job Field specifications, and displayed on the * Job Order form, the Confirm Job page and the More User Info page. *

*/ - (BOOL *) showPrice { return _showPrice; } /** *

Calculate Price

*

* If set, this option will cause the price of the order to be calculated using * the price fields set in Job Field specifications, and displayed on the * Job Order form, the Confirm Job page and the More User Info page. *

*/ - (void) setShowPrice: (BOOL *) newShowPrice { if (_showPrice != NULL) { free(_showPrice); } _showPrice = newShowPrice; } /** *

Show Thumbnails

*

* Display's thumbnails in certain workflows on the Job confirmation page next to each item. * Preview thumbnails only appear on images uploaded using the Java Applet option. *

*/ - (BOOL *) showThumbnails { return _showThumbnails; } /** *

Show Thumbnails

*

* Display's thumbnails in certain workflows on the Job confirmation page next to each item. * Preview thumbnails only appear on images uploaded using the Java Applet option. *

*/ - (void) setShowThumbnails: (BOOL *) newShowThumbnails { if (_showThumbnails != NULL) { free(_showThumbnails); } _showThumbnails = newShowThumbnails; } /** *

Thumbnail Height

*

* Set the fixed height of the thumbnails. * If this is set to blank, then a size relative to the width will be used. *

*

* Please note: * If both height and width are blank, no resizing will be done to the images. * This is not recommended. *

*/ - (NSString *) thumbnailHeight { return _thumbnailHeight; } /** *

Thumbnail Height

*

* Set the fixed height of the thumbnails. * If this is set to blank, then a size relative to the width will be used. *

*

* Please note: * If both height and width are blank, no resizing will be done to the images. * This is not recommended. *

*/ - (void) setThumbnailHeight: (NSString *) newThumbnailHeight { [newThumbnailHeight retain]; [_thumbnailHeight release]; _thumbnailHeight = newThumbnailHeight; } /** *

Thumbnail Width

*

* Set the fixed width of the thumbnails. * If this is set to blank, then a size relative to the height will be used. *

*

* Please note: * If both height and width are blank, no resizing will be done to the images. * This is not recommended. *

*/ - (NSString *) thumbnailWidth { return _thumbnailWidth; } /** *

Thumbnail Width

*

* Set the fixed width of the thumbnails. * If this is set to blank, then a size relative to the height will be used. *

*

* Please note: * If both height and width are blank, no resizing will be done to the images. * This is not recommended. *

*/ - (void) setThumbnailWidth: (NSString *) newThumbnailWidth { [newThumbnailWidth retain]; [_thumbnailWidth release]; _thumbnailWidth = newThumbnailWidth; } /** *

Tier Pricing

*

* This option applies when a discount levels are used to set prices. * In tier pricing, the discounted pricing is only applied to quantities above the discounted level, * whereas in normal mode, all items have the discounted price. *

*

* For example, with one discount level of 10 items, and prices of $1, and $.80, * ,in normal mode, the cost will be $8.80: 11 x 0.80c - 0.80 being the discounted price for quantity 11, * however when Tier Pricing is in effect, the cost will be $10.80: $10 x $1 plus 0.80. *

*/ - (BOOL *) tierPricing { return _tierPricing; } /** *

Tier Pricing

*

* This option applies when a discount levels are used to set prices. * In tier pricing, the discounted pricing is only applied to quantities above the discounted level, * whereas in normal mode, all items have the discounted price. *

*

* For example, with one discount level of 10 items, and prices of $1, and $.80, * ,in normal mode, the cost will be $8.80: 11 x 0.80c - 0.80 being the discounted price for quantity 11, * however when Tier Pricing is in effect, the cost will be $10.80: $10 x $1 plus 0.80. *

*/ - (void) setTierPricing: (BOOL *) newTierPricing { if (_tierPricing != NULL) { free(_tierPricing); } _tierPricing = newTierPricing; } /** * Hyperlink reference to the resource */ - (NSURL *) href { return _href; } /** * Hyperlink reference to the resource */ - (void) setHref: (NSURL *) newHref { [newHref retain]; [_href release]; _href = newHref; } /** * List of file fields. These fields will be present for every file selected. */ - (FILECATALYSTMODELFileFieldsModel *) fileFields { return _fileFields; } /** * List of file fields. These fields will be present for every file selected. */ - (void) setFileFields: (FILECATALYSTMODELFileFieldsModel *) newFileFields { [newFileFields retain]; [_fileFields release]; _fileFields = newFileFields; } /** * List of job fields. */ - (NSArray *) jobFields { return _jobFields; } /** * List of job fields. */ - (void) setJobFields: (NSArray *) newJobFields { [newJobFields retain]; [_jobFields release]; _jobFields = newJobFields; } - (void) dealloc { [self setAtLeastOneFile: NULL]; [self setDaysBeforeUploadExpires: NULL]; [self setFormName: nil]; [self setFormNameAlias: nil]; [self setIsTemplate: NULL]; [self setItemsPerPage: NULL]; [self setMinimumCost: NULL]; [self setPrivateGroupOnly: NULL]; [self setShowPrice: NULL]; [self setShowThumbnails: NULL]; [self setThumbnailHeight: nil]; [self setThumbnailWidth: nil]; [self setTierPricing: NULL]; [self setHref: nil]; [self setFileFields: nil]; [self setJobFields: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELOrderFormModel *_fILECATALYSTMODELOrderFormModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELOrderFormModel = (FILECATALYSTMODELOrderFormModel *) [FILECATALYSTMODELOrderFormModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELOrderFormModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELOrderFormModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELOrderFormModel (JAXB) @end /*interface FILECATALYSTMODELOrderFormModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELOrderFormModel (JAXB) /** * Read an instance of FILECATALYSTMODELOrderFormModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELOrderFormModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELOrderFormModel *_fILECATALYSTMODELOrderFormModel = [[FILECATALYSTMODELOrderFormModel alloc] init]; NS_DURING { [_fILECATALYSTMODELOrderFormModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELOrderFormModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELOrderFormModel autorelease]; return _fILECATALYSTMODELOrderFormModel; } /** * Initialize this instance of FILECATALYSTMODELOrderFormModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELOrderFormModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELOrderFormModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}orderform". * * @param reader The XML reader. * @return The FILECATALYSTMODELOrderFormModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELOrderFormModel *_orderFormModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}orderform."]; } } if (xmlStrcmp(BAD_CAST "orderform", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}orderform."); #endif _orderFormModel = (FILECATALYSTMODELOrderFormModel *)[FILECATALYSTMODELOrderFormModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}orderform."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELOrderFormModel. Expected element {http://filecatalyst.com/model}orderform. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELOrderFormModel. Expected element {http://filecatalyst.com/model}orderform. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _orderFormModel; } /** * Writes this FILECATALYSTMODELOrderFormModel to XML under element name "{http://filecatalyst.com/model}orderform". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _orderFormModel The OrderFormModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELOrderFormModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "orderform", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}orderform. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}orderform..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}orderform'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}orderform..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}orderFormModel for root element {http://filecatalyst.com/model}orderform..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}orderFormModel for root element {http://filecatalyst.com/model}orderform..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}orderform. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "atLeastOneFile", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}atLeastOneFile..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}atLeastOneFile."]; } [self setAtLeastOneFile: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}atLeastOneFile..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "daysBeforeUploadExpires", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}daysBeforeUploadExpires..."); #endif _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}daysBeforeUploadExpires."]; } [self setDaysBeforeUploadExpires: ((int*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}daysBeforeUploadExpires..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "formName", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}formName..."); #endif [self setFormName: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}formName..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "formNameAlias", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}formNameAlias..."); #endif [self setFormNameAlias: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}formNameAlias..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "isTemplate", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}isTemplate..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}isTemplate."]; } [self setIsTemplate: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}isTemplate..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "itemsPerPage", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}itemsPerPage..."); #endif _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}itemsPerPage."]; } [self setItemsPerPage: ((int*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}itemsPerPage..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "minimumCost", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}minimumCost..."); #endif _child_accessor = xmlTextReaderReadDoubleType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}minimumCost."]; } [self setMinimumCost: ((double*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}minimumCost..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "privateGroupOnly", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}privateGroupOnly..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}privateGroupOnly."]; } [self setPrivateGroupOnly: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}privateGroupOnly..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "showPrice", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}showPrice..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}showPrice."]; } [self setShowPrice: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}showPrice..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "showThumbnails", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}showThumbnails..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}showThumbnails."]; } [self setShowThumbnails: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}showThumbnails..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "thumbnailHeight", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}thumbnailHeight..."); #endif [self setThumbnailHeight: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}thumbnailHeight..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "thumbnailWidth", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}thumbnailWidth..."); #endif [self setThumbnailWidth: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}thumbnailWidth..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "tierPricing", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}tierPricing..."); #endif _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}tierPricing."]; } [self setTierPricing: ((BOOL*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}tierPricing..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "href", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}href..."); #endif [self setHref: (NSURL*) [NSURL readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}href..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "fileFields", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}fileFields of type {http://filecatalyst.com/model}fileFieldsModel."); #endif __child = [FILECATALYSTMODELFileFieldsModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}fileFields of type {http://filecatalyst.com/model}fileFieldsModel."); #endif [self setFileFields: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "jobFields", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}jobFields of type {http://filecatalyst.com/model}jobFieldsModel."); #endif __child = [FILECATALYSTMODELJobFieldsModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}jobFields of type {http://filecatalyst.com/model}jobFieldsModel."); #endif if ([self jobFields]) { [self setJobFields: [[self jobFields] arrayByAddingObject: __child]]; } else { [self setJobFields: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self atLeastOneFile] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "atLeastOneFile", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}atLeastOneFile."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}atLeastOneFile..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self atLeastOneFile]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}atLeastOneFile."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}atLeastOneFile..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}atLeastOneFile."]; } } if ([self daysBeforeUploadExpires] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "daysBeforeUploadExpires", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}daysBeforeUploadExpires."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}daysBeforeUploadExpires..."); #endif status = xmlTextWriterWriteIntType(writer, [self daysBeforeUploadExpires]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}daysBeforeUploadExpires."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}daysBeforeUploadExpires..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}daysBeforeUploadExpires."]; } } if ([self formName]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "formName", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}formName."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}formName..."); #endif [[self formName] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}formName..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}formName."]; } } if ([self formNameAlias]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "formNameAlias", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}formNameAlias."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}formNameAlias..."); #endif [[self formNameAlias] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}formNameAlias..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}formNameAlias."]; } } if ([self isTemplate] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "isTemplate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}isTemplate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}isTemplate..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self isTemplate]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}isTemplate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}isTemplate..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}isTemplate."]; } } if ([self itemsPerPage] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "itemsPerPage", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}itemsPerPage."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}itemsPerPage..."); #endif status = xmlTextWriterWriteIntType(writer, [self itemsPerPage]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}itemsPerPage."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}itemsPerPage..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}itemsPerPage."]; } } if ([self minimumCost] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "minimumCost", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}minimumCost."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}minimumCost..."); #endif status = xmlTextWriterWriteDoubleType(writer, [self minimumCost]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}minimumCost."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}minimumCost..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}minimumCost."]; } } if ([self privateGroupOnly] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "privateGroupOnly", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}privateGroupOnly."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}privateGroupOnly..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self privateGroupOnly]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}privateGroupOnly."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}privateGroupOnly..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}privateGroupOnly."]; } } if ([self showPrice] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "showPrice", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}showPrice."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}showPrice..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self showPrice]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}showPrice."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}showPrice..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}showPrice."]; } } if ([self showThumbnails] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "showThumbnails", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}showThumbnails."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}showThumbnails..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self showThumbnails]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}showThumbnails."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}showThumbnails..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}showThumbnails."]; } } if ([self thumbnailHeight]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "thumbnailHeight", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}thumbnailHeight."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}thumbnailHeight..."); #endif [[self thumbnailHeight] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}thumbnailHeight..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}thumbnailHeight."]; } } if ([self thumbnailWidth]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "thumbnailWidth", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}thumbnailWidth."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}thumbnailWidth..."); #endif [[self thumbnailWidth] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}thumbnailWidth..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}thumbnailWidth."]; } } if ([self tierPricing] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "tierPricing", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}tierPricing."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}tierPricing..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self tierPricing]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}tierPricing."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}tierPricing..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}tierPricing."]; } } if ([self href]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "href", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}href."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}href..."); #endif [[self href] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}href..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}href."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self fileFields]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "fileFields", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}fileFields."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}fileFields..."); #endif [[self fileFields] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}fileFields..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}fileFields."]; } } if ([self jobFields]) { __enumerator = [[self jobFields] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "jobFields", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}jobFields."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}jobFields..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}jobFields..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}jobFields."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELOrderFormModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELOrderFormModel_M */ #ifndef DEF_FILECATALYSTMODELPriceModel_M #define DEF_FILECATALYSTMODELPriceModel_M /** * Price model class */ @implementation FILECATALYSTMODELPriceModel /** * Price amount. */ - (double *) amount { return _amount; } /** * Price amount. */ - (void) setAmount: (double *) newAmount { if (_amount != NULL) { free(_amount); } _amount = newAmount; } - (void) dealloc { [self setAmount: NULL]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELPriceModel *_fILECATALYSTMODELPriceModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELPriceModel = (FILECATALYSTMODELPriceModel *) [FILECATALYSTMODELPriceModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELPriceModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELPriceModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELPriceModel (JAXB) @end /*interface FILECATALYSTMODELPriceModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELPriceModel (JAXB) /** * Read an instance of FILECATALYSTMODELPriceModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELPriceModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELPriceModel *_fILECATALYSTMODELPriceModel = [[FILECATALYSTMODELPriceModel alloc] init]; NS_DURING { [_fILECATALYSTMODELPriceModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELPriceModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELPriceModel autorelease]; return _fILECATALYSTMODELPriceModel; } /** * Initialize this instance of FILECATALYSTMODELPriceModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELPriceModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELPriceModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}price". * * @param reader The XML reader. * @return The FILECATALYSTMODELPriceModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELPriceModel *_priceModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}price."]; } } if (xmlStrcmp(BAD_CAST "price", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}price."); #endif _priceModel = (FILECATALYSTMODELPriceModel *)[FILECATALYSTMODELPriceModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}price."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELPriceModel. Expected element {http://filecatalyst.com/model}price. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELPriceModel. Expected element {http://filecatalyst.com/model}price. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _priceModel; } /** * Writes this FILECATALYSTMODELPriceModel to XML under element name "{http://filecatalyst.com/model}price". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _priceModel The PriceModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELPriceModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "price", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}price. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}price..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}price'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}price..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}priceModel for root element {http://filecatalyst.com/model}price..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}priceModel for root element {http://filecatalyst.com/model}price..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}price. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "amount", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}amount..."); #endif _child_accessor = xmlTextReaderReadDoubleType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}amount."]; } [self setAmount: ((double*) _child_accessor)]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}amount..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self amount] != NULL) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "amount", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}amount."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}amount..."); #endif status = xmlTextWriterWriteDoubleType(writer, [self amount]); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}amount."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}amount..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}amount."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; } @end /* implementation FILECATALYSTMODELPriceModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELPriceModel_M */ #ifndef DEF_FILECATALYSTMODELSessionAuthorizationModel_M #define DEF_FILECATALYSTMODELSessionAuthorizationModel_M /** * Class to hold user session authorization */ @implementation FILECATALYSTMODELSessionAuthorizationModel /** * Authorization authentication string. * Format: BASE64(USER:PASSWORD) */ - (NSString *) authorization { return _authorization; } /** * Authorization authentication string. * Format: BASE64(USER:PASSWORD) */ - (void) setAuthorization: (NSString *) newAuthorization { [newAuthorization retain]; [_authorization release]; _authorization = newAuthorization; } - (void) dealloc { [self setAuthorization: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELSessionAuthorizationModel *_fILECATALYSTMODELSessionAuthorizationModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELSessionAuthorizationModel = (FILECATALYSTMODELSessionAuthorizationModel *) [FILECATALYSTMODELSessionAuthorizationModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELSessionAuthorizationModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELSessionAuthorizationModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELSessionAuthorizationModel (JAXB) @end /*interface FILECATALYSTMODELSessionAuthorizationModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELSessionAuthorizationModel (JAXB) /** * Read an instance of FILECATALYSTMODELSessionAuthorizationModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELSessionAuthorizationModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELSessionAuthorizationModel *_fILECATALYSTMODELSessionAuthorizationModel = [[FILECATALYSTMODELSessionAuthorizationModel alloc] init]; NS_DURING { [_fILECATALYSTMODELSessionAuthorizationModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELSessionAuthorizationModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELSessionAuthorizationModel autorelease]; return _fILECATALYSTMODELSessionAuthorizationModel; } /** * Initialize this instance of FILECATALYSTMODELSessionAuthorizationModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELSessionAuthorizationModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELSessionAuthorizationModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}sessionAuthorization". * * @param reader The XML reader. * @return The FILECATALYSTMODELSessionAuthorizationModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELSessionAuthorizationModel *_sessionAuthorizationModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}sessionAuthorization."]; } } if (xmlStrcmp(BAD_CAST "sessionAuthorization", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}sessionAuthorization."); #endif _sessionAuthorizationModel = (FILECATALYSTMODELSessionAuthorizationModel *)[FILECATALYSTMODELSessionAuthorizationModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}sessionAuthorization."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELSessionAuthorizationModel. Expected element {http://filecatalyst.com/model}sessionAuthorization. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELSessionAuthorizationModel. Expected element {http://filecatalyst.com/model}sessionAuthorization. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _sessionAuthorizationModel; } /** * Writes this FILECATALYSTMODELSessionAuthorizationModel to XML under element name "{http://filecatalyst.com/model}sessionAuthorization". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _sessionAuthorizationModel The SessionAuthorizationModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELSessionAuthorizationModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "sessionAuthorization", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}sessionAuthorization. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}sessionAuthorization..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}sessionAuthorization'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}sessionAuthorization..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}sessionAuthorizationModel for root element {http://filecatalyst.com/model}sessionAuthorization..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}sessionAuthorizationModel for root element {http://filecatalyst.com/model}sessionAuthorization..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}sessionAuthorization. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "authorization", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}authorization of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}authorization of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setAuthorization: __child]; return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self authorization]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "authorization", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}authorization."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}authorization..."); #endif [[self authorization] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}authorization..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}authorization."]; } } } @end /* implementation FILECATALYSTMODELSessionAuthorizationModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELSessionAuthorizationModel_M */ #ifndef DEF_FILECATALYSTMODELSessionSecretTokenModel_M #define DEF_FILECATALYSTMODELSessionSecretTokenModel_M /** * Class to hold user session secret */ @implementation FILECATALYSTMODELSessionSecretTokenModel /** * Session secret string. */ - (NSString *) sessionSecret { return _sessionSecret; } /** * Session secret string. */ - (void) setSessionSecret: (NSString *) newSessionSecret { [newSessionSecret retain]; [_sessionSecret release]; _sessionSecret = newSessionSecret; } - (void) dealloc { [self setSessionSecret: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELSessionSecretTokenModel *_fILECATALYSTMODELSessionSecretTokenModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELSessionSecretTokenModel = (FILECATALYSTMODELSessionSecretTokenModel *) [FILECATALYSTMODELSessionSecretTokenModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELSessionSecretTokenModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELSessionSecretTokenModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELSessionSecretTokenModel (JAXB) @end /*interface FILECATALYSTMODELSessionSecretTokenModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELSessionSecretTokenModel (JAXB) /** * Read an instance of FILECATALYSTMODELSessionSecretTokenModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELSessionSecretTokenModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELSessionSecretTokenModel *_fILECATALYSTMODELSessionSecretTokenModel = [[FILECATALYSTMODELSessionSecretTokenModel alloc] init]; NS_DURING { [_fILECATALYSTMODELSessionSecretTokenModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELSessionSecretTokenModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELSessionSecretTokenModel autorelease]; return _fILECATALYSTMODELSessionSecretTokenModel; } /** * Initialize this instance of FILECATALYSTMODELSessionSecretTokenModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELSessionSecretTokenModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELSessionSecretTokenModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}sessionSecretToken". * * @param reader The XML reader. * @return The FILECATALYSTMODELSessionSecretTokenModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELSessionSecretTokenModel *_sessionSecretTokenModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}sessionSecretToken."]; } } if (xmlStrcmp(BAD_CAST "sessionSecretToken", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}sessionSecretToken."); #endif _sessionSecretTokenModel = (FILECATALYSTMODELSessionSecretTokenModel *)[FILECATALYSTMODELSessionSecretTokenModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}sessionSecretToken."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELSessionSecretTokenModel. Expected element {http://filecatalyst.com/model}sessionSecretToken. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELSessionSecretTokenModel. Expected element {http://filecatalyst.com/model}sessionSecretToken. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _sessionSecretTokenModel; } /** * Writes this FILECATALYSTMODELSessionSecretTokenModel to XML under element name "{http://filecatalyst.com/model}sessionSecretToken". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _sessionSecretTokenModel The SessionSecretTokenModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELSessionSecretTokenModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "sessionSecretToken", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}sessionSecretToken. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}sessionSecretToken..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}sessionSecretToken'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}sessionSecretToken..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}sessionSecretTokenModel for root element {http://filecatalyst.com/model}sessionSecretToken..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}sessionSecretTokenModel for root element {http://filecatalyst.com/model}sessionSecretToken..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}sessionSecretToken. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "sessionSecret", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}sessionSecret of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}sessionSecret of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setSessionSecret: __child]; return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self sessionSecret]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "sessionSecret", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}sessionSecret."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}sessionSecret..."); #endif [[self sessionSecret] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}sessionSecret..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}sessionSecret."]; } } } @end /* implementation FILECATALYSTMODELSessionSecretTokenModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELSessionSecretTokenModel_M */ #ifndef DEF_FILECATALYSTMODELUsersModel_M #define DEF_FILECATALYSTMODELUsersModel_M /** * Users model class */ @implementation FILECATALYSTMODELUsersModel /** * List of users. */ - (NSArray *) user { return _user; } /** * List of users. */ - (void) setUser: (NSArray *) newUser { [newUser retain]; [_user release]; _user = newUser; } - (void) dealloc { [self setUser: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELUsersModel *_fILECATALYSTMODELUsersModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELUsersModel = (FILECATALYSTMODELUsersModel *) [FILECATALYSTMODELUsersModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELUsersModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELUsersModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELUsersModel (JAXB) @end /*interface FILECATALYSTMODELUsersModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELUsersModel (JAXB) /** * Read an instance of FILECATALYSTMODELUsersModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELUsersModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELUsersModel *_fILECATALYSTMODELUsersModel = [[FILECATALYSTMODELUsersModel alloc] init]; NS_DURING { [_fILECATALYSTMODELUsersModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELUsersModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELUsersModel autorelease]; return _fILECATALYSTMODELUsersModel; } /** * Initialize this instance of FILECATALYSTMODELUsersModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELUsersModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELUsersModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}users". * * @param reader The XML reader. * @return The FILECATALYSTMODELUsersModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELUsersModel *_usersModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}users."]; } } if (xmlStrcmp(BAD_CAST "users", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}users."); #endif _usersModel = (FILECATALYSTMODELUsersModel *)[FILECATALYSTMODELUsersModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}users."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELUsersModel. Expected element {http://filecatalyst.com/model}users. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELUsersModel. Expected element {http://filecatalyst.com/model}users. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _usersModel; } /** * Writes this FILECATALYSTMODELUsersModel to XML under element name "{http://filecatalyst.com/model}users". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _usersModel The UsersModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELUsersModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "users", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}users. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}users..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}users'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}users..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}usersModel for root element {http://filecatalyst.com/model}users..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}usersModel for root element {http://filecatalyst.com/model}users..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}users. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "user", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}user of type {http://filecatalyst.com/model}userModel."); #endif __child = [FILECATALYSTMODELUserModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}user of type {http://filecatalyst.com/model}userModel."); #endif if ([self user]) { [self setUser: [[self user] arrayByAddingObject: __child]]; } else { [self setUser: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self user]) { __enumerator = [[self user] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "user", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}user."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}user..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}user..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}user."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELUsersModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELUsersModel_M */ #ifndef DEF_FILECATALYSTMODELUserModel_M #define DEF_FILECATALYSTMODELUserModel_M /** * Model class to hold user information */ @implementation FILECATALYSTMODELUserModel /** * Hyperlink reference to the resource */ - (NSURL *) href { return _href; } /** * Hyperlink reference to the resource */ - (void) setHref: (NSURL *) newHref { [newHref retain]; [_href release]; _href = newHref; } /** * Unique login user name. Required field. */ - (NSString *) userName { return _userName; } /** * Unique login user name. Required field. */ - (void) setUserName: (NSString *) newUserName { [newUserName retain]; [_userName release]; _userName = newUserName; } /** * User status type. See userStatusType. */ - (enum FILECATALYSTMODELUserStatusType *) status { return _status; } /** * User status type. See userStatusType. */ - (void) setStatus: (enum FILECATALYSTMODELUserStatusType *) newStatus { if (_status != NULL) { free(_status); } _status = newStatus; } /** * User password. Only used on initial creation. Passwords are converted to an MD5 string and then persisted. */ - (NSString *) password { return _password; } /** * User password. Only used on initial creation. Passwords are converted to an MD5 string and then persisted. */ - (void) setPassword: (NSString *) newPassword { [newPassword retain]; [_password release]; _password = newPassword; } /** * User first name. Required field. */ - (NSString *) firstName { return _firstName; } /** * User first name. Required field. */ - (void) setFirstName: (NSString *) newFirstName { [newFirstName retain]; [_firstName release]; _firstName = newFirstName; } /** * User last name. Required field. */ - (NSString *) lastName { return _lastName; } /** * User last name. Required field. */ - (void) setLastName: (NSString *) newLastName { [newLastName retain]; [_lastName release]; _lastName = newLastName; } /** * Company for which the user works for. */ - (NSString *) company { return _company; } /** * Company for which the user works for. */ - (void) setCompany: (NSString *) newCompany { [newCompany retain]; [_company release]; _company = newCompany; } /** * User address. */ - (NSString *) address { return _address; } /** * User address. */ - (void) setAddress: (NSString *) newAddress { [newAddress retain]; [_address release]; _address = newAddress; } /** * User address line 2. */ - (NSString *) address2 { return _address2; } /** * User address line 2. */ - (void) setAddress2: (NSString *) newAddress2 { [newAddress2 retain]; [_address2 release]; _address2 = newAddress2; } /** * User city. */ - (NSString *) city { return _city; } /** * User city. */ - (void) setCity: (NSString *) newCity { [newCity retain]; [_city release]; _city = newCity; } /** * User state or province. */ - (NSString *) state { return _state; } /** * User state or province. */ - (void) setState: (NSString *) newState { [newState retain]; [_state release]; _state = newState; } /** * User alternate phone number. */ - (NSString *) altPhone { return _altPhone; } /** * User alternate phone number. */ - (void) setAltPhone: (NSString *) newAltPhone { [newAltPhone retain]; [_altPhone release]; _altPhone = newAltPhone; } /** * User ZIP or Postal code. */ - (NSString *) zip { return _zip; } /** * User ZIP or Postal code. */ - (void) setZip: (NSString *) newZip { [newZip retain]; [_zip release]; _zip = newZip; } /** * User country code. */ - (NSString *) country { return _country; } /** * User country code. */ - (void) setCountry: (NSString *) newCountry { [newCountry retain]; [_country release]; _country = newCountry; } /** * User phone number. */ - (NSString *) phone { return _phone; } /** * User phone number. */ - (void) setPhone: (NSString *) newPhone { [newPhone retain]; [_phone release]; _phone = newPhone; } /** * User fax number. */ - (NSString *) fax { return _fax; } /** * User fax number. */ - (void) setFax: (NSString *) newFax { [newFax retain]; [_fax release]; _fax = newFax; } /** * User email address. Required field. */ - (NSString *) email { return _email; } /** * User email address. Required field. */ - (void) setEmail: (NSString *) newEmail { [newEmail retain]; [_email release]; _email = newEmail; } /** * User last login date timestamp. */ - (long *) lastLogin { return _lastLogin; } /** * User last login date timestamp. */ - (void) setLastLogin: (long *) newLastLogin { if (_lastLogin != NULL) { free(_lastLogin); } _lastLogin = newLastLogin; } /** * Date user was created. */ - (long *) creation { return _creation; } /** * Date user was created. */ - (void) setCreation: (long *) newCreation { if (_creation != NULL) { free(_creation); } _creation = newCreation; } /** * User preferred FTP server. */ - (FILECATALYSTMODELNameHrefModel *) preferredServer { return _preferredServer; } /** * User preferred FTP server. */ - (void) setPreferredServer: (FILECATALYSTMODELNameHrefModel *) newPreferredServer { [newPreferredServer retain]; [_preferredServer release]; _preferredServer = newPreferredServer; } /** * User credit card type. */ - (NSString *) creditCardType { return _creditCardType; } /** * User credit card type. */ - (void) setCreditCardType: (NSString *) newCreditCardType { [newCreditCardType retain]; [_creditCardType release]; _creditCardType = newCreditCardType; } /** * User credit card number. */ - (NSString *) creditCardNumber { return _creditCardNumber; } /** * User credit card number. */ - (void) setCreditCardNumber: (NSString *) newCreditCardNumber { [newCreditCardNumber retain]; [_creditCardNumber release]; _creditCardNumber = newCreditCardNumber; } /** * User credit card expiry date. */ - (NSString *) creditCardExpiry { return _creditCardExpiry; } /** * User credit card expiry date. */ - (void) setCreditCardExpiry: (NSString *) newCreditCardExpiry { [newCreditCardExpiry retain]; [_creditCardExpiry release]; _creditCardExpiry = newCreditCardExpiry; } /** * User account status type. See userAccountStatusType. */ - (enum FILECATALYSTMODELUserAccountStatusType *) accountStatus { return _accountStatus; } /** * User account status type. See userAccountStatusType. */ - (void) setAccountStatus: (enum FILECATALYSTMODELUserAccountStatusType *) newAccountStatus { if (_accountStatus != NULL) { free(_accountStatus); } _accountStatus = newAccountStatus; } /** * User comment. */ - (NSString *) comment { return _comment; } /** * User comment. */ - (void) setComment: (NSString *) newComment { [newComment retain]; [_comment release]; _comment = newComment; } /** * Flag to indicate that the user is an administrator. */ - (BOOL *) admin { return _admin; } /** * Flag to indicate that the user is an administrator. */ - (void) setAdmin: (BOOL *) newAdmin { if (_admin != NULL) { free(_admin); } _admin = newAdmin; } /** * Flag to indicate that the user is an super administrator. */ - (BOOL *) superAdmin { return _superAdmin; } /** * Flag to indicate that the user is an super administrator. */ - (void) setSuperAdmin: (BOOL *) newSuperAdmin { if (_superAdmin != NULL) { free(_superAdmin); } _superAdmin = newSuperAdmin; } /** * Flag to indicate that the user accepts emails. */ - (BOOL *) acceptEmail { return _acceptEmail; } /** * Flag to indicate that the user accepts emails. */ - (void) setAcceptEmail: (BOOL *) newAcceptEmail { if (_acceptEmail != NULL) { free(_acceptEmail); } _acceptEmail = newAcceptEmail; } /** * Flag to indicate that the user is allowed Job Submission through HotFolder/Outlook/API. */ - (BOOL *) allowHotFolder { return _allowHotFolder; } /** * Flag to indicate that the user is allowed Job Submission through HotFolder/Outlook/API. */ - (void) setAllowHotFolder: (BOOL *) newAllowHotFolder { if (_allowHotFolder != NULL) { free(_allowHotFolder); } _allowHotFolder = newAllowHotFolder; } /** * User preferred protocol to use. See userProtocolType. */ - (enum FILECATALYSTMODELUserProtocolType *) protocol { return _protocol; } /** * User preferred protocol to use. See userProtocolType. */ - (void) setProtocol: (enum FILECATALYSTMODELUserProtocolType *) newProtocol { if (_protocol != NULL) { free(_protocol); } _protocol = newProtocol; } /** * Value in kbps. The user is prevented from exceeding this bandwidth. * Default is 0, which signifies no limit; maximum bandwidth is therefore the speed of the FileCatalyst server. */ - (NSString *) bandwidth { return _bandwidth; } /** * Value in kbps. The user is prevented from exceeding this bandwidth. * Default is 0, which signifies no limit; maximum bandwidth is therefore the speed of the FileCatalyst server. */ - (void) setBandwidth: (NSString *) newBandwidth { [newBandwidth retain]; [_bandwidth release]; _bandwidth = newBandwidth; } /** * Flag to indicate if the user is part of an LDAP directory server. * Read only attribute. */ - (BOOL *) directory { return _directory; } /** * Flag to indicate if the user is part of an LDAP directory server. * Read only attribute. */ - (void) setDirectory: (BOOL *) newDirectory { if (_directory != NULL) { free(_directory); } _directory = newDirectory; } /** * Slow start rate. */ - (NSString *) slowStartRate { return _slowStartRate; } /** * Slow start rate. */ - (void) setSlowStartRate: (NSString *) newSlowStartRate { [newSlowStartRate retain]; [_slowStartRate release]; _slowStartRate = newSlowStartRate; } /** * Flag to indicate if the slow start rate should be used. */ - (BOOL *) useSlowStart { return _useSlowStart; } /** * Flag to indicate if the slow start rate should be used. */ - (void) setUseSlowStart: (BOOL *) newUseSlowStart { if (_useSlowStart != NULL) { free(_useSlowStart); } _useSlowStart = newUseSlowStart; } /** * Slow start aggression rate. */ - (NSString *) slowStartAggressionRate { return _slowStartAggressionRate; } /** * Slow start aggression rate. */ - (void) setSlowStartAggressionRate: (NSString *) newSlowStartAggressionRate { [newSlowStartAggressionRate retain]; [_slowStartAggressionRate release]; _slowStartAggressionRate = newSlowStartAggressionRate; } /** * Value in bytes - default 4096000. * The block size determines how much data will be stored, encoded and sent from the transmitter to the receiver * at one time in any one thread. The transmitter waits for acknowledgment that a block is received before proceeding * to the next block; therefore the larger the block size, the better the throughput due to fewer acknowledgments. * However, poorly-performing networks may cause excessive retransmission of lost data if the block size is overly large. */ - (NSString *) blocksize { return _blocksize; } /** * Value in bytes - default 4096000. * The block size determines how much data will be stored, encoded and sent from the transmitter to the receiver * at one time in any one thread. The transmitter waits for acknowledgment that a block is received before proceeding * to the next block; therefore the larger the block size, the better the throughput due to fewer acknowledgments. * However, poorly-performing networks may cause excessive retransmission of lost data if the block size is overly large. */ - (void) setBlocksize: (NSString *) newBlocksize { [newBlocksize retain]; [_blocksize release]; _blocksize = newBlocksize; } /** * Value in bytes - default 1024. * The maximum UDP packet size that client applications can send to the server. * Generally this should be less than the MTU of your network (usually 1500). */ - (NSString *) unitSize { return _unitSize; } /** * Value in bytes - default 1024. * The maximum UDP packet size that client applications can send to the server. * Generally this should be less than the MTU of your network (usually 1500). */ - (void) setUnitSize: (NSString *) newUnitSize { [newUnitSize retain]; [_unitSize release]; _unitSize = newUnitSize; } /** * Number of encoders. */ - (NSString *) numEncoders { return _numEncoders; } /** * Number of encoders. */ - (void) setNumEncoders: (NSString *) newNumEncoders { [newNumEncoders retain]; [_numEncoders release]; _numEncoders = newNumEncoders; } /** * Number of FTP streams. */ - (NSString *) numFTPStreams { return _numFTPStreams; } /** * Number of FTP streams. */ - (void) setNumFTPStreams: (NSString *) newNumFTPStreams { [newNumFTPStreams retain]; [_numFTPStreams release]; _numFTPStreams = newNumFTPStreams; } /** * Flag to indicate that the user is allowed bandwidth tuning. */ - (BOOL *) allowUserBandwidthTuning { return _allowUserBandwidthTuning; } /** * Flag to indicate that the user is allowed bandwidth tuning. */ - (void) setAllowUserBandwidthTuning: (BOOL *) newAllowUserBandwidthTuning { if (_allowUserBandwidthTuning != NULL) { free(_allowUserBandwidthTuning); } _allowUserBandwidthTuning = newAllowUserBandwidthTuning; } /** * User account expiry date. */ - (long *) expiryDate { return _expiryDate; } /** * User account expiry date. */ - (void) setExpiryDate: (long *) newExpiryDate { if (_expiryDate != NULL) { free(_expiryDate); } _expiryDate = newExpiryDate; } /** * Flag to indicate that the user is allowed to create temporary accounts. */ - (BOOL *) allowTempAccountCreation { return _allowTempAccountCreation; } /** * Flag to indicate that the user is allowed to create temporary accounts. */ - (void) setAllowTempAccountCreation: (BOOL *) newAllowTempAccountCreation { if (_allowTempAccountCreation != NULL) { free(_allowTempAccountCreation); } _allowTempAccountCreation = newAllowTempAccountCreation; } /** * Owner user name */ - (NSString *) ownerUserName { return _ownerUserName; } /** * Owner user name */ - (void) setOwnerUserName: (NSString *) newOwnerUserName { [newOwnerUserName retain]; [_ownerUserName release]; _ownerUserName = newOwnerUserName; } /** * Temporary user flag. */ - (BOOL *) tempUser { return _tempUser; } /** * Temporary user flag. */ - (void) setTempUser: (BOOL *) newTempUser { if (_tempUser != NULL) { free(_tempUser); } _tempUser = newTempUser; } /** * User preferred upload method to use. See userUploadMethodType. */ - (enum FILECATALYSTMODELUserUploadMethodType *) uploadMethod { return _uploadMethod; } /** * User preferred upload method to use. See userUploadMethodType. */ - (void) setUploadMethod: (enum FILECATALYSTMODELUserUploadMethodType *) newUploadMethod { if (_uploadMethod != NULL) { free(_uploadMethod); } _uploadMethod = newUploadMethod; } /** * Flag to indicate id the user is allowed to change his/her password. */ - (BOOL *) pwChangeable { return _pwChangeable; } /** * Flag to indicate id the user is allowed to change his/her password. */ - (void) setPwChangeable: (BOOL *) newPwChangeable { if (_pwChangeable != NULL) { free(_pwChangeable); } _pwChangeable = newPwChangeable; } /** * Date password was created. */ - (long *) pwcreationDate { return _pwcreationDate; } /** * Date password was created. */ - (void) setPwcreationDate: (long *) newPwcreationDate { if (_pwcreationDate != NULL) { free(_pwcreationDate); } _pwcreationDate = newPwcreationDate; } /** * Days before password will expire. */ - (long *) pwdaysBeforeExpire { return _pwdaysBeforeExpire; } /** * Days before password will expire. */ - (void) setPwdaysBeforeExpire: (long *) newPwdaysBeforeExpire { if (_pwdaysBeforeExpire != NULL) { free(_pwdaysBeforeExpire); } _pwdaysBeforeExpire = newPwdaysBeforeExpire; } /** * Flag to indicate that the user must change his/her password on the next login. */ - (BOOL *) pwmustChange { return _pwmustChange; } /** * Flag to indicate that the user must change his/her password on the next login. */ - (void) setPwmustChange: (BOOL *) newPwmustChange { if (_pwmustChange != NULL) { free(_pwmustChange); } _pwmustChange = newPwmustChange; } /** * Previously used passwords. */ - (NSString *) pwusedPasswords { return _pwusedPasswords; } /** * Previously used passwords. */ - (void) setPwusedPasswords: (NSString *) newPwusedPasswords { [newPwusedPasswords retain]; [_pwusedPasswords release]; _pwusedPasswords = newPwusedPasswords; } /** * Password error attempts. */ - (int *) pwnumErrors { return _pwnumErrors; } /** * Password error attempts. */ - (void) setPwnumErrors: (int *) newPwnumErrors { if (_pwnumErrors != NULL) { free(_pwnumErrors); } _pwnumErrors = newPwnumErrors; } /** * List of groups for which the user belongs to */ - (NSArray *) userGroup { return _userGroup; } /** * List of groups for which the user belongs to */ - (void) setUserGroup: (NSArray *) newUserGroup { [newUserGroup retain]; [_userGroup release]; _userGroup = newUserGroup; } - (void) dealloc { [self setHref: nil]; [self setUserName: nil]; [self setStatus: NULL]; [self setPassword: nil]; [self setFirstName: nil]; [self setLastName: nil]; [self setCompany: nil]; [self setAddress: nil]; [self setAddress2: nil]; [self setCity: nil]; [self setState: nil]; [self setAltPhone: nil]; [self setZip: nil]; [self setCountry: nil]; [self setPhone: nil]; [self setFax: nil]; [self setEmail: nil]; [self setLastLogin: NULL]; [self setCreation: NULL]; [self setPreferredServer: nil]; [self setCreditCardType: nil]; [self setCreditCardNumber: nil]; [self setCreditCardExpiry: nil]; [self setAccountStatus: NULL]; [self setComment: nil]; [self setAdmin: NULL]; [self setSuperAdmin: NULL]; [self setAcceptEmail: NULL]; [self setAllowHotFolder: NULL]; [self setProtocol: NULL]; [self setBandwidth: nil]; [self setDirectory: NULL]; [self setSlowStartRate: nil]; [self setUseSlowStart: NULL]; [self setSlowStartAggressionRate: nil]; [self setBlocksize: nil]; [self setUnitSize: nil]; [self setNumEncoders: nil]; [self setNumFTPStreams: nil]; [self setAllowUserBandwidthTuning: NULL]; [self setExpiryDate: NULL]; [self setAllowTempAccountCreation: NULL]; [self setOwnerUserName: nil]; [self setTempUser: NULL]; [self setUploadMethod: NULL]; [self setPwChangeable: NULL]; [self setPwcreationDate: NULL]; [self setPwdaysBeforeExpire: NULL]; [self setPwmustChange: NULL]; [self setPwusedPasswords: nil]; [self setPwnumErrors: NULL]; [self setUserGroup: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELUserModel *_fILECATALYSTMODELUserModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELUserModel = (FILECATALYSTMODELUserModel *) [FILECATALYSTMODELUserModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELUserModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELUserModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELUserModel (JAXB) @end /*interface FILECATALYSTMODELUserModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELUserModel (JAXB) /** * Read an instance of FILECATALYSTMODELUserModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELUserModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELUserModel *_fILECATALYSTMODELUserModel = [[FILECATALYSTMODELUserModel alloc] init]; NS_DURING { [_fILECATALYSTMODELUserModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELUserModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELUserModel autorelease]; return _fILECATALYSTMODELUserModel; } /** * Initialize this instance of FILECATALYSTMODELUserModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELUserModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELUserModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}user". * * @param reader The XML reader. * @return The FILECATALYSTMODELUserModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELUserModel *_userModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}user."]; } } if (xmlStrcmp(BAD_CAST "user", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}user."); #endif _userModel = (FILECATALYSTMODELUserModel *)[FILECATALYSTMODELUserModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}user."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELUserModel. Expected element {http://filecatalyst.com/model}user. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELUserModel. Expected element {http://filecatalyst.com/model}user. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _userModel; } /** * Writes this FILECATALYSTMODELUserModel to XML under element name "{http://filecatalyst.com/model}user". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _userModel The UserModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELUserModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "user", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}user. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}user..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}user'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}user..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}userModel for root element {http://filecatalyst.com/model}user..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}userModel for root element {http://filecatalyst.com/model}user..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}user. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "href", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}href..."); #endif [self setHref: (NSURL*) [NSURL readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}href..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "userName", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}userName of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}userName of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setUserName: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadFILECATALYSTMODELUserStatusTypeType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setStatus: ((enum FILECATALYSTMODELUserStatusType*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "password", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}password of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}password of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setPassword: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "firstName", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}firstName of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}firstName of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setFirstName: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "lastName", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}lastName of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}lastName of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setLastName: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "company", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}company of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}company of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCompany: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "address", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}address of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}address of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setAddress: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "address2", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}address2 of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}address2 of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setAddress2: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "city", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}city of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}city of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCity: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "state", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}state of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}state of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setState: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "altPhone", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}altPhone of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}altPhone of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setAltPhone: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "zip", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}zip of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}zip of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setZip: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "country", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}country of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}country of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCountry: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "phone", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}phone of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}phone of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setPhone: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "fax", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}fax of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}fax of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setFax: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "email", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}email of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}email of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setEmail: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "lastLogin", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadLongType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setLastLogin: ((long*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "creation", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadLongType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setCreation: ((long*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "preferredServer", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}preferredServer of type {http://filecatalyst.com/model}nameHrefModel."); #endif __child = [FILECATALYSTMODELNameHrefModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}preferredServer of type {http://filecatalyst.com/model}nameHrefModel."); #endif [self setPreferredServer: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "creditCardType", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}creditCardType of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}creditCardType of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCreditCardType: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "creditCardNumber", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}creditCardNumber of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}creditCardNumber of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCreditCardNumber: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "creditCardExpiry", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}creditCardExpiry of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}creditCardExpiry of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setCreditCardExpiry: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "accountStatus", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadFILECATALYSTMODELUserAccountStatusTypeType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setAccountStatus: ((enum FILECATALYSTMODELUserAccountStatusType*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "comment", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}comment of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}comment of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setComment: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "admin", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setAdmin: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "superAdmin", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setSuperAdmin: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "acceptEmail", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setAcceptEmail: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "allowHotFolder", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setAllowHotFolder: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "protocol", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadFILECATALYSTMODELUserProtocolTypeType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setProtocol: ((enum FILECATALYSTMODELUserProtocolType*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "bandwidth", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}bandwidth of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}bandwidth of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setBandwidth: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "directory", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setDirectory: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "slowStartRate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}slowStartRate of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}slowStartRate of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setSlowStartRate: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "useSlowStart", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setUseSlowStart: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "slowStartAggressionRate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}slowStartAggressionRate of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}slowStartAggressionRate of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setSlowStartAggressionRate: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "blocksize", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}blocksize of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}blocksize of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setBlocksize: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "unitSize", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}unitSize of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}unitSize of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setUnitSize: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "numEncoders", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}numEncoders of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}numEncoders of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setNumEncoders: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "numFTPStreams", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}numFTPStreams of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}numFTPStreams of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setNumFTPStreams: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "allowUserBandwidthTuning", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setAllowUserBandwidthTuning: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "expiryDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadLongType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setExpiryDate: ((long*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "allowTempAccountCreation", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setAllowTempAccountCreation: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "ownerUserName", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}ownerUserName of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}ownerUserName of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setOwnerUserName: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "tempUser", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setTempUser: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "uploadMethod", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadFILECATALYSTMODELUserUploadMethodTypeType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setUploadMethod: ((enum FILECATALYSTMODELUserUploadMethodType*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "pwChangeable", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setPwChangeable: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "pwcreationDate", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadLongType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setPwcreationDate: ((long*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "pwdaysBeforeExpire", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadLongType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setPwdaysBeforeExpire: ((long*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "pwmustChange", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadBooleanType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setPwmustChange: ((BOOL*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "pwusedPasswords", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}pwusedPasswords of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}pwusedPasswords of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setPwusedPasswords: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "pwnumErrors", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { _child_accessor = xmlTextReaderReadIntType(reader); if (_child_accessor == NULL) { //panic: unable to return the value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading element value."]; } [self setPwnumErrors: ((int*) _child_accessor)]; return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "group", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}group of type {http://filecatalyst.com/model}nameHrefModel."); #endif __child = [FILECATALYSTMODELNameHrefModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}group of type {http://filecatalyst.com/model}nameHrefModel."); #endif if ([self userGroup]) { [self setUserGroup: [[self userGroup] arrayByAddingObject: __child]]; } else { [self setUserGroup: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self href]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "href", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}href."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}href..."); #endif [[self href] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}href..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}href."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self userName]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "userName", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}userName."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}userName..."); #endif [[self userName] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}userName..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}userName."]; } } if ([self status] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}status."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}status..."); #endif status = xmlTextWriterWriteFILECATALYSTMODELUserStatusTypeType(writer, [self status]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}status..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}status."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}status."]; } } if ([self password]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "password", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}password."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}password..."); #endif [[self password] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}password..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}password."]; } } if ([self firstName]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "firstName", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}firstName."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}firstName..."); #endif [[self firstName] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}firstName..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}firstName."]; } } if ([self lastName]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "lastName", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}lastName."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}lastName..."); #endif [[self lastName] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}lastName..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}lastName."]; } } if ([self company]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "company", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}company."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}company..."); #endif [[self company] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}company..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}company."]; } } if ([self address]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "address", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}address."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}address..."); #endif [[self address] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}address..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}address."]; } } if ([self address2]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "address2", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}address2."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}address2..."); #endif [[self address2] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}address2..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}address2."]; } } if ([self city]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "city", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}city."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}city..."); #endif [[self city] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}city..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}city."]; } } if ([self state]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "state", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}state."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}state..."); #endif [[self state] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}state..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}state."]; } } if ([self altPhone]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "altPhone", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}altPhone."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}altPhone..."); #endif [[self altPhone] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}altPhone..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}altPhone."]; } } if ([self zip]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "zip", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}zip."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}zip..."); #endif [[self zip] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}zip..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}zip."]; } } if ([self country]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "country", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}country."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}country..."); #endif [[self country] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}country..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}country."]; } } if ([self phone]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "phone", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}phone."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}phone..."); #endif [[self phone] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}phone..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}phone."]; } } if ([self fax]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "fax", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}fax."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}fax..."); #endif [[self fax] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}fax..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}fax."]; } } if ([self email]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "email", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}email."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}email..."); #endif [[self email] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}email..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}email."]; } } if ([self lastLogin] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "lastLogin", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}lastLogin."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}lastLogin..."); #endif status = xmlTextWriterWriteLongType(writer, [self lastLogin]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}lastLogin..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}lastLogin."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}lastLogin."]; } } if ([self creation] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "creation", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}creation."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}creation..."); #endif status = xmlTextWriterWriteLongType(writer, [self creation]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}creation..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}creation."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}creation."]; } } if ([self preferredServer]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "preferredServer", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}preferredServer."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}preferredServer..."); #endif [[self preferredServer] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}preferredServer..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}preferredServer."]; } } if ([self creditCardType]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "creditCardType", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}creditCardType."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}creditCardType..."); #endif [[self creditCardType] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}creditCardType..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}creditCardType."]; } } if ([self creditCardNumber]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "creditCardNumber", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}creditCardNumber."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}creditCardNumber..."); #endif [[self creditCardNumber] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}creditCardNumber..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}creditCardNumber."]; } } if ([self creditCardExpiry]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "creditCardExpiry", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}creditCardExpiry."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}creditCardExpiry..."); #endif [[self creditCardExpiry] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}creditCardExpiry..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}creditCardExpiry."]; } } if ([self accountStatus] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "accountStatus", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}accountStatus."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}accountStatus..."); #endif status = xmlTextWriterWriteFILECATALYSTMODELUserAccountStatusTypeType(writer, [self accountStatus]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}accountStatus..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}accountStatus."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}accountStatus."]; } } if ([self comment]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "comment", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}comment."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}comment..."); #endif [[self comment] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}comment..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}comment."]; } } if ([self admin] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "admin", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}admin."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}admin..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self admin]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}admin..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}admin."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}admin."]; } } if ([self superAdmin] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "superAdmin", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}superAdmin."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}superAdmin..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self superAdmin]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}superAdmin..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}superAdmin."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}superAdmin."]; } } if ([self acceptEmail] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "acceptEmail", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}acceptEmail."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}acceptEmail..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self acceptEmail]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}acceptEmail..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}acceptEmail."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}acceptEmail."]; } } if ([self allowHotFolder] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "allowHotFolder", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}allowHotFolder."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}allowHotFolder..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self allowHotFolder]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}allowHotFolder..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}allowHotFolder."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}allowHotFolder."]; } } if ([self protocol] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "protocol", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}protocol."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}protocol..."); #endif status = xmlTextWriterWriteFILECATALYSTMODELUserProtocolTypeType(writer, [self protocol]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}protocol..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}protocol."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}protocol."]; } } if ([self bandwidth]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "bandwidth", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}bandwidth."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}bandwidth..."); #endif [[self bandwidth] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}bandwidth..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}bandwidth."]; } } if ([self directory] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "directory", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}directory."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}directory..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self directory]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}directory..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}directory."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}directory."]; } } if ([self slowStartRate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "slowStartRate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}slowStartRate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}slowStartRate..."); #endif [[self slowStartRate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}slowStartRate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}slowStartRate."]; } } if ([self useSlowStart] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "useSlowStart", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}useSlowStart."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}useSlowStart..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self useSlowStart]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}useSlowStart..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}useSlowStart."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}useSlowStart."]; } } if ([self slowStartAggressionRate]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "slowStartAggressionRate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}slowStartAggressionRate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}slowStartAggressionRate..."); #endif [[self slowStartAggressionRate] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}slowStartAggressionRate..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}slowStartAggressionRate."]; } } if ([self blocksize]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "blocksize", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}blocksize."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}blocksize..."); #endif [[self blocksize] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}blocksize..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}blocksize."]; } } if ([self unitSize]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "unitSize", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}unitSize."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}unitSize..."); #endif [[self unitSize] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}unitSize..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}unitSize."]; } } if ([self numEncoders]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "numEncoders", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}numEncoders."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}numEncoders..."); #endif [[self numEncoders] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}numEncoders..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}numEncoders."]; } } if ([self numFTPStreams]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "numFTPStreams", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}numFTPStreams."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}numFTPStreams..."); #endif [[self numFTPStreams] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}numFTPStreams..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}numFTPStreams."]; } } if ([self allowUserBandwidthTuning] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "allowUserBandwidthTuning", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}allowUserBandwidthTuning."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}allowUserBandwidthTuning..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self allowUserBandwidthTuning]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}allowUserBandwidthTuning..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}allowUserBandwidthTuning."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}allowUserBandwidthTuning."]; } } if ([self expiryDate] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "expiryDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}expiryDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}expiryDate..."); #endif status = xmlTextWriterWriteLongType(writer, [self expiryDate]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}expiryDate..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}expiryDate."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}expiryDate."]; } } if ([self allowTempAccountCreation] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "allowTempAccountCreation", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}allowTempAccountCreation."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}allowTempAccountCreation..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self allowTempAccountCreation]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}allowTempAccountCreation..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}allowTempAccountCreation."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}allowTempAccountCreation."]; } } if ([self ownerUserName]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "ownerUserName", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}ownerUserName."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}ownerUserName..."); #endif [[self ownerUserName] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}ownerUserName..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}ownerUserName."]; } } if ([self tempUser] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "tempUser", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}tempUser."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}tempUser..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self tempUser]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}tempUser..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}tempUser."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}tempUser."]; } } if ([self uploadMethod] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "uploadMethod", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}uploadMethod."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}uploadMethod..."); #endif status = xmlTextWriterWriteFILECATALYSTMODELUserUploadMethodTypeType(writer, [self uploadMethod]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}uploadMethod..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}uploadMethod."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}uploadMethod."]; } } if ([self pwChangeable] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "pwChangeable", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}pwChangeable."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}pwChangeable..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self pwChangeable]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}pwChangeable..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}pwChangeable."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}pwChangeable."]; } } if ([self pwcreationDate] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "pwcreationDate", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}pwcreationDate."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}pwcreationDate..."); #endif status = xmlTextWriterWriteLongType(writer, [self pwcreationDate]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}pwcreationDate..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}pwcreationDate."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}pwcreationDate."]; } } if ([self pwdaysBeforeExpire] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "pwdaysBeforeExpire", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}pwdaysBeforeExpire."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}pwdaysBeforeExpire..."); #endif status = xmlTextWriterWriteLongType(writer, [self pwdaysBeforeExpire]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}pwdaysBeforeExpire..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}pwdaysBeforeExpire."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}pwdaysBeforeExpire."]; } } if ([self pwmustChange] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "pwmustChange", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}pwmustChange."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}pwmustChange..."); #endif status = xmlTextWriterWriteBooleanType(writer, [self pwmustChange]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}pwmustChange..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}pwmustChange."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}pwmustChange."]; } } if ([self pwusedPasswords]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "pwusedPasswords", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}pwusedPasswords."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}pwusedPasswords..."); #endif [[self pwusedPasswords] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}pwusedPasswords..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}pwusedPasswords."]; } } if ([self pwnumErrors] != NULL) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "pwnumErrors", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}pwnumErrors."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}pwnumErrors..."); #endif status = xmlTextWriterWriteIntType(writer, [self pwnumErrors]); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}pwnumErrors..."); #endif if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing child element {}pwnumErrors."]; } status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}pwnumErrors."]; } } if ([self userGroup]) { __enumerator = [[self userGroup] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "group", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}group."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}group..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}group..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}group."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELUserModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELUserModel_M */ #ifndef DEF_FILECATALYSTMODELSessionInfoModel_M #define DEF_FILECATALYSTMODELSessionInfoModel_M /** * Class to hold user session information */ @implementation FILECATALYSTMODELSessionInfoModel /** * Authorization authentication string. * Format: BASE64(USER:PASSWORD) */ - (NSString *) authorization { return _authorization; } /** * Authorization authentication string. * Format: BASE64(USER:PASSWORD) */ - (void) setAuthorization: (NSString *) newAuthorization { [newAuthorization retain]; [_authorization release]; _authorization = newAuthorization; } /** * Session secret string. */ - (NSString *) sessionSecret { return _sessionSecret; } /** * Session secret string. */ - (void) setSessionSecret: (NSString *) newSessionSecret { [newSessionSecret retain]; [_sessionSecret release]; _sessionSecret = newSessionSecret; } - (void) dealloc { [self setAuthorization: nil]; [self setSessionSecret: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELSessionInfoModel *_fILECATALYSTMODELSessionInfoModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELSessionInfoModel = (FILECATALYSTMODELSessionInfoModel *) [FILECATALYSTMODELSessionInfoModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELSessionInfoModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELSessionInfoModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELSessionInfoModel (JAXB) @end /*interface FILECATALYSTMODELSessionInfoModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELSessionInfoModel (JAXB) /** * Read an instance of FILECATALYSTMODELSessionInfoModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELSessionInfoModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELSessionInfoModel *_fILECATALYSTMODELSessionInfoModel = [[FILECATALYSTMODELSessionInfoModel alloc] init]; NS_DURING { [_fILECATALYSTMODELSessionInfoModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELSessionInfoModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELSessionInfoModel autorelease]; return _fILECATALYSTMODELSessionInfoModel; } /** * Initialize this instance of FILECATALYSTMODELSessionInfoModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELSessionInfoModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELSessionInfoModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}sessionInfo". * * @param reader The XML reader. * @return The FILECATALYSTMODELSessionInfoModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELSessionInfoModel *_sessionInfoModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}sessionInfo."]; } } if (xmlStrcmp(BAD_CAST "sessionInfo", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}sessionInfo."); #endif _sessionInfoModel = (FILECATALYSTMODELSessionInfoModel *)[FILECATALYSTMODELSessionInfoModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}sessionInfo."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELSessionInfoModel. Expected element {http://filecatalyst.com/model}sessionInfo. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELSessionInfoModel. Expected element {http://filecatalyst.com/model}sessionInfo. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _sessionInfoModel; } /** * Writes this FILECATALYSTMODELSessionInfoModel to XML under element name "{http://filecatalyst.com/model}sessionInfo". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _sessionInfoModel The SessionInfoModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELSessionInfoModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "sessionInfo", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}sessionInfo. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}sessionInfo..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}sessionInfo'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}sessionInfo..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}sessionInfoModel for root element {http://filecatalyst.com/model}sessionInfo..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}sessionInfoModel for root element {http://filecatalyst.com/model}sessionInfo..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}sessionInfo. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "authorization", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}authorization of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}authorization of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setAuthorization: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "sessionSecret", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}sessionSecret of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}sessionSecret of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setSessionSecret: __child]; return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self authorization]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "authorization", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}authorization."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}authorization..."); #endif [[self authorization] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}authorization..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}authorization."]; } } if ([self sessionSecret]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "sessionSecret", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}sessionSecret."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}sessionSecret..."); #endif [[self sessionSecret] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}sessionSecret..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}sessionSecret."]; } } } @end /* implementation FILECATALYSTMODELSessionInfoModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELSessionInfoModel_M */ #ifndef DEF_FILECATALYSTMODELPricesModel_M #define DEF_FILECATALYSTMODELPricesModel_M /** * Prices model class */ @implementation FILECATALYSTMODELPricesModel /** * Minimum cost to use. */ - (double) minimumCost { return _minimumCost; } /** * Minimum cost to use. */ - (void) setMinimumCost: (double) newMinimumCost { _minimumCost = newMinimumCost; } /** * Price name. */ - (NSString *) name { return _name; } /** * Price name. */ - (void) setName: (NSString *) newName { [newName retain]; [_name release]; _name = newName; } /** * List of prices. */ - (NSArray *) price { return _price; } /** * List of prices. */ - (void) setPrice: (NSArray *) newPrice { [newPrice retain]; [_price release]; _price = newPrice; } - (void) dealloc { [self setName: nil]; [self setPrice: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELPricesModel *_fILECATALYSTMODELPricesModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELPricesModel = (FILECATALYSTMODELPricesModel *) [FILECATALYSTMODELPricesModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELPricesModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELPricesModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELPricesModel (JAXB) @end /*interface FILECATALYSTMODELPricesModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELPricesModel (JAXB) /** * Read an instance of FILECATALYSTMODELPricesModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELPricesModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELPricesModel *_fILECATALYSTMODELPricesModel = [[FILECATALYSTMODELPricesModel alloc] init]; NS_DURING { [_fILECATALYSTMODELPricesModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELPricesModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELPricesModel autorelease]; return _fILECATALYSTMODELPricesModel; } /** * Initialize this instance of FILECATALYSTMODELPricesModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELPricesModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELPricesModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}prices". * * @param reader The XML reader. * @return The FILECATALYSTMODELPricesModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELPricesModel *_pricesModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}prices."]; } } if (xmlStrcmp(BAD_CAST "prices", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}prices."); #endif _pricesModel = (FILECATALYSTMODELPricesModel *)[FILECATALYSTMODELPricesModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}prices."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELPricesModel. Expected element {http://filecatalyst.com/model}prices. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELPricesModel. Expected element {http://filecatalyst.com/model}prices. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _pricesModel; } /** * Writes this FILECATALYSTMODELPricesModel to XML under element name "{http://filecatalyst.com/model}prices". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _pricesModel The PricesModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELPricesModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "prices", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}prices. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}prices..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}prices'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}prices..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}pricesModel for root element {http://filecatalyst.com/model}prices..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}pricesModel for root element {http://filecatalyst.com/model}prices..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}prices. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "minimumCost", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}minimumCost..."); #endif _child_accessor = xmlTextReaderReadDoubleType(reader); if (_child_accessor == NULL) { //panic: unable to read the attribute value for some reason. [NSException raise: @"XMLReadError" format: @"Error reading attribute {}minimumCost."]; } [self setMinimumCost: *((double*) _child_accessor)]; free(_child_accessor); #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}minimumCost..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}name..."); #endif [self setName: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}name..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "price", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}price of type {http://filecatalyst.com/model}priceModel."); #endif __child = [FILECATALYSTMODELPriceModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}price of type {http://filecatalyst.com/model}priceModel."); #endif if ([self price]) { [self setPrice: [[self price] arrayByAddingObject: __child]]; } else { [self setPrice: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if (YES) { //always write the primitive attributes... status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "minimumCost", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}minimumCost."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}minimumCost..."); #endif status = xmlTextWriterWriteDoubleType(writer, &_minimumCost); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute {}minimumCost."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}minimumCost..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}minimumCost."]; } } if ([self name]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}name."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}name..."); #endif [[self name] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}name..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}name."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self price]) { __enumerator = [[self price] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "price", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}price."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}price..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}price..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}price."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELPricesModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELPricesModel_M */ #ifndef DEF_FILECATALYSTMODELOrderFormsModel_M #define DEF_FILECATALYSTMODELOrderFormsModel_M /** * Order forms model class */ @implementation FILECATALYSTMODELOrderFormsModel /** * List of order forms. */ - (NSArray *) orderform { return _orderform; } /** * List of order forms. */ - (void) setOrderform: (NSArray *) newOrderform { [newOrderform retain]; [_orderform release]; _orderform = newOrderform; } - (void) dealloc { [self setOrderform: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELOrderFormsModel *_fILECATALYSTMODELOrderFormsModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELOrderFormsModel = (FILECATALYSTMODELOrderFormsModel *) [FILECATALYSTMODELOrderFormsModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELOrderFormsModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELOrderFormsModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELOrderFormsModel (JAXB) @end /*interface FILECATALYSTMODELOrderFormsModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELOrderFormsModel (JAXB) /** * Read an instance of FILECATALYSTMODELOrderFormsModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELOrderFormsModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELOrderFormsModel *_fILECATALYSTMODELOrderFormsModel = [[FILECATALYSTMODELOrderFormsModel alloc] init]; NS_DURING { [_fILECATALYSTMODELOrderFormsModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELOrderFormsModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELOrderFormsModel autorelease]; return _fILECATALYSTMODELOrderFormsModel; } /** * Initialize this instance of FILECATALYSTMODELOrderFormsModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELOrderFormsModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELOrderFormsModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}orderforms". * * @param reader The XML reader. * @return The FILECATALYSTMODELOrderFormsModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELOrderFormsModel *_orderFormsModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}orderforms."]; } } if (xmlStrcmp(BAD_CAST "orderforms", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}orderforms."); #endif _orderFormsModel = (FILECATALYSTMODELOrderFormsModel *)[FILECATALYSTMODELOrderFormsModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}orderforms."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELOrderFormsModel. Expected element {http://filecatalyst.com/model}orderforms. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELOrderFormsModel. Expected element {http://filecatalyst.com/model}orderforms. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _orderFormsModel; } /** * Writes this FILECATALYSTMODELOrderFormsModel to XML under element name "{http://filecatalyst.com/model}orderforms". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _orderFormsModel The OrderFormsModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELOrderFormsModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "orderforms", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}orderforms. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}orderforms..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}orderforms'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}orderforms..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}orderFormsModel for root element {http://filecatalyst.com/model}orderforms..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}orderFormsModel for root element {http://filecatalyst.com/model}orderforms..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}orderforms. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "orderform", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}orderform of type {http://filecatalyst.com/model}orderFormModel."); #endif __child = [FILECATALYSTMODELOrderFormModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}orderform of type {http://filecatalyst.com/model}orderFormModel."); #endif if ([self orderform]) { [self setOrderform: [[self orderform] arrayByAddingObject: __child]]; } else { [self setOrderform: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self orderform]) { __enumerator = [[self orderform] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "orderform", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}orderform."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}orderform..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}orderform..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}orderform."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELOrderFormsModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELOrderFormsModel_M */ #ifndef DEF_FILECATALYSTMODELNameHrefModel_M #define DEF_FILECATALYSTMODELNameHrefModel_M /** * Name HREF model class */ @implementation FILECATALYSTMODELNameHrefModel /** * Resource name or ID. */ - (NSString *) name { return _name; } /** * Resource name or ID. */ - (void) setName: (NSString *) newName { [newName retain]; [_name release]; _name = newName; } /** * Hyperlink reference to the resource */ - (NSURL *) href { return _href; } /** * Hyperlink reference to the resource */ - (void) setHref: (NSURL *) newHref { [newHref retain]; [_href release]; _href = newHref; } /** * User friendly name for the resource. */ - (NSString *) value { return _value; } /** * User friendly name for the resource. */ - (void) setValue: (NSString *) newValue { [newValue retain]; [_value release]; _value = newValue; } - (void) dealloc { [self setName: nil]; [self setHref: nil]; [self setValue: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELNameHrefModel *_fILECATALYSTMODELNameHrefModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELNameHrefModel = (FILECATALYSTMODELNameHrefModel *) [FILECATALYSTMODELNameHrefModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELNameHrefModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELNameHrefModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELNameHrefModel (JAXB) @end /*interface FILECATALYSTMODELNameHrefModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELNameHrefModel (JAXB) /** * Read an instance of FILECATALYSTMODELNameHrefModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELNameHrefModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELNameHrefModel *_fILECATALYSTMODELNameHrefModel = [[FILECATALYSTMODELNameHrefModel alloc] init]; NS_DURING { [_fILECATALYSTMODELNameHrefModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELNameHrefModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELNameHrefModel autorelease]; return _fILECATALYSTMODELNameHrefModel; } /** * Initialize this instance of FILECATALYSTMODELNameHrefModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELNameHrefModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELNameHrefModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}nameHref". * * @param reader The XML reader. * @return The FILECATALYSTMODELNameHrefModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELNameHrefModel *_nameHrefModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}nameHref."]; } } if (xmlStrcmp(BAD_CAST "nameHref", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}nameHref."); #endif _nameHrefModel = (FILECATALYSTMODELNameHrefModel *)[FILECATALYSTMODELNameHrefModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}nameHref."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELNameHrefModel. Expected element {http://filecatalyst.com/model}nameHref. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELNameHrefModel. Expected element {http://filecatalyst.com/model}nameHref. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _nameHrefModel; } /** * Writes this FILECATALYSTMODELNameHrefModel to XML under element name "{http://filecatalyst.com/model}nameHref". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _nameHrefModel The NameHrefModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELNameHrefModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "nameHref", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}nameHref. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}nameHref..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}nameHref'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}nameHref..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}nameHrefModel for root element {http://filecatalyst.com/model}nameHref..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}nameHrefModel for root element {http://filecatalyst.com/model}nameHref..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}nameHref. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "name", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}name..."); #endif [self setName: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}name..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "href", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}href..."); #endif [self setHref: (NSURL*) [NSURL readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}href..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "value", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}value..."); #endif [self setValue: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}value..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self name]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "name", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}name."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}name..."); #endif [[self name] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}name..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}name."]; } } if ([self href]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "href", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}href."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}href..."); #endif [[self href] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}href..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}href."]; } } if ([self value]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "value", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}value."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}value..."); #endif [[self value] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}value..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}value."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; } @end /* implementation FILECATALYSTMODELNameHrefModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELNameHrefModel_M */ #ifndef DEF_FILECATALYSTMODELItemsModel_M #define DEF_FILECATALYSTMODELItemsModel_M /** * Items model class */ @implementation FILECATALYSTMODELItemsModel /** * (no documentation provided) */ - (NSString *) priceMultiplierField { return _priceMultiplierField; } /** * (no documentation provided) */ - (void) setPriceMultiplierField: (NSString *) newPriceMultiplierField { [newPriceMultiplierField retain]; [_priceMultiplierField release]; _priceMultiplierField = newPriceMultiplierField; } /** * Conditional field to use for price calculations. */ - (NSString *) priceConditionField { return _priceConditionField; } /** * Conditional field to use for price calculations. */ - (void) setPriceConditionField: (NSString *) newPriceConditionField { [newPriceConditionField retain]; [_priceConditionField release]; _priceConditionField = newPriceConditionField; } /** * List of items. */ - (NSArray *) item { return _item; } /** * List of items. */ - (void) setItem: (NSArray *) newItem { [newItem retain]; [_item release]; _item = newItem; } - (void) dealloc { [self setPriceMultiplierField: nil]; [self setPriceConditionField: nil]; [self setItem: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELItemsModel *_fILECATALYSTMODELItemsModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELItemsModel = (FILECATALYSTMODELItemsModel *) [FILECATALYSTMODELItemsModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELItemsModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELItemsModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELItemsModel (JAXB) @end /*interface FILECATALYSTMODELItemsModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELItemsModel (JAXB) /** * Read an instance of FILECATALYSTMODELItemsModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELItemsModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELItemsModel *_fILECATALYSTMODELItemsModel = [[FILECATALYSTMODELItemsModel alloc] init]; NS_DURING { [_fILECATALYSTMODELItemsModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELItemsModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELItemsModel autorelease]; return _fILECATALYSTMODELItemsModel; } /** * Initialize this instance of FILECATALYSTMODELItemsModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELItemsModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELItemsModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}items". * * @param reader The XML reader. * @return The FILECATALYSTMODELItemsModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELItemsModel *_itemsModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}items."]; } } if (xmlStrcmp(BAD_CAST "items", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}items."); #endif _itemsModel = (FILECATALYSTMODELItemsModel *)[FILECATALYSTMODELItemsModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}items."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELItemsModel. Expected element {http://filecatalyst.com/model}items. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELItemsModel. Expected element {http://filecatalyst.com/model}items. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _itemsModel; } /** * Writes this FILECATALYSTMODELItemsModel to XML under element name "{http://filecatalyst.com/model}items". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _itemsModel The ItemsModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELItemsModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "items", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}items. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}items..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}items'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}items..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}itemsModel for root element {http://filecatalyst.com/model}items..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}itemsModel for root element {http://filecatalyst.com/model}items..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}items. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "priceMultiplierField", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}priceMultiplierField..."); #endif [self setPriceMultiplierField: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}priceMultiplierField..."); #endif return YES; } if ((xmlStrcmp(BAD_CAST "priceConditionField", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}priceConditionField..."); #endif [self setPriceConditionField: (NSString*) [NSString readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}priceConditionField..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "item", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}item of type {http://filecatalyst.com/model}itemModel."); #endif __child = [FILECATALYSTMODELItemModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}item of type {http://filecatalyst.com/model}itemModel."); #endif if ([self item]) { [self setItem: [[self item] arrayByAddingObject: __child]]; } else { [self setItem: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self priceMultiplierField]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "priceMultiplierField", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}priceMultiplierField."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}priceMultiplierField..."); #endif [[self priceMultiplierField] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}priceMultiplierField..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}priceMultiplierField."]; } } if ([self priceConditionField]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "priceConditionField", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}priceConditionField."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}priceConditionField..."); #endif [[self priceConditionField] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}priceConditionField..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}priceConditionField."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self item]) { __enumerator = [[self item] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "item", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}item."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}item..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}item..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}item."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELItemsModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELItemsModel_M */ #ifndef DEF_FILECATALYSTMODELGroupsModel_M #define DEF_FILECATALYSTMODELGroupsModel_M /** * Groups model class */ @implementation FILECATALYSTMODELGroupsModel /** * List of groups. */ - (NSArray *) group { return _group; } /** * List of groups. */ - (void) setGroup: (NSArray *) newGroup { [newGroup retain]; [_group release]; _group = newGroup; } - (void) dealloc { [self setGroup: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELGroupsModel *_fILECATALYSTMODELGroupsModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELGroupsModel = (FILECATALYSTMODELGroupsModel *) [FILECATALYSTMODELGroupsModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELGroupsModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELGroupsModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELGroupsModel (JAXB) @end /*interface FILECATALYSTMODELGroupsModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELGroupsModel (JAXB) /** * Read an instance of FILECATALYSTMODELGroupsModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELGroupsModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELGroupsModel *_fILECATALYSTMODELGroupsModel = [[FILECATALYSTMODELGroupsModel alloc] init]; NS_DURING { [_fILECATALYSTMODELGroupsModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELGroupsModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELGroupsModel autorelease]; return _fILECATALYSTMODELGroupsModel; } /** * Initialize this instance of FILECATALYSTMODELGroupsModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELGroupsModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELGroupsModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}groups". * * @param reader The XML reader. * @return The FILECATALYSTMODELGroupsModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELGroupsModel *_groupsModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}groups."]; } } if (xmlStrcmp(BAD_CAST "groups", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}groups."); #endif _groupsModel = (FILECATALYSTMODELGroupsModel *)[FILECATALYSTMODELGroupsModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}groups."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELGroupsModel. Expected element {http://filecatalyst.com/model}groups. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELGroupsModel. Expected element {http://filecatalyst.com/model}groups. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _groupsModel; } /** * Writes this FILECATALYSTMODELGroupsModel to XML under element name "{http://filecatalyst.com/model}groups". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _groupsModel The GroupsModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELGroupsModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "groups", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}groups. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}groups..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}groups'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}groups..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}groupsModel for root element {http://filecatalyst.com/model}groups..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}groupsModel for root element {http://filecatalyst.com/model}groups..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}groups. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "group", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}group of type {http://filecatalyst.com/model}groupModel."); #endif __child = [FILECATALYSTMODELGroupModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}group of type {http://filecatalyst.com/model}groupModel."); #endif if ([self group]) { [self setGroup: [[self group] arrayByAddingObject: __child]]; } else { [self setGroup: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self group]) { __enumerator = [[self group] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "group", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}group."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}group..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}group..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}group."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELGroupsModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELGroupsModel_M */ #ifndef DEF_FILECATALYSTMODELFtpsitesModel_M #define DEF_FILECATALYSTMODELFtpsitesModel_M /** * FTP sites model class */ @implementation FILECATALYSTMODELFtpsitesModel /** * List of FTP sites. */ - (NSArray *) ftpsite { return _ftpsite; } /** * List of FTP sites. */ - (void) setFtpsite: (NSArray *) newFtpsite { [newFtpsite retain]; [_ftpsite release]; _ftpsite = newFtpsite; } - (void) dealloc { [self setFtpsite: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELFtpsitesModel *_fILECATALYSTMODELFtpsitesModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELFtpsitesModel = (FILECATALYSTMODELFtpsitesModel *) [FILECATALYSTMODELFtpsitesModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELFtpsitesModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELFtpsitesModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELFtpsitesModel (JAXB) @end /*interface FILECATALYSTMODELFtpsitesModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELFtpsitesModel (JAXB) /** * Read an instance of FILECATALYSTMODELFtpsitesModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELFtpsitesModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELFtpsitesModel *_fILECATALYSTMODELFtpsitesModel = [[FILECATALYSTMODELFtpsitesModel alloc] init]; NS_DURING { [_fILECATALYSTMODELFtpsitesModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELFtpsitesModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELFtpsitesModel autorelease]; return _fILECATALYSTMODELFtpsitesModel; } /** * Initialize this instance of FILECATALYSTMODELFtpsitesModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELFtpsitesModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELFtpsitesModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}ftpsites". * * @param reader The XML reader. * @return The FILECATALYSTMODELFtpsitesModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELFtpsitesModel *_ftpsitesModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}ftpsites."]; } } if (xmlStrcmp(BAD_CAST "ftpsites", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}ftpsites."); #endif _ftpsitesModel = (FILECATALYSTMODELFtpsitesModel *)[FILECATALYSTMODELFtpsitesModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}ftpsites."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELFtpsitesModel. Expected element {http://filecatalyst.com/model}ftpsites. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELFtpsitesModel. Expected element {http://filecatalyst.com/model}ftpsites. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _ftpsitesModel; } /** * Writes this FILECATALYSTMODELFtpsitesModel to XML under element name "{http://filecatalyst.com/model}ftpsites". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _ftpsitesModel The FtpsitesModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELFtpsitesModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "ftpsites", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}ftpsites. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}ftpsites..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}ftpsites'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}ftpsites..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}ftpsitesModel for root element {http://filecatalyst.com/model}ftpsites..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}ftpsitesModel for root element {http://filecatalyst.com/model}ftpsites..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}ftpsites. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "ftpsite", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}ftpsite of type {http://filecatalyst.com/model}ftpsiteModel."); #endif __child = [FILECATALYSTMODELFtpsiteModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}ftpsite of type {http://filecatalyst.com/model}ftpsiteModel."); #endif if ([self ftpsite]) { [self setFtpsite: [[self ftpsite] arrayByAddingObject: __child]]; } else { [self setFtpsite: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self ftpsite]) { __enumerator = [[self ftpsite] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "ftpsite", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}ftpsite."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}ftpsite..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}ftpsite..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}ftpsite."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELFtpsitesModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELFtpsitesModel_M */ #ifndef DEF_FILECATALYSTMODELFormfieldsModel_M #define DEF_FILECATALYSTMODELFormfieldsModel_M /** * Form fields model class */ @implementation FILECATALYSTMODELFormfieldsModel /** * Hyperlink reference to the resource */ - (NSURL *) href { return _href; } /** * Hyperlink reference to the resource */ - (void) setHref: (NSURL *) newHref { [newHref retain]; [_href release]; _href = newHref; } /** * List of form fields. */ - (NSArray *) field { return _field; } /** * List of form fields. */ - (void) setField: (NSArray *) newField { [newField retain]; [_field release]; _field = newField; } - (void) dealloc { [self setHref: nil]; [self setField: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTMODELFormfieldsModel *_fILECATALYSTMODELFormfieldsModel; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTMODELFormfieldsModel = (FILECATALYSTMODELFormfieldsModel *) [FILECATALYSTMODELFormfieldsModel readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTMODELFormfieldsModel; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTMODELFormfieldsModel */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTMODELFormfieldsModel (JAXB) @end /*interface FILECATALYSTMODELFormfieldsModel (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTMODELFormfieldsModel (JAXB) /** * Read an instance of FILECATALYSTMODELFormfieldsModel from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTMODELFormfieldsModel defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTMODELFormfieldsModel *_fILECATALYSTMODELFormfieldsModel = [[FILECATALYSTMODELFormfieldsModel alloc] init]; NS_DURING { [_fILECATALYSTMODELFormfieldsModel initWithReader: reader]; } NS_HANDLER { _fILECATALYSTMODELFormfieldsModel = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTMODELFormfieldsModel autorelease]; return _fILECATALYSTMODELFormfieldsModel; } /** * Initialize this instance of FILECATALYSTMODELFormfieldsModel according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTMODELFormfieldsModel to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTMODELFormfieldsModel from an XML reader. The element to be read is * "{http://filecatalyst.com/model}formfields". * * @param reader The XML reader. * @return The FILECATALYSTMODELFormfieldsModel. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTMODELFormfieldsModel *_formfieldsModel = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/model}formfields."]; } } if (xmlStrcmp(BAD_CAST "formfields", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/model", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/model}formfields."); #endif _formfieldsModel = (FILECATALYSTMODELFormfieldsModel *)[FILECATALYSTMODELFormfieldsModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/model}formfields."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELFormfieldsModel. Expected element {http://filecatalyst.com/model}formfields. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTMODELFormfieldsModel. Expected element {http://filecatalyst.com/model}formfields. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _formfieldsModel; } /** * Writes this FILECATALYSTMODELFormfieldsModel to XML under element name "{http://filecatalyst.com/model}formfields". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _formfieldsModel The FormfieldsModel to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTMODELFormfieldsModel to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "model", BAD_CAST "formfields", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/model}formfields. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/model}formfields..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:model", BAD_CAST "http://filecatalyst.com/model"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:model' on '{http://filecatalyst.com/model}formfields'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/model}formfields..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/model}formfieldsModel for root element {http://filecatalyst.com/model}formfields..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/model}formfieldsModel for root element {http://filecatalyst.com/model}formfields..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/model}formfields. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } if ((xmlStrcmp(BAD_CAST "href", xmlTextReaderConstLocalName(reader)) == 0) && (xmlTextReaderConstNamespaceUri(reader) == NULL)) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read attribute {}href..."); #endif [self setHref: (NSURL*) [NSURL readXMLType: reader]]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read attribute {}href..."); #endif return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "field", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}field of type {http://filecatalyst.com/model}fieldModel."); #endif __child = [FILECATALYSTMODELFieldModel readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}field of type {http://filecatalyst.com/model}fieldModel."); #endif if ([self field]) { [self setField: [[self field] arrayByAddingObject: __child]]; } else { [self setField: [NSArray arrayWithObject: __child]]; } return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; if ([self href]) { status = xmlTextWriterStartAttributeNS(writer, NULL, BAD_CAST "href", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start attribute {}href."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing attribute {}href..."); #endif [[self href] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote attribute {}href..."); #endif status = xmlTextWriterEndAttribute(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end attribute {}href."]; } } } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self field]) { __enumerator = [[self field] objectEnumerator]; while ( (__item = [__enumerator nextObject]) ) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "field", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}field."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}field..."); #endif [__item writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}field..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}field."]; } } //end item iterator. } } @end /* implementation FILECATALYSTMODELFormfieldsModel (JAXB) */ #endif /* DEF_FILECATALYSTMODELFormfieldsModel_M */ #ifndef DEF_FILECATALYSTFAULTFaultCode_M #define DEF_FILECATALYSTFAULTFaultCode_M /** * Fault code */ @implementation FILECATALYSTFAULTFaultCode /** * Fault status code. */ - (NSString *) status { return _status; } /** * Fault status code. */ - (void) setStatus: (NSString *) newStatus { [newStatus retain]; [_status release]; _status = newStatus; } /** * Fault subcode. */ - (FILECATALYSTFAULTValueCode *) subcode { return _subcode; } /** * Fault subcode. */ - (void) setSubcode: (FILECATALYSTFAULTValueCode *) newSubcode { [newSubcode retain]; [_subcode release]; _subcode = newSubcode; } - (void) dealloc { [self setStatus: nil]; [self setSubcode: nil]; [super dealloc]; } //documentation inherited. + (id) readFromXML: (NSData *) xml { FILECATALYSTFAULTFaultCode *_fILECATALYSTFAULTFaultCode; xmlTextReaderPtr reader = xmlReaderForMemory([xml bytes], [xml length], NULL, NULL, 0); if (reader == NULL) { [NSException raise: @"XMLReadError" format: @"Error instantiating an XML reader."]; return nil; } _fILECATALYSTFAULTFaultCode = (FILECATALYSTFAULTFaultCode *) [FILECATALYSTFAULTFaultCode readXMLElement: reader]; xmlFreeTextReader(reader); //free the reader return _fILECATALYSTFAULTFaultCode; } //documentation inherited. - (NSData *) writeToXML { xmlBufferPtr buf; xmlTextWriterPtr writer; int rc; NSData *data; buf = xmlBufferCreate(); if (buf == NULL) { [NSException raise: @"XMLWriteError" format: @"Error creating an XML buffer."]; return nil; } writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error creating an XML writer."]; return nil; } rc = xmlTextWriterStartDocument(writer, NULL, "utf-8", NULL); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML start document."]; return nil; } NS_DURING { [self writeXMLElement: writer]; } NS_HANDLER { xmlFreeTextWriter(writer); xmlBufferFree(buf); [localException raise]; } NS_ENDHANDLER rc = xmlTextWriterEndDocument(writer); if (rc < 0) { xmlFreeTextWriter(writer); xmlBufferFree(buf); [NSException raise: @"XMLWriteError" format: @"Error writing XML end document."]; return nil; } xmlFreeTextWriter(writer); data = [NSData dataWithBytes: buf->content length: buf->use]; xmlBufferFree(buf); return data; } @end /* implementation FILECATALYSTFAULTFaultCode */ /** * Internal, private interface for JAXB reading and writing. */ @interface FILECATALYSTFAULTFaultCode (JAXB) @end /*interface FILECATALYSTFAULTFaultCode (JAXB)*/ /** * Internal, private implementation for JAXB reading and writing. */ @implementation FILECATALYSTFAULTFaultCode (JAXB) /** * Read an instance of FILECATALYSTFAULTFaultCode from an XML reader. * * @param reader The reader. * @return An instance of FILECATALYSTFAULTFaultCode defined by the XML reader. */ + (id) readXMLType: (xmlTextReaderPtr) reader { FILECATALYSTFAULTFaultCode *_fILECATALYSTFAULTFaultCode = [[FILECATALYSTFAULTFaultCode alloc] init]; NS_DURING { [_fILECATALYSTFAULTFaultCode initWithReader: reader]; } NS_HANDLER { _fILECATALYSTFAULTFaultCode = nil; [localException raise]; } NS_ENDHANDLER [_fILECATALYSTFAULTFaultCode autorelease]; return _fILECATALYSTFAULTFaultCode; } /** * Initialize this instance of FILECATALYSTFAULTFaultCode according to * the XML being read from the reader. * * @param reader The reader. */ - (id) initWithReader: (xmlTextReaderPtr) reader { return [super initWithReader: reader]; } /** * Write the XML for this instance of FILECATALYSTFAULTFaultCode to the writer. * Note that since we're only writing the XML type, * No start/end element will be written. * * @param reader The reader. */ - (void) writeXMLType: (xmlTextWriterPtr) writer { [super writeXMLType:writer]; } /** * Reads a FILECATALYSTFAULTFaultCode from an XML reader. The element to be read is * "{http://filecatalyst.com/fault}code". * * @param reader The XML reader. * @return The FILECATALYSTFAULTFaultCode. */ + (id) readXMLElement: (xmlTextReaderPtr) reader { int status; FILECATALYSTFAULTFaultCode *_faultCode = nil; if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT) { status = xmlTextReaderAdvanceToNextStartOrEndElement(reader); if (status < 1) { [NSException raise: @"XMLReadError" format: @"Error advancing the reader to start element {http://filecatalyst.com/fault}code."]; } } if (xmlStrcmp(BAD_CAST "code", xmlTextReaderConstLocalName(reader)) == 0 && xmlStrcmp(BAD_CAST "http://filecatalyst.com/fault", xmlTextReaderConstNamespaceUri(reader)) == 0) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read root element {http://filecatalyst.com/fault}code."); #endif _faultCode = (FILECATALYSTFAULTFaultCode *)[FILECATALYSTFAULTFaultCode readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"Successfully read root element {http://filecatalyst.com/fault}code."); #endif } else { if (xmlTextReaderConstNamespaceUri(reader) == NULL) { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTFAULTFaultCode. Expected element {http://filecatalyst.com/fault}code. Current element: {}%s", xmlTextReaderConstLocalName(reader)]; } else { [NSException raise: @"XMLReadError" format: @"Unable to read FILECATALYSTFAULTFaultCode. Expected element {http://filecatalyst.com/fault}code. Current element: {%s}%s\n", xmlTextReaderConstNamespaceUri(reader), xmlTextReaderConstLocalName(reader)]; } } return _faultCode; } /** * Writes this FILECATALYSTFAULTFaultCode to XML under element name "{http://filecatalyst.com/fault}code". * The namespace declarations for the element will be written. * * @param writer The XML writer. * @param _faultCode The FaultCode to write. * @return 1 if successful, 0 otherwise. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer { [self writeXMLElement: writer writeNamespaces: YES]; } /** * Writes this FILECATALYSTFAULTFaultCode to an XML writer. * * @param writer The writer. * @param writeNs Whether to write the namespaces for this element to the xml writer. */ - (void) writeXMLElement: (xmlTextWriterPtr) writer writeNamespaces: (BOOL) writeNs { int rc = xmlTextWriterStartElementNS(writer, BAD_CAST "fault", BAD_CAST "code", NULL); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start element {http://filecatalyst.com/fault}code. XML writer status: %i\n", rc]; } if (writeNs) { #if DEBUG_ENUNCIATE > 1 NSLog(@"writing namespaces for start element {http://filecatalyst.com/fault}code..."); #endif rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "xmlns:fault", BAD_CAST "http://filecatalyst.com/fault"); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing attribute 'xmlns:fault' on '{http://filecatalyst.com/fault}code'. XML writer status: %i\n", rc]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote namespaces for start element {http://filecatalyst.com/fault}code..."); #endif } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing type {http://filecatalyst.com/fault}faultCode for root element {http://filecatalyst.com/fault}code..."); #endif [self writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote type {http://filecatalyst.com/fault}faultCode for root element {http://filecatalyst.com/fault}code..."); #endif rc = xmlTextWriterEndElement(writer); if (rc < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end element {http://filecatalyst.com/fault}code. XML writer status: %i\n", rc]; } } //documentation inherited. - (BOOL) readJAXBAttribute: (xmlTextReaderPtr) reader { void *_child_accessor; if ([super readJAXBAttribute: reader]) { return YES; } return NO; } //documentation inherited. - (BOOL) readJAXBValue: (xmlTextReaderPtr) reader { return [super readJAXBValue: reader]; } //documentation inherited. - (BOOL) readJAXBChildElement: (xmlTextReaderPtr) reader { id __child; void *_child_accessor; int status, depth; if ([super readJAXBChildElement: reader]) { return YES; } if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "status", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}status of type {http://www.w3.org/2001/XMLSchema}string."); #endif __child = [NSString readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}status of type {http://www.w3.org/2001/XMLSchema}string."); #endif [self setStatus: __child]; return YES; } //end "if choice" if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT && xmlStrcmp(BAD_CAST "subcode", xmlTextReaderConstLocalName(reader)) == 0 && xmlTextReaderConstNamespaceUri(reader) == NULL) { #if DEBUG_ENUNCIATE > 1 NSLog(@"Attempting to read choice {}subcode of type {http://filecatalyst.com/fault}valueCode."); #endif __child = [FILECATALYSTFAULTValueCode readXMLType: reader]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully read choice {}subcode of type {http://filecatalyst.com/fault}valueCode."); #endif [self setSubcode: __child]; return YES; } //end "if choice" return NO; } //documentation inherited. - (int) readUnknownJAXBChildElement: (xmlTextReaderPtr) reader { return [super readUnknownJAXBChildElement: reader]; } //documentation inherited. - (void) readUnknownJAXBAttribute: (xmlTextReaderPtr) reader { [super readUnknownJAXBAttribute: reader]; } //documentation inherited. - (void) writeJAXBAttributes: (xmlTextWriterPtr) writer { int status; [super writeJAXBAttributes: writer]; } //documentation inherited. - (void) writeJAXBValue: (xmlTextWriterPtr) writer { [super writeJAXBValue: writer]; } /** * Method for writing the child elements. * * @param writer The writer. */ - (void) writeJAXBChildElements: (xmlTextWriterPtr) writer { int status; id __item; NSEnumerator *__enumerator; [super writeJAXBChildElements: writer]; if ([self status]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "status", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}status."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}status..."); #endif [[self status] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}status..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}status."]; } } if ([self subcode]) { status = xmlTextWriterStartElementNS(writer, NULL, BAD_CAST "subcode", NULL); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing start child element {}subcode."]; } #if DEBUG_ENUNCIATE > 1 NSLog(@"writing element {}subcode..."); #endif [[self subcode] writeXMLType: writer]; #if DEBUG_ENUNCIATE > 1 NSLog(@"successfully wrote element {}subcode..."); #endif status = xmlTextWriterEndElement(writer); if (status < 0) { [NSException raise: @"XMLWriteError" format: @"Error writing end child element {}subcode."]; } } } @end /* implementation FILECATALYSTFAULTFaultCode (JAXB) */ #endif /* DEF_FILECATALYSTFAULTFaultCode_M */ #ifndef DEF_FILECATALYSTMODELUserStatusType_M #define DEF_FILECATALYSTMODELUserStatusType_M /** * Reads a UserStatusType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The UserStatusType, or NULL if unable to be read. */ static enum FILECATALYSTMODELUserStatusType *xmlTextReaderReadFILECATALYSTMODELUserStatusTypeType(xmlTextReaderPtr reader) { xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader); enum FILECATALYSTMODELUserStatusType *value = calloc(1, sizeof(enum FILECATALYSTMODELUserStatusType)); if (enumValue != NULL) { if (xmlStrcmp(enumValue, BAD_CAST "NEW_USER_NO_PRIVILEGE") == 0) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_NEW_USER_NO_PRIVILEGE; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "ACCOUNT_FROZEN") == 0) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_ACCOUNT_FROZEN; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "ADMIN_USER") == 0) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_ADMIN_USER; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "NORMAL_USER_FULL_ACCESS") == 0) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_NORMAL_USER_FULL_ACCESS; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "NORMAL_USER_RESTRICTED_ACCESS") == 0) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_NORMAL_USER_RESTRICTED_ACCESS; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "TEMPORARY_USER") == 0) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_TEMPORARY_USER; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "EXPIRED_REGULAR_USER") == 0) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_EXPIRED_REGULAR_USER; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "EXPIRED_TEMPORARY_USER") == 0) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_EXPIRED_TEMPORARY_USER; free(enumValue); return value; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", enumValue); #endif } #if DEBUG_ENUNCIATE else { NSLog(@"Attempt to read enum value failed: NULL value."); } #endif return NULL; } /** * Utility method for getting the enum value for a string. * * @param _userStatusType The string to format. * @return The enum value or NULL on error. */ static enum FILECATALYSTMODELUserStatusType *formatStringToFILECATALYSTMODELUserStatusTypeType(NSString *_userStatusType) { enum FILECATALYSTMODELUserStatusType *value = calloc(1, sizeof(enum FILECATALYSTMODELUserStatusType)); value = NULL; if ([@"NEW_USER_NO_PRIVILEGE" isEqualToString:_userStatusType]) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_NEW_USER_NO_PRIVILEGE; } if ([@"ACCOUNT_FROZEN" isEqualToString:_userStatusType]) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_ACCOUNT_FROZEN; } if ([@"ADMIN_USER" isEqualToString:_userStatusType]) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_ADMIN_USER; } if ([@"NORMAL_USER_FULL_ACCESS" isEqualToString:_userStatusType]) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_NORMAL_USER_FULL_ACCESS; } if ([@"NORMAL_USER_RESTRICTED_ACCESS" isEqualToString:_userStatusType]) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_NORMAL_USER_RESTRICTED_ACCESS; } if ([@"TEMPORARY_USER" isEqualToString:_userStatusType]) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_TEMPORARY_USER; } if ([@"EXPIRED_REGULAR_USER" isEqualToString:_userStatusType]) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_EXPIRED_REGULAR_USER; } if ([@"EXPIRED_TEMPORARY_USER" isEqualToString:_userStatusType]) { *value = FILECATALYST_MODEL_USERSTATUSTYPE_EXPIRED_TEMPORARY_USER; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", _userStatusType); #endif return value; } /** * Writes a UserStatusType to XML. * * @param writer The XML writer. * @param _userStatusType The UserStatusType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteFILECATALYSTMODELUserStatusTypeType(xmlTextWriterPtr writer, enum FILECATALYSTMODELUserStatusType *_userStatusType) { switch (*_userStatusType) { case FILECATALYST_MODEL_USERSTATUSTYPE_NEW_USER_NO_PRIVILEGE: return xmlTextWriterWriteString(writer, BAD_CAST "NEW_USER_NO_PRIVILEGE"); case FILECATALYST_MODEL_USERSTATUSTYPE_ACCOUNT_FROZEN: return xmlTextWriterWriteString(writer, BAD_CAST "ACCOUNT_FROZEN"); case FILECATALYST_MODEL_USERSTATUSTYPE_ADMIN_USER: return xmlTextWriterWriteString(writer, BAD_CAST "ADMIN_USER"); case FILECATALYST_MODEL_USERSTATUSTYPE_NORMAL_USER_FULL_ACCESS: return xmlTextWriterWriteString(writer, BAD_CAST "NORMAL_USER_FULL_ACCESS"); case FILECATALYST_MODEL_USERSTATUSTYPE_NORMAL_USER_RESTRICTED_ACCESS: return xmlTextWriterWriteString(writer, BAD_CAST "NORMAL_USER_RESTRICTED_ACCESS"); case FILECATALYST_MODEL_USERSTATUSTYPE_TEMPORARY_USER: return xmlTextWriterWriteString(writer, BAD_CAST "TEMPORARY_USER"); case FILECATALYST_MODEL_USERSTATUSTYPE_EXPIRED_REGULAR_USER: return xmlTextWriterWriteString(writer, BAD_CAST "EXPIRED_REGULAR_USER"); case FILECATALYST_MODEL_USERSTATUSTYPE_EXPIRED_TEMPORARY_USER: return xmlTextWriterWriteString(writer, BAD_CAST "EXPIRED_TEMPORARY_USER"); } #if DEBUG_ENUNCIATE NSLog(@"Unable to write enum value (no valid value found)."); #endif return -1; } /** * Utility method for getting the string value of UserStatusType. * * @param _userStatusType The UserStatusType to format. * @return The string value or NULL on error. */ static NSString *formatFILECATALYSTMODELUserStatusTypeTypeToString(enum FILECATALYSTMODELUserStatusType *_userStatusType) { switch (*_userStatusType) { case FILECATALYST_MODEL_USERSTATUSTYPE_NEW_USER_NO_PRIVILEGE: return @"NEW_USER_NO_PRIVILEGE"; case FILECATALYST_MODEL_USERSTATUSTYPE_ACCOUNT_FROZEN: return @"ACCOUNT_FROZEN"; case FILECATALYST_MODEL_USERSTATUSTYPE_ADMIN_USER: return @"ADMIN_USER"; case FILECATALYST_MODEL_USERSTATUSTYPE_NORMAL_USER_FULL_ACCESS: return @"NORMAL_USER_FULL_ACCESS"; case FILECATALYST_MODEL_USERSTATUSTYPE_NORMAL_USER_RESTRICTED_ACCESS: return @"NORMAL_USER_RESTRICTED_ACCESS"; case FILECATALYST_MODEL_USERSTATUSTYPE_TEMPORARY_USER: return @"TEMPORARY_USER"; case FILECATALYST_MODEL_USERSTATUSTYPE_EXPIRED_REGULAR_USER: return @"EXPIRED_REGULAR_USER"; case FILECATALYST_MODEL_USERSTATUSTYPE_EXPIRED_TEMPORARY_USER: return @"EXPIRED_TEMPORARY_USER"; default: return NULL; } return NULL; } #endif /* DEF_FILECATALYSTMODELUserStatusType_M */ #ifndef DEF_FILECATALYSTMODELUserUploadMethodType_M #define DEF_FILECATALYSTMODELUserUploadMethodType_M /** * Reads a UserUploadMethodType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The UserUploadMethodType, or NULL if unable to be read. */ static enum FILECATALYSTMODELUserUploadMethodType *xmlTextReaderReadFILECATALYSTMODELUserUploadMethodTypeType(xmlTextReaderPtr reader) { xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader); enum FILECATALYSTMODELUserUploadMethodType *value = calloc(1, sizeof(enum FILECATALYSTMODELUserUploadMethodType)); if (enumValue != NULL) { if (xmlStrcmp(enumValue, BAD_CAST "UPLOAD_METHOD_NONE") == 0) { *value = FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_NONE; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "UPLOAD_METHOD_DEFAULT") == 0) { *value = FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_DEFAULT; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "UPLOAD_METHOD_APPLET_ONLY") == 0) { *value = FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_APPLET_ONLY; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "UPLOAD_METHOD_HTML_APPLET") == 0) { *value = FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_HTML_APPLET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "UPLOAD_METHOD_HTML_ONLY") == 0) { *value = FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_HTML_ONLY; free(enumValue); return value; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", enumValue); #endif } #if DEBUG_ENUNCIATE else { NSLog(@"Attempt to read enum value failed: NULL value."); } #endif return NULL; } /** * Utility method for getting the enum value for a string. * * @param _userUploadMethodType The string to format. * @return The enum value or NULL on error. */ static enum FILECATALYSTMODELUserUploadMethodType *formatStringToFILECATALYSTMODELUserUploadMethodTypeType(NSString *_userUploadMethodType) { enum FILECATALYSTMODELUserUploadMethodType *value = calloc(1, sizeof(enum FILECATALYSTMODELUserUploadMethodType)); value = NULL; if ([@"UPLOAD_METHOD_NONE" isEqualToString:_userUploadMethodType]) { *value = FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_NONE; } if ([@"UPLOAD_METHOD_DEFAULT" isEqualToString:_userUploadMethodType]) { *value = FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_DEFAULT; } if ([@"UPLOAD_METHOD_APPLET_ONLY" isEqualToString:_userUploadMethodType]) { *value = FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_APPLET_ONLY; } if ([@"UPLOAD_METHOD_HTML_APPLET" isEqualToString:_userUploadMethodType]) { *value = FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_HTML_APPLET; } if ([@"UPLOAD_METHOD_HTML_ONLY" isEqualToString:_userUploadMethodType]) { *value = FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_HTML_ONLY; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", _userUploadMethodType); #endif return value; } /** * Writes a UserUploadMethodType to XML. * * @param writer The XML writer. * @param _userUploadMethodType The UserUploadMethodType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteFILECATALYSTMODELUserUploadMethodTypeType(xmlTextWriterPtr writer, enum FILECATALYSTMODELUserUploadMethodType *_userUploadMethodType) { switch (*_userUploadMethodType) { case FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_NONE: return xmlTextWriterWriteString(writer, BAD_CAST "UPLOAD_METHOD_NONE"); case FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_DEFAULT: return xmlTextWriterWriteString(writer, BAD_CAST "UPLOAD_METHOD_DEFAULT"); case FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_APPLET_ONLY: return xmlTextWriterWriteString(writer, BAD_CAST "UPLOAD_METHOD_APPLET_ONLY"); case FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_HTML_APPLET: return xmlTextWriterWriteString(writer, BAD_CAST "UPLOAD_METHOD_HTML_APPLET"); case FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_HTML_ONLY: return xmlTextWriterWriteString(writer, BAD_CAST "UPLOAD_METHOD_HTML_ONLY"); } #if DEBUG_ENUNCIATE NSLog(@"Unable to write enum value (no valid value found)."); #endif return -1; } /** * Utility method for getting the string value of UserUploadMethodType. * * @param _userUploadMethodType The UserUploadMethodType to format. * @return The string value or NULL on error. */ static NSString *formatFILECATALYSTMODELUserUploadMethodTypeTypeToString(enum FILECATALYSTMODELUserUploadMethodType *_userUploadMethodType) { switch (*_userUploadMethodType) { case FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_NONE: return @"UPLOAD_METHOD_NONE"; case FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_DEFAULT: return @"UPLOAD_METHOD_DEFAULT"; case FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_APPLET_ONLY: return @"UPLOAD_METHOD_APPLET_ONLY"; case FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_HTML_APPLET: return @"UPLOAD_METHOD_HTML_APPLET"; case FILECATALYST_MODEL_USERUPLOADMETHODTYPE_UPLOAD_METHOD_HTML_ONLY: return @"UPLOAD_METHOD_HTML_ONLY"; default: return NULL; } return NULL; } #endif /* DEF_FILECATALYSTMODELUserUploadMethodType_M */ #ifndef DEF_FILECATALYSTMODELUserProtocolType_M #define DEF_FILECATALYSTMODELUserProtocolType_M /** * Reads a UserProtocolType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The UserProtocolType, or NULL if unable to be read. */ static enum FILECATALYSTMODELUserProtocolType *xmlTextReaderReadFILECATALYSTMODELUserProtocolTypeType(xmlTextReaderPtr reader) { xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader); enum FILECATALYSTMODELUserProtocolType *value = calloc(1, sizeof(enum FILECATALYSTMODELUserProtocolType)); if (enumValue != NULL) { if (xmlStrcmp(enumValue, BAD_CAST "PROTOCOL_NONE") == 0) { *value = FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_NONE; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PROTOCOL_DEFAULT") == 0) { *value = FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_DEFAULT; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PROTOCOL_AUTO") == 0) { *value = FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_AUTO; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PROTOCOL_FTP") == 0) { *value = FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_FTP; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PROTOCOL_UDP") == 0) { *value = FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_UDP; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PROTOCOL_HTTP") == 0) { *value = FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_HTTP; free(enumValue); return value; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", enumValue); #endif } #if DEBUG_ENUNCIATE else { NSLog(@"Attempt to read enum value failed: NULL value."); } #endif return NULL; } /** * Utility method for getting the enum value for a string. * * @param _userProtocolType The string to format. * @return The enum value or NULL on error. */ static enum FILECATALYSTMODELUserProtocolType *formatStringToFILECATALYSTMODELUserProtocolTypeType(NSString *_userProtocolType) { enum FILECATALYSTMODELUserProtocolType *value = calloc(1, sizeof(enum FILECATALYSTMODELUserProtocolType)); value = NULL; if ([@"PROTOCOL_NONE" isEqualToString:_userProtocolType]) { *value = FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_NONE; } if ([@"PROTOCOL_DEFAULT" isEqualToString:_userProtocolType]) { *value = FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_DEFAULT; } if ([@"PROTOCOL_AUTO" isEqualToString:_userProtocolType]) { *value = FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_AUTO; } if ([@"PROTOCOL_FTP" isEqualToString:_userProtocolType]) { *value = FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_FTP; } if ([@"PROTOCOL_UDP" isEqualToString:_userProtocolType]) { *value = FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_UDP; } if ([@"PROTOCOL_HTTP" isEqualToString:_userProtocolType]) { *value = FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_HTTP; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", _userProtocolType); #endif return value; } /** * Writes a UserProtocolType to XML. * * @param writer The XML writer. * @param _userProtocolType The UserProtocolType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteFILECATALYSTMODELUserProtocolTypeType(xmlTextWriterPtr writer, enum FILECATALYSTMODELUserProtocolType *_userProtocolType) { switch (*_userProtocolType) { case FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_NONE: return xmlTextWriterWriteString(writer, BAD_CAST "PROTOCOL_NONE"); case FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_DEFAULT: return xmlTextWriterWriteString(writer, BAD_CAST "PROTOCOL_DEFAULT"); case FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_AUTO: return xmlTextWriterWriteString(writer, BAD_CAST "PROTOCOL_AUTO"); case FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_FTP: return xmlTextWriterWriteString(writer, BAD_CAST "PROTOCOL_FTP"); case FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_UDP: return xmlTextWriterWriteString(writer, BAD_CAST "PROTOCOL_UDP"); case FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_HTTP: return xmlTextWriterWriteString(writer, BAD_CAST "PROTOCOL_HTTP"); } #if DEBUG_ENUNCIATE NSLog(@"Unable to write enum value (no valid value found)."); #endif return -1; } /** * Utility method for getting the string value of UserProtocolType. * * @param _userProtocolType The UserProtocolType to format. * @return The string value or NULL on error. */ static NSString *formatFILECATALYSTMODELUserProtocolTypeTypeToString(enum FILECATALYSTMODELUserProtocolType *_userProtocolType) { switch (*_userProtocolType) { case FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_NONE: return @"PROTOCOL_NONE"; case FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_DEFAULT: return @"PROTOCOL_DEFAULT"; case FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_AUTO: return @"PROTOCOL_AUTO"; case FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_FTP: return @"PROTOCOL_FTP"; case FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_UDP: return @"PROTOCOL_UDP"; case FILECATALYST_MODEL_USERPROTOCOLTYPE_PROTOCOL_HTTP: return @"PROTOCOL_HTTP"; default: return NULL; } return NULL; } #endif /* DEF_FILECATALYSTMODELUserProtocolType_M */ #ifndef DEF_FILECATALYSTMODELFieldType_M #define DEF_FILECATALYSTMODELFieldType_M /** * Reads a FieldType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The FieldType, or NULL if unable to be read. */ static enum FILECATALYSTMODELFieldType *xmlTextReaderReadFILECATALYSTMODELFieldTypeType(xmlTextReaderPtr reader) { xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader); enum FILECATALYSTMODELFieldType *value = calloc(1, sizeof(enum FILECATALYSTMODELFieldType)); if (enumValue != NULL) { if (xmlStrcmp(enumValue, BAD_CAST "TEXT_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_TEXT_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SELECT_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_SELECT_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "RECIPIENT_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_RECIPIENT_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "NUMBER_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_NUMBER_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "DATE_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_DATE_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "TEXTAREA_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_TEXTAREA_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "CONTACTS_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_CONTACTS_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "EMAIL_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_EMAIL_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "TAX_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_TAX_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "CUSTOM_PRICE_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_CUSTOM_PRICE_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PASSSWORD_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_PASSSWORD_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PIN_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_PIN_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "EMAIL_AUTHOR_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_EMAIL_AUTHOR_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "ENHANCED_SECURITY_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_ENHANCED_SECURITY_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SENDER_NOTIFICATION_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_SENDER_NOTIFICATION_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "RECIPIENT_EMAIL_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_RECIPIENT_EMAIL_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "FTP_SERVER_LIST_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_FTP_SERVER_LIST_FIELD; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "EXPIRE_UPLOAD_FIELD") == 0) { *value = FILECATALYST_MODEL_FIELDTYPE_EXPIRE_UPLOAD_FIELD; free(enumValue); return value; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", enumValue); #endif } #if DEBUG_ENUNCIATE else { NSLog(@"Attempt to read enum value failed: NULL value."); } #endif return NULL; } /** * Utility method for getting the enum value for a string. * * @param _fieldType The string to format. * @return The enum value or NULL on error. */ static enum FILECATALYSTMODELFieldType *formatStringToFILECATALYSTMODELFieldTypeType(NSString *_fieldType) { enum FILECATALYSTMODELFieldType *value = calloc(1, sizeof(enum FILECATALYSTMODELFieldType)); value = NULL; if ([@"TEXT_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_TEXT_FIELD; } if ([@"SELECT_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_SELECT_FIELD; } if ([@"RECIPIENT_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_RECIPIENT_FIELD; } if ([@"NUMBER_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_NUMBER_FIELD; } if ([@"DATE_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_DATE_FIELD; } if ([@"TEXTAREA_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_TEXTAREA_FIELD; } if ([@"CONTACTS_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_CONTACTS_FIELD; } if ([@"EMAIL_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_EMAIL_FIELD; } if ([@"TAX_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_TAX_FIELD; } if ([@"CUSTOM_PRICE_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_CUSTOM_PRICE_FIELD; } if ([@"PASSSWORD_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_PASSSWORD_FIELD; } if ([@"PIN_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_PIN_FIELD; } if ([@"EMAIL_AUTHOR_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_EMAIL_AUTHOR_FIELD; } if ([@"ENHANCED_SECURITY_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_ENHANCED_SECURITY_FIELD; } if ([@"SENDER_NOTIFICATION_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_SENDER_NOTIFICATION_FIELD; } if ([@"RECIPIENT_EMAIL_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_RECIPIENT_EMAIL_FIELD; } if ([@"FTP_SERVER_LIST_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_FTP_SERVER_LIST_FIELD; } if ([@"EXPIRE_UPLOAD_FIELD" isEqualToString:_fieldType]) { *value = FILECATALYST_MODEL_FIELDTYPE_EXPIRE_UPLOAD_FIELD; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", _fieldType); #endif return value; } /** * Writes a FieldType to XML. * * @param writer The XML writer. * @param _fieldType The FieldType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteFILECATALYSTMODELFieldTypeType(xmlTextWriterPtr writer, enum FILECATALYSTMODELFieldType *_fieldType) { switch (*_fieldType) { case FILECATALYST_MODEL_FIELDTYPE_TEXT_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "TEXT_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_SELECT_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "SELECT_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_RECIPIENT_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "RECIPIENT_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_NUMBER_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "NUMBER_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_DATE_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "DATE_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_TEXTAREA_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "TEXTAREA_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_CONTACTS_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "CONTACTS_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_EMAIL_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "EMAIL_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_TAX_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "TAX_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_CUSTOM_PRICE_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "CUSTOM_PRICE_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_PASSSWORD_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "PASSSWORD_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_PIN_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "PIN_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_EMAIL_AUTHOR_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "EMAIL_AUTHOR_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_ENHANCED_SECURITY_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "ENHANCED_SECURITY_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_SENDER_NOTIFICATION_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "SENDER_NOTIFICATION_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_RECIPIENT_EMAIL_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "RECIPIENT_EMAIL_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_FTP_SERVER_LIST_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "FTP_SERVER_LIST_FIELD"); case FILECATALYST_MODEL_FIELDTYPE_EXPIRE_UPLOAD_FIELD: return xmlTextWriterWriteString(writer, BAD_CAST "EXPIRE_UPLOAD_FIELD"); } #if DEBUG_ENUNCIATE NSLog(@"Unable to write enum value (no valid value found)."); #endif return -1; } /** * Utility method for getting the string value of FieldType. * * @param _fieldType The FieldType to format. * @return The string value or NULL on error. */ static NSString *formatFILECATALYSTMODELFieldTypeTypeToString(enum FILECATALYSTMODELFieldType *_fieldType) { switch (*_fieldType) { case FILECATALYST_MODEL_FIELDTYPE_TEXT_FIELD: return @"TEXT_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_SELECT_FIELD: return @"SELECT_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_RECIPIENT_FIELD: return @"RECIPIENT_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_NUMBER_FIELD: return @"NUMBER_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_DATE_FIELD: return @"DATE_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_TEXTAREA_FIELD: return @"TEXTAREA_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_CONTACTS_FIELD: return @"CONTACTS_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_EMAIL_FIELD: return @"EMAIL_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_TAX_FIELD: return @"TAX_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_CUSTOM_PRICE_FIELD: return @"CUSTOM_PRICE_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_PASSSWORD_FIELD: return @"PASSSWORD_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_PIN_FIELD: return @"PIN_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_EMAIL_AUTHOR_FIELD: return @"EMAIL_AUTHOR_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_ENHANCED_SECURITY_FIELD: return @"ENHANCED_SECURITY_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_SENDER_NOTIFICATION_FIELD: return @"SENDER_NOTIFICATION_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_RECIPIENT_EMAIL_FIELD: return @"RECIPIENT_EMAIL_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_FTP_SERVER_LIST_FIELD: return @"FTP_SERVER_LIST_FIELD"; case FILECATALYST_MODEL_FIELDTYPE_EXPIRE_UPLOAD_FIELD: return @"EXPIRE_UPLOAD_FIELD"; default: return NULL; } return NULL; } #endif /* DEF_FILECATALYSTMODELFieldType_M */ #ifndef DEF_FILECATALYSTMODELUserAccountStatusType_M #define DEF_FILECATALYSTMODELUserAccountStatusType_M /** * Reads a UserAccountStatusType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The UserAccountStatusType, or NULL if unable to be read. */ static enum FILECATALYSTMODELUserAccountStatusType *xmlTextReaderReadFILECATALYSTMODELUserAccountStatusTypeType(xmlTextReaderPtr reader) { xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader); enum FILECATALYSTMODELUserAccountStatusType *value = calloc(1, sizeof(enum FILECATALYSTMODELUserAccountStatusType)); if (enumValue != NULL) { if (xmlStrcmp(enumValue, BAD_CAST "USER_STATUS_NONE") == 0) { *value = FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_NONE; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "USER_STATUS_ENTRY_ONLY") == 0) { *value = FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_ENTRY_ONLY; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "USER_STATUS_FULL_ACCESS") == 0) { *value = FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_FULL_ACCESS; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "USER_STATUS_FILE_AREA_ONLY") == 0) { *value = FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_FILE_AREA_ONLY; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "USER_STATUS_MAX_LOGON_ATTEMPTS") == 0) { *value = FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_MAX_LOGON_ATTEMPTS; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "USER_STATUS_EXPIRED") == 0) { *value = FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_EXPIRED; free(enumValue); return value; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", enumValue); #endif } #if DEBUG_ENUNCIATE else { NSLog(@"Attempt to read enum value failed: NULL value."); } #endif return NULL; } /** * Utility method for getting the enum value for a string. * * @param _userAccountStatusType The string to format. * @return The enum value or NULL on error. */ static enum FILECATALYSTMODELUserAccountStatusType *formatStringToFILECATALYSTMODELUserAccountStatusTypeType(NSString *_userAccountStatusType) { enum FILECATALYSTMODELUserAccountStatusType *value = calloc(1, sizeof(enum FILECATALYSTMODELUserAccountStatusType)); value = NULL; if ([@"USER_STATUS_NONE" isEqualToString:_userAccountStatusType]) { *value = FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_NONE; } if ([@"USER_STATUS_ENTRY_ONLY" isEqualToString:_userAccountStatusType]) { *value = FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_ENTRY_ONLY; } if ([@"USER_STATUS_FULL_ACCESS" isEqualToString:_userAccountStatusType]) { *value = FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_FULL_ACCESS; } if ([@"USER_STATUS_FILE_AREA_ONLY" isEqualToString:_userAccountStatusType]) { *value = FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_FILE_AREA_ONLY; } if ([@"USER_STATUS_MAX_LOGON_ATTEMPTS" isEqualToString:_userAccountStatusType]) { *value = FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_MAX_LOGON_ATTEMPTS; } if ([@"USER_STATUS_EXPIRED" isEqualToString:_userAccountStatusType]) { *value = FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_EXPIRED; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", _userAccountStatusType); #endif return value; } /** * Writes a UserAccountStatusType to XML. * * @param writer The XML writer. * @param _userAccountStatusType The UserAccountStatusType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteFILECATALYSTMODELUserAccountStatusTypeType(xmlTextWriterPtr writer, enum FILECATALYSTMODELUserAccountStatusType *_userAccountStatusType) { switch (*_userAccountStatusType) { case FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_NONE: return xmlTextWriterWriteString(writer, BAD_CAST "USER_STATUS_NONE"); case FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_ENTRY_ONLY: return xmlTextWriterWriteString(writer, BAD_CAST "USER_STATUS_ENTRY_ONLY"); case FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_FULL_ACCESS: return xmlTextWriterWriteString(writer, BAD_CAST "USER_STATUS_FULL_ACCESS"); case FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_FILE_AREA_ONLY: return xmlTextWriterWriteString(writer, BAD_CAST "USER_STATUS_FILE_AREA_ONLY"); case FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_MAX_LOGON_ATTEMPTS: return xmlTextWriterWriteString(writer, BAD_CAST "USER_STATUS_MAX_LOGON_ATTEMPTS"); case FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_EXPIRED: return xmlTextWriterWriteString(writer, BAD_CAST "USER_STATUS_EXPIRED"); } #if DEBUG_ENUNCIATE NSLog(@"Unable to write enum value (no valid value found)."); #endif return -1; } /** * Utility method for getting the string value of UserAccountStatusType. * * @param _userAccountStatusType The UserAccountStatusType to format. * @return The string value or NULL on error. */ static NSString *formatFILECATALYSTMODELUserAccountStatusTypeTypeToString(enum FILECATALYSTMODELUserAccountStatusType *_userAccountStatusType) { switch (*_userAccountStatusType) { case FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_NONE: return @"USER_STATUS_NONE"; case FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_ENTRY_ONLY: return @"USER_STATUS_ENTRY_ONLY"; case FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_FULL_ACCESS: return @"USER_STATUS_FULL_ACCESS"; case FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_FILE_AREA_ONLY: return @"USER_STATUS_FILE_AREA_ONLY"; case FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_MAX_LOGON_ATTEMPTS: return @"USER_STATUS_MAX_LOGON_ATTEMPTS"; case FILECATALYST_MODEL_USERACCOUNTSTATUSTYPE_USER_STATUS_EXPIRED: return @"USER_STATUS_EXPIRED"; default: return NULL; } return NULL; } #endif /* DEF_FILECATALYSTMODELUserAccountStatusType_M */ #ifndef DEF_FILECATALYSTMODELFtpTransferType_M #define DEF_FILECATALYSTMODELFtpTransferType_M /** * Reads a FtpTransferType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The FtpTransferType, or NULL if unable to be read. */ static enum FILECATALYSTMODELFtpTransferType *xmlTextReaderReadFILECATALYSTMODELFtpTransferTypeType(xmlTextReaderPtr reader) { xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader); enum FILECATALYSTMODELFtpTransferType *value = calloc(1, sizeof(enum FILECATALYSTMODELFtpTransferType)); if (enumValue != NULL) { if (xmlStrcmp(enumValue, BAD_CAST "FTP") == 0) { *value = FILECATALYST_MODEL_FTPTRANSFERTYPE_FTP; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "FTPS") == 0) { *value = FILECATALYST_MODEL_FTPTRANSFERTYPE_FTPS; free(enumValue); return value; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", enumValue); #endif } #if DEBUG_ENUNCIATE else { NSLog(@"Attempt to read enum value failed: NULL value."); } #endif return NULL; } /** * Utility method for getting the enum value for a string. * * @param _ftpTransferType The string to format. * @return The enum value or NULL on error. */ static enum FILECATALYSTMODELFtpTransferType *formatStringToFILECATALYSTMODELFtpTransferTypeType(NSString *_ftpTransferType) { enum FILECATALYSTMODELFtpTransferType *value = calloc(1, sizeof(enum FILECATALYSTMODELFtpTransferType)); value = NULL; if ([@"FTP" isEqualToString:_ftpTransferType]) { *value = FILECATALYST_MODEL_FTPTRANSFERTYPE_FTP; } if ([@"FTPS" isEqualToString:_ftpTransferType]) { *value = FILECATALYST_MODEL_FTPTRANSFERTYPE_FTPS; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", _ftpTransferType); #endif return value; } /** * Writes a FtpTransferType to XML. * * @param writer The XML writer. * @param _ftpTransferType The FtpTransferType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteFILECATALYSTMODELFtpTransferTypeType(xmlTextWriterPtr writer, enum FILECATALYSTMODELFtpTransferType *_ftpTransferType) { switch (*_ftpTransferType) { case FILECATALYST_MODEL_FTPTRANSFERTYPE_FTP: return xmlTextWriterWriteString(writer, BAD_CAST "FTP"); case FILECATALYST_MODEL_FTPTRANSFERTYPE_FTPS: return xmlTextWriterWriteString(writer, BAD_CAST "FTPS"); } #if DEBUG_ENUNCIATE NSLog(@"Unable to write enum value (no valid value found)."); #endif return -1; } /** * Utility method for getting the string value of FtpTransferType. * * @param _ftpTransferType The FtpTransferType to format. * @return The string value or NULL on error. */ static NSString *formatFILECATALYSTMODELFtpTransferTypeTypeToString(enum FILECATALYSTMODELFtpTransferType *_ftpTransferType) { switch (*_ftpTransferType) { case FILECATALYST_MODEL_FTPTRANSFERTYPE_FTP: return @"FTP"; case FILECATALYST_MODEL_FTPTRANSFERTYPE_FTPS: return @"FTPS"; default: return NULL; } return NULL; } #endif /* DEF_FILECATALYSTMODELFtpTransferType_M */ #ifndef DEF_FILECATALYSTMODELFieldOperandActionType_M #define DEF_FILECATALYSTMODELFieldOperandActionType_M /** * Reads a FieldOperandActionType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The FieldOperandActionType, or NULL if unable to be read. */ static enum FILECATALYSTMODELFieldOperandActionType *xmlTextReaderReadFILECATALYSTMODELFieldOperandActionTypeType(xmlTextReaderPtr reader) { xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader); enum FILECATALYSTMODELFieldOperandActionType *value = calloc(1, sizeof(enum FILECATALYSTMODELFieldOperandActionType)); if (enumValue != NULL) { if (xmlStrcmp(enumValue, BAD_CAST "IMPRESSION_PER_PAGE_ACTION") == 0) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_IMPRESSION_PER_PAGE_ACTION; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "NO_PRICING_ACTION") == 0) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NO_PRICING_ACTION; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "NUMBER_ACTION") == 0) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NUMBER_ACTION; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "NUMBER_OF_ORIGINALS_ACTION") == 0) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NUMBER_OF_ORIGINALS_ACTION; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "NUMBER_OF_SETS_ACTION") == 0) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NUMBER_OF_SETS_ACTION; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PER_ORDER_ACTION") == 0) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_ORDER_ACTION; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PER_SET_ACTION") == 0) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_SET_ACTION; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PER_PAGE_ACTION") == 0) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_PAGE_ACTION; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PER_IMPRESSION_ACTION") == 0) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_IMPRESSION_ACTION; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "TAX_SELECT_ACTION") == 0) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_TAX_SELECT_ACTION; free(enumValue); return value; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", enumValue); #endif } #if DEBUG_ENUNCIATE else { NSLog(@"Attempt to read enum value failed: NULL value."); } #endif return NULL; } /** * Utility method for getting the enum value for a string. * * @param _fieldOperandActionType The string to format. * @return The enum value or NULL on error. */ static enum FILECATALYSTMODELFieldOperandActionType *formatStringToFILECATALYSTMODELFieldOperandActionTypeType(NSString *_fieldOperandActionType) { enum FILECATALYSTMODELFieldOperandActionType *value = calloc(1, sizeof(enum FILECATALYSTMODELFieldOperandActionType)); value = NULL; if ([@"IMPRESSION_PER_PAGE_ACTION" isEqualToString:_fieldOperandActionType]) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_IMPRESSION_PER_PAGE_ACTION; } if ([@"NO_PRICING_ACTION" isEqualToString:_fieldOperandActionType]) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NO_PRICING_ACTION; } if ([@"NUMBER_ACTION" isEqualToString:_fieldOperandActionType]) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NUMBER_ACTION; } if ([@"NUMBER_OF_ORIGINALS_ACTION" isEqualToString:_fieldOperandActionType]) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NUMBER_OF_ORIGINALS_ACTION; } if ([@"NUMBER_OF_SETS_ACTION" isEqualToString:_fieldOperandActionType]) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NUMBER_OF_SETS_ACTION; } if ([@"PER_ORDER_ACTION" isEqualToString:_fieldOperandActionType]) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_ORDER_ACTION; } if ([@"PER_SET_ACTION" isEqualToString:_fieldOperandActionType]) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_SET_ACTION; } if ([@"PER_PAGE_ACTION" isEqualToString:_fieldOperandActionType]) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_PAGE_ACTION; } if ([@"PER_IMPRESSION_ACTION" isEqualToString:_fieldOperandActionType]) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_IMPRESSION_ACTION; } if ([@"TAX_SELECT_ACTION" isEqualToString:_fieldOperandActionType]) { *value = FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_TAX_SELECT_ACTION; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", _fieldOperandActionType); #endif return value; } /** * Writes a FieldOperandActionType to XML. * * @param writer The XML writer. * @param _fieldOperandActionType The FieldOperandActionType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteFILECATALYSTMODELFieldOperandActionTypeType(xmlTextWriterPtr writer, enum FILECATALYSTMODELFieldOperandActionType *_fieldOperandActionType) { switch (*_fieldOperandActionType) { case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_IMPRESSION_PER_PAGE_ACTION: return xmlTextWriterWriteString(writer, BAD_CAST "IMPRESSION_PER_PAGE_ACTION"); case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NO_PRICING_ACTION: return xmlTextWriterWriteString(writer, BAD_CAST "NO_PRICING_ACTION"); case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NUMBER_ACTION: return xmlTextWriterWriteString(writer, BAD_CAST "NUMBER_ACTION"); case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NUMBER_OF_ORIGINALS_ACTION: return xmlTextWriterWriteString(writer, BAD_CAST "NUMBER_OF_ORIGINALS_ACTION"); case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NUMBER_OF_SETS_ACTION: return xmlTextWriterWriteString(writer, BAD_CAST "NUMBER_OF_SETS_ACTION"); case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_ORDER_ACTION: return xmlTextWriterWriteString(writer, BAD_CAST "PER_ORDER_ACTION"); case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_SET_ACTION: return xmlTextWriterWriteString(writer, BAD_CAST "PER_SET_ACTION"); case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_PAGE_ACTION: return xmlTextWriterWriteString(writer, BAD_CAST "PER_PAGE_ACTION"); case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_IMPRESSION_ACTION: return xmlTextWriterWriteString(writer, BAD_CAST "PER_IMPRESSION_ACTION"); case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_TAX_SELECT_ACTION: return xmlTextWriterWriteString(writer, BAD_CAST "TAX_SELECT_ACTION"); } #if DEBUG_ENUNCIATE NSLog(@"Unable to write enum value (no valid value found)."); #endif return -1; } /** * Utility method for getting the string value of FieldOperandActionType. * * @param _fieldOperandActionType The FieldOperandActionType to format. * @return The string value or NULL on error. */ static NSString *formatFILECATALYSTMODELFieldOperandActionTypeTypeToString(enum FILECATALYSTMODELFieldOperandActionType *_fieldOperandActionType) { switch (*_fieldOperandActionType) { case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_IMPRESSION_PER_PAGE_ACTION: return @"IMPRESSION_PER_PAGE_ACTION"; case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NO_PRICING_ACTION: return @"NO_PRICING_ACTION"; case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NUMBER_ACTION: return @"NUMBER_ACTION"; case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NUMBER_OF_ORIGINALS_ACTION: return @"NUMBER_OF_ORIGINALS_ACTION"; case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_NUMBER_OF_SETS_ACTION: return @"NUMBER_OF_SETS_ACTION"; case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_ORDER_ACTION: return @"PER_ORDER_ACTION"; case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_SET_ACTION: return @"PER_SET_ACTION"; case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_PAGE_ACTION: return @"PER_PAGE_ACTION"; case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_PER_IMPRESSION_ACTION: return @"PER_IMPRESSION_ACTION"; case FILECATALYST_MODEL_FIELDOPERANDACTIONTYPE_TAX_SELECT_ACTION: return @"TAX_SELECT_ACTION"; default: return NULL; } return NULL; } #endif /* DEF_FILECATALYSTMODELFieldOperandActionType_M */ #ifndef DEF_FILECATALYSTMODELCellPhoneCarrierType_M #define DEF_FILECATALYSTMODELCellPhoneCarrierType_M /** * Reads a CellPhoneCarrierType from XML. The reader is assumed to be at the start element. * * @param reader The XML reader. * @return The CellPhoneCarrierType, or NULL if unable to be read. */ static enum FILECATALYSTMODELCellPhoneCarrierType *xmlTextReaderReadFILECATALYSTMODELCellPhoneCarrierTypeType(xmlTextReaderPtr reader) { xmlChar *enumValue = xmlTextReaderReadEntireNodeValue(reader); enum FILECATALYSTMODELCellPhoneCarrierType *value = calloc(1, sizeof(enum FILECATALYSTMODELCellPhoneCarrierType)); if (enumValue != NULL) { if (xmlStrcmp(enumValue, BAD_CAST "PLEASE_SELECT_CARRIER") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PLEASE_SELECT_CARRIER; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "OTHER") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_OTHER; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MSG_ACSLASKA_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MSG_ACSLASKA_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MESSAGE_ALLTEL_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MESSAGE_ALLTEL_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "DIGITALEDGE_ACSWIRELESS_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_DIGITALEDGE_ACSWIRELESS_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "AWSMS_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_AWSMS_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MOBILE_ATT_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_ATT_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "DPCS_MOBILE_ATT_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_DPCS_MOBILE_ATT_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SMS_EDGEWIRELESS_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_EDGEWIRELESS_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "WIRELESS_BELLSOUTH_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_WIRELESS_BELLSOUTH_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "BELLSOUTHWIRELESSEMAIL_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_BELLSOUTHWIRELESSEMAIL_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SMS_BLUECELL_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_BLUECELL_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "TYPETALK_RURALCELLULAR_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TYPETALK_RURALCELLULAR_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "CWWSMS_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CWWSMS_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MOBILE_CELLONEUSA_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_CELLONEUSA_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "C1USA_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_C1USA_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "C1EMAIL_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_C1EMAIL_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "TYPETALK_RURALCELLULAR_COM2") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TYPETALK_RURALCELLULAR_COM2; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SBCEMAIL_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SBCEMAIL_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "CELLONE_MS_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CELLONE_MS_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MYCELLONE_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MYCELLONE_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SMS_IOWAONE_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_IOWAONE_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "UTEXT_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_UTEXT_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MOBILE_C1_SLO_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_C1_SLO_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "CSOUTH1_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CSOUTH1_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "GOCBW_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_GOCBW_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MYCINGULAR_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MYCINGULAR_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MYCINGULAR_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MYCINGULAR_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MOBILE_MYCINGULAR_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_MYCINGULAR_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MOBILE_MYCINGULAR_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_MYCINGULAR_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "CORRWIRELESS_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CORRWIRELESS_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MOBILE_DOBSONCELLULAR_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_DOBSONCELLULAR_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SMS_HICKORYTECH_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_HICKORYTECH_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "TEXT_HOUSTONCELLULAR_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TEXT_HOUSTONCELLULAR_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "CLEARLYDIGITAL_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CLEARLYDIGITAL_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MESSAGE_PIONEERENIDCELLULAR_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MESSAGE_PIONEERENIDCELLULAR_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SMSMAIL_PLATEAUTEL_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMSMAIL_PLATEAUTEL_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SMS_PSCEL_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_PSCEL_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MAIL_DATA1SOURCE_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MAIL_DATA1SOURCE_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MOBILE_ATT_NET2") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_ATT_NET2; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PCS_ROGERS_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PCS_ROGERS_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "EMAIL2GO_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_EMAIL2GO_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "EMAIL_SWBW_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_EMAIL_SWBW_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "TMS_SUNCOM_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TMS_SUNCOM_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SUNCOM1_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SUNCOM1_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SUNGRAM_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SUNGRAM_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "TYPETALK_RURALCELLULAR_COM3") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TYPETALK_RURALCELLULAR_COM3; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "USCC_TEXTMSG_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_USCC_TEXTMSG_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "EMAIL_USCC_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_EMAIL_USCC_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "USCC_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_USCC_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SMSC_VZPACIFICA_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMSC_VZPACIFICA_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "SMS_WCC_NET") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_WCC_NET; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "MSG_TELUS_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MSG_TELUS_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "TXT_BELLMOBILITY_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TXT_BELLMOBILITY_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PCS_ROGERS_COM2") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PCS_ROGERS_COM2; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "WIREFREE_INFORME_CA") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_WIREFREE_INFORME_CA; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "PCS_SASKTELMOBILITY_COM") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PCS_SASKTELMOBILITY_COM; free(enumValue); return value; } if (xmlStrcmp(enumValue, BAD_CAST "TXT_BELLMOBILITY_CA") == 0) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TXT_BELLMOBILITY_CA; free(enumValue); return value; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", enumValue); #endif } #if DEBUG_ENUNCIATE else { NSLog(@"Attempt to read enum value failed: NULL value."); } #endif return NULL; } /** * Utility method for getting the enum value for a string. * * @param _cellPhoneCarrierType The string to format. * @return The enum value or NULL on error. */ static enum FILECATALYSTMODELCellPhoneCarrierType *formatStringToFILECATALYSTMODELCellPhoneCarrierTypeType(NSString *_cellPhoneCarrierType) { enum FILECATALYSTMODELCellPhoneCarrierType *value = calloc(1, sizeof(enum FILECATALYSTMODELCellPhoneCarrierType)); value = NULL; if ([@"PLEASE_SELECT_CARRIER" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PLEASE_SELECT_CARRIER; } if ([@"OTHER" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_OTHER; } if ([@"MSG_ACSLASKA_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MSG_ACSLASKA_COM; } if ([@"MESSAGE_ALLTEL_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MESSAGE_ALLTEL_COM; } if ([@"DIGITALEDGE_ACSWIRELESS_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_DIGITALEDGE_ACSWIRELESS_COM; } if ([@"AWSMS_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_AWSMS_COM; } if ([@"MOBILE_ATT_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_ATT_NET; } if ([@"DPCS_MOBILE_ATT_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_DPCS_MOBILE_ATT_NET; } if ([@"SMS_EDGEWIRELESS_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_EDGEWIRELESS_COM; } if ([@"WIRELESS_BELLSOUTH_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_WIRELESS_BELLSOUTH_COM; } if ([@"BELLSOUTHWIRELESSEMAIL_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_BELLSOUTHWIRELESSEMAIL_COM; } if ([@"SMS_BLUECELL_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_BLUECELL_COM; } if ([@"TYPETALK_RURALCELLULAR_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TYPETALK_RURALCELLULAR_COM; } if ([@"CWWSMS_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CWWSMS_COM; } if ([@"MOBILE_CELLONEUSA_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_CELLONEUSA_COM; } if ([@"C1USA_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_C1USA_COM; } if ([@"C1EMAIL_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_C1EMAIL_COM; } if ([@"TYPETALK_RURALCELLULAR_COM2" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TYPETALK_RURALCELLULAR_COM2; } if ([@"SBCEMAIL_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SBCEMAIL_COM; } if ([@"CELLONE_MS_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CELLONE_MS_COM; } if ([@"MYCELLONE_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MYCELLONE_NET; } if ([@"SMS_IOWAONE_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_IOWAONE_NET; } if ([@"UTEXT_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_UTEXT_COM; } if ([@"MOBILE_C1_SLO_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_C1_SLO_COM; } if ([@"CSOUTH1_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CSOUTH1_COM; } if ([@"GOCBW_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_GOCBW_COM; } if ([@"MYCINGULAR_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MYCINGULAR_COM; } if ([@"MYCINGULAR_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MYCINGULAR_NET; } if ([@"MOBILE_MYCINGULAR_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_MYCINGULAR_COM; } if ([@"MOBILE_MYCINGULAR_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_MYCINGULAR_NET; } if ([@"CORRWIRELESS_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CORRWIRELESS_NET; } if ([@"MOBILE_DOBSONCELLULAR_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_DOBSONCELLULAR_COM; } if ([@"SMS_HICKORYTECH_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_HICKORYTECH_COM; } if ([@"TEXT_HOUSTONCELLULAR_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TEXT_HOUSTONCELLULAR_NET; } if ([@"CLEARLYDIGITAL_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CLEARLYDIGITAL_COM; } if ([@"MESSAGE_PIONEERENIDCELLULAR_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MESSAGE_PIONEERENIDCELLULAR_COM; } if ([@"SMSMAIL_PLATEAUTEL_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMSMAIL_PLATEAUTEL_NET; } if ([@"SMS_PSCEL_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_PSCEL_COM; } if ([@"MAIL_DATA1SOURCE_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MAIL_DATA1SOURCE_COM; } if ([@"MOBILE_ATT_NET2" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_ATT_NET2; } if ([@"PCS_ROGERS_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PCS_ROGERS_COM; } if ([@"EMAIL2GO_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_EMAIL2GO_COM; } if ([@"EMAIL_SWBW_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_EMAIL_SWBW_COM; } if ([@"TMS_SUNCOM_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TMS_SUNCOM_COM; } if ([@"SUNCOM1_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SUNCOM1_COM; } if ([@"SUNGRAM_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SUNGRAM_COM; } if ([@"TYPETALK_RURALCELLULAR_COM3" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TYPETALK_RURALCELLULAR_COM3; } if ([@"USCC_TEXTMSG_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_USCC_TEXTMSG_COM; } if ([@"EMAIL_USCC_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_EMAIL_USCC_NET; } if ([@"USCC_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_USCC_NET; } if ([@"SMSC_VZPACIFICA_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMSC_VZPACIFICA_NET; } if ([@"SMS_WCC_NET" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_WCC_NET; } if ([@"MSG_TELUS_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MSG_TELUS_COM; } if ([@"TXT_BELLMOBILITY_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TXT_BELLMOBILITY_COM; } if ([@"PCS_ROGERS_COM2" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PCS_ROGERS_COM2; } if ([@"WIREFREE_INFORME_CA" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_WIREFREE_INFORME_CA; } if ([@"PCS_SASKTELMOBILITY_COM" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PCS_SASKTELMOBILITY_COM; } if ([@"TXT_BELLMOBILITY_CA" isEqualToString:_cellPhoneCarrierType]) { *value = FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TXT_BELLMOBILITY_CA; } #if DEBUG_ENUNCIATE NSLog(@"Attempt to read enum value failed: %s doesn't match an enum value.", _cellPhoneCarrierType); #endif return value; } /** * Writes a CellPhoneCarrierType to XML. * * @param writer The XML writer. * @param _cellPhoneCarrierType The CellPhoneCarrierType to write. * @return The bytes written (may be 0 in case of buffering) or -1 in case of error. */ static int xmlTextWriterWriteFILECATALYSTMODELCellPhoneCarrierTypeType(xmlTextWriterPtr writer, enum FILECATALYSTMODELCellPhoneCarrierType *_cellPhoneCarrierType) { switch (*_cellPhoneCarrierType) { case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PLEASE_SELECT_CARRIER: return xmlTextWriterWriteString(writer, BAD_CAST "PLEASE_SELECT_CARRIER"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_OTHER: return xmlTextWriterWriteString(writer, BAD_CAST "OTHER"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MSG_ACSLASKA_COM: return xmlTextWriterWriteString(writer, BAD_CAST "MSG_ACSLASKA_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MESSAGE_ALLTEL_COM: return xmlTextWriterWriteString(writer, BAD_CAST "MESSAGE_ALLTEL_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_DIGITALEDGE_ACSWIRELESS_COM: return xmlTextWriterWriteString(writer, BAD_CAST "DIGITALEDGE_ACSWIRELESS_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_AWSMS_COM: return xmlTextWriterWriteString(writer, BAD_CAST "AWSMS_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_ATT_NET: return xmlTextWriterWriteString(writer, BAD_CAST "MOBILE_ATT_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_DPCS_MOBILE_ATT_NET: return xmlTextWriterWriteString(writer, BAD_CAST "DPCS_MOBILE_ATT_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_EDGEWIRELESS_COM: return xmlTextWriterWriteString(writer, BAD_CAST "SMS_EDGEWIRELESS_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_WIRELESS_BELLSOUTH_COM: return xmlTextWriterWriteString(writer, BAD_CAST "WIRELESS_BELLSOUTH_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_BELLSOUTHWIRELESSEMAIL_COM: return xmlTextWriterWriteString(writer, BAD_CAST "BELLSOUTHWIRELESSEMAIL_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_BLUECELL_COM: return xmlTextWriterWriteString(writer, BAD_CAST "SMS_BLUECELL_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TYPETALK_RURALCELLULAR_COM: return xmlTextWriterWriteString(writer, BAD_CAST "TYPETALK_RURALCELLULAR_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CWWSMS_COM: return xmlTextWriterWriteString(writer, BAD_CAST "CWWSMS_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_CELLONEUSA_COM: return xmlTextWriterWriteString(writer, BAD_CAST "MOBILE_CELLONEUSA_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_C1USA_COM: return xmlTextWriterWriteString(writer, BAD_CAST "C1USA_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_C1EMAIL_COM: return xmlTextWriterWriteString(writer, BAD_CAST "C1EMAIL_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TYPETALK_RURALCELLULAR_COM2: return xmlTextWriterWriteString(writer, BAD_CAST "TYPETALK_RURALCELLULAR_COM2"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SBCEMAIL_COM: return xmlTextWriterWriteString(writer, BAD_CAST "SBCEMAIL_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CELLONE_MS_COM: return xmlTextWriterWriteString(writer, BAD_CAST "CELLONE_MS_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MYCELLONE_NET: return xmlTextWriterWriteString(writer, BAD_CAST "MYCELLONE_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_IOWAONE_NET: return xmlTextWriterWriteString(writer, BAD_CAST "SMS_IOWAONE_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_UTEXT_COM: return xmlTextWriterWriteString(writer, BAD_CAST "UTEXT_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_C1_SLO_COM: return xmlTextWriterWriteString(writer, BAD_CAST "MOBILE_C1_SLO_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CSOUTH1_COM: return xmlTextWriterWriteString(writer, BAD_CAST "CSOUTH1_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_GOCBW_COM: return xmlTextWriterWriteString(writer, BAD_CAST "GOCBW_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MYCINGULAR_COM: return xmlTextWriterWriteString(writer, BAD_CAST "MYCINGULAR_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MYCINGULAR_NET: return xmlTextWriterWriteString(writer, BAD_CAST "MYCINGULAR_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_MYCINGULAR_COM: return xmlTextWriterWriteString(writer, BAD_CAST "MOBILE_MYCINGULAR_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_MYCINGULAR_NET: return xmlTextWriterWriteString(writer, BAD_CAST "MOBILE_MYCINGULAR_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CORRWIRELESS_NET: return xmlTextWriterWriteString(writer, BAD_CAST "CORRWIRELESS_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_DOBSONCELLULAR_COM: return xmlTextWriterWriteString(writer, BAD_CAST "MOBILE_DOBSONCELLULAR_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_HICKORYTECH_COM: return xmlTextWriterWriteString(writer, BAD_CAST "SMS_HICKORYTECH_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TEXT_HOUSTONCELLULAR_NET: return xmlTextWriterWriteString(writer, BAD_CAST "TEXT_HOUSTONCELLULAR_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CLEARLYDIGITAL_COM: return xmlTextWriterWriteString(writer, BAD_CAST "CLEARLYDIGITAL_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MESSAGE_PIONEERENIDCELLULAR_COM: return xmlTextWriterWriteString(writer, BAD_CAST "MESSAGE_PIONEERENIDCELLULAR_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMSMAIL_PLATEAUTEL_NET: return xmlTextWriterWriteString(writer, BAD_CAST "SMSMAIL_PLATEAUTEL_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_PSCEL_COM: return xmlTextWriterWriteString(writer, BAD_CAST "SMS_PSCEL_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MAIL_DATA1SOURCE_COM: return xmlTextWriterWriteString(writer, BAD_CAST "MAIL_DATA1SOURCE_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_ATT_NET2: return xmlTextWriterWriteString(writer, BAD_CAST "MOBILE_ATT_NET2"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PCS_ROGERS_COM: return xmlTextWriterWriteString(writer, BAD_CAST "PCS_ROGERS_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_EMAIL2GO_COM: return xmlTextWriterWriteString(writer, BAD_CAST "EMAIL2GO_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_EMAIL_SWBW_COM: return xmlTextWriterWriteString(writer, BAD_CAST "EMAIL_SWBW_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TMS_SUNCOM_COM: return xmlTextWriterWriteString(writer, BAD_CAST "TMS_SUNCOM_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SUNCOM1_COM: return xmlTextWriterWriteString(writer, BAD_CAST "SUNCOM1_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SUNGRAM_COM: return xmlTextWriterWriteString(writer, BAD_CAST "SUNGRAM_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TYPETALK_RURALCELLULAR_COM3: return xmlTextWriterWriteString(writer, BAD_CAST "TYPETALK_RURALCELLULAR_COM3"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_USCC_TEXTMSG_COM: return xmlTextWriterWriteString(writer, BAD_CAST "USCC_TEXTMSG_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_EMAIL_USCC_NET: return xmlTextWriterWriteString(writer, BAD_CAST "EMAIL_USCC_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_USCC_NET: return xmlTextWriterWriteString(writer, BAD_CAST "USCC_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMSC_VZPACIFICA_NET: return xmlTextWriterWriteString(writer, BAD_CAST "SMSC_VZPACIFICA_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_WCC_NET: return xmlTextWriterWriteString(writer, BAD_CAST "SMS_WCC_NET"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MSG_TELUS_COM: return xmlTextWriterWriteString(writer, BAD_CAST "MSG_TELUS_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TXT_BELLMOBILITY_COM: return xmlTextWriterWriteString(writer, BAD_CAST "TXT_BELLMOBILITY_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PCS_ROGERS_COM2: return xmlTextWriterWriteString(writer, BAD_CAST "PCS_ROGERS_COM2"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_WIREFREE_INFORME_CA: return xmlTextWriterWriteString(writer, BAD_CAST "WIREFREE_INFORME_CA"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PCS_SASKTELMOBILITY_COM: return xmlTextWriterWriteString(writer, BAD_CAST "PCS_SASKTELMOBILITY_COM"); case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TXT_BELLMOBILITY_CA: return xmlTextWriterWriteString(writer, BAD_CAST "TXT_BELLMOBILITY_CA"); } #if DEBUG_ENUNCIATE NSLog(@"Unable to write enum value (no valid value found)."); #endif return -1; } /** * Utility method for getting the string value of CellPhoneCarrierType. * * @param _cellPhoneCarrierType The CellPhoneCarrierType to format. * @return The string value or NULL on error. */ static NSString *formatFILECATALYSTMODELCellPhoneCarrierTypeTypeToString(enum FILECATALYSTMODELCellPhoneCarrierType *_cellPhoneCarrierType) { switch (*_cellPhoneCarrierType) { case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PLEASE_SELECT_CARRIER: return @"PLEASE_SELECT_CARRIER"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_OTHER: return @"OTHER"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MSG_ACSLASKA_COM: return @"MSG_ACSLASKA_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MESSAGE_ALLTEL_COM: return @"MESSAGE_ALLTEL_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_DIGITALEDGE_ACSWIRELESS_COM: return @"DIGITALEDGE_ACSWIRELESS_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_AWSMS_COM: return @"AWSMS_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_ATT_NET: return @"MOBILE_ATT_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_DPCS_MOBILE_ATT_NET: return @"DPCS_MOBILE_ATT_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_EDGEWIRELESS_COM: return @"SMS_EDGEWIRELESS_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_WIRELESS_BELLSOUTH_COM: return @"WIRELESS_BELLSOUTH_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_BELLSOUTHWIRELESSEMAIL_COM: return @"BELLSOUTHWIRELESSEMAIL_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_BLUECELL_COM: return @"SMS_BLUECELL_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TYPETALK_RURALCELLULAR_COM: return @"TYPETALK_RURALCELLULAR_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CWWSMS_COM: return @"CWWSMS_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_CELLONEUSA_COM: return @"MOBILE_CELLONEUSA_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_C1USA_COM: return @"C1USA_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_C1EMAIL_COM: return @"C1EMAIL_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TYPETALK_RURALCELLULAR_COM2: return @"TYPETALK_RURALCELLULAR_COM2"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SBCEMAIL_COM: return @"SBCEMAIL_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CELLONE_MS_COM: return @"CELLONE_MS_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MYCELLONE_NET: return @"MYCELLONE_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_IOWAONE_NET: return @"SMS_IOWAONE_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_UTEXT_COM: return @"UTEXT_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_C1_SLO_COM: return @"MOBILE_C1_SLO_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CSOUTH1_COM: return @"CSOUTH1_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_GOCBW_COM: return @"GOCBW_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MYCINGULAR_COM: return @"MYCINGULAR_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MYCINGULAR_NET: return @"MYCINGULAR_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_MYCINGULAR_COM: return @"MOBILE_MYCINGULAR_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_MYCINGULAR_NET: return @"MOBILE_MYCINGULAR_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CORRWIRELESS_NET: return @"CORRWIRELESS_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_DOBSONCELLULAR_COM: return @"MOBILE_DOBSONCELLULAR_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_HICKORYTECH_COM: return @"SMS_HICKORYTECH_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TEXT_HOUSTONCELLULAR_NET: return @"TEXT_HOUSTONCELLULAR_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_CLEARLYDIGITAL_COM: return @"CLEARLYDIGITAL_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MESSAGE_PIONEERENIDCELLULAR_COM: return @"MESSAGE_PIONEERENIDCELLULAR_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMSMAIL_PLATEAUTEL_NET: return @"SMSMAIL_PLATEAUTEL_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_PSCEL_COM: return @"SMS_PSCEL_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MAIL_DATA1SOURCE_COM: return @"MAIL_DATA1SOURCE_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MOBILE_ATT_NET2: return @"MOBILE_ATT_NET2"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PCS_ROGERS_COM: return @"PCS_ROGERS_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_EMAIL2GO_COM: return @"EMAIL2GO_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_EMAIL_SWBW_COM: return @"EMAIL_SWBW_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TMS_SUNCOM_COM: return @"TMS_SUNCOM_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SUNCOM1_COM: return @"SUNCOM1_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SUNGRAM_COM: return @"SUNGRAM_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TYPETALK_RURALCELLULAR_COM3: return @"TYPETALK_RURALCELLULAR_COM3"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_USCC_TEXTMSG_COM: return @"USCC_TEXTMSG_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_EMAIL_USCC_NET: return @"EMAIL_USCC_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_USCC_NET: return @"USCC_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMSC_VZPACIFICA_NET: return @"SMSC_VZPACIFICA_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_SMS_WCC_NET: return @"SMS_WCC_NET"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_MSG_TELUS_COM: return @"MSG_TELUS_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TXT_BELLMOBILITY_COM: return @"TXT_BELLMOBILITY_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PCS_ROGERS_COM2: return @"PCS_ROGERS_COM2"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_WIREFREE_INFORME_CA: return @"WIREFREE_INFORME_CA"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_PCS_SASKTELMOBILITY_COM: return @"PCS_SASKTELMOBILITY_COM"; case FILECATALYST_MODEL_CELLPHONECARRIERTYPE_TXT_BELLMOBILITY_CA: return @"TXT_BELLMOBILITY_CA"; default: return NULL; } return NULL; } #endif /* DEF_FILECATALYSTMODELCellPhoneCarrierType_M */