Exporting .dat files
You must also export a map that contains the edit-time and runtime applications for your part. You can export more than one map if you want to, but the following example uses only one map:
1. In the Organizer, from the Tools menu, select Configuration Maps. This opens a Configuration Maps Browser. If you have already created a map, select it, and open a new edition by selecting Create New Edition from the Editions menu. If you have not already created a map, create one and include your applications in it.
2. In the map, release the final editions of your applications. Do this by selecting each application name, and then selecting Release Other from the Applications menu.
3. Before you can version a map, you must load it at least once. Load the open edition of the map, by selecting Load from the Editions menu. To version the map, select Version from the Editions menu, and enter the version number you want to use.
It's easy to test your work up to this point. Save your image and then unload your test applications, edit-time application, and runtime application. (If your prerequisites are correctly set, you can unload your configuration map instead.) Be sure to do it in this order or you will not be able to unload one of the applications due to other applications having a dependency on the application you're unloading. Inspect the Smalltalk dictionary. Your pool dictionary will be gone as it was removed by the removing method you implemented earlier. Now load your configuration map. Your pool dictionary will be added to the Smalltalk dictionary and your parts will be present on the parts palette. Load your test application again, or restore the image you saved earlier, and you'll be back where you started.
4. Create a new, empty library. In the Organizer, from the Options menu select Library > Create New. Use the file dialog that is displayed to select a name for the new library. Use .dat as the file extension.
5. If you want to hide the source code, follow these steps:
a. For each application, build a dictionary that describes which classes and methods you want to hide. For example, to hide all of the classes and methods in MyRunSamplePartsApp, run code like the following:
b. | aDict |
c. "Hide all of the classes and methods"
d. aDict := Dictionary new.
e. MyRunSamplePartsApp classes do: :cls |
f. aDict at: cls symbol put: nil].
g. MyRunSamplePartsApp removeSourceStructure: aDict.
The key of each dictionary element is a symbol representing the name of the class. If you want to hide all of the methods for the class, set the value of each dictionary element to nil, as shown.
If you only want to hide certain methods, set the value of each dictionary element to be an association. The key of the association is an array of the instance method names to hide, and the value of the association is an array of the class method names to hide. Here is an example:
| aDict |
"Hides the source code for the start and stop instance methods
and the displayName class method."
aDict := Dictionary new.
aDict at: #MyTimer
put: (Association
key: (Array with: #start with: #stop)
value: (Array with: #displayName)).
MyRunSamplePartsApp removeSourceStructure: aDict.
h. Return to the Configuration Maps Browser, and select the Names menu. Select Settings, and then select Remove Source.
6. Export your map to the new library by selecting Export from the Names menu.
7. Select the .dat file into which you are exporting your map.
Your source code will now be hidden whenever it is imported into a manager which does not contain the original source code.
Last modified date: 05/14/2020