Part 10: Building for the Future

Normally, the creation of a passive image in VA Smalltalk is accomplished by choosing “New Image…” from the XD menu of the transcript window. This then opens the dialog where we set several things.

One of the first things we need to know is the target environment. Current versions of VA Smalltalk only support two, Windows and UNIX (the last vestiges of support for a third operating system were dropped recently). Knowing the environment controls the list of image features that can be installed, and the selection of features controls the available subsystem types.

It’s a truly lovely dialog, but it suffers from an important flaw: every last scrap of logic to drive this dialog lives within the user interface, in the class EtImagePropertiesDialog. If someone has a time machine, please go back to 1996 and slap the author of this monstrosity upside the head…

Meanwhile, back in the present, I dug into how a passive image was created based on the selections made in the dialog. Luckily I only had to create one kind of passive image, so I took the expedient approach of scripting the creation of my build specifications.

Target platforms are the subclasses of EmImageType. You can ask EmImageType for #defaults to get a valid list (it answers instances of those classes), and each of those instances knows its #possibleFeatures, which are subclasses of AbtAbstractXDFeature. Each of those features knows its possible subsystems based on the image type.

Now, you need to think back to Part 6, where I introduced the “-c” command line parameter to load the latest version or edition of a config map, with the “-t” modifier to specify whether we want to load a version, edition or any instance of the map we can find. For an XD package, we need to consider two config maps, the one containing the packaging instructions and maps to load the Server Workbench, and the one containing the application code.

For a simple, non-XD image, we can create a build specification with a script like this:

AbtBuildSpecification new
name: 'GBS Client';
mapName: 'GBS Client';
mapType: 'Any';
packagingInstructions: #GbsStorageClientPackagingInstructions;

Or an XD image like this:

AbtBuildSpecification new
name: 'Headless Server';
mapName: 'Headless Packaging';
mapType: 'Any';
packagingInstructions: #AvServersHeadlessPackagingInstructions;
xdEnvironment: 'UNIX';
xdMap: 'Headless Servers';
xdMapType: 'Any';
xdImageSubsystems: ( (LookupTable new)
at: 'CFS' put: 'POSIX';
at: 'CLDT' put: 'ES';
at: 'CLIM' put: 'ES';
at: 'CPM' put: 'ES';
at: 'OS' put: 'UNIX';
at: 'SCI' put: 'UNIX';
at: 'XDDB' put: 'UNIX';
xdImageFeatures: #(#AbtTCPIPFeature #AbtDatabaseDb2CliFeature #AbtDatabaseOdbcFeature #AbtLanguageFeature #AbtSstFeature #AbtWebServicesFeature #AbtSstWebFeature #AbtWebConnFeature #AbtXmlCommunicationsFeature #AbtXmlFeature);

I’ve actually stored all of these in my Script Manager (load the config map “Mastering ENVY/Developer Script Manager”) for easy rebuilding. If you decide to do the same thing, you might want to change the direct class reference to AbtBuildSpecification to an indirect reference such as “Smalltalk at: #AbtBuildSpecification” in case you open the Script Manager in an image that doesn’t have that class loaded.

At this point, we’ve created a build specification, and even saved it somewhere. Next time, we’ll look at how to get it back, and what to do with it.

P.S. Yes, I know the map type string is inconsistent with the command line parameter. One of these days, I’ll fix that and also a couple of refactoring opportunities, but I was holding off on that until I got around to developing a UI for build specification creation.


0 Responses to “Part 10: Building for the Future”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: