DocumentPalettes by Adam Hertz (original code), revised by Mike Riggs, edited by Mai Nguyen Overview This palette is a subclass of Control. It shows how to conveniently store files into the database using their absolute pathnames, instead of the data associated with them, and let the Workspace do the work for opening or reading the files. You can also drop a file into the document well, and double-click to open it for reading. Some additional features - The palette's "value" is a full path for a file. Use stringValue and setStringValue: to get and set these. - The palette supports both inbound and outbound dragging (using NXFilenamePBoardType). When inbound dragging happens, it notifies its target. - The palette supports the Database Kit's customAssociation protocol. This is useful for document management applications, where you have filenames stored in a database, along with "metadata" about the documents. How to use this example Ideally, your dbmodel should have a table column of type string which stores some files's absolute pathnames. Quick Demo with DBKit: 1) Load the palette and create a New Application in IB 2) Drag a document icon into the Window 3) Drag a tableview into the Window. Make the tableview editable. 4) Drag a DBModule object into the Objects suitcase, and select a dbmodel to be used for the demo (for ex. OracleDemo, Employee Table, or SybaseDemo, Sale table) 5) Connect some attributes from the DBModule instance to the tableview, for example: (Employee.name, Department.name, Department.location if you are using the OracleDemo.dbmodel) (Sale.orderNumber, titles.notes if you are using SybaseDemo.dbmodel) Ideally, we should have a more meaningful database, where a table attribute will be used to describe the absolute pathname of a certain file. Also make a connection from Department.location to the document icon for OracleDemo, or titles.notes for SybaseDemo. 6) Drag a button into the Window, name it FETCH and make its target action be fetchAllRecords: 7) Fetch all the records. Change the location name by typing some string such as /tmp/console.log. Notice that the edit file icon appears in the document well. If you type a directory name, such as /NextDeveloper/Headers, you'll see the folder icon. Double-click to open that file. Valid for 3.1, 3.2 Change History May 1993 Updated for Release 3.1