Developer

Fixing Data Validation Issues

Data is fetched, validated, and transformed into generic business objects. The extensibility layer displays the data on its views and subviews.

When you modify or create data, you must validate and transform the generic BO back to the database-specific format (OData) before you commit it to the database. The validation step may fail, for example, because of malformed, non-OData-compliant date/time values. If you set an error handler delegate property that is exposed by the datasource adapter library, you can listen for and fix conversion-related issues.

@property (nonatomic, assign) id<MAFSDMEntryConvertErrorHandlerDelegate> conversionErrorHandlerDelegate;
MAFSDMEntryConvertErrorHandlerDelegate declares these delegate methods:
  • -(BOOL) willConvertODataEntryToBO:(SDMODataEntry*)entry_in collectionName:(NSString*)collectionName_in;

    Implement this delegate method to intercept the OData entry before it is converted to a generic BO. Pass the entry to be converted and the name of the collection the entry belongs to to the method. Return YES to perform the conversion; otherwise, return NO.

  • -(void) didConvertODataEntryToBO:(SDMODataEntry*)entry_in collectionName:(NSString*)collectionName_in bo:(id<MAFGenericBO>)bo_in;

    Implement this delegate method to be notified when the OData entry to generic BO conversion finishes.

  • -(BOOL) willConvertBOToODataEntry:(id<MAFGenericBO>)bo_in boType:(NSString*)boType_in;

    Implement this delegate method to intercept the generic BO before it is converted to an OData entry, that is, when the Extensibility Framework commits data to the database. The generic BO to be converted and its type (which must match the collection name the entry belongs to) is passed to the method. Return YES to perform the conversion; otherwise, return NO.

  • -(void) didConvertBOToODataEntry:(id<MAFGenericBO>)bo_in boType:(NSString*)boType_in entry:(SDMODataEntry*)entry_in;

    Implement this delegate method to be notified when the generic BO to OData entry conversion finishes.