diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-12-02 10:42:31 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-12-02 10:42:31 +0000 |
commit | f43ceef620d7d2f1325b4bbbdede58e5dc7d47f7 (patch) | |
tree | 1e4e55586c41375561a9d80db2d0181ca3ccc0fa | |
parent | c17b46be3a8f3b4e7f952b70928d88768355ed70 (diff) | |
download | sequelpro-f43ceef620d7d2f1325b4bbbdede58e5dc7d47f7.tar.gz sequelpro-f43ceef620d7d2f1325b4bbbdede58e5dc7d47f7.tar.bz2 sequelpro-f43ceef620d7d2f1325b4bbbdede58e5dc7d47f7.zip |
• Bundle Command
- for Data Table scope added the chance to specify the handling of BLOB fields (if underlying data are kind of NSData or GEOMETRY) as 'Exclude', 'Include', 'save as image file - the data will be saved as tif file and the path will appear in the table', 'save as file - the data will be saved as raw dat file and the path will appear in the table'; for GEOMETRY fields if set to 'save as {image} file' the representation will be saved as PDF file otherwise the WKT string appears
-rw-r--r-- | Interfaces/English.lproj/BundleEditor.xib | 232 | ||||
-rw-r--r-- | Source/SPBundleEditorController.h | 5 | ||||
-rw-r--r-- | Source/SPBundleEditorController.m | 62 | ||||
-rw-r--r-- | Source/SPConstants.h | 6 | ||||
-rw-r--r-- | Source/SPConstants.m | 6 | ||||
-rw-r--r-- | Source/SPCopyTable.h | 7 | ||||
-rw-r--r-- | Source/SPCopyTable.m | 168 |
7 files changed, 456 insertions, 30 deletions
diff --git a/Interfaces/English.lproj/BundleEditor.xib b/Interfaces/English.lproj/BundleEditor.xib index 03cec12d..f3606a7b 100644 --- a/Interfaces/English.lproj/BundleEditor.xib +++ b/Interfaces/English.lproj/BundleEditor.xib @@ -23,7 +23,6 @@ </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="683"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -91,6 +90,7 @@ <int key="NSvFlags">4370</int> <string key="NSFrameSize">{143, 421}</string> <reference key="NSSuperview" ref="34907435"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="_NSCornerView" key="NSCornerView"> <nil key="NSNextResponder"/> @@ -191,6 +191,7 @@ </object> <string key="NSFrame">{{1, 1}, {143, 421}}</string> <reference key="NSSuperview" ref="802985400"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="472206854"/> <reference key="NSDocView" ref="472206854"/> <reference key="NSBGColor" ref="255000212"/> @@ -201,6 +202,7 @@ <int key="NSvFlags">-2147483392</int> <string key="NSFrame">{{-100, -100}, {15, 102}}</string> <reference key="NSSuperview" ref="802985400"/> + <reference key="NSWindow"/> <reference key="NSTarget" ref="802985400"/> <string key="NSAction">_doScroller:</string> <double key="NSPercent">0.99585062265396118</double> @@ -210,6 +212,7 @@ <int key="NSvFlags">-2147483392</int> <string key="NSFrame">{{-100, -100}, {192, 15}}</string> <reference key="NSSuperview" ref="802985400"/> + <reference key="NSWindow"/> <int key="NSsFlags">1</int> <reference key="NSTarget" ref="802985400"/> <string key="NSAction">_doScroller:</string> @@ -218,6 +221,7 @@ </object> <string key="NSFrame">{{-1.5, 22.5}, {145, 423}}</string> <reference key="NSSuperview" ref="69213598"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="34907435"/> <int key="NSsFlags">530</int> <reference key="NSVScroller" ref="769403162"/> @@ -235,6 +239,7 @@ <int key="NSvFlags">292</int> <string key="NSFrame">{{-1, -1}, {32, 25}}</string> <reference key="NSSuperview" ref="78837987"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="846292214"> <int key="NSCellFlags">67239424</int> @@ -263,6 +268,7 @@ <int key="NSvFlags">292</int> <string key="NSFrame">{{30, -1}, {32, 25}}</string> <reference key="NSSuperview" ref="78837987"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="653176607"> <int key="NSCellFlags">67239424</int> @@ -287,6 +293,7 @@ <int key="NSvFlags">292</int> <string key="NSFrame">{{61, -1}, {32, 24}}</string> <reference key="NSSuperview" ref="78837987"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="BWAnchoredPopUpButtonCell" key="NSCell" id="998795499"> <int key="NSCellFlags">71433792</int> @@ -392,6 +399,7 @@ </object> <string key="NSFrameSize">{142, 23}</string> <reference key="NSSuperview" ref="69213598"/> + <reference key="NSWindow"/> <bool key="BWABBIsResizable">YES</bool> <bool key="BWABBIsAtBottom">YES</bool> <bool key="BWABBHandleIsRightAligned">NO</bool> @@ -400,6 +408,7 @@ </object> <string key="NSFrameSize">{142, 444}</string> <reference key="NSSuperview" ref="358491109"/> + <reference key="NSWindow"/> <string key="NSClassName">NSView</string> </object> <object class="BWCustomView" id="338542681"> @@ -412,6 +421,7 @@ <int key="NSvFlags">288</int> <string key="NSFrame">{{17, 16}, {167, 22}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSPopUpButtonCell" key="NSCell" id="1019011390"> <int key="NSCellFlags">-2076049856</int> @@ -445,6 +455,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{17, 280}, {167, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="494412820"> <int key="NSCellFlags">68288064</int> @@ -466,6 +477,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{236, 332}, {167, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="312288989"> <int key="NSCellFlags">68288064</int> @@ -482,6 +494,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{17, 332}, {167, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="201087110"> <int key="NSCellFlags">68288064</int> @@ -531,6 +544,7 @@ </object> <string key="NSFrameSize">{504, 110}</string> <reference key="NSSuperview" ref="593193785"/> + <reference key="NSWindow"/> <object class="NSTextContainer" key="NSTextContainer" id="1024719458"> <object class="NSLayoutManager" key="NSLayoutManager"> <object class="NSTextStorage" key="NSTextStorage"> @@ -613,6 +627,7 @@ </object> <string key="NSFrame">{{1, 1}, {504, 133}}</string> <reference key="NSSuperview" ref="737548631"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="367533279"/> <reference key="NSDocView" ref="367533279"/> <reference key="NSBGColor" ref="856229010"/> @@ -627,6 +642,7 @@ <int key="NSvFlags">-2147483392</int> <string key="NSFrame">{{490, 1}, {15, 140}}</string> <reference key="NSSuperview" ref="737548631"/> + <reference key="NSWindow"/> <reference key="NSTarget" ref="737548631"/> <string key="NSAction">_doScroller:</string> <double key="NSCurValue">1</double> @@ -637,6 +653,7 @@ <int key="NSvFlags">-2147483392</int> <string key="NSFrame">{{-100, -100}, {87, 18}}</string> <reference key="NSSuperview" ref="737548631"/> + <reference key="NSWindow"/> <int key="NSsFlags">1</int> <reference key="NSTarget" ref="737548631"/> <string key="NSAction">_doScroller:</string> @@ -646,6 +663,7 @@ </object> <string key="NSFrame">{{20, 140}, {506, 135}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="593193785"/> <int key="NSsFlags">530</int> <reference key="NSVScroller" ref="245045448"/> @@ -655,8 +673,9 @@ <object class="NSTextField" id="978939688"> <reference key="NSNextResponder" ref="338542681"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{239, 308}, {161, 19}}</string> + <string key="NSFrame">{{239, 309}, {161, 19}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="59154256"> <int key="NSCellFlags">-1804468671</int> @@ -682,8 +701,9 @@ <object class="NSTextField" id="145924516"> <reference key="NSNextResponder" ref="338542681"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{20, 308}, {161, 19}}</string> + <string key="NSFrame">{{20, 309}, {161, 19}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="552732389"> <int key="NSCellFlags">-1804468671</int> @@ -701,6 +721,7 @@ <int key="NSvFlags">265</int> <string key="NSFrame">{{440, 394}, {86, 17}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="315187981"> <int key="NSCellFlags">67239424</int> @@ -721,6 +742,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{236, 330}, {292, 18}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="702004127"> <int key="NSCellFlags">-2080244224</int> @@ -781,6 +803,7 @@ </object> <string key="NSFrameSize">{138, 69}</string> <reference key="NSSuperview" ref="971406968"/> + <reference key="NSWindow"/> <object class="NSTextContainer" key="NSTextContainer" id="1001899575"> <object class="NSLayoutManager" key="NSLayoutManager"> <object class="NSTextStorage" key="NSTextStorage"> @@ -843,6 +866,7 @@ </object> <string key="NSFrame">{{1, 1}, {504, 187}}</string> <reference key="NSSuperview" ref="179792134"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="965862131"/> <reference key="NSDocView" ref="965862131"/> <reference key="NSBGColor" ref="856229010"/> @@ -854,6 +878,7 @@ <int key="NSvFlags">-2147483392</int> <string key="NSFrame">{{454, 1}, {15, 190}}</string> <reference key="NSSuperview" ref="179792134"/> + <reference key="NSWindow"/> <reference key="NSTarget" ref="179792134"/> <string key="NSAction">_doScroller:</string> <double key="NSCurValue">1</double> @@ -864,6 +889,7 @@ <int key="NSvFlags">-2147483392</int> <string key="NSFrame">{{-100, -100}, {87, 18}}</string> <reference key="NSSuperview" ref="179792134"/> + <reference key="NSWindow"/> <int key="NSsFlags">1</int> <reference key="NSTarget" ref="179792134"/> <string key="NSAction">_doScroller:</string> @@ -873,6 +899,7 @@ </object> <string key="NSFrame">{{20, 140}, {506, 189}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="971406968"/> <int key="NSsFlags">562</int> <reference key="NSVScroller" ref="414961522"/> @@ -884,6 +911,7 @@ <int key="NSvFlags">289</int> <string key="NSFrame">{{435, 13}, {96, 28}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <int key="NSTag">1</int> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="1051503991"> @@ -905,6 +933,7 @@ <int key="NSvFlags">289</int> <string key="NSFrame">{{309, 13}, {96, 28}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="697434956"> <int key="NSCellFlags">67239424</int> @@ -925,6 +954,7 @@ <int key="NSvFlags">292</int> <string key="NSFrame">{{20, 55}, {161, 22}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="SRRecorderCell" key="NSCell" id="670400760"> <int key="NSCellFlags">67239424</int> @@ -942,11 +972,46 @@ <integer value="1" key="style"/> </object> </object> + <object class="NSPopUpButton" id="710770414"> + <reference key="NSNextResponder" ref="338542681"/> + <int key="NSvFlags">268</int> + <string key="NSFrame">{{236, 356}, {167, 22}}</string> + <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> + <bool key="NSEnabled">YES</bool> + <object class="NSPopUpButtonCell" key="NSCell" id="68459104"> + <int key="NSCellFlags">-2076049856</int> + <int key="NSCellFlags2">133120</int> + <reference key="NSSupport" ref="26"/> + <reference key="NSControlView" ref="710770414"/> + <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="979150328"> + <string key="NSTitle">OtherViews</string> + <object class="NSMutableArray" key="NSMenuItems"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + <reference key="NSMenuFont" ref="604392898"/> + </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="NSPopUpButton" id="1013555552"> <reference key="NSNextResponder" ref="338542681"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{236, 356}, {167, 22}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSPopUpButtonCell" key="NSCell" id="4363123"> <int key="NSCellFlags">-2076049856</int> @@ -980,6 +1045,7 @@ <int key="NSvFlags">292</int> <string key="NSFrame">{{17, 96}, {167, 22}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSPopUpButtonCell" key="NSCell" id="299353121"> <int key="NSCellFlags">-2076049856</int> @@ -1013,6 +1079,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{236, 391}, {167, 22}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSPopUpButtonCell" key="NSCell" id="886363818"> <int key="NSCellFlags">-2076049856</int> @@ -1046,6 +1113,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{17, 356}, {167, 22}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSPopUpButtonCell" key="NSCell" id="131002945"> <int key="NSCellFlags">-2076049856</int> @@ -1079,6 +1147,7 @@ <int key="NSvFlags">265</int> <string key="NSFrame">{{504, 354}, {25, 25}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="1021110085"> <int key="NSCellFlags">67239424</int> @@ -1094,11 +1163,29 @@ <int key="NSPeriodicInterval">25</int> </object> </object> + <object class="NSTextField" id="703222741"> + <reference key="NSNextResponder" ref="338542681"/> + <int key="NSvFlags">268</int> + <string key="NSFrame">{{186, 360}, {48, 14}}</string> + <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> + <bool key="NSEnabled">YES</bool> + <object class="NSTextFieldCell" key="NSCell" id="116371218"> + <int key="NSCellFlags">68288064</int> + <int key="NSCellFlags2">138544128</int> + <string key="NSContents">and</string> + <reference key="NSSupport" ref="26"/> + <reference key="NSControlView" ref="703222741"/> + <reference key="NSBackgroundColor" ref="90467341"/> + <reference key="NSTextColor" ref="576381864"/> + </object> + </object> <object class="NSTextField" id="411989314"> <reference key="NSNextResponder" ref="338542681"/> <int key="NSvFlags">268</int> <string key="NSFrame">{{186, 360}, {48, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="679867674"> <int key="NSCellFlags">68288064</int> @@ -1115,6 +1202,7 @@ <int key="NSvFlags">292</int> <string key="NSFrame">{{239, 98}, {161, 19}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="748268806"> <int key="NSCellFlags">-1804468671</int> @@ -1133,6 +1221,7 @@ <int key="NSvFlags">288</int> <string key="NSFrame">{{17, 78}, {95, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="38136759"> <int key="NSCellFlags">68288064</int> @@ -1149,6 +1238,7 @@ <int key="NSvFlags">288</int> <string key="NSFrame">{{17, 38}, {167, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="75217064"> <int key="NSCellFlags">68288064</int> @@ -1165,6 +1255,7 @@ <int key="NSvFlags">288</int> <string key="NSFrame">{{17, 118}, {167, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="849546250"> <int key="NSCellFlags">68288064</int> @@ -1181,6 +1272,7 @@ <int key="NSvFlags">292</int> <string key="NSFrame">{{236, 118}, {167, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="622343774"> <int key="NSCellFlags">68288064</int> @@ -1197,6 +1289,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{236, 414}, {167, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="44795332"> <int key="NSCellFlags">68288064</int> @@ -1213,6 +1306,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{17, 332}, {167, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="553916693"> <int key="NSCellFlags">68288064</int> @@ -1229,6 +1323,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{17, 379}, {167, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="370999655"> <int key="NSCellFlags">68288064</int> @@ -1245,6 +1340,7 @@ <int key="NSvFlags">292</int> <string key="NSFrame">{{236, 78}, {167, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="627233937"> <int key="NSCellFlags">68288064</int> @@ -1261,6 +1357,7 @@ <int key="NSvFlags">292</int> <string key="NSFrame">{{239, 57}, {161, 19}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="43525095"> <int key="NSCellFlags">-1804468671</int> @@ -1279,6 +1376,7 @@ <int key="NSvFlags">264</int> <string key="NSFrame">{{17, 414}, {167, 14}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="434303900"> <int key="NSCellFlags">68288064</int> @@ -1295,6 +1393,7 @@ <int key="NSvFlags">268</int> <string key="NSFrame">{{20, 394}, {161, 19}}</string> <reference key="NSSuperview" ref="338542681"/> + <reference key="NSWindow"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="1025501303"> <int key="NSCellFlags">-1804468671</int> @@ -1311,11 +1410,13 @@ </object> <string key="NSFrame">{{143, 0}, {548, 444}}</string> <reference key="NSSuperview" ref="358491109"/> + <reference key="NSWindow"/> <string key="NSClassName">NSView</string> </object> </object> <string key="NSFrameSize">{691, 444}</string> <reference key="NSSuperview" ref="391663674"/> + <reference key="NSWindow"/> <bool key="NSIsVertical">YES</bool> <int key="NSDividerStyle">2</int> <string key="NSAutosaveName">SPQueryFavoriteSplitView</string> @@ -1382,6 +1483,7 @@ </object> <string key="NSFrameSize">{691, 444}</string> <reference key="NSSuperview"/> + <reference key="NSWindow"/> </object> <string key="NSScreenRect">{{0, 0}, {1920, 1058}}</string> <string key="NSMinSize">{691, 466}</string> @@ -2200,6 +2302,38 @@ </object> <int key="connectionID">1087</int> </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">withBlobLabelField</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="703222741"/> + </object> + <int key="connectionID">1090</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">nextKeyView</string> + <reference key="source" ref="710770414"/> + <reference key="destination" ref="965862131"/> + </object> + <int key="connectionID">1094</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">withBlobPopupButton</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="710770414"/> + </object> + <int key="connectionID">1096</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">withBlobButtonChanged:</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="710770414"/> + </object> + <int key="connectionID">1097</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -2488,6 +2622,8 @@ <reference ref="284549777"/> <reference ref="413102423"/> <reference ref="679408795"/> + <reference ref="703222741"/> + <reference ref="710770414"/> </object> <reference key="parent" ref="358491109"/> <string key="objectName">Bundle Content View</string> @@ -3013,6 +3149,44 @@ <reference key="object" ref="75217064"/> <reference key="parent" ref="413102423"/> </object> + <object class="IBObjectRecord"> + <int key="objectID">1088</int> + <reference key="object" ref="703222741"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="116371218"/> + </object> + <reference key="parent" ref="338542681"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1089</int> + <reference key="object" ref="116371218"/> + <reference key="parent" ref="703222741"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1091</int> + <reference key="object" ref="710770414"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="68459104"/> + </object> + <reference key="parent" ref="338542681"/> + <string key="objectName">Pop Up Button (Input Fallback)</string> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1092</int> + <reference key="object" ref="68459104"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="979150328"/> + </object> + <reference key="parent" ref="710770414"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">1093</int> + <reference key="object" ref="979150328"/> + <reference key="parent" ref="68459104"/> + </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> @@ -3047,6 +3221,14 @@ <string>1083.IBAttributePlaceholdersKey</string> <string>1083.IBPluginDependency</string> <string>1084.IBPluginDependency</string> + <string>1088.IBAttributePlaceholdersKey</string> + <string>1088.IBPluginDependency</string> + <string>1089.IBPluginDependency</string> + <string>1091.IBAttributePlaceholdersKey</string> + <string>1091.IBPluginDependency</string> + <string>1092.IBPluginDependency</string> + <string>1093.IBEditorWindowLastContentRect</string> + <string>1093.IBPluginDependency</string> <string>521.IBEditorWindowLastContentRect</string> <string>521.IBPluginDependency</string> <string>521.IBWindowTemplateEditedContentRect</string> @@ -3207,6 +3389,27 @@ </object> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <object class="NSMutableDictionary"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference key="dict.sortedKeys" ref="0"/> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + </object> + </object> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <object class="NSMutableDictionary"> + <string key="NS.key.0">ToolTip</string> + <object class="IBToolTipAttribute" key="NS.object.0"> + <string key="name">ToolTip</string> + <reference key="object" ref="710770414"/> + <string key="toolTip">Choose the handling of BLOB fields</string> + </object> + </object> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>{{430, 598}, {167, 4}}</string> + <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>{{172, 298}, {691, 444}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>{{172, 298}, {691, 444}}</string> @@ -3444,7 +3647,7 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">1087</int> + <int key="maxID">1097</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -3602,6 +3805,7 @@ <string>scopeButtonChanged:</string> <string>showHelp:</string> <string>triggerButtonChanged:</string> + <string>withBlobButtonChanged:</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -3619,6 +3823,7 @@ <string>id</string> <string>id</string> <string>id</string> + <string>id</string> </object> </object> <object class="NSMutableDictionary" key="actionInfosByName"> @@ -3639,6 +3844,7 @@ <string>scopeButtonChanged:</string> <string>showHelp:</string> <string>triggerButtonChanged:</string> + <string>withBlobButtonChanged:</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -3698,6 +3904,10 @@ <string key="name">triggerButtonChanged:</string> <string key="candidateClassName">id</string> </object> + <object class="IBActionInfo"> + <string key="name">withBlobButtonChanged:</string> + <string key="candidateClassName">id</string> + </object> </object> </object> <object class="NSMutableDictionary" key="outlets"> @@ -3736,6 +3946,8 @@ <string>showHideMetaButton</string> <string>tooltipTextField</string> <string>triggerPopupButton</string> + <string>withBlobLabelField</string> + <string>withBlobPopupButton</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -3771,6 +3983,8 @@ <string>NSButton</string> <string>NSTextField</string> <string>NSPopUpButton</string> + <string>NSTextField</string> + <string>NSPopUpButton</string> </object> </object> <object class="NSMutableDictionary" key="toOneOutletInfosByName"> @@ -3809,6 +4023,8 @@ <string>showHideMetaButton</string> <string>tooltipTextField</string> <string>triggerPopupButton</string> + <string>withBlobLabelField</string> + <string>withBlobPopupButton</string> </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -3940,6 +4156,14 @@ <string key="name">triggerPopupButton</string> <string key="candidateClassName">NSPopUpButton</string> </object> + <object class="IBToOneOutletInfo"> + <string key="name">withBlobLabelField</string> + <string key="candidateClassName">NSTextField</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">withBlobPopupButton</string> + <string key="candidateClassName">NSPopUpButton</string> + </object> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> diff --git a/Source/SPBundleEditorController.h b/Source/SPBundleEditorController.h index 5ccd8a9a..7cc36de4 100644 --- a/Source/SPBundleEditorController.h +++ b/Source/SPBundleEditorController.h @@ -40,6 +40,7 @@ IBOutlet NSTextField *tooltipTextField; IBOutlet NSTextField *categoryTextField; IBOutlet NSTextField *fallbackLabelField; + IBOutlet NSTextField *withBlobLabelField; IBOutlet NSTextField *commandLabelField; IBOutlet NSTextField *authorLabelField; IBOutlet NSTextField *contactLabelField; @@ -49,6 +50,7 @@ IBOutlet NSPopUpButton *outputPopupButton; IBOutlet NSPopUpButton *scopePopupButton; IBOutlet NSPopUpButton *triggerPopupButton; + IBOutlet NSPopUpButton *withBlobPopupButton; IBOutlet NSButton *removeButton; IBOutlet NSButton *addButton; IBOutlet NSButton *saveButton; @@ -84,6 +86,7 @@ NSMenu *triggerInputFieldPopUpMenu; NSMenu *triggerDataTablePopUpMenu; NSMenu *triggerGeneralPopUpMenu; + NSMenu *withBlobDataTablePopUpMenu; NSArray *inputGeneralScopeArray; NSArray *inputInputFieldScopeArray; @@ -95,6 +98,7 @@ NSArray *triggerInputFieldArray; NSArray *triggerDataTableArray; NSArray *triggerGeneralArray; + NSArray *withBlobDataTableArray; BOOL doGroupDueToChars; BOOL allowUndo; @@ -109,6 +113,7 @@ - (IBAction)outputPopupButtonChanged:(id)sender; - (IBAction)scopeButtonChanged:(id)sender; - (IBAction)triggerButtonChanged:(id)sender; +- (IBAction)withBlobButtonChanged:(id)sender; - (IBAction)duplicateCommandBundle:(id)sender; - (IBAction)addCommandBundle:(id)sender; - (IBAction)removeCommandBundle:(id)sender; diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 60f95f3b..56258ee3 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -93,6 +93,7 @@ [triggerInputFieldArray release]; [triggerDataTableArray release]; [triggerGeneralArray release]; + [withBlobDataTableArray release]; if(touchedBundleArray) [touchedBundleArray release], touchedBundleArray = nil; if(commandBundleTree) [commandBundleTree release], commandBundleTree = nil; @@ -134,6 +135,7 @@ triggerInputFieldPopUpMenu = [[NSMenu alloc] initWithTitle:@""]; triggerDataTablePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; triggerGeneralPopUpMenu = [[NSMenu alloc] initWithTitle:@""]; + withBlobDataTablePopUpMenu = [[NSMenu alloc] initWithTitle:@""]; inputGeneralScopeArray = [[NSArray arrayWithObjects:SPBundleInputSourceNone, nil] retain]; inputInputFieldScopeArray = [[NSArray arrayWithObjects:SPBundleInputSourceNone, SPBundleInputSourceSelectedText, SPBundleInputSourceEntireContent, nil] retain]; @@ -145,6 +147,7 @@ triggerInputFieldArray = [[NSArray arrayWithObjects:SPBundleTriggerActionNone, nil] retain]; triggerDataTableArray = [[NSArray arrayWithObjects:SPBundleTriggerActionNone, SPBundleTriggerActionDatabaseChanged, SPBundleTriggerActionTableChanged, SPBundleTriggerActionTableRowChanged, nil] retain]; triggerGeneralArray = [[NSArray arrayWithObjects:SPBundleTriggerActionNone, SPBundleTriggerActionDatabaseChanged, SPBundleTriggerActionTableChanged, nil] retain]; + withBlobDataTableArray = [[NSArray arrayWithObjects:SPBundleInputSourceBlobHandlingExclude, SPBundleInputSourceBlobHandlingInclude, SPBundleInputSourceBlobHandlingImageFileReference, SPBundleInputSourceBlobHandlingFileReference, nil] retain]; NSMutableArray *allPopupScopeItems = [NSMutableArray array]; [allPopupScopeItems addObjectsFromArray:inputGeneralScopeArray]; @@ -157,6 +160,7 @@ [allPopupScopeItems addObjectsFromArray:triggerInputFieldArray]; [allPopupScopeItems addObjectsFromArray:triggerDataTableArray]; [allPopupScopeItems addObjectsFromArray:triggerGeneralArray]; + [allPopupScopeItems addObjectsFromArray:withBlobDataTableArray]; NSDictionary *menuItemTitles = [NSDictionary dictionaryWithObjects: [NSArray arrayWithObjects: @@ -210,6 +214,11 @@ NSLocalizedString(@"Database changed", @"database changed item label"), NSLocalizedString(@"Table changed", @"table changed item label"), + NSLocalizedString(@"exclude BLOB", @"exclude BLOB item label"), + NSLocalizedString(@"include BLOB", @"include BLOB item label"), + NSLocalizedString(@"save BLOB as image file", @"save BLOB as image file item label"), + NSLocalizedString(@"save BLOB as dat file", @"save BLOB as dat file item label"), + nil] forKeys:allPopupScopeItems]; @@ -264,6 +273,11 @@ [triggerGeneralPopUpMenu addItem:anItem]; [anItem release]; } + for(NSString* title in withBlobDataTableArray) { + anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:title] action:@selector(withBlobButtonChanged:) keyEquivalent:@""]; + [withBlobDataTablePopUpMenu addItem:anItem]; + [anItem release]; + } anItem = [[NSMenuItem alloc] initWithTitle:[menuItemTitles objectForKey:SPBundleInputSourceNone] action:nil keyEquivalent:@""]; [inputNonePopUpMenu addItem:anItem]; [anItem release]; @@ -456,6 +470,28 @@ } /** + * Store trigger in bundle dict since it is not bound + * via key binding and update various GUI elements + */ +- (IBAction)withBlobButtonChanged:(id)sender +{ + + id currentDict = [self _currentSelectedObject]; + + NSMenu* senderMenu = [sender menu]; + + NSInteger selectedIndex = [senderMenu indexOfItem:sender]; + NSString *input = SPBundleInputSourceBlobHandlingExclude; + + input = [withBlobDataTableArray objectAtIndex:selectedIndex]; + + [currentDict setObject:input forKey:SPBundleFileWithBlobKey]; + + [self _updateBundleDataView]; + +} + +/** * Duplicate the selected bundle (processed in addCommandBundle:) */ - (IBAction)duplicateCommandBundle:(id)sender @@ -1618,6 +1654,9 @@ NSString *trigger = [currentDict objectForKey:SPBundleFileTriggerKey]; if(!trigger) trigger = SPBundleTriggerActionNone; + NSString *withBlob = [currentDict objectForKey:SPBundleFileWithBlobKey]; + if(!withBlob) withBlob = SPBundleInputSourceBlobHandlingExclude; + // Update the scope popup button if([scope isEqualToString:SPBundleScopeGeneral]) [scopePopupButton selectItemWithTag:kGeneralScopeArrayIndex]; @@ -1647,6 +1686,8 @@ input = SPBundleInputSourceNone; [inputFallbackPopupButton setHidden:YES]; [fallbackLabelField setHidden:YES]; + [withBlobPopupButton setHidden:YES]; + [withBlobLabelField setHidden:YES]; break; case kInputFieldScopeArrayIndex: // Input Field @@ -1670,6 +1711,9 @@ if(anIndex == NSNotFound) anIndex = 0; [triggerPopupButton selectItemAtIndex:anIndex]; + [withBlobPopupButton setHidden:YES]; + [withBlobLabelField setHidden:YES]; + break; case kDataTableScopeArrayIndex: // Data Table [inputPopupButton setMenu:inputDataTableScopePopUpMenu]; @@ -1682,7 +1726,6 @@ if(anIndex == NSNotFound) anIndex = 0; [outputPopupButton selectItemAtIndex:anIndex]; - input = SPBundleInputSourceNone; [inputFallbackPopupButton setHidden:YES]; [fallbackLabelField setHidden:YES]; @@ -1691,6 +1734,23 @@ if(anIndex == NSNotFound) anIndex = 0; [triggerPopupButton selectItemAtIndex:anIndex]; + [withBlobPopupButton setMenu:withBlobDataTablePopUpMenu]; + anIndex = [withBlobDataTableArray indexOfObject:withBlob]; + if(anIndex == NSNotFound) anIndex = 0; + [withBlobPopupButton selectItemAtIndex:anIndex]; + + [inputFallbackPopupButton setHidden:YES]; + [fallbackLabelField setHidden:YES]; + + if([currentDict objectForKey:SPBundleFileInputSourceKey] && ([[currentDict objectForKey:SPBundleFileInputSourceKey] isEqualToString:SPBundleInputSourceNone] || [[currentDict objectForKey:SPBundleFileInputSourceKey] isEqualToString:SPBundleInputSourceTableRowsAsSqlInsert] || [[currentDict objectForKey:SPBundleFileInputSourceKey] isEqualToString:SPBundleInputSourceSelectedTableRowsAsSqlInsert])) { + [withBlobPopupButton setHidden:YES]; + [withBlobLabelField setHidden:YES]; + } else { + [withBlobPopupButton setHidden:NO]; + [withBlobLabelField setHidden:NO]; + } + input = SPBundleInputSourceNone; + break; case kDisabledScopeTag: // Disable command break; diff --git a/Source/SPConstants.h b/Source/SPConstants.h index 5327fd45..91777dbe 100644 --- a/Source/SPConstants.h +++ b/Source/SPConstants.h @@ -448,6 +448,10 @@ extern NSString *SPBundleInputSourceTableRowsAsTab; extern NSString *SPBundleInputSourceTableRowsAsCsv; extern NSString *SPBundleInputSourceTableRowsAsSqlInsert; extern NSString *SPBundleInputSourceNone; +extern NSString *SPBundleInputSourceBlobHandlingInclude; +extern NSString *SPBundleInputSourceBlobHandlingExclude; +extern NSString *SPBundleInputSourceBlobHandlingImageFileReference; +extern NSString *SPBundleInputSourceBlobHandlingFileReference; extern NSString *SPBundleOutputActionNone; extern NSString *SPBundleOutputActionInsertAsText; extern NSString *SPBundleOutputActionInsertAsSnippet; @@ -476,12 +480,14 @@ extern NSString *SPBundleFileContactKey; extern NSString *SPBundleFileUUIDKey; extern NSString *SPBundleFileDescriptionKey; extern NSString *SPBundleFileTriggerKey; +extern NSString *SPBundleFileWithBlobKey; extern NSString *SPBundleInternLabelKey; extern NSString *SPBundleInternPathToFileKey; extern NSString *SPBundleInternKeyEquivalentKey; extern NSString *SPBundleFileName; extern NSString *SPBundleTaskInputFilePath; extern NSString *SPBundleTaskScriptCommandFilePath; +extern NSString *SPBundleTaskCopyBlobFileDirectory; // sequel URL scheme extern NSString *SPURLSchemeQueryInputPathHeader; diff --git a/Source/SPConstants.m b/Source/SPConstants.m index 495a7580..94abe414 100644 --- a/Source/SPConstants.m +++ b/Source/SPConstants.m @@ -260,6 +260,10 @@ NSString *SPBundleInputSourceTableRowsAsTab = @"tablerowsastab"; NSString *SPBundleInputSourceTableRowsAsCsv = @"tablerowsascsv"; NSString *SPBundleInputSourceTableRowsAsSqlInsert = @"tablerowsassqlinsert"; NSString *SPBundleInputSourceNone = @"none"; +NSString *SPBundleInputSourceBlobHandlingInclude = @"include"; +NSString *SPBundleInputSourceBlobHandlingExclude = @"exclude"; +NSString *SPBundleInputSourceBlobHandlingImageFileReference = @"imagefilereference"; +NSString *SPBundleInputSourceBlobHandlingFileReference = @"filereference"; NSString *SPBundleOutputActionNone = @"none"; NSString *SPBundleOutputActionInsertAsText = @"insertastext"; NSString *SPBundleOutputActionInsertAsSnippet = @"insertassnippet"; @@ -288,6 +292,7 @@ NSString *SPBundleFileContactKey = @"contact"; NSString *SPBundleFileUUIDKey = @"uuid"; NSString *SPBundleFileDescriptionKey = @"description"; NSString *SPBundleFileTriggerKey = @"trigger"; +NSString *SPBundleFileWithBlobKey = @"withblob"; NSString *SPBundleInternLabelKey = @"label"; NSString *SPBundleInternPathToFileKey = @"path"; NSString *SPBundleInternKeyEquivalentKey = @"keyEquivalent"; @@ -295,6 +300,7 @@ NSString *SPBundleInternKeyEquivalentKey = @"keyEquivalent"; NSString *SPBundleFileName = @"command.plist"; NSString *SPBundleTaskInputFilePath = @"/tmp/SP_BUNDLE_TASK_INPUT"; NSString *SPBundleTaskScriptCommandFilePath = @"/tmp/SP_SCRIPT_COMMAND"; +NSString *SPBundleTaskCopyBlobFileDirectory = @"/tmp/SP_COPY_BLOB_FILES"; // sequel URL scheme NSString *SPURLSchemeQueryInputPathHeader = @"/tmp/SP_QUERY_"; diff --git a/Source/SPCopyTable.h b/Source/SPCopyTable.h index 89030976..4723dbc9 100644 --- a/Source/SPCopyTable.h +++ b/Source/SPCopyTable.h @@ -48,9 +48,12 @@ NSUserDefaults *prefs; NSRange fieldEditorSelectedRange; + NSString *copyBlobFileDirectory; } +@property(readwrite,assign) NSString *copyBlobFileDirectory; + @property(readwrite,assign) NSRange fieldEditorSelectedRange; /*! @@ -90,7 +93,7 @@ returns something meaningful. @result The above described string, or nil if nothing selected */ -- (NSString *)rowsAsTabStringWithHeaders:(BOOL)withHeaders onlySelectedRows:(BOOL)onlySelected; +- (NSString *)rowsAsTabStringWithHeaders:(BOOL)withHeaders onlySelectedRows:(BOOL)onlySelected blobHandling:(NSInteger)withBlobHandling; /*! @method rowsAsCsvStringWithHeaders:onlySelectedRows: @@ -101,7 +104,7 @@ returns something meaningful. @result The above described string, or nil if nothing selected */ -- (NSString *)rowsAsCsvStringWithHeaders:(BOOL)withHeaders onlySelectedRows:(BOOL)onlySelected; +- (NSString *)rowsAsCsvStringWithHeaders:(BOOL)withHeaders onlySelectedRows:(BOOL)onlySelected blobHandling:(NSInteger)withBlobHandling; /* * Generate a string in form of INSERT INTO <table> VALUES () of diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 687cb2e4..493c3fb4 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -34,11 +34,17 @@ #import "SPTooltip.h" #import "SPAlertSheets.h" #import "SPBundleHTMLOutputController.h" +#import "SPGeometryDataView.h" NSInteger MENU_EDIT_COPY = 2001; NSInteger MENU_EDIT_COPY_WITH_COLUMN = 2002; NSInteger MENU_EDIT_COPY_AS_SQL = 2003; +NSInteger kBlobExclude = 1; +NSInteger kBlobInclude = 2; +NSInteger kBlobAsFile = 3; +NSInteger kBlobAsImageFile = 4; + @implementation SPCopyTable @@ -47,6 +53,7 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; * selection in the field editor's editTextView */ @synthesize fieldEditorSelectedRange; +@synthesize copyBlobFileDirectory; /** * Cell editing in SPCustomQuery or for views in SPTableContent @@ -93,7 +100,7 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; [pb setString:tmp forType:NSStringPboardType]; } } else { - tmp = [self rowsAsTabStringWithHeaders:([sender tag] == MENU_EDIT_COPY_WITH_COLUMN) onlySelectedRows:YES]; + tmp = [self rowsAsTabStringWithHeaders:([sender tag] == MENU_EDIT_COPY_WITH_COLUMN) onlySelectedRows:YES blobHandling:kBlobInclude]; if ( nil != tmp ) { NSPasteboard *pb = [NSPasteboard generalPasteboard]; @@ -114,7 +121,7 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; * Get selected rows a string of newline separated lines of tab separated fields * the value in each field is from the objects description method */ -- (NSString *) rowsAsTabStringWithHeaders:(BOOL)withHeaders onlySelectedRows:(BOOL)onlySelected +- (NSString *) rowsAsTabStringWithHeaders:(BOOL)withHeaders onlySelectedRows:(BOOL)onlySelected blobHandling:(NSInteger)withBlobHandling { if (onlySelected && [self numberOfSelectedRows] == 0) return nil; @@ -152,6 +159,13 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; NSString *nullString = [prefs objectForKey:SPNullValue]; NSStringEncoding connectionEncoding = [mySQLConnection encoding]; Class mcpGeometryData = [MCPGeometryData class]; + NSUInteger rowCounter = 0; + + if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && copyBlobFileDirectory && [copyBlobFileDirectory length]) { + NSFileManager *fm = [NSFileManager defaultManager]; + [fm removeItemAtPath:copyBlobFileDirectory error:nil]; + [fm createDirectoryAtPath:copyBlobFileDirectory withIntermediateDirectories:YES attributes:nil error:nil]; + } while ( rowIndex != NSNotFound ) { @@ -159,22 +173,59 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; cellData = SPDataStorageObjectAtRowAndColumn(tableStorage, rowIndex, columnMappings[c]); // Copy the shown representation of the cell - custom NULL display strings, (not loaded), - // and the string representation of any blobs or binary texts. + // definable representation of any blobs or binary texts. if (cellData) { if ([cellData isNSNull]) [result appendFormat:@"%@\t", nullString]; else if ([cellData isSPNotLoaded]) [result appendFormat:@"%@\t", NSLocalizedString(@"(not loaded)", @"value shown for hidden blob and text fields")]; else if ([cellData isKindOfClass:[NSData class]]) { - NSString *displayString = [[NSString alloc] initWithData:cellData encoding:[mySQLConnection stringEncoding]]; - if (!displayString) displayString = [[NSString alloc] initWithData:cellData encoding:NSASCIIStringEncoding]; - if (displayString) { - [result appendFormat:@"%@\t", displayString]; - [displayString release]; + if(withBlobHandling == kBlobInclude) { + NSString *displayString = [[NSString alloc] initWithData:cellData encoding:[mySQLConnection stringEncoding]]; + if (!displayString) displayString = [[NSString alloc] initWithData:cellData encoding:NSASCIIStringEncoding]; + if (displayString) { + [result appendFormat:@"%@\t", displayString]; + [displayString release]; + } + } + else if(withBlobHandling == kBlobAsFile && copyBlobFileDirectory && [copyBlobFileDirectory length]) { + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.dat", copyBlobFileDirectory, rowCounter, c]; + [cellData writeToFile:fp atomically:NO]; + [result appendFormat:@"%@\t", fp]; + } + else if(withBlobHandling == kBlobAsImageFile && copyBlobFileDirectory && [copyBlobFileDirectory length]) { + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.tif", copyBlobFileDirectory, rowCounter, c]; + NSImage *image = [[NSImage alloc] initWithData:cellData]; + if (image) { + NSData *d = [[NSData alloc] initWithData:[image TIFFRepresentationUsingCompression:NSTIFFCompressionLZW factor:1]]; + [d writeToFile:fp atomically:NO]; + if(d) [d release], d = nil; + [image release]; + } else { + NSString *noData = @""; + [noData writeToFile:fp atomically:NO]; + } + [result appendFormat:@"%@\t", fp]; + } + else { + [result appendString:@"BLOB\t"]; } } else if ([cellData isKindOfClass:mcpGeometryData]) { - [result appendFormat:@"%@\t", [cellData wktString]]; + if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && copyBlobFileDirectory && [copyBlobFileDirectory length]) { + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.pdf", copyBlobFileDirectory, rowCounter, c]; + SPGeometryDataView *v = [[SPGeometryDataView alloc] initWithCoordinates:[cellData coordinates]]; + NSData *thePDF = [v pdfData]; + if(thePDF) { + [thePDF writeToFile:fp atomically:NO]; + [result appendFormat:@"%@\t", fp]; + } else { + [result appendFormat:@"%@\t", [cellData wktString]]; + } + if(v) [v release], v = nil; + } else { + [result appendFormat:@"%@\t", [cellData wktString]]; + } } else [result appendFormat:@"%@\t", [cellData description]]; @@ -183,6 +234,8 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; } } + rowCounter++; + // Remove the trailing tab and add the linebreak if ([result length]){ [result deleteCharactersInRange:NSMakeRange([result length]-1, 1)]; @@ -207,7 +260,7 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; * Get selected rows a string of newline separated lines of , separated fields wrapped into quotes * the value in each field is from the objects description method */ -- (NSString *) rowsAsCsvStringWithHeaders:(BOOL)withHeaders onlySelectedRows:(BOOL)onlySelected +- (NSString *) rowsAsCsvStringWithHeaders:(BOOL)withHeaders onlySelectedRows:(BOOL)onlySelected blobHandling:(NSInteger)withBlobHandling { if (onlySelected && [self numberOfSelectedRows] == 0) return nil; @@ -246,36 +299,83 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; NSStringEncoding connectionEncoding = [mySQLConnection encoding]; Class mcpGeometryData = [MCPGeometryData class]; + NSUInteger rowCounter = 0; + + if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && copyBlobFileDirectory && [copyBlobFileDirectory length]) { + NSFileManager *fm = [NSFileManager defaultManager]; + [fm removeItemAtPath:copyBlobFileDirectory error:nil]; + [fm createDirectoryAtPath:copyBlobFileDirectory withIntermediateDirectories:YES attributes:nil error:nil]; + } + while ( rowIndex != NSNotFound ) { for ( c = 0; c < numColumns; c++ ) { cellData = SPDataStorageObjectAtRowAndColumn(tableStorage, rowIndex, columnMappings[c]); // Copy the shown representation of the cell - custom NULL display strings, (not loaded), - // and the string representation of any blobs or binary texts. + // definable representation of any blobs or binary texts. if (cellData) { if ([cellData isNSNull]) [result appendFormat:@"\"%@\",", nullString]; else if ([cellData isSPNotLoaded]) [result appendFormat:@"\"%@\",", NSLocalizedString(@"(not loaded)", @"value shown for hidden blob and text fields")]; else if ([cellData isKindOfClass:[NSData class]]) { - NSString *displayString = [[NSString alloc] initWithData:cellData encoding:[mySQLConnection stringEncoding]]; - if (!displayString) displayString = [[NSString alloc] initWithData:cellData encoding:NSASCIIStringEncoding]; - if (displayString) { - [result appendFormat:@"\"%@\",", [displayString stringByReplacingOccurrencesOfString:@"\"" withString:@"\"\""]]; - [displayString release]; + if(withBlobHandling == kBlobInclude) { + NSString *displayString = [[NSString alloc] initWithData:cellData encoding:[mySQLConnection stringEncoding]]; + if (!displayString) displayString = [[NSString alloc] initWithData:cellData encoding:NSASCIIStringEncoding]; + if (displayString) { + [result appendFormat:@"\"%@\",", displayString]; + [displayString release]; + } + } + else if(withBlobHandling == kBlobAsFile && copyBlobFileDirectory && [copyBlobFileDirectory length]) { + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.dat", copyBlobFileDirectory, rowCounter, c]; + [cellData writeToFile:fp atomically:NO]; + [result appendFormat:@"\"%@\",", fp]; + } + else if(withBlobHandling == kBlobAsImageFile && copyBlobFileDirectory && [copyBlobFileDirectory length]) { + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.tif", copyBlobFileDirectory, rowCounter, c]; + NSImage *image = [[NSImage alloc] initWithData:cellData]; + if (image) { + NSData *d = [[NSData alloc] initWithData:[image TIFFRepresentationUsingCompression:NSTIFFCompressionLZW factor:1]]; + [d writeToFile:fp atomically:NO]; + if(d) [d release], d = nil; + [image release]; + } else { + NSString *noData = @""; + [noData writeToFile:fp atomically:NO]; + } + [result appendFormat:@"\"%@\",", fp]; + } + else { + [result appendString:@"\"BLOB\","]; } } else if ([cellData isKindOfClass:mcpGeometryData]) { - [result appendFormat:@"\"%@\",", [cellData wktString]]; + if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && copyBlobFileDirectory && [copyBlobFileDirectory length]) { + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.pdf", copyBlobFileDirectory, rowCounter, c]; + SPGeometryDataView *v = [[SPGeometryDataView alloc] initWithCoordinates:[cellData coordinates]]; + NSData *thePDF = [v pdfData]; + if(thePDF) { + [thePDF writeToFile:fp atomically:NO]; + [result appendFormat:@"\"%@\",", fp]; + } else { + [result appendFormat:@"\"%@\",", [cellData wktString]]; + } + if(v) [v release], v = nil; + } else { + [result appendFormat:@"\"%@\",", [cellData wktString]]; + } } else - [result appendFormat:@"\"%@\",", [[cellData description] stringByReplacingOccurrencesOfString:@"\"" withString:@"\"\""]]; + [result appendFormat:@"\"%@\",", [cellData description]]; } else { [result appendString:@","]; } } + rowCounter++; + // Remove the trailing tab and add the linebreak if ([result length]){ [result deleteCharactersInRange:NSMakeRange([result length]-1, 1)]; @@ -860,8 +960,10 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; NSString *cmd = [cmdData objectForKey:SPBundleFileCommandKey]; NSString *inputAction = @""; NSString *inputFallBackAction = @""; + NSString *withBlobHandling = @""; NSError *err = nil; - NSString *bundleInputFilePath = [NSString stringWithFormat:@"%@_%@", SPBundleTaskInputFilePath, [NSString stringWithNewUUID]]; + NSString *uuid = [NSString stringWithNewUUID]; + NSString *bundleInputFilePath = [NSString stringWithFormat:@"%@_%@", SPBundleTaskInputFilePath, uuid]; [[NSFileManager defaultManager] removeItemAtPath:bundleInputFilePath error:nil]; @@ -890,20 +992,40 @@ NSInteger MENU_EDIT_COPY_AS_SQL = 2003; NSError *inputFileError = nil; NSString *input = @""; + NSInteger blobHandling = kBlobExclude; + if([cmdData objectForKey:SPBundleFileWithBlobKey]) { + if([[cmdData objectForKey:SPBundleFileWithBlobKey] isEqualToString:SPBundleInputSourceBlobHandlingExclude]) + blobHandling = kBlobExclude; + else if([[cmdData objectForKey:SPBundleFileWithBlobKey] isEqualToString:SPBundleInputSourceBlobHandlingInclude]) + blobHandling = kBlobInclude; + else if([[cmdData objectForKey:SPBundleFileWithBlobKey] isEqualToString:SPBundleInputSourceBlobHandlingImageFileReference]) + blobHandling = kBlobAsImageFile; + else if([[cmdData objectForKey:SPBundleFileWithBlobKey] isEqualToString:SPBundleInputSourceBlobHandlingFileReference]) + blobHandling = kBlobAsFile; + } + + if(blobHandling != kBlobExclude) { + NSString *bundleBlobFilePath = [NSString stringWithFormat:@"%@_%@", SPBundleTaskCopyBlobFileDirectory, uuid]; + [env setObject:bundleBlobFilePath forKey:@"SP_BUNDLE_BLOB_FILES_DIRECTORY"]; + [self setCopyBlobFileDirectory:bundleBlobFilePath]; + } else { + [self setCopyBlobFileDirectory:@""]; + } + if([inputAction isEqualToString:SPBundleInputSourceSelectedTableRowsAsTab]) { - input = [self rowsAsTabStringWithHeaders:YES onlySelectedRows:YES]; + input = [self rowsAsTabStringWithHeaders:YES onlySelectedRows:YES blobHandling:blobHandling]; } else if([inputAction isEqualToString:SPBundleInputSourceSelectedTableRowsAsCsv]) { - input = [self rowsAsCsvStringWithHeaders:YES onlySelectedRows:YES]; + input = [self rowsAsCsvStringWithHeaders:YES onlySelectedRows:YES blobHandling:blobHandling]; } else if([inputAction isEqualToString:SPBundleInputSourceSelectedTableRowsAsSqlInsert]) { input = [self rowsAsSqlInsertsOnlySelectedRows:YES]; } else if([inputAction isEqualToString:SPBundleInputSourceTableRowsAsTab]) { - input = [self rowsAsTabStringWithHeaders:YES onlySelectedRows:NO]; + input = [self rowsAsTabStringWithHeaders:YES onlySelectedRows:NO blobHandling:blobHandling]; } else if([inputAction isEqualToString:SPBundleInputSourceTableRowsAsCsv]) { - input = [self rowsAsCsvStringWithHeaders:YES onlySelectedRows:NO]; + input = [self rowsAsCsvStringWithHeaders:YES onlySelectedRows:NO blobHandling:blobHandling]; } else if([inputAction isEqualToString:SPBundleInputSourceTableRowsAsSqlInsert]) { input = [self rowsAsSqlInsertsOnlySelectedRows:NO]; |