aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-02-16 11:23:45 +0000
committerBibiko <bibiko@eva.mpg.de>2010-02-16 11:23:45 +0000
commit22ae0fa8c302d22071116abca27d2add3a0af991 (patch)
tree0110aebd405f15296badd823157eaac500e6a18d
parentc64877be105019508234b9ee867d710de3b8160c (diff)
downloadsequelpro-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
-rw-r--r--Interfaces/English.lproj/DBView.xib844
-rw-r--r--Interfaces/English.lproj/DataMigrationDialog.xib609
-rw-r--r--Source/SPFieldMapperController.h36
-rw-r--r--Source/SPFieldMapperController.m285
-rw-r--r--Source/TableDump.h116
-rw-r--r--Source/TableDump.m220
6 files changed, 672 insertions, 1438 deletions
diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib
index 69fca47c..70e6c534 100644
--- a/Interfaces/English.lproj/DBView.xib
+++ b/Interfaces/English.lproj/DBView.xib
@@ -18,13 +18,13 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>740</string>
<string>740</string>
- <string>1.2.2</string>
+ <string>1.2.5</string>
</object>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="6698"/>
<integer value="6766"/>
+ <integer value="6698"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1694,6 +1694,7 @@
<bool key="BWGBHasTopBorder">NO</bool>
<bool key="BWGBHasBottomBorder">NO</bool>
<bool key="BWGBHasGradient">NO</bool>
+ <bool key="BWGBHasFillColor">NO</bool>
<float key="BWGBTopInsetAlpha">0.0</float>
<float key="BWGBBottomInsetAlpha">0.0</float>
</object>
@@ -8925,409 +8926,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
<string key="NSFrameAutosaveName">MYSQL_HELP_WINDOW</string>
</object>
- <object class="NSWindowTemplate" id="176945499">
- <int key="NSWindowStyleMask">15</int>
- <int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{262, 469}, {465, 294}}</string>
- <int key="NSWTFlags">1886912512</int>
- <string key="NSWindowTitle">CSV Field Mapping</string>
- <string key="NSWindowClass">NSWindow</string>
- <object class="NSMutableString" key="NSViewClass">
- <characters key="NS.bytes">View</characters>
- </object>
- <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
- <string key="NSWindowContentMinSize">{350, 250}</string>
- <object class="NSView" key="NSWindowView" id="1024486775">
- <nil key="NSNextResponder"/>
- <int key="NSvFlags">256</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSBox" id="908136938">
- <reference key="NSNextResponder" ref="1024486775"/>
- <int key="NSvFlags">10</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSView" id="573332983">
- <reference key="NSNextResponder" ref="908136938"/>
- <int key="NSvFlags">256</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSPopUpButton" id="874969464">
- <reference key="NSNextResponder" ref="573332983"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{128, 16}, {160, 26}}</string>
- <reference key="NSSuperview" ref="573332983"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSPopUpButtonCell" key="NSCell" id="691314210">
- <int key="NSCellFlags">-2076049856</int>
- <int key="NSCellFlags2">2048</int>
- <reference key="NSSupport" ref="244931163"/>
- <reference key="NSControlView" ref="874969464"/>
- <int key="NSButtonFlags">109199615</int>
- <int key="NSButtonFlags2">129</int>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- <nil key="NSMenuItem"/>
- <bool key="NSMenuItemRespectAlignment">YES</bool>
- <object class="NSMenu" key="NSMenu" id="380312256">
- <string key="NSTitle">OtherViews</string>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- </object>
- <int key="NSSelectedIndex">-1</int>
- <int key="NSPreferredEdge">1</int>
- <bool key="NSUsesItemFromMenu">YES</bool>
- <bool key="NSAltersState">YES</bool>
- <int key="NSArrowPosition">2</int>
- </object>
- </object>
- <object class="NSTextField" id="231180464">
- <reference key="NSNextResponder" ref="573332983"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 22}, {109, 17}}</string>
- <reference key="NSSuperview" ref="573332983"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="1059848808">
- <int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">272630784</int>
- <string key="NSContents">Insert into table:</string>
- <reference key="NSSupport" ref="244931163"/>
- <reference key="NSControlView" ref="231180464"/>
- <reference key="NSBackgroundColor" ref="62854682"/>
- <reference key="NSTextColor" ref="454249633"/>
- </object>
- </object>
- </object>
- <string key="NSFrame">{{1, 1}, {465, 60}}</string>
- <reference key="NSSuperview" ref="908136938"/>
- </object>
- </object>
- <string key="NSFrame">{{-1, 233}, {467, 62}}</string>
- <reference key="NSSuperview" ref="1024486775"/>
- <string key="NSOffsets">{0, 0}</string>
- <object class="NSTextFieldCell" key="NSTitleCell">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">Box</string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSBackgroundColor" ref="480189472"/>
- <object class="NSColor" key="NSTextColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MCAwLjgwMDAwMDAxMTkAA</bytes>
- </object>
- </object>
- <reference key="NSContentView" ref="573332983"/>
- <int key="NSBorderType">1</int>
- <int key="NSBoxType">4</int>
- <int key="NSTitlePosition">0</int>
- <bool key="NSTransparent">NO</bool>
- <object class="NSColor" key="NSFillColor2">
- <int key="NSColorSpace">2</int>
- <bytes key="NSRGB">MC45NDUwOTgxMDIxIDAuOTQ1MDk4MTAyMSAwLjk0NTA5ODEwMjEAA</bytes>
- </object>
- </object>
- <object class="NSScrollView" id="1041893843">
- <reference key="NSNextResponder" ref="1024486775"/>
- <int key="NSvFlags">274</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSClipView" id="68425806">
- <reference key="NSNextResponder" ref="1041893843"/>
- <int key="NSvFlags">2304</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSTableView" id="134631251">
- <reference key="NSNextResponder" ref="68425806"/>
- <int key="NSvFlags">256</int>
- <string key="NSFrameSize">{423, 141}</string>
- <reference key="NSSuperview" ref="68425806"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTableHeaderView" key="NSHeaderView" id="568493807">
- <reference key="NSNextResponder" ref="256453894"/>
- <int key="NSvFlags">256</int>
- <string key="NSFrameSize">{423, 17}</string>
- <reference key="NSSuperview" ref="256453894"/>
- <reference key="NSTableView" ref="134631251"/>
- </object>
- <object class="_NSCornerView" key="NSCornerView" id="639896268">
- <reference key="NSNextResponder" ref="1041893843"/>
- <int key="NSvFlags">-2147483392</int>
- <string key="NSFrame">{{-22, 0}, {12, 17}}</string>
- <reference key="NSSuperview" ref="1041893843"/>
- </object>
- <object class="NSMutableArray" key="NSTableColumns">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSTableColumn" id="611279908">
- <string key="NSIdentifier">field</string>
- <double key="NSWidth">210</double>
- <double key="NSMinWidth">15</double>
- <double key="NSMaxWidth">1000</double>
- <object class="NSTableHeaderCell" key="NSHeaderCell">
- <int key="NSCellFlags">75628096</int>
- <int key="NSCellFlags2">2048</int>
- <string key="NSContents">Field</string>
- <reference key="NSSupport" ref="26"/>
- <object class="NSColor" key="NSBackgroundColor" id="512412976">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC4zMzMzMzI5ODU2AA</bytes>
- </object>
- <reference key="NSTextColor" ref="222976159"/>
- </object>
- <object class="NSTextFieldCell" key="NSDataCell" id="515758282">
- <int key="NSCellFlags">338820672</int>
- <int key="NSCellFlags2">132096</int>
- <string key="NSContents">Text Cell</string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSControlView" ref="134631251"/>
- <reference key="NSBackgroundColor" ref="449903125"/>
- <reference key="NSTextColor" ref="454249633"/>
- </object>
- <int key="NSResizingMask">3</int>
- <bool key="NSIsResizeable">YES</bool>
- <reference key="NSTableView" ref="134631251"/>
- </object>
- <object class="NSTableColumn" id="68154948">
- <string key="NSIdentifier">value</string>
- <double key="NSWidth">207</double>
- <double key="NSMinWidth">40</double>
- <double key="NSMaxWidth">1000</double>
- <object class="NSTableHeaderCell" key="NSHeaderCell">
- <int key="NSCellFlags">75628096</int>
- <int key="NSCellFlags2">2048</int>
- <string key="NSContents">Value</string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSBackgroundColor" ref="512412976"/>
- <reference key="NSTextColor" ref="222976159"/>
- </object>
- <object class="NSTextFieldCell" key="NSDataCell" id="209130090">
- <int key="NSCellFlags">338820672</int>
- <int key="NSCellFlags2">132096</int>
- <string key="NSContents">Text Cell</string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSControlView" ref="134631251"/>
- <reference key="NSBackgroundColor" ref="449903125"/>
- <reference key="NSTextColor" ref="454249633"/>
- </object>
- <int key="NSResizingMask">3</int>
- <bool key="NSIsResizeable">YES</bool>
- <bool key="NSIsEditable">YES</bool>
- <reference key="NSTableView" ref="134631251"/>
- </object>
- </object>
- <double key="NSIntercellSpacingWidth">3</double>
- <double key="NSIntercellSpacingHeight">2</double>
- <reference key="NSBackgroundColor" ref="1024678221"/>
- <reference key="NSGridColor" ref="864903678"/>
- <double key="NSRowHeight">20</double>
- <int key="NSTvFlags">1379958784</int>
- <reference key="NSDelegate"/>
- <reference key="NSDataSource"/>
- <int key="NSGridStyleMask">1</int>
- <int key="NSColumnAutoresizingStyle">1</int>
- <int key="NSDraggingSourceMaskForLocal">15</int>
- <int key="NSDraggingSourceMaskForNonLocal">0</int>
- <bool key="NSAllowsTypeSelect">YES</bool>
- <int key="NSTableViewDraggingDestinationStyle">0</int>
- </object>
- </object>
- <string key="NSFrame">{{1, 17}, {423, 141}}</string>
- <reference key="NSSuperview" ref="1041893843"/>
- <reference key="NSNextKeyView" ref="134631251"/>
- <reference key="NSDocView" ref="134631251"/>
- <reference key="NSBGColor" ref="1024678221"/>
- <int key="NScvFlags">6</int>
- </object>
- <object class="NSScroller" id="99652168">
- <reference key="NSNextResponder" ref="1041893843"/>
- <int key="NSvFlags">-2147483392</int>
- <string key="NSFrame">{{413, 18}, {11, 140}}</string>
- <reference key="NSSuperview" ref="1041893843"/>
- <int key="NSsFlags">256</int>
- <reference key="NSTarget" ref="1041893843"/>
- <string key="NSAction">_doScroller:</string>
- <double key="NSPercent">0.9929078221321106</double>
- </object>
- <object class="NSScroller" id="1053700221">
- <reference key="NSNextResponder" ref="1041893843"/>
- <int key="NSvFlags">-2147483392</int>
- <string key="NSFrame">{{-100, -100}, {227, 11}}</string>
- <reference key="NSSuperview" ref="1041893843"/>
- <int key="NSsFlags">257</int>
- <reference key="NSTarget" ref="1041893843"/>
- <string key="NSAction">_doScroller:</string>
- <double key="NSPercent">0.99047619104385376</double>
- </object>
- <object class="NSClipView" id="256453894">
- <reference key="NSNextResponder" ref="1041893843"/>
- <int key="NSvFlags">2304</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="568493807"/>
- </object>
- <string key="NSFrame">{{1, 0}, {423, 17}}</string>
- <reference key="NSSuperview" ref="1041893843"/>
- <reference key="NSNextKeyView" ref="568493807"/>
- <reference key="NSDocView" ref="568493807"/>
- <reference key="NSBGColor" ref="1024678221"/>
- <int key="NScvFlags">4</int>
- </object>
- <reference ref="639896268"/>
- </object>
- <string key="NSFrame">{{20, 45}, {425, 159}}</string>
- <reference key="NSSuperview" ref="1024486775"/>
- <reference key="NSNextKeyView" ref="68425806"/>
- <int key="NSsFlags">530</int>
- <reference key="NSVScroller" ref="99652168"/>
- <reference key="NSHScroller" ref="1053700221"/>
- <reference key="NSContentView" ref="68425806"/>
- <reference key="NSHeaderClipView" ref="256453894"/>
- <reference key="NSCornerView" ref="639896268"/>
- <bytes key="NSScrollAmts">QSAAAEEgAABBsAAAQbAAAA</bytes>
- </object>
- <object class="NSTextField" id="940196687">
- <reference key="NSNextResponder" ref="1024486775"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 211}, {151, 13}}</string>
- <reference key="NSSuperview" ref="1024486775"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="879803695">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">4194304</int>
- <string key="NSContents">Please choose field mapping</string>
- <object class="NSFont" key="NSSupport">
- <string key="NSName">LucidaGrande-Bold</string>
- <double key="NSSize">10</double>
- <int key="NSfFlags">16</int>
- </object>
- <reference key="NSControlView" ref="940196687"/>
- <reference key="NSBackgroundColor" ref="62854682"/>
- <reference key="NSTextColor" ref="454249633"/>
- </object>
- </object>
- <object class="NSButton" id="537769422">
- <reference key="NSNextResponder" ref="1024486775"/>
- <int key="NSvFlags">289</int>
- <string key="NSFrame">{{286, 6}, {82, 32}}</string>
- <reference key="NSSuperview" ref="1024486775"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="688110794">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">137887744</int>
- <string key="NSContents">Cancel</string>
- <reference key="NSSupport" ref="244931163"/>
- <reference key="NSControlView" ref="537769422"/>
- <int key="NSButtonFlags">-2038284033</int>
- <int key="NSButtonFlags2">1</int>
- <object class="NSFont" key="NSAlternateImage" id="514282836">
- <string key="NSName">Helvetica</string>
- <double key="NSSize">13</double>
- <int key="NSfFlags">16</int>
- </object>
- <string key="NSAlternateContents"/>
- <string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- </object>
- <object class="NSButton" id="322520441">
- <reference key="NSNextResponder" ref="1024486775"/>
- <int key="NSvFlags">289</int>
- <string key="NSFrame">{{368, 6}, {83, 32}}</string>
- <reference key="NSSuperview" ref="1024486775"/>
- <int key="NSTag">1</int>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="469479462">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">137887744</int>
- <string key="NSContents">Import</string>
- <reference key="NSSupport" ref="244931163"/>
- <reference key="NSControlView" ref="322520441"/>
- <int key="NSTag">1</int>
- <int key="NSButtonFlags">-2038284033</int>
- <int key="NSButtonFlags2">1</int>
- <reference key="NSAlternateImage" ref="514282836"/>
- <string key="NSAlternateContents"/>
- <string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- </object>
- <object class="NSButton" id="269606631">
- <reference key="NSNextResponder" ref="1024486775"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{20, 11}, {32, 24}}</string>
- <reference key="NSSuperview" ref="1024486775"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="249886123">
- <int key="NSCellFlags">604110336</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents"/>
- <reference key="NSSupport" ref="244931163"/>
- <reference key="NSControlView" ref="269606631"/>
- <int key="NSButtonFlags">-2030812929</int>
- <int key="NSButtonFlags2">34</int>
- <object class="NSCustomResource" key="NSNormalImage" id="435122777">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">NSGoLeftTemplate</string>
- </object>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- </object>
- </object>
- <object class="NSButton" id="943423465">
- <reference key="NSNextResponder" ref="1024486775"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{51, 11}, {32, 24}}</string>
- <reference key="NSSuperview" ref="1024486775"/>
- <int key="NSTag">1</int>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="468691156">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents"/>
- <reference key="NSSupport" ref="244931163"/>
- <reference key="NSControlView" ref="943423465"/>
- <int key="NSTag">1</int>
- <int key="NSButtonFlags">-2030812929</int>
- <int key="NSButtonFlags2">34</int>
- <object class="NSCustomResource" key="NSNormalImage" id="888810603">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">NSGoRightTemplate</string>
- </object>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- </object>
- </object>
- <object class="NSTextField" id="1029840737">
- <reference key="NSNextResponder" ref="1024486775"/>
- <int key="NSvFlags">290</int>
- <string key="NSFrame">{{88, 16}, {199, 14}}</string>
- <reference key="NSSuperview" ref="1024486775"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="179332122">
- <int key="NSCellFlags">67239488</int>
- <int key="NSCellFlags2">272763136</int>
- <string key="NSContents">x of y records</string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSControlView" ref="1029840737"/>
- <reference key="NSBackgroundColor" ref="62854682"/>
- <reference key="NSTextColor" ref="454249633"/>
- </object>
- </object>
- </object>
- <string key="NSFrameSize">{465, 294}</string>
- </object>
- <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
- <string key="NSMinSize">{350, 272}</string>
- <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
- </object>
<object class="NSWindowTemplate" id="434046103">
<int key="NSWindowStyleMask">9</int>
<int key="NSWindowBacking">2</int>
@@ -11352,7 +10950,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSSegmentItem">
<double key="NSSegmentItemWidth">27</double>
- <reference key="NSSegmentItemImage" ref="435122777"/>
+ <object class="NSCustomResource" key="NSSegmentItemImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSGoLeftTemplate</string>
+ </object>
<string key="NSSegmentItemLabel"/>
<string key="NSSegmentItemTooltip">Back</string>
<bool key="NSSegmentItemDisabled">YES</bool>
@@ -11360,7 +10961,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<object class="NSSegmentItem">
<double key="NSSegmentItemWidth">27</double>
- <reference key="NSSegmentItemImage" ref="888810603"/>
+ <object class="NSCustomResource" key="NSSegmentItemImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSGoRightTemplate</string>
+ </object>
<string key="NSSegmentItemLabel"/>
<string key="NSSegmentItemTooltip">Forward</string>
<int key="NSSegmentItemTag">1</int>
@@ -12788,86 +12392,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="connectionID">4524</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">recordCountLabel</string>
- <reference key="source" ref="225526897"/>
- <reference key="destination" ref="1029840737"/>
- </object>
- <int key="connectionID">4597</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">stepRow:</string>
- <reference key="source" ref="225526897"/>
- <reference key="destination" ref="943423465"/>
- </object>
- <int key="connectionID">4598</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">stepRow:</string>
- <reference key="source" ref="225526897"/>
- <reference key="destination" ref="269606631"/>
- </object>
- <int key="connectionID">4599</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">rowUpButton</string>
- <reference key="source" ref="225526897"/>
- <reference key="destination" ref="943423465"/>
- </object>
- <int key="connectionID">4600</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">rowDownButton</string>
- <reference key="source" ref="225526897"/>
- <reference key="destination" ref="269606631"/>
- </object>
- <int key="connectionID">4601</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">dataSource</string>
- <reference key="source" ref="134631251"/>
- <reference key="destination" ref="225526897"/>
- </object>
- <int key="connectionID">4602</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">fieldMappingTableView</string>
- <reference key="source" ref="225526897"/>
- <reference key="destination" ref="134631251"/>
- </object>
- <int key="connectionID">4603</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">changeTable:</string>
- <reference key="source" ref="225526897"/>
- <reference key="destination" ref="874969464"/>
- </object>
- <int key="connectionID">4605</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">fieldMappingPopup</string>
- <reference key="source" ref="225526897"/>
- <reference key="destination" ref="874969464"/>
- </object>
- <int key="connectionID">4606</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">fieldMappingSheet</string>
- <reference key="source" ref="225526897"/>
- <reference key="destination" ref="176945499"/>
- </object>
- <int key="connectionID">4607</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">filterTable:</string>
<reference key="source" ref="392169872"/>
@@ -15565,22 +15089,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="connectionID">6752</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">closeFieldMapperSheet:</string>
- <reference key="source" ref="225526897"/>
- <reference key="destination" ref="322520441"/>
- </object>
- <int key="connectionID">6758</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">closeFieldMapperSheet:</string>
- <reference key="source" ref="225526897"/>
- <reference key="destination" ref="537769422"/>
- </object>
- <int key="connectionID">6759</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">previousHistoryMenuItem</string>
<reference key="source" ref="601471102"/>
@@ -17197,228 +16705,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<reference key="parent" ref="280926998"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">4565</int>
- <reference key="object" ref="176945499"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="1024486775"/>
- </object>
- <reference key="parent" ref="0"/>
- <string key="objectName">CSV Field Mapping Sheet</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4566</int>
- <reference key="object" ref="1024486775"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="1029840737"/>
- <reference ref="943423465"/>
- <reference ref="269606631"/>
- <reference ref="537769422"/>
- <reference ref="322520441"/>
- <reference ref="940196687"/>
- <reference ref="908136938"/>
- <reference ref="1041893843"/>
- </object>
- <reference key="parent" ref="176945499"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4567</int>
- <reference key="object" ref="1029840737"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="179332122"/>
- </object>
- <reference key="parent" ref="1024486775"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4568</int>
- <reference key="object" ref="943423465"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="468691156"/>
- </object>
- <reference key="parent" ref="1024486775"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4569</int>
- <reference key="object" ref="269606631"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="249886123"/>
- </object>
- <reference key="parent" ref="1024486775"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4570</int>
- <reference key="object" ref="537769422"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="688110794"/>
- </object>
- <reference key="parent" ref="1024486775"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4571</int>
- <reference key="object" ref="322520441"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="469479462"/>
- </object>
- <reference key="parent" ref="1024486775"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4572</int>
- <reference key="object" ref="940196687"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="879803695"/>
- </object>
- <reference key="parent" ref="1024486775"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4573</int>
- <reference key="object" ref="908136938"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="874969464"/>
- <reference ref="231180464"/>
- </object>
- <reference key="parent" ref="1024486775"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4574</int>
- <reference key="object" ref="1041893843"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="568493807"/>
- <reference ref="1053700221"/>
- <reference ref="99652168"/>
- <reference ref="134631251"/>
- </object>
- <reference key="parent" ref="1024486775"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4575</int>
- <reference key="object" ref="568493807"/>
- <reference key="parent" ref="1041893843"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4576</int>
- <reference key="object" ref="1053700221"/>
- <reference key="parent" ref="1041893843"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4577</int>
- <reference key="object" ref="99652168"/>
- <reference key="parent" ref="1041893843"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4578</int>
- <reference key="object" ref="134631251"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="611279908"/>
- <reference ref="68154948"/>
- </object>
- <reference key="parent" ref="1041893843"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4579</int>
- <reference key="object" ref="611279908"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="515758282"/>
- </object>
- <reference key="parent" ref="134631251"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4580</int>
- <reference key="object" ref="68154948"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="209130090"/>
- </object>
- <reference key="parent" ref="134631251"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4581</int>
- <reference key="object" ref="209130090"/>
- <reference key="parent" ref="68154948"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4582</int>
- <reference key="object" ref="515758282"/>
- <reference key="parent" ref="611279908"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4583</int>
- <reference key="object" ref="874969464"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="691314210"/>
- </object>
- <reference key="parent" ref="908136938"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4584</int>
- <reference key="object" ref="231180464"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="1059848808"/>
- </object>
- <reference key="parent" ref="908136938"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4585</int>
- <reference key="object" ref="1059848808"/>
- <reference key="parent" ref="231180464"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4586</int>
- <reference key="object" ref="691314210"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="380312256"/>
- </object>
- <reference key="parent" ref="874969464"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4587</int>
- <reference key="object" ref="380312256"/>
- <reference key="parent" ref="691314210"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4588</int>
- <reference key="object" ref="879803695"/>
- <reference key="parent" ref="940196687"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4589</int>
- <reference key="object" ref="469479462"/>
- <reference key="parent" ref="322520441"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4590</int>
- <reference key="object" ref="688110794"/>
- <reference key="parent" ref="537769422"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4591</int>
- <reference key="object" ref="249886123"/>
- <reference key="parent" ref="269606631"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4592</int>
- <reference key="object" ref="468691156"/>
- <reference key="parent" ref="943423465"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4593</int>
- <reference key="object" ref="179332122"/>
- <reference key="parent" ref="1029840737"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">4702</int>
<reference key="object" ref="1006422530"/>
<reference key="parent" ref="0"/>
@@ -22750,58 +22036,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>4521.IBPluginDependency</string>
<string>4522.IBPluginDependency</string>
<string>4523.IBPluginDependency</string>
- <string>4565.IBEditorWindowLastContentRect</string>
- <string>4565.IBPluginDependency</string>
- <string>4565.IBWindowTemplateEditedContentRect</string>
- <string>4565.ImportedFromIB2</string>
- <string>4565.editorWindowContentRectSynchronizationRect</string>
- <string>4565.windowTemplate.hasMaxSize</string>
- <string>4565.windowTemplate.hasMinSize</string>
- <string>4565.windowTemplate.maxSize</string>
- <string>4565.windowTemplate.minSize</string>
- <string>4566.IBPluginDependency</string>
- <string>4566.ImportedFromIB2</string>
- <string>4567.IBPluginDependency</string>
- <string>4568.IBPluginDependency</string>
- <string>4568.ImportedFromIB2</string>
- <string>4569.IBPluginDependency</string>
- <string>4569.ImportedFromIB2</string>
- <string>4570.IBPluginDependency</string>
- <string>4570.ImportedFromIB2</string>
- <string>4571.IBPluginDependency</string>
- <string>4571.ImportedFromIB2</string>
- <string>4572.IBPluginDependency</string>
- <string>4572.ImportedFromIB2</string>
- <string>4573.IBPluginDependency</string>
- <string>4574.IBPluginDependency</string>
- <string>4574.ImportedFromIB2</string>
- <string>4575.IBPluginDependency</string>
- <string>4576.IBPluginDependency</string>
- <string>4576.IBShouldRemoveOnLegacySave</string>
- <string>4577.IBPluginDependency</string>
- <string>4577.IBShouldRemoveOnLegacySave</string>
- <string>4578.IBPluginDependency</string>
- <string>4578.ImportedFromIB2</string>
- <string>4579.IBPluginDependency</string>
- <string>4579.ImportedFromIB2</string>
- <string>4580.IBPluginDependency</string>
- <string>4580.ImportedFromIB2</string>
- <string>4581.IBPluginDependency</string>
- <string>4581.IBShouldRemoveOnLegacySave</string>
- <string>4582.IBPluginDependency</string>
- <string>4582.IBShouldRemoveOnLegacySave</string>
- <string>4583.IBPluginDependency</string>
- <string>4584.IBPluginDependency</string>
- <string>4585.IBPluginDependency</string>
- <string>4586.IBPluginDependency</string>
- <string>4587.IBEditorWindowLastContentRect</string>
- <string>4587.IBPluginDependency</string>
- <string>4588.IBPluginDependency</string>
- <string>4589.IBPluginDependency</string>
- <string>4590.IBPluginDependency</string>
- <string>4591.IBPluginDependency</string>
- <string>4592.IBPluginDependency</string>
- <string>4593.IBPluginDependency</string>
<string>4676.IBPluginDependency</string>
<string>4677.IBPluginDependency</string>
<string>4741.IBPluginDependency</string>
@@ -24374,58 +23608,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{315, 449}, {465, 294}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{315, 449}, {465, 294}}</string>
- <integer value="1"/>
- <string>{{387, 725}, {432, 282}}</string>
- <integer value="0"/>
- <integer value="1"/>
- <string>{3.40282e+38, 3.40282e+38}</string>
- <string>{350, 250}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{611, 880}, {113, 4}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -24487,10 +23669,10 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{95, 306}, {944, 550}}</string>
+ <string>{{95, 206}, {944, 550}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO"/>
- <string>{{95, 306}, {944, 550}}</string>
+ <string>{{95, 206}, {944, 550}}</string>
<integer value="1"/>
<integer value="1"/>
<string>{{62, 352}, {845, 504}}</string>
diff --git a/Interfaces/English.lproj/DataMigrationDialog.xib b/Interfaces/English.lproj/DataMigrationDialog.xib
index a6a2b81e..23579daf 100644
--- a/Interfaces/English.lproj/DataMigrationDialog.xib
+++ b/Interfaces/English.lproj/DataMigrationDialog.xib
@@ -41,7 +41,7 @@
<object class="NSWindowTemplate" id="420604405">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{262, 452}, {465, 311}}</string>
+ <string key="NSWindowRect">{{262, 438}, {465, 325}}</string>
<int key="NSWTFlags">1886912512</int>
<string key="NSWindowTitle">CSV Field Mapping</string>
<string key="NSWindowClass">NSWindow</string>
@@ -68,7 +68,7 @@
<object class="NSTextField" id="1052916804">
<reference key="NSNextResponder" ref="297364507"/>
<int key="NSvFlags">269</int>
- <string key="NSFrame">{{179, 10}, {93, 17}}</string>
+ <string key="NSFrame">{{179, 12}, {93, 17}}</string>
<reference key="NSSuperview" ref="297364507"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="922239869">
@@ -102,11 +102,11 @@
</object>
</object>
</object>
- <string key="NSFrame">{{1, 1}, {465, 34}}</string>
+ <string key="NSFrame">{{1, 1}, {465, 39}}</string>
<reference key="NSSuperview" ref="617902336"/>
</object>
</object>
- <string key="NSFrame">{{-1, 276}, {467, 36}}</string>
+ <string key="NSFrame">{{-1, 285}, {467, 41}}</string>
<reference key="NSSuperview" ref="78582513"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
@@ -175,13 +175,13 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSTableColumn" id="790992768">
<string key="NSIdentifier">import_value</string>
- <double key="NSWidth">216</double>
+ <double key="NSWidth">212</double>
<double key="NSMinWidth">15</double>
<double key="NSMaxWidth">1000</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75628096</int>
- <int key="NSCellFlags2">67110912</int>
- <string key="NSContents"/>
+ <int key="NSCellFlags2">2048</int>
+ <string key="NSContents">Source Fields</string>
<reference key="NSSupport" ref="26"/>
<object class="NSColor" key="NSBackgroundColor" id="796399838">
<int key="NSColorSpace">3</int>
@@ -194,14 +194,48 @@
<reference key="NSColor" ref="938074100"/>
</object>
</object>
- <object class="NSTextFieldCell" key="NSDataCell" id="316634554">
- <int key="NSCellFlags">338820672</int>
- <int key="NSCellFlags2">132096</int>
- <string key="NSContents">Text Cell</string>
+ <object class="NSPopUpButtonCell" key="NSDataCell" id="130736119">
+ <int key="NSCellFlags">-2076049856</int>
+ <int key="NSCellFlags2">133120</int>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="678921094"/>
- <reference key="NSBackgroundColor" ref="746040121"/>
- <reference key="NSTextColor" ref="263116164"/>
+ <int key="NSButtonFlags">100679935</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ <object class="NSMenuItem" key="NSMenuItem" id="922650264">
+ <reference key="NSMenu" ref="318206101"/>
+ <string key="NSTitle">Pop Up</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <int key="NSState">1</int>
+ <object class="NSCustomResource" key="NSOnImage" id="884724275">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSMenuCheckmark</string>
+ </object>
+ <object class="NSCustomResource" key="NSMixedImage" id="1071040955">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSMenuMixedState</string>
+ </object>
+ <string key="NSAction">_popUpItemAction:</string>
+ <reference key="NSTarget" ref="130736119"/>
+ </object>
+ <bool key="NSMenuItemRespectAlignment">YES</bool>
+ <object class="NSMenu" key="NSMenu" id="318206101">
+ <string key="NSTitle">OtherViews</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="922650264"/>
+ </object>
+ <reference key="NSMenuFont" ref="26"/>
+ </object>
+ <int key="NSPreferredEdge">3</int>
+ <bool key="NSUsesItemFromMenu">YES</bool>
+ <bool key="NSAltersState">YES</bool>
+ <int key="NSArrowPosition">1</int>
</object>
<int key="NSResizingMask">3</int>
<bool key="NSIsResizeable">YES</bool>
@@ -210,21 +244,21 @@
</object>
<object class="NSTableColumn" id="283787363">
<string key="NSIdentifier">operator</string>
- <double key="NSWidth">20</double>
- <double key="NSMinWidth">20</double>
- <double key="NSMaxWidth">1000</double>
+ <double key="NSWidth">28</double>
+ <double key="NSMinWidth">28</double>
+ <double key="NSMaxWidth">28</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75628096</int>
<int key="NSCellFlags2">134219776</int>
- <string key="NSContents"/>
+ <string key="NSContents">→×</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSBackgroundColor" ref="796399838"/>
<reference key="NSTextColor" ref="186205954"/>
</object>
- <object class="NSPopUpButtonCell" key="NSDataCell" id="833492334">
+ <object class="NSPopUpButtonCell" key="NSDataCell" id="264818313">
<int key="NSCellFlags">-2076049856</int>
- <int key="NSCellFlags2">134350848</int>
- <reference key="NSSupport" ref="26"/>
+ <int key="NSCellFlags2">134219776</int>
+ <reference key="NSSupport" ref="388072550"/>
<reference key="NSControlView" ref="678921094"/>
<int key="NSButtonFlags">100679935</int>
<int key="NSButtonFlags2">129</int>
@@ -232,16 +266,27 @@
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
- <nil key="NSMenuItem"/>
+ <object class="NSMenuItem" key="NSMenuItem" id="635539778">
+ <reference key="NSMenu" ref="311482551"/>
+ <string key="NSTitle">Pop Up</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <int key="NSState">1</int>
+ <reference key="NSOnImage" ref="884724275"/>
+ <reference key="NSMixedImage" ref="1071040955"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <reference key="NSTarget" ref="264818313"/>
+ </object>
<bool key="NSMenuItemRespectAlignment">YES</bool>
- <object class="NSMenu" key="NSMenu" id="793057420">
+ <object class="NSMenu" key="NSMenu" id="311482551">
<string key="NSTitle">OtherViews</string>
<object class="NSMutableArray" key="NSMenuItems">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="635539778"/>
</object>
<reference key="NSMenuFont" ref="26"/>
</object>
- <int key="NSSelectedIndex">-1</int>
<int key="NSPreferredEdge">3</int>
<bool key="NSUsesItemFromMenu">YES</bool>
<bool key="NSAltersState">YES</bool>
@@ -251,13 +296,13 @@
</object>
<object class="NSTableColumn" id="185178480">
<string key="NSIdentifier">target_field</string>
- <double key="NSWidth">220</double>
+ <double key="NSWidth">216</double>
<double key="NSMinWidth">10</double>
<double key="NSMaxWidth">3.4028234663852886e+38</double>
<object class="NSTableHeaderCell" key="NSHeaderCell">
<int key="NSCellFlags">75628096</int>
<int key="NSCellFlags2">2048</int>
- <string key="NSContents"/>
+ <string key="NSContents">Target Fields</string>
<reference key="NSSupport" ref="26"/>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
@@ -267,19 +312,43 @@
</object>
<reference key="NSTextColor" ref="186205954"/>
</object>
- <object class="NSTextFieldCell" key="NSDataCell" id="704196003">
- <int key="NSCellFlags">69336641</int>
- <int key="NSCellFlags2">137216</int>
- <string key="NSContents">Text Cell</string>
+ <object class="NSPopUpButtonCell" key="NSDataCell" id="201096656">
+ <int key="NSCellFlags">-2076049856</int>
+ <int key="NSCellFlags2">133120</int>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="678921094"/>
- <object class="NSColor" key="NSBackgroundColor" id="518286732">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">controlBackgroundColor</string>
- <reference key="NSColor" ref="240513327"/>
+ <int key="NSButtonFlags">100679935</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ <object class="NSMenuItem" key="NSMenuItem" id="683769208">
+ <reference key="NSMenu" ref="920630540"/>
+ <bool key="NSIsHidden">YES</bool>
+ <string key="NSTitle">Pop Up</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <int key="NSState">1</int>
+ <reference key="NSOnImage" ref="884724275"/>
+ <reference key="NSMixedImage" ref="1071040955"/>
+ <string key="NSAction">_popUpItemAction:</string>
+ <reference key="NSTarget" ref="201096656"/>
+ </object>
+ <bool key="NSMenuItemRespectAlignment">YES</bool>
+ <object class="NSMenu" key="NSMenu" id="920630540">
+ <string key="NSTitle">OtherViews</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="683769208"/>
+ </object>
+ <reference key="NSMenuFont" ref="26"/>
</object>
- <reference key="NSTextColor" ref="263116164"/>
+ <bool key="NSPullDown">YES</bool>
+ <int key="NSPreferredEdge">3</int>
+ <bool key="NSUsesItemFromMenu">YES</bool>
+ <bool key="NSAltersState">YES</bool>
</object>
<int key="NSResizingMask">3</int>
<bool key="NSIsResizeable">YES</bool>
@@ -323,7 +392,12 @@
<reference key="NSSuperview" ref="495172082"/>
<reference key="NSNextKeyView" ref="678921094"/>
<reference key="NSDocView" ref="678921094"/>
- <reference key="NSBGColor" ref="518286732"/>
+ <object class="NSColor" key="NSBGColor" id="518286732">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlBackgroundColor</string>
+ <reference key="NSColor" ref="240513327"/>
+ </object>
<int key="NScvFlags">6</int>
</object>
<object class="NSScroller" id="59350381">
@@ -363,7 +437,7 @@
</object>
<reference ref="20192669"/>
</object>
- <string key="NSFrame">{{-1, 77}, {467, 159}}</string>
+ <string key="NSFrame">{{-1, 91}, {467, 159}}</string>
<reference key="NSSuperview" ref="78582513"/>
<reference key="NSNextKeyView" ref="929465390"/>
<int key="NSsFlags">530</int>
@@ -377,7 +451,7 @@
<object class="NSButton" id="920273776">
<reference key="NSNextResponder" ref="78582513"/>
<int key="NSvFlags">289</int>
- <string key="NSFrame">{{286, 12}, {82, 32}}</string>
+ <string key="NSFrame">{{286, 14}, {82, 32}}</string>
<reference key="NSSuperview" ref="78582513"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="977848648">
@@ -402,7 +476,7 @@
<object class="NSButton" id="341819846">
<reference key="NSNextResponder" ref="78582513"/>
<int key="NSvFlags">289</int>
- <string key="NSFrame">{{368, 12}, {83, 32}}</string>
+ <string key="NSFrame">{{368, 14}, {83, 32}}</string>
<reference key="NSSuperview" ref="78582513"/>
<int key="NSTag">1</int>
<bool key="NSEnabled">YES</bool>
@@ -425,7 +499,7 @@
<object class="NSButton" id="834757891">
<reference key="NSNextResponder" ref="78582513"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{20, 17}, {32, 24}}</string>
+ <string key="NSFrame">{{20, 19}, {32, 24}}</string>
<reference key="NSSuperview" ref="78582513"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="87458302">
@@ -449,7 +523,7 @@
<object class="NSButton" id="116285743">
<reference key="NSNextResponder" ref="78582513"/>
<int key="NSvFlags">292</int>
- <string key="NSFrame">{{51, 17}, {32, 24}}</string>
+ <string key="NSFrame">{{51, 19}, {32, 24}}</string>
<reference key="NSSuperview" ref="78582513"/>
<int key="NSTag">1</int>
<bool key="NSEnabled">YES</bool>
@@ -475,7 +549,7 @@
<object class="NSTextField" id="186404366">
<reference key="NSNextResponder" ref="78582513"/>
<int key="NSvFlags">290</int>
- <string key="NSFrame">{{88, 22}, {199, 14}}</string>
+ <string key="NSFrame">{{88, 24}, {199, 14}}</string>
<reference key="NSSuperview" ref="78582513"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="929441265">
@@ -491,7 +565,7 @@
<object class="NSPopUpButton" id="549705971">
<reference key="NSNextResponder" ref="78582513"/>
<int key="NSvFlags">267</int>
- <string key="NSFrame">{{238, 237}, {220, 22}}</string>
+ <string key="NSFrame">{{244, 255}, {215, 22}}</string>
<reference key="NSSuperview" ref="78582513"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="107647973">
@@ -522,8 +596,8 @@
</object>
<object class="NSPopUpButton" id="599385609">
<reference key="NSNextResponder" ref="78582513"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{103, 46}, {126, 22}}</string>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{357, 61}, {91, 22}}</string>
<reference key="NSSuperview" ref="78582513"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="1033308908">
@@ -537,22 +611,15 @@
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
- <object class="NSMenuItem" key="NSMenuItem" id="604589401">
+ <object class="NSMenuItem" key="NSMenuItem" id="1004582521">
<reference key="NSMenu" ref="519018523"/>
- <string key="NSTitle">UPDATE</string>
+ <string key="NSTitle">INSERT</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<int key="NSState">1</int>
- <object class="NSCustomResource" key="NSOnImage" id="74411591">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">NSMenuCheckmark</string>
- </object>
- <object class="NSCustomResource" key="NSMixedImage" id="715110738">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">NSMenuMixedState</string>
- </object>
+ <reference key="NSOnImage" ref="884724275"/>
+ <reference key="NSMixedImage" ref="1071040955"/>
<string key="NSAction">_popUpItemAction:</string>
- <int key="NSTag">2</int>
<reference key="NSTarget" ref="1033308908"/>
</object>
<bool key="NSMenuItemRespectAlignment">YES</bool>
@@ -560,31 +627,32 @@
<string key="NSTitle">OtherViews</string>
<object class="NSMutableArray" key="NSMenuItems">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="1004582521">
+ <reference ref="1004582521"/>
+ <object class="NSMenuItem" id="167502619">
<reference key="NSMenu" ref="519018523"/>
- <string key="NSTitle">INSERT</string>
+ <string key="NSTitle">REPLACE</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="74411591"/>
- <reference key="NSMixedImage" ref="715110738"/>
+ <reference key="NSOnImage" ref="884724275"/>
+ <reference key="NSMixedImage" ref="1071040955"/>
<string key="NSAction">_popUpItemAction:</string>
+ <int key="NSTag">1</int>
<reference key="NSTarget" ref="1033308908"/>
</object>
- <object class="NSMenuItem" id="167502619">
+ <object class="NSMenuItem" id="604589401">
<reference key="NSMenu" ref="519018523"/>
- <string key="NSTitle">REPLACE</string>
+ <bool key="NSIsHidden">YES</bool>
+ <string key="NSTitle">UPDATE</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="74411591"/>
- <reference key="NSMixedImage" ref="715110738"/>
+ <reference key="NSOnImage" ref="884724275"/>
+ <reference key="NSMixedImage" ref="1071040955"/>
<string key="NSAction">_popUpItemAction:</string>
- <int key="NSTag">1</int>
+ <int key="NSTag">2</int>
<reference key="NSTarget" ref="1033308908"/>
</object>
- <reference ref="604589401"/>
</object>
</object>
- <int key="NSSelectedIndex">2</int>
<int key="NSPreferredEdge">1</int>
<bool key="NSUsesItemFromMenu">YES</bool>
<bool key="NSAltersState">YES</bool>
@@ -593,8 +661,8 @@
</object>
<object class="NSTextField" id="228203205">
<reference key="NSNextResponder" ref="78582513"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{17, 51}, {94, 14}}</string>
+ <int key="NSvFlags">289</int>
+ <string key="NSFrame">{{261, 66}, {94, 14}}</string>
<reference key="NSSuperview" ref="78582513"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="869323357">
@@ -618,7 +686,7 @@
<string>NSFilenamesPboardType</string>
</object>
</object>
- <string key="NSFrame">{{5, 239}, {212, 20}}</string>
+ <string key="NSFrame">{{5, 257}, {212, 20}}</string>
<reference key="NSSuperview" ref="78582513"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPathCell" key="NSCell" id="183652084">
@@ -664,48 +732,43 @@
<reference key="NSDelegate" ref="697948389"/>
</object>
</object>
- <object class="NSTextField" id="661467962">
+ <object class="NSButton" id="397227507">
<reference key="NSNextResponder" ref="78582513"/>
- <int key="NSvFlags">267</int>
- <string key="NSFrame">{{322, 261}, {43, 14}}</string>
- <reference key="NSSuperview" ref="78582513"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="471642953">
- <int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">272761856</int>
- <string key="NSContents">Target:</string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSControlView" ref="661467962"/>
- <reference key="NSBackgroundColor" ref="19028295"/>
- <reference key="NSTextColor" ref="263116164"/>
- </object>
- </object>
- <object class="NSTextField" id="158244936">
- <reference key="NSNextResponder" ref="78582513"/>
- <int key="NSvFlags">270</int>
- <string key="NSFrame">{{88, 261}, {44, 14}}</string>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{17, 64}, {188, 18}}</string>
<reference key="NSSuperview" ref="78582513"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="149253930">
- <int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">272761856</int>
- <string key="NSContents">Source:</string>
+ <object class="NSButtonCell" key="NSCell" id="413696615">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">131072</int>
+ <string key="NSContents">First line contains fields names</string>
<reference key="NSSupport" ref="26"/>
- <reference key="NSControlView" ref="158244936"/>
- <reference key="NSBackgroundColor" ref="19028295"/>
- <reference key="NSTextColor" ref="263116164"/>
+ <reference key="NSControlView" ref="397227507"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <object class="NSCustomResource" key="NSNormalImage">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSSwitch</string>
+ </object>
+ <object class="NSButtonImageSource" key="NSAlternateImage">
+ <string key="NSImageName">NSSwitch</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
</object>
</object>
</object>
- <string key="NSFrameSize">{465, 311}</string>
+ <string key="NSFrameSize">{465, 325}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1280, 1002}}</string>
<string key="NSMinSize">{465, 333}</string>
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
</object>
- <object class="NSCustomObject" id="914102730">
- <string key="NSClassName">TableDump</string>
+ <object class="NSUserDefaultsController" id="443551699">
+ <bool key="NSSharedInstance">YES</bool>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
@@ -816,14 +879,6 @@
<int key="connectionID">72</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">window</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="420604405"/>
- </object>
- <int key="connectionID">76</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">closeSheet:</string>
<reference key="source" ref="1001"/>
@@ -839,6 +894,30 @@
</object>
<int key="connectionID">84</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">nextKeyView</string>
+ <reference key="source" ref="341819846"/>
+ <reference key="destination" ref="920273776"/>
+ </object>
+ <int key="connectionID">98</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">importFieldNamesHeaderSwitch</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="397227507"/>
+ </object>
+ <int key="connectionID">113</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">window</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="420604405"/>
+ </object>
+ <int key="connectionID">119</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -888,13 +967,12 @@
<reference ref="834757891"/>
<reference ref="116285743"/>
<reference ref="186404366"/>
- <reference ref="228203205"/>
- <reference ref="599385609"/>
<reference ref="549705971"/>
<reference ref="495172082"/>
<reference ref="697948389"/>
- <reference ref="158244936"/>
- <reference ref="661467962"/>
+ <reference ref="599385609"/>
+ <reference ref="228203205"/>
+ <reference ref="397227507"/>
</object>
<reference key="parent" ref="420604405"/>
</object>
@@ -1115,7 +1193,7 @@
<reference key="object" ref="283787363"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="833492334"/>
+ <reference ref="264818313"/>
</object>
<reference key="parent" ref="678921094"/>
</object>
@@ -1124,7 +1202,7 @@
<reference key="object" ref="790992768"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="316634554"/>
+ <reference ref="130736119"/>
</object>
<reference key="parent" ref="678921094"/>
</object>
@@ -1133,84 +1211,111 @@
<reference key="object" ref="185178480"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="704196003"/>
+ <reference ref="201096656"/>
</object>
<reference key="parent" ref="678921094"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">49</int>
- <reference key="object" ref="704196003"/>
- <reference key="parent" ref="185178480"/>
+ <int key="objectID">56</int>
+ <reference key="object" ref="1052916804"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="922239869"/>
+ </object>
+ <reference key="parent" ref="617902336"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">50</int>
- <reference key="object" ref="316634554"/>
+ <int key="objectID">57</int>
+ <reference key="object" ref="922239869"/>
+ <reference key="parent" ref="1052916804"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">89</int>
+ <reference key="object" ref="130736119"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="318206101"/>
+ </object>
<reference key="parent" ref="790992768"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">51</int>
- <reference key="object" ref="833492334"/>
+ <int key="objectID">90</int>
+ <reference key="object" ref="318206101"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="793057420"/>
+ <reference ref="922650264"/>
</object>
- <reference key="parent" ref="283787363"/>
+ <reference key="parent" ref="130736119"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">91</int>
+ <reference key="object" ref="922650264"/>
+ <reference key="parent" ref="318206101"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">52</int>
- <reference key="object" ref="793057420"/>
+ <int key="objectID">92</int>
+ <reference key="object" ref="201096656"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="920630540"/>
</object>
- <reference key="parent" ref="833492334"/>
+ <reference key="parent" ref="185178480"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">56</int>
- <reference key="object" ref="1052916804"/>
+ <int key="objectID">93</int>
+ <reference key="object" ref="920630540"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="922239869"/>
+ <reference ref="683769208"/>
</object>
- <reference key="parent" ref="617902336"/>
+ <reference key="parent" ref="201096656"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">57</int>
- <reference key="object" ref="922239869"/>
- <reference key="parent" ref="1052916804"/>
+ <int key="objectID">94</int>
+ <reference key="object" ref="683769208"/>
+ <reference key="parent" ref="920630540"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">80</int>
- <reference key="object" ref="914102730"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">TableDump</string>
+ <int key="objectID">95</int>
+ <reference key="object" ref="264818313"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="311482551"/>
+ </object>
+ <reference key="parent" ref="283787363"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">85</int>
- <reference key="object" ref="661467962"/>
+ <int key="objectID">96</int>
+ <reference key="object" ref="311482551"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="471642953"/>
+ <reference ref="635539778"/>
</object>
- <reference key="parent" ref="78582513"/>
+ <reference key="parent" ref="264818313"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">97</int>
+ <reference key="object" ref="635539778"/>
+ <reference key="parent" ref="311482551"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">86</int>
- <reference key="object" ref="471642953"/>
- <reference key="parent" ref="661467962"/>
+ <int key="objectID">99</int>
+ <reference key="object" ref="443551699"/>
+ <reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">87</int>
- <reference key="object" ref="158244936"/>
+ <int key="objectID">111</int>
+ <reference key="object" ref="397227507"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="149253930"/>
+ <reference ref="413696615"/>
</object>
<reference key="parent" ref="78582513"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">88</int>
- <reference key="object" ref="149253930"/>
- <reference key="parent" ref="158244936"/>
+ <int key="objectID">112</int>
+ <reference key="object" ref="413696615"/>
+ <reference key="parent" ref="397227507"/>
</object>
</object>
</object>
@@ -1228,6 +1333,8 @@
<string>11.windowTemplate.hasMinSize</string>
<string>11.windowTemplate.maxSize</string>
<string>11.windowTemplate.minSize</string>
+ <string>111.IBPluginDependency</string>
+ <string>112.IBPluginDependency</string>
<string>12.IBPluginDependency</string>
<string>12.ImportedFromIB2</string>
<string>13.IBPluginDependency</string>
@@ -1274,25 +1381,27 @@
<string>47.IBPluginDependency</string>
<string>47.ImportedFromIB2</string>
<string>48.IBPluginDependency</string>
- <string>49.IBPluginDependency</string>
- <string>50.IBPluginDependency</string>
- <string>50.IBShouldRemoveOnLegacySave</string>
- <string>51.IBPluginDependency</string>
- <string>52.IBEditorWindowLastContentRect</string>
- <string>52.IBPluginDependency</string>
<string>56.IBPluginDependency</string>
<string>57.IBPluginDependency</string>
- <string>85.IBPluginDependency</string>
- <string>86.IBPluginDependency</string>
- <string>87.IBPluginDependency</string>
- <string>88.IBPluginDependency</string>
+ <string>89.IBPluginDependency</string>
+ <string>90.IBEditorWindowLastContentRect</string>
+ <string>90.IBPluginDependency</string>
+ <string>91.IBPluginDependency</string>
+ <string>92.IBPluginDependency</string>
+ <string>93.IBEditorWindowLastContentRect</string>
+ <string>93.IBPluginDependency</string>
+ <string>94.IBPluginDependency</string>
+ <string>95.IBPluginDependency</string>
+ <string>96.IBPluginDependency</string>
+ <string>97.IBPluginDependency</string>
+ <string>99.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{139, 173}, {465, 311}}</string>
+ <string>{{180, 351}, {465, 325}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{139, 173}, {465, 311}}</string>
+ <string>{{180, 351}, {465, 325}}</string>
<integer value="1"/>
<string>{{387, 725}, {432, 282}}</string>
<integer value="0"/>
@@ -1300,6 +1409,8 @@
<string>{3.40282e+38, 3.40282e+38}</string>
<string>{465, 311}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
@@ -1319,7 +1430,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{302, 438}, {126, 54}}</string>
+ <string>{{651, 435}, {95, 54}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -1347,11 +1458,13 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{153, 554}, {423, 4}}</string>
+ <string>{{128, 372}, {465, 20}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{128, 372}, {465, 20}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -1375,7 +1488,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">88</int>
+ <int key="maxID">119</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1429,7 +1542,9 @@
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>fieldMapperTableView</string>
+ <string>fieldMappingImportArray</string>
<string>fileSourcePath</string>
+ <string>importFieldNamesHeaderSwitch</string>
<string>importMethodPopup</string>
<string>recordCountLabel</string>
<string>rowDownButton</string>
@@ -1441,165 +1556,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBDocumentRelativeSource</string>
- <string key="minorKey">../../Source/SPFieldMapperController.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">TableDump</string>
- <string key="superclassName">NSObject</string>
- <object class="NSMutableDictionary" key="actions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>cancelProgressBar:</string>
- <string>changeFormat:</string>
- <string>changeTable:</string>
- <string>closeFieldMapperSheet:</string>
- <string>closeSheet:</string>
- <string>panelSelectionDidChange:</string>
- <string>reloadTables:</string>
- <string>selectTables:</string>
- <string>stepRow:</string>
- <string>switchInput:</string>
- <string>switchTab:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="outlets">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>addCreateTableSwitch</string>
- <string>addDropTableSwitch</string>
- <string>addErrorsSwitch</string>
- <string>addTableContentSwitch</string>
- <string>csvFullStreamingSwitch</string>
- <string>customQueryInstance</string>
- <string>errorsSheet</string>
- <string>errorsView</string>
- <string>exportCSVView</string>
- <string>exportDumpTableView</string>
- <string>exportDumpView</string>
- <string>exportFieldNamesSwitch</string>
- <string>exportFieldsEnclosedField</string>
- <string>exportFieldsEscapedField</string>
- <string>exportFieldsTerminatedField</string>
- <string>exportLinesTerminatedField</string>
- <string>exportMultipleCSVTableView</string>
- <string>exportMultipleCSVView</string>
- <string>exportMultipleFieldNamesSwitch</string>
- <string>exportMultipleFieldsEnclosedField</string>
- <string>exportMultipleFieldsEscapedField</string>
- <string>exportMultipleFieldsTerminatedField</string>
- <string>exportMultipleLinesTerminatedField</string>
- <string>exportMultipleXMLTableView</string>
- <string>exportMultipleXMLView</string>
- <string>exportTabBar</string>
- <string>exportTableList</string>
- <string>exportToolbar</string>
- <string>exportWindow</string>
- <string>fieldMappingPopup</string>
- <string>fieldMappingSheet</string>
- <string>fieldMappingTableView</string>
- <string>importCSVBox</string>
- <string>importCSVView</string>
- <string>importFieldNamesSwitch</string>
- <string>importFieldsEnclosedField</string>
- <string>importFieldsEscapedField</string>
- <string>importFieldsTerminatedField</string>
- <string>importFormatPopup</string>
- <string>importLinesTerminatedField</string>
- <string>multiCSVFullStreamingSwitch</string>
- <string>multiXMLFullStreamingSwitch</string>
- <string>recordCountLabel</string>
- <string>rowDownButton</string>
- <string>rowUpButton</string>
- <string>singleProgressBar</string>
- <string>singleProgressSheet</string>
- <string>singleProgressText</string>
- <string>singleProgressTitle</string>
- <string>sqlFullStreamingSwitch</string>
- <string>tableContentInstance</string>
- <string>tableDataInstance</string>
- <string>tableDocumentInstance</string>
- <string>tableSourceInstance</string>
- <string>tableWindow</string>
- <string>tablesListInstance</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>NSPopUpButton</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
+ <string>NSPathControl</string>
<string>id</string>
<string>id</string>
<string>id</string>
@@ -1611,7 +1568,7 @@
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBDocumentRelativeSource</string>
- <string key="minorKey">../../Source/TableDump.h</string>
+ <string key="minorKey">../../Source/SPFieldMapperController.h</string>
</object>
</object>
</object>
diff --git a/Source/SPFieldMapperController.h b/Source/SPFieldMapperController.h
index d48585e0..19cf316a 100644
--- a/Source/SPFieldMapperController.h
+++ b/Source/SPFieldMapperController.h
@@ -1,7 +1,7 @@
//
// $Id$
//
-// SPQueryFavoriteManager.h
+// SPFieldMapperController.h
// sequel-pro
//
// Created by Hans-Jörg Bibiko on February 01, 2010
@@ -25,8 +25,6 @@
#import <Cocoa/Cocoa.h>
#import <MCPKit/MCPKit.h>
-
-
@interface SPFieldMapperController : NSWindowController {
IBOutlet id fieldMapperTableView;
@@ -36,19 +34,33 @@
IBOutlet id rowUpButton;
IBOutlet id rowDownButton;
IBOutlet id recordCountLabel;
+ IBOutlet id importFieldNamesHeaderSwitch;
id theDelegate;
+ id fieldMappingImportArray;
NSInteger fieldMappingCurrentRow;
- NSArray *fieldMappingImportArray;
- NSArray *fieldMappingArray;
+ NSMutableArray *fieldMappingArray;
NSMutableArray *fieldMappingTableColumnNames;
+ NSMutableArray *fieldMappingButtonOptions;
+ NSMutableArray *fieldMappingOperatorOptions;
+ NSMutableArray *fieldMappingOperatorArray;
+
+ NSNumber *doImport;
+ NSNumber *doNotImport;
+ NSNumber *isEqual;
+ NSString *doImportString;
+ NSString *doNotImportString;
+ NSString *isEqualString;
BOOL fieldMappingImportArrayIsPreview;
+ BOOL importFieldNamesHeader;
MCPConnection *mySQLConnection;
NSString *sourcePath;
+
+ NSUserDefaults *prefs;
}
@property(retain) NSString* sourcePath;
@@ -56,6 +68,15 @@
- (id)initWithDelegate:(id)managerDelegate;
- (void)setConnection:(MCPConnection *)theConnection;
+- (void)setImportDataArray:(id)theFieldMappingImportArray hasHeader:(BOOL)hasHeader;
+
+// Getter methods
+- (NSString*)selectedTableTarget;
+- (NSArray*)fieldMapperOperator;
+- (NSString*)selectedImportMethod;
+- (NSArray*)fieldMappingArray;
+- (NSArray*)fieldMappingTableColumnNames;
+- (BOOL)importFieldNamesHeader;
// IBAction methods
- (IBAction)changeTableTarget:(id)sender;
@@ -63,4 +84,9 @@
- (IBAction)stepRow:(id)sender;
- (IBAction)closeSheet:(id)sender;
+// Others
+- (void)setupFieldMappingArray;
+- (void)updateFieldMappingButtonCell;
+- (void)updateFieldMappingOperatorOptions;
+
@end
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m
index 3ed30270..8dc06d87 100644
--- a/Source/SPFieldMapperController.m
+++ b/Source/SPFieldMapperController.m
@@ -1,7 +1,7 @@
//
// $Id$
//
-// SPQueryFavoriteManager.m
+// SPFieldMapperController.m
// sequel-pro
//
// Created by Hans-Jörg Bibiko on February 01, 2010
@@ -26,6 +26,8 @@
#import "SPFieldMapperController.h"
#import "SPTableData.h"
#import "TablesList.h"
+#import "SPArrayAdditions.h"
+#import "SPConstants.h"
@implementation SPFieldMapperController
@@ -34,7 +36,6 @@
#pragma mark -
#pragma mark Initialization
-
/**
* Initialize the field mapper
*/
@@ -49,7 +50,20 @@
return nil;
}
theDelegate = managerDelegate;
- fieldMappingTableColumnNames = [[NSMutableArray alloc] initWithCapacity:1];
+ fieldMappingTableColumnNames = [[NSMutableArray alloc] init];
+ fieldMappingButtonOptions = [[NSMutableArray alloc] init];
+ fieldMappingOperatorOptions = [[NSMutableArray alloc] init];
+ fieldMappingOperatorArray = [[NSMutableArray alloc] init];
+ fieldMappingArray = nil;
+
+ doImport = [NSNumber numberWithInteger:0];
+ doNotImport = [NSNumber numberWithInteger:1];
+ isEqual = [NSNumber numberWithInteger:2];
+ doImportString = @"→";
+ doNotImportString = @"×";
+ isEqualString = @"=";
+
+ prefs = [NSUserDefaults standardUserDefaults];
}
return self;
@@ -57,27 +71,31 @@
- (void)awakeFromNib
{
+
+ // Set source path
[fileSourcePath setURL:[NSURL URLWithString:sourcePath]];
+
+ // Init table target popup menu
[tableTargetPopup removeAllItems];
- [tableTargetPopup addItemsWithTitles:[[theDelegate valueForKeyPath:@"tablesListInstance"] allTableNames]];
+ if([[theDelegate valueForKeyPath:@"tablesListInstance"] allTableNames]) {
+ [tableTargetPopup addItemsWithTitles:[[theDelegate valueForKeyPath:@"tablesListInstance"] allTableNames]];
+
+ // Select either the currently selected table, or the first item in the list
+ if ([[theDelegate valueForKeyPath:@"tableDocumentInstance"] table] != nil && ![[[theDelegate valueForKeyPath:@"tablesListInstance"] tableName] isEqualToString:@""]) {
+ [tableTargetPopup selectItemWithTitle:[[theDelegate valueForKeyPath:@"tablesListInstance"] tableName]];
+ } else {
+ [tableTargetPopup selectItemAtIndex:0];
+ }
- // Select either the currently selected table, or the first item in the list
- if ([[theDelegate valueForKeyPath:@"tableDocumentInstance"] table] != nil && ![[[theDelegate valueForKeyPath:@"tablesListInstance"] tableName] isEqualToString:@""]) {
- [tableTargetPopup selectItemWithTitle:[[theDelegate valueForKeyPath:@"tablesListInstance"] tableName]];
- } else {
- [tableTargetPopup selectItemAtIndex:0];
}
+ [importFieldNamesHeaderSwitch setState:importFieldNamesHeader];
+
[self changeTableTarget:self];
-}
-/*
- * Set the connection for use.
- * Called by the connect sheet methods.
- */
-- (void)setConnection:(MCPConnection *)theConnection
-{
- mySQLConnection = theConnection;
- [mySQLConnection retain];
+ [[self window] makeFirstResponder:fieldMapperTableView];
+ if([fieldMappingTableColumnNames count])
+ [fieldMapperTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
+
}
- (void)dealloc
@@ -85,10 +103,62 @@
if (mySQLConnection) [mySQLConnection release];
if (sourcePath) [sourcePath release];
if (fieldMappingTableColumnNames) [fieldMappingTableColumnNames release];
+ if (fieldMappingArray) [fieldMappingArray release];
+ if (fieldMappingButtonOptions) [fieldMappingButtonOptions release];
+ if (fieldMappingOperatorOptions) [fieldMappingOperatorOptions release];
+ if (fieldMappingOperatorArray) [fieldMappingOperatorArray release];
[super dealloc];
}
#pragma mark -
+#pragma mark Setter methods
+
+- (void)setConnection:(MCPConnection *)theConnection
+{
+ mySQLConnection = theConnection;
+ [mySQLConnection retain];
+}
+
+- (void)setImportDataArray:(id)theFieldMappingImportArray hasHeader:(BOOL)hasHeader
+{
+ fieldMappingImportArray = theFieldMappingImportArray;
+ importFieldNamesHeader = hasHeader;
+}
+
+#pragma mark -
+#pragma mark Getter methods
+
+- (NSString*)selectedTableTarget
+{
+ return [tableTargetPopup titleOfSelectedItem];
+}
+
+- (NSArray*)fieldMapperOperator
+{
+ return [NSArray arrayWithArray:fieldMappingOperatorArray];
+}
+
+- (NSString*)selectedImportMethod
+{
+ return [importMethodPopup titleOfSelectedItem];
+}
+
+- (NSArray*)fieldMappingArray
+{
+ return fieldMappingArray;
+}
+
+- (NSArray*)fieldMappingTableColumnNames
+{
+ return fieldMappingTableColumnNames;
+}
+
+- (BOOL)importFieldNamesHeader
+{
+ return importFieldNamesHeader;
+}
+
+#pragma mark -
#pragma mark IBAction methods
- (IBAction)closeSheet:(id)sender
@@ -98,7 +168,9 @@
- (IBAction)changeTableTarget:(id)sender
{
-
+
+ NSInteger i;
+
// Remove all the current columns
[fieldMappingTableColumnNames removeAllObjects];
@@ -111,24 +183,49 @@
[fieldMappingTableColumnNames addObject:[NSString stringWithString:[column objectForKey:@"name"]]];
}
}
- NSLog(@"f %@", [fieldMappingTableColumnNames description]);
+
[selectedTableData release];
// Update the table view
fieldMappingCurrentRow = 0;
if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil;
- // [self setupFieldMappingArray];
+ [self setupFieldMappingArray];
[rowDownButton setEnabled:NO];
[rowUpButton setEnabled:([fieldMappingImportArray count] > 1)];
[recordCountLabel setStringValue:[NSString stringWithFormat:@"%ld of %@%lu records", (long)(fieldMappingCurrentRow+1), fieldMappingImportArrayIsPreview?@"first ":@"", (unsigned long)[fieldMappingImportArray count]]];
- // [self updateFieldMappingButtonCell];
+ [self updateFieldMappingButtonCell];
+ [self updateFieldMappingOperatorOptions];
+
+ // Set all operators to doNotImport
+ [fieldMappingOperatorArray removeAllObjects];
+ for(i=0; i < [fieldMappingTableColumnNames count]; i++)
+ [fieldMappingOperatorArray addObject:doNotImport];
+
+ // Set the first n operators to doImport
+ if([fieldMappingImportArray count]) {
+ NSInteger possibleImports = ([NSArrayObjectAtIndex(fieldMappingImportArray, 0) count] > [fieldMappingTableColumnNames count]) ? [fieldMappingTableColumnNames count] : [NSArrayObjectAtIndex(fieldMappingImportArray, 0) count];
+ for(i=0; i < possibleImports; i++)
+ [fieldMappingOperatorArray replaceObjectAtIndex:i withObject:doImport];
+ }
+
[fieldMapperTableView reloadData];
+
}
- (IBAction)changeImportMethod:(id)sender
{
-
+ NSInteger i;
+ // If operator is set to = for UPDATE method replace it by doNotImport
+ if(![[importMethodPopup titleOfSelectedItem] isEqualToString:@"UPDATE"]) {
+ for(i=0; i<[fieldMappingTableColumnNames count]; i++) {
+ if([fieldMappingOperatorArray objectAtIndex:i] == isEqual)
+ [fieldMappingOperatorArray replaceObjectAtIndex:i withObject:doNotImport];
+ }
+ }
+
+ [self updateFieldMappingOperatorOptions];
+ [fieldMapperTableView reloadData];
}
/*
@@ -141,7 +238,7 @@
} else {
fieldMappingCurrentRow++;
}
- // [self updateFieldMappingButtonCell];
+ [self updateFieldMappingButtonCell];
[fieldMapperTableView reloadData];
@@ -152,6 +249,61 @@
[rowUpButton setEnabled:(fieldMappingCurrentRow != ([fieldMappingImportArray count]-1))];
}
+/*
+ * Sets up the fieldMapping array to be shown in the tableView
+ */
+- (void)setupFieldMappingArray
+{
+ NSInteger i, value;
+
+ if (!fieldMappingArray) {
+ fieldMappingArray = [[NSMutableArray alloc] init];
+
+ for (i = 0; i < [fieldMappingTableColumnNames count]; i++) {
+ if (i < [NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow) count]
+ && ![NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow), i) isKindOfClass:[NSNull class]]) {
+ value = i;
+ } else {
+ value = 0;
+ }
+
+ [fieldMappingArray addObject:[NSNumber numberWithInteger:value]];
+ }
+ }
+
+ [fieldMapperTableView reloadData];
+}
+
+/*
+ * Update the NSButtonCell items for use in the import_value mapping display
+ */
+- (void)updateFieldMappingButtonCell
+{
+ NSInteger i;
+
+ [fieldMappingButtonOptions setArray:[fieldMappingImportArray objectAtIndex:fieldMappingCurrentRow]];
+ for (i = 0; i < [fieldMappingButtonOptions count]; i++) {
+ if ([[fieldMappingButtonOptions objectAtIndex:i] isNSNull]) {
+ [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%i. %@", i+1, [prefs objectForKey:SPNullValue]]];
+ } else {
+ [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%i. %@", i+1, NSArrayObjectAtIndex(fieldMappingButtonOptions, i)]];
+ }
+ }
+}
+
+/*
+ * Update the NSButtonCell items for use in the operator mapping display
+ */
+- (void)updateFieldMappingOperatorOptions
+{
+ if(![[importMethodPopup titleOfSelectedItem] isEqualToString:@"UPDATE"]) {
+ [fieldMappingOperatorOptions setArray:[NSArray arrayWithObjects:doImportString, doNotImportString, nil]];
+ } else {
+ [fieldMappingOperatorOptions setArray:[NSArray arrayWithObjects:doImportString, doNotImportString, isEqualString, nil]];
+ }
+}
+
+
#pragma mark -
#pragma mark Table view datasource methods
@@ -162,30 +314,93 @@
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
{
+ [aCell setFont:([prefs boolForKey:SPUseMonospacedFonts]) ? [NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]] : [NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+}
+
+- (void)tableView:(NSTableView*)tableView didClickTableColumn:(NSTableColumn *)aTableColumn
+{
+
+ // A click at the operator column's header toggles all operators
+ if ([[aTableColumn identifier] isEqualToString:@"operator"]
+ && [self numberOfRowsInTableView:tableView]
+ && [fieldMappingOperatorArray count]
+ && [fieldMappingTableColumnNames count]) {
+ NSInteger i;
+ NSNumber *globalValue = doImport;
+ if([fieldMappingOperatorArray objectAtIndex:0] == doImport)
+ globalValue = doNotImport;
+ [fieldMappingOperatorArray removeAllObjects];
+ for(i=0; i < [fieldMappingTableColumnNames count]; i++)
+ [fieldMappingOperatorArray addObject:globalValue];
+ [fieldMapperTableView reloadData];
+ }
}
+- (NSString *)tableView:(NSTableView *)aTableView toolTipForCell:(NSCell *)aCell rect:(NSRectPointer)rect tableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex mouseLocation:(NSPoint)mouseLocation
+{
+ if([[aTableColumn identifier] isEqualToString:@"import_value"] && [importFieldNamesHeaderSwitch state] == NSOnState)
+ if(fieldMappingCurrentRow)
+ return [NSString stringWithFormat:@"%@: %@",
+ [NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, 0), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]) description],
+ [NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]) description]];
+ else
+ return [NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, 0), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]) description];
+ else if([[aTableColumn identifier] isEqualToString:@"import_value"] && [importFieldNamesHeaderSwitch state] == NSOffState)
+ return [NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow), [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]) description];
+ else if([[aTableColumn identifier] isEqualToString:@"operator"]) {
+ if([aCell objectValue] == doImport)
+ return NSLocalizedString(@"Do import", @"import operator");
+ else if([aCell objectValue] == doNotImport)
+ return NSLocalizedString(@"Do not import", @"do not import operator");
+ else if([aCell objectValue] == isEqual)
+ return NSLocalizedString(@"Do UPDATE where field contents match", @"do update operator");
+ else
+ return @"";
+ }
+ else if([[aTableColumn identifier] isEqualToString:@"target_field"])
+ return [fieldMappingTableColumnNames objectAtIndex:rowIndex];
+
+
+ return @"";
+}
+
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
{
if ([[aTableColumn identifier] isEqualToString:@"target_field"]) {
+ if ([[aTableColumn dataCell] isKindOfClass:[NSPopUpButtonCell class]]) {
+ [(NSPopUpButton *)[aTableColumn dataCell] removeAllItems];
+ [(NSPopUpButtonCell *)[aTableColumn dataCell] addItemWithTitle:[fieldMappingTableColumnNames objectAtIndex:rowIndex]];
+ }
return [fieldMappingTableColumnNames objectAtIndex:rowIndex];
-
}
- // else if ([[aTableColumn identifier] isEqualToString:@"value"]) {
- // if ([[[aTableColumn dataCell] class] isEqualTo:[NSPopUpButtonCell class]]) {
- // [(NSPopUpButtonCell *)[aTableColumn dataCell] removeAllItems];
- // [(NSPopUpButtonCell *)[aTableColumn dataCell] addItemWithTitle:NSLocalizedString(@"Do not import", @"text for csv import drop downs")];
- // [(NSPopUpButtonCell *)[aTableColumn dataCell] addItemsWithTitles:fieldMappingButtonOptions];
- // }
- //
- // returnObject = [fieldMappingArray objectAtIndex:rowIndex];
- // }
+ else if ([[aTableColumn identifier] isEqualToString:@"import_value"]) {
+ if ([[aTableColumn dataCell] isKindOfClass:[NSPopUpButtonCell class]]) {
+ [(NSPopUpButtonCell *)[aTableColumn dataCell] removeAllItems];
+ [(NSPopUpButtonCell *)[aTableColumn dataCell] addItemsWithTitles:fieldMappingButtonOptions];
+ }
+
+ return [fieldMappingArray objectAtIndex:rowIndex];
+ }
+ else if ([[aTableColumn identifier] isEqualToString:@"operator"]) {
+ if ([[aTableColumn dataCell] isKindOfClass:[NSPopUpButtonCell class]]) {
+ [(NSPopUpButtonCell *)[aTableColumn dataCell] removeAllItems];
+ [(NSPopUpButtonCell *)[aTableColumn dataCell] addItemsWithTitles:fieldMappingOperatorOptions];
+ }
+
+ return [fieldMappingOperatorArray objectAtIndex:rowIndex];
+ }
return nil;
}
- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
{
+ if ([[aTableColumn identifier] isEqualToString:@"import_value"]) {
+ [fieldMappingArray replaceObjectAtIndex:rowIndex withObject:anObject];
+ }
+ else if ([[aTableColumn identifier] isEqualToString:@"operator"]) {
+ [fieldMappingOperatorArray replaceObjectAtIndex:rowIndex withObject:anObject];
+ }
}
-
@end
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
diff --git a/Source/TableDump.m b/Source/TableDump.m
index 2e055f94..33118738 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -108,11 +108,6 @@
[exportMultipleXMLTableView reloadData];
}
-- (IBAction)closeFieldMapperSheet:(id)sender
-{
- [NSApp endSheet:fieldMappingSheet returnCode:[sender tag]];
-}
-
/**
* Common method for ending modal sessions
*/
@@ -513,39 +508,6 @@
[importCSVBox setHidden:![[[importFormatPopup selectedItem] title] isEqualToString:@"CSV"]];
}
-/**
- * When the table in the CSV field mapping sheet is changed, retrieve
- * the columns from the new table and reset the field mapping array.
- */
-- (IBAction)changeTable:(id)sender
-{
-
- // Remove all the current columns
- [fieldMappingTableColumnNames removeAllObjects];
-
- // Retrieve the information for the newly selected table using a SPTableData instance
- SPTableData *selectedTableData = [[SPTableData alloc] init];
- [selectedTableData setConnection:mySQLConnection];
- NSDictionary *tableDetails = [selectedTableData informationForTable:[fieldMappingPopup titleOfSelectedItem]];
- if (tableDetails) {
- for (NSDictionary *column in [tableDetails objectForKey:@"columns"]) {
- [fieldMappingTableColumnNames addObject:[NSString stringWithString:[column objectForKey:@"name"]]];
- }
- }
- [selectedTableData release];
-
- // Update the table view
- fieldMappingCurrentRow = 0;
- if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil;
- [self setupFieldMappingArray];
- [rowDownButton setEnabled:NO];
- [rowUpButton setEnabled:([fieldMappingImportArray count] > 1)];
- [recordCountLabel setStringValue:[NSString stringWithFormat:@"%ld of %@%lu records", (long)(fieldMappingCurrentRow+1), fieldMappingImportArrayIsPreview?@"first ":@"", (unsigned long)[fieldMappingImportArray count]]];
-
- [self updateFieldMappingButtonCell];
- [fieldMappingTableView reloadData];
-}
-
- (void)importBackgroundProcess:(NSString*)filename
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -822,7 +784,7 @@
BOOL allDataRead = NO;
BOOL insertBaseStringHasEntries;
NSStringEncoding csvEncoding = [MCPConnection encodingForMySQLEncoding:[[tableDocumentInstance connectionEncoding] UTF8String]];
- if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil;
+ fieldMappingArray = nil;
// Start the notification timer to allow notifications to be shown even if frontmost for long queries
[[SPGrowlController sharedGrowlController] setVisibilityForNotificationName:@"Import Finished"];
@@ -975,7 +937,7 @@
&& ([parsedRows count] >= 100 || (!csvRowArray && allDataRead)))
{
[self closeAndStopProgressSheet];
- if (![self buildFieldMappingArrayWithData:parsedRows isPreview:!allDataRead]) {
+ if (![self buildFieldMappingArrayWithData:parsedRows isPreview:!allDataRead ofSoureFile:filename]) {
[csvParser release];
[csvDataBuffer release];
[parsedRows release];
@@ -992,13 +954,13 @@
[NSApp beginSheet:singleProgressSheet modalForWindow:tableWindow modalDelegate:self didEndSelector:nil contextInfo:nil];
[singleProgressSheet makeKeyWindow];
- // Set up the field names import string
- [insertBaseString appendString:@"INSERT INTO "];
- [insertBaseString appendString:[[fieldMappingPopup titleOfSelectedItem] backtickQuotedString]];
+ // Set up the field names import string for INSERT or REPLACE INTO
+ [insertBaseString appendFormat:@"%@ INTO ", selectedImportMethod];
+ [insertBaseString appendString:[selectedTableTarget backtickQuotedString]];
[insertBaseString appendString:@" ("];
insertBaseStringHasEntries = NO;
for (i = 0; i < [fieldMappingArray count]; i++) {
- if ([NSArrayObjectAtIndex(fieldMappingArray, i) integerValue] > 0) {
+ if ([NSArrayObjectAtIndex(fieldMapperOperator, i) integerValue] == 0) {
if (insertBaseStringHasEntries) [insertBaseString appendString:@","];
else insertBaseStringHasEntries = YES;
[insertBaseString appendString:[NSArrayObjectAtIndex(fieldMappingTableColumnNames, i) backtickQuotedString]];
@@ -1079,7 +1041,7 @@
[csvDataBuffer release];
[parsedRows release];
[parsePositions release];
- if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil;
+ fieldMappingArray = nil;
[importPool drain];
[tableDocumentInstance setQueryMode:SPInterfaceQueryMode];
@@ -1103,7 +1065,7 @@
// If the table selected for import is also selected in the content view,
// update the content view - on the main thread to avoid crashes.
- if ([tablesListInstance tableName] && [[fieldMappingPopup titleOfSelectedItem] isEqualToString:[tablesListInstance tableName]]) {
+ if ([tablesListInstance tableName] && [selectedTableTarget isEqualToString:[tablesListInstance tableName]]) {
if ([[tableDocumentInstance selectedToolbarItemIdentifier] isEqualToString:SPMainToolbarTableContent]) {
[tableContentInstance performSelectorOnMainThread:@selector(reloadTable:) withObject:nil waitUntilDone:YES];
} else {
@@ -1142,7 +1104,7 @@
* Takes an array of data to show when selecting the field mapping, and an indicator of whether
* that dataset is complete or a preview of the full data set.
*/
-- (BOOL) buildFieldMappingArrayWithData:(NSArray *)importData isPreview:(BOOL)dataIsPreviewData
+- (BOOL) buildFieldMappingArrayWithData:(NSArray *)importData isPreview:(BOOL)dataIsPreviewData ofSoureFile:(NSString*)filename
{
// Ensure data was provided, or alert than an import error occurred and return false.
@@ -1172,12 +1134,8 @@
}
fieldMappingImportArrayIsPreview = dataIsPreviewData;
- // Get the list of tables (not views) to display in the field mapping interface
- [fieldMappingPopup removeAllItems];
- [fieldMappingPopup addItemsWithTitles:[tablesListInstance allTableNames]];
-
// If there's no tables to select, error
- if (![[fieldMappingPopup itemArray] count]) {
+ if (![[tablesListInstance allTableNames] count]) {
[self closeAndStopProgressSheet];
SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"),
NSLocalizedString(@"OK", @"OK button"),
@@ -1189,46 +1147,41 @@
return FALSE;
}
- // Set up tableView buttons
- NSPopUpButtonCell *buttonCell = [[NSPopUpButtonCell alloc] init];
- [buttonCell setControlSize:NSSmallControlSize];
- [buttonCell setFont:[NSFont labelFontOfSize:[NSFont smallSystemFontSize]]];
- [buttonCell setBordered:NO];
- [[fieldMappingTableView tableColumnWithIdentifier:@"value"] setDataCell:buttonCell];
- [buttonCell release];
-
- // Select either the currently selected table, or the first item in the list
- if ([tableDocumentInstance table] != nil && ![[tablesListInstance tableName] isEqualToString:@""]) {
- [fieldMappingPopup selectItemWithTitle:[tablesListInstance tableName]];
- } else {
- [fieldMappingPopup selectItemAtIndex:0];
- }
-
// Set the import array
if (fieldMappingImportArray) [fieldMappingImportArray release];
fieldMappingImportArray = [[NSArray alloc] initWithArray:importData];
-
- // Trigger a table selection and setup
- [self changeTable:self];
fieldMapperSheetStatus = 1;
- // if(fieldMapperController) [fieldMapperController release];
- // fieldMapperController = [[SPFieldMapperController alloc] initWithDelegate:self];
+ // Init the field mapper controller
+ fieldMapperController = [[SPFieldMapperController alloc] initWithDelegate:self];
+ [fieldMapperController setConnection:mySQLConnection];
+ [fieldMapperController setSourcePath:filename];
+ [fieldMapperController setImportDataArray:fieldMappingImportArray hasHeader:[importFieldNamesSwitch state]];
- // Show fieldMapping sheet
- // [NSApp beginSheet:[fieldMapperController window]
- [NSApp beginSheet:fieldMappingSheet
+ // Show field mapper sheet and set the focus to it
+ [NSApp beginSheet:[fieldMapperController window]
modalForWindow:tableWindow
modalDelegate:self
didEndSelector:@selector(fieldMapperDidEndSheet:returnCode:contextInfo:)
contextInfo:nil];
- // Wait for fieldMappingSheet
+ [[fieldMapperController window] makeKeyWindow];
+
+ // Wait for field mapper sheet
while (fieldMapperSheetStatus == 1)
usleep(100000);
- // if(fieldMapperController) [fieldMapperController release];
+ // Get mapping settings
+ fieldMapperOperator = [NSArray arrayWithArray:[fieldMapperController fieldMapperOperator]];
+ fieldMappingArray = [NSArray arrayWithArray:[fieldMapperController fieldMappingArray]];
+ selectedTableTarget = [NSString stringWithString:[fieldMapperController selectedTableTarget]];
+ selectedImportMethod = [NSString stringWithString:[fieldMapperController selectedImportMethod]];
+ fieldMappingTableColumnNames = [NSArray arrayWithArray:[fieldMapperController fieldMappingTableColumnNames]];
+ [importFieldNamesSwitch setState:[fieldMapperController importFieldNamesHeader]];
+ [prefs setBool:[importFieldNamesSwitch state] forKey:SPCSVImportFirstLineIsHeader];
+
+ if(fieldMapperController) [fieldMapperController release];
if(fieldMapperSheetStatus == 2)
return YES;
@@ -1243,69 +1196,6 @@
}
/*
- * Sets up the fieldMapping array to be shown in the tableView
- */
-- (void)setupFieldMappingArray
-{
- NSInteger i, value;
-
- if (!fieldMappingArray) {
- fieldMappingArray = [[NSMutableArray alloc] init];
-
- for (i = 0; i < [fieldMappingTableColumnNames count]; i++) {
- if (i < [NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow) count] && ![NSArrayObjectAtIndex(NSArrayObjectAtIndex(fieldMappingImportArray, fieldMappingCurrentRow), i) isKindOfClass:[NSNull class]]) {
- value = i + 1;
- } else {
- value = 0;
- }
-
- [fieldMappingArray addObject:[NSNumber numberWithInteger:value]];
- }
- }
-
- [fieldMappingTableView reloadData];
-}
-
-/*
- * Update the NSButtonCell items for use in the field mapping display
- */
-- (void)updateFieldMappingButtonCell
-{
- int i;
-
- [fieldMappingButtonOptions setArray:[fieldMappingImportArray objectAtIndex:fieldMappingCurrentRow]];
- for (i = 0; i < [fieldMappingButtonOptions count]; i++) {
- if ([[fieldMappingButtonOptions objectAtIndex:i] isNSNull]) {
- [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%i. %@", i+1, [prefs objectForKey:SPNullValue]]];
- } else {
- [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%i. %@", i+1, NSArrayObjectAtIndex(fieldMappingButtonOptions, i)]];
- }
- }
-}
-
-- (IBAction)stepRow:(id)sender
-/*
- displays next/previous row in fieldMapping tableView
- */
-{
- if ( [sender tag] == 0 ) {
- fieldMappingCurrentRow--;
- } else {
- fieldMappingCurrentRow++;
- }
- [self updateFieldMappingButtonCell];
-
- //-----------[self setupFieldMappingArray];
- [fieldMappingTableView reloadData];
-
- [recordCountLabel setStringValue:[NSString stringWithFormat:@"%ld of %@%lu records", (long)(fieldMappingCurrentRow+1), fieldMappingImportArrayIsPreview?@"first ":@"", (unsigned long)[fieldMappingImportArray count]]];
-
- // enable/disable buttons
- [rowDownButton setEnabled:(fieldMappingCurrentRow != 0)];
- [rowUpButton setEnabled:(fieldMappingCurrentRow != ([fieldMappingImportArray count]-1))];
-}
-
-/*
* Construct the VALUES string for a CSV row, based on the field mapping array - including
* surrounding brackets but not including the VALUES keyword.
*/
@@ -1318,15 +1208,16 @@
NSInteger mappingArrayCount = [fieldMappingArray count];
for (i = 0; i < mappingArrayCount; i++) {
- mapColumn = [NSArrayObjectAtIndex(fieldMappingArray, i) integerValue];
// Skip unmapped columns
- if (!mapColumn) continue;
+ if ([NSArrayObjectAtIndex(fieldMapperOperator, i) integerValue] > 0) continue;
+
+ mapColumn = [NSArrayObjectAtIndex(fieldMappingArray, i) integerValue];
if ([valueString length] > 1) [valueString appendString:@","];
// Append the data
- cellData = NSArrayObjectAtIndex(csvRowArray, mapColumn - 1);
+ cellData = NSArrayObjectAtIndex(csvRowArray, mapColumn);
if (cellData == [NSNull null]) {
[valueString appendString:@"NULL"];
@@ -2794,8 +2685,6 @@
setFont:[NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]]];
[[[exportMultipleXMLTableView tableColumnWithIdentifier:@"tables"] dataCell]
setFont:[NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]]];
- [[[fieldMappingTableView tableColumnWithIdentifier:@"0"] dataCell]
- setFont:[NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]]];
[errorsView setFont:[NSFont fontWithName:SPDefaultMonospacedFontName size:[NSFont smallSystemFontSize]]];
} else {
[[[exportDumpTableView tableColumnWithIdentifier:@"tables"] dataCell]
@@ -2804,8 +2693,6 @@
setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
[[[exportMultipleXMLTableView tableColumnWithIdentifier:@"tables"] dataCell]
setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
- [[[fieldMappingTableView tableColumnWithIdentifier:@"0"] dataCell]
- setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
[errorsView setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
}
}
@@ -2815,7 +2702,7 @@
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView;
{
- return (aTableView == fieldMappingTableView) ? [fieldMappingTableColumnNames count] : [tables count];
+ return [tables count];
}
- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
@@ -2826,39 +2713,19 @@
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
{
id returnObject = nil;
-
- if ( aTableView == fieldMappingTableView ) {
- if ([[aTableColumn identifier] isEqualToString:@"field"]) {
- returnObject = [fieldMappingTableColumnNames objectAtIndex:rowIndex];
-
- } else if ([[aTableColumn identifier] isEqualToString:@"value"]) {
- if ([[[aTableColumn dataCell] class] isEqualTo:[NSPopUpButtonCell class]]) {
- [(NSPopUpButtonCell *)[aTableColumn dataCell] removeAllItems];
- [(NSPopUpButtonCell *)[aTableColumn dataCell] addItemWithTitle:NSLocalizedString(@"Do not import", @"text for csv import drop downs")];
- [(NSPopUpButtonCell *)[aTableColumn dataCell] addItemsWithTitles:fieldMappingButtonOptions];
- }
-
- returnObject = [fieldMappingArray objectAtIndex:rowIndex];
- }
+
+ if ( [[aTableColumn identifier] isEqualToString:@"switch"] ) {
+ returnObject = [[tables objectAtIndex:rowIndex] objectAtIndex:0];
} else {
- if ( [[aTableColumn identifier] isEqualToString:@"switch"] ) {
- returnObject = [[tables objectAtIndex:rowIndex] objectAtIndex:0];
- } else {
- returnObject = [[tables objectAtIndex:rowIndex] objectAtIndex:1];
- }
+ returnObject = [[tables objectAtIndex:rowIndex] objectAtIndex:1];
}
-
+
return returnObject;
}
- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
{
- if ( aTableView == fieldMappingTableView ) {
- [fieldMappingArray replaceObjectAtIndex:rowIndex withObject:anObject];
- }
- else {
- [[tables objectAtIndex:rowIndex] replaceObjectAtIndex:0 withObject:anObject];
- }
+ [[tables objectAtIndex:rowIndex] replaceObjectAtIndex:0 withObject:anObject];
}
@@ -2925,8 +2792,6 @@
self = [super init];
tables = [[NSMutableArray alloc] init];
- fieldMappingTableColumnNames = [[NSMutableArray alloc] init];
- fieldMappingButtonOptions = [[NSMutableArray alloc] init];
fieldMappingArray = nil;
fieldMappingImportArray = nil;
fieldMappingImportArrayIsPreview = NO;
@@ -2938,10 +2803,7 @@
- (void)dealloc
{
[tables release];
- [fieldMappingTableColumnNames release];
- [fieldMappingButtonOptions release];
if (fieldMappingImportArray) [fieldMappingImportArray release];
- if (fieldMappingArray) [fieldMappingArray release];
if (prefs) [prefs release];
[super dealloc];