diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-02-16 11:23:45 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-02-16 11:23:45 +0000 |
commit | 22ae0fa8c302d22071116abca27d2add3a0af991 (patch) | |
tree | 0110aebd405f15296badd823157eaac500e6a18d /Source/TableDump.h | |
parent | c64877be105019508234b9ee867d710de3b8160c (diff) | |
download | sequelpro-22ae0fa8c302d22071116abca27d2add3a0af991.tar.gz sequelpro-22ae0fa8c302d22071116abca27d2add3a0af991.tar.bz2 sequelpro-22ae0fa8c302d22071116abca27d2add3a0af991.zip |
• re-factored and outsourced the entire CSV import field mapper sheet
- changed the way to choose whether a source field should be imported or not by introducing a new table column 'operators'
- clicking at the 'operator's header toggles all operators to 'Import' or 'Do not import'
- added tooltips for each table cell; if file's first line are the headers show them in the tooltips as well
- added checkbox "First line contains fields names" since it'll be clear in this pane whether a file has a header line or not (will be sync with prefs)
- added the possibility to choose the import method: INSERT INTO or REPLACE INTO
• deleted all old field mapper stuff from TableDump and DBView.xib
Notes:
- tests are needed to be sure that this change does not cause mismatches while importing
- symbols for Do (not) import are tendative - maybe use images
- a further import method UPDATE plus an operator '=' will be added soon
- chance to add a new global source variable will come soon
- displaying of source field types will come soon
- semi-automatically matching of source field names and header names will come soon
- the GUI needs some improvements afterwards
Diffstat (limited to 'Source/TableDump.h')
-rw-r--r-- | Source/TableDump.h | 116 |
1 files changed, 54 insertions, 62 deletions
diff --git a/Source/TableDump.h b/Source/TableDump.h index 644057b6..001b1778 100644 --- a/Source/TableDump.h +++ b/Source/TableDump.h @@ -44,87 +44,82 @@ typedef enum _SPExportModes { IBOutlet id tableDataInstance; IBOutlet id customQueryInstance; - IBOutlet id tableWindow; - - IBOutlet id exportDumpView; - IBOutlet id exportCSVView; - IBOutlet id exportMultipleCSVView; - IBOutlet id exportMultipleXMLView; - IBOutlet id exportDumpTableView; - IBOutlet id exportMultipleCSVTableView; - IBOutlet id exportMultipleXMLTableView; - IBOutlet id exportFieldNamesSwitch; - IBOutlet id exportFieldsTerminatedField; - IBOutlet id exportFieldsEnclosedField; - IBOutlet id exportFieldsEscapedField; - IBOutlet id exportLinesTerminatedField; - IBOutlet id exportMultipleFieldNamesSwitch; - IBOutlet id exportMultipleFieldsTerminatedField; - IBOutlet id exportMultipleFieldsEnclosedField; - IBOutlet id exportMultipleFieldsEscapedField; - IBOutlet id exportMultipleLinesTerminatedField; - + IBOutlet id tableWindow; + + IBOutlet id exportDumpView; + IBOutlet id exportCSVView; + IBOutlet id exportMultipleCSVView; + IBOutlet id exportMultipleXMLView; + IBOutlet id exportDumpTableView; + IBOutlet id exportMultipleCSVTableView; + IBOutlet id exportMultipleXMLTableView; + IBOutlet id exportFieldNamesSwitch; + IBOutlet id exportFieldsTerminatedField; + IBOutlet id exportFieldsEnclosedField; + IBOutlet id exportFieldsEscapedField; + IBOutlet id exportLinesTerminatedField; + IBOutlet id exportMultipleFieldNamesSwitch; + IBOutlet id exportMultipleFieldsTerminatedField; + IBOutlet id exportMultipleFieldsEnclosedField; + IBOutlet id exportMultipleFieldsEscapedField; + IBOutlet id exportMultipleLinesTerminatedField; + // New Export Window IBOutlet id exportWindow; IBOutlet id exportTabBar; IBOutlet id exportToolbar; IBOutlet id exportTableList; - + IBOutlet id importCSVView; IBOutlet NSPopUpButton *importFormatPopup; IBOutlet id importCSVBox; - IBOutlet id importFieldNamesSwitch; - IBOutlet id importFieldsTerminatedField; - IBOutlet id importFieldsEnclosedField; - IBOutlet id importFieldsEscapedField; - IBOutlet id importLinesTerminatedField; - - IBOutlet id addDropTableSwitch; - IBOutlet id addCreateTableSwitch; - IBOutlet id addTableContentSwitch; - IBOutlet id addErrorsSwitch; - IBOutlet id sqlFullStreamingSwitch; - IBOutlet id csvFullStreamingSwitch; - IBOutlet id multiCSVFullStreamingSwitch; - IBOutlet id multiXMLFullStreamingSwitch; - IBOutlet id errorsSheet; - IBOutlet id errorsView; - IBOutlet id singleProgressSheet; - IBOutlet id singleProgressBar; - IBOutlet id singleProgressTitle; - IBOutlet id singleProgressText; - - IBOutlet id fieldMappingSheet; - IBOutlet id fieldMappingPopup; - IBOutlet id fieldMappingTableView; - - IBOutlet id rowUpButton; - IBOutlet id rowDownButton; - IBOutlet id recordCountLabel; + IBOutlet id importFieldNamesSwitch; + IBOutlet id importFieldsTerminatedField; + IBOutlet id importFieldsEnclosedField; + IBOutlet id importFieldsEscapedField; + IBOutlet id importLinesTerminatedField; + IBOutlet id importFieldMapperSheetWindow; + + IBOutlet id addDropTableSwitch; + IBOutlet id addCreateTableSwitch; + IBOutlet id addTableContentSwitch; + IBOutlet id addErrorsSwitch; + IBOutlet id sqlFullStreamingSwitch; + IBOutlet id csvFullStreamingSwitch; + IBOutlet id multiCSVFullStreamingSwitch; + IBOutlet id multiXMLFullStreamingSwitch; + IBOutlet id errorsSheet; + IBOutlet id errorsView; + IBOutlet id singleProgressSheet; + IBOutlet id singleProgressBar; + IBOutlet id singleProgressTitle; + IBOutlet id singleProgressText; MCPConnection *mySQLConnection; NSMutableArray *tables; + + // Field Mapper Controller + SPFieldMapperController *fieldMapperController; NSArray *fieldMappingImportArray; BOOL fieldMappingImportArrayIsPreview; - NSMutableArray *fieldMappingTableColumnNames; - NSMutableArray *fieldMappingArray; - NSMutableArray *fieldMappingButtonOptions; - NSInteger fieldMappingCurrentRow; + NSArray *fieldMappingTableColumnNames; + NSArray *fieldMappingArray; + NSArray *fieldMapperOperator; + NSString *selectedTableTarget; + NSString *selectedImportMethod; + NSInteger fieldMapperSheetStatus; + NSUInteger exportMode; NSUserDefaults *prefs; BOOL progressCancelled; - - NSInteger fieldMapperSheetStatus; - SPFieldMapperController *fieldMapperController; + } // IBAction methods - (IBAction)reloadTables:(id)sender; - (IBAction)selectTables:(id)sender; - (IBAction)closeSheet:(id)sender; -- (IBAction)closeFieldMapperSheet:(id)sender; -- (IBAction)stepRow:(id)sender; - (IBAction)cancelProgressBar:(id)sender; // Export methods @@ -139,11 +134,8 @@ typedef enum _SPExportModes { - (void)startSQLImportProcessWithFile:(NSString *)filename; - (void)importCSVFile:(NSString *)filename; - (IBAction)changeFormat:(id)sender; -- (IBAction)changeTable:(id)sender; - (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(NSInteger)returnCode contextInfo:(NSString *)contextInfo; -- (BOOL) buildFieldMappingArrayWithData:(NSArray *)importData isPreview:(BOOL)dataIsPreviewData; -- (void)setupFieldMappingArray; -- (void)updateFieldMappingButtonCell; +- (BOOL) buildFieldMappingArrayWithData:(NSArray *)importData isPreview:(BOOL)dataIsPreviewData ofSoureFile:(NSString*)filename; - (NSString *) mappedValueStringForRowArray:(NSArray *)csvRowArray; // Export methods |