VASmalltalk – IC’s and headless Seaside apps

Based on the wonderful work of Thomas Koschate about scribteable building systems in VASmalltalk I took his code and used it under VASmalltalk 8.5 to produce headless IC based Seaside applications.

As mentioned in the Instantiations forum there are some changes between 8.03 and VA 8.5, which breaks some code – but the stuff is still general working.

* How to Start *

Copy an unconnected image to image850 directory and start VA – be sure to have NO abt.cnf in this directory. Connect to your repository and then save the image.

Start the IDE again and load the map “Abt Image Startup” (at least version “TK 2011-01-27 – MSK 03). To get a local “abt.cnf” you should execute “AbtStartupApp setUpEnvironment”. Then exit the IDE without saving.

From that time on you will always have “Abt Image Startup” loaded in your starting image – even though you have not save the image: due to abt.cnf.

Whenever you have to start with an unconnected image: remove “abt.cnf” and repeat the steps above.

I did not touch the functionality from Tom, but added a new command line switch: “-z”. This command line is used like ‘-z”[mapName],[className]”‘ (ouf course without $[,$]).

Instead of storing the AbtBuildSpecifications as user objects in the repository I decided to store my source code to create an instance of AbtBuildSpecification on the class side of a Packaging Instruction class (the class, the packager creates when you save your packaging rules).

The original idea from Tom was to give VASmalltalk the (unique) name of a AbtBuildSpecification and this is then loaded from the user objects. Within this object all information are stored to package an image.

Now because I store the specifications as source code I have to give VASmalltalk the information WHERE the packager class is located (the config map) and what the name of the packaging class is.

Via the new switch, the system loads the specified config map, looks for the named class and ask this class for the building specs. After this point, it works the way Tom designed it to do.

Because my work is targeted toward headless system (Seaside) I always need the Server Workbench. Therefore I add the ServerWorkbench as a required map to the config map from the command line.

For each (!) IC you want to build you have to define a config map, which defines the content of the IC AND the required additional content. The whole stuff is loaded into the passive image.

By the way: To create the packaging class for a new IC you have to use the GUI to create the this class. If you have the packaging class you may create the rest to integrate the new IC in the scriptable builing process.

Now in a bat-file I exeute:

del mskXD*.txt
del mskXD*.ic
del mskXD*.snp
abt -z"MSKICInstructions,MSKBaseKernelICInstruction" -fmskXDBaseKernelOut.txt
abt -z"MSKICInstructions,MSKKernelExtensionICInstruction" -fmskXDKernelExtensionsOut.txt
abt -z"MSKICInstructions,MSKAnnouncementICInstruction" -fmskXDAnnouncementOut.txt
abt -z"MSKICInstructions,MSKBaseTCPIPICInstruction" -fmskXDBaseTCPIPOut.txt
abt -z"MSKICInstructions,MSKGreaseLayerICInstruction" -fmskXDGreaselayerOut.txt
abt -z"MSKICInstructions,MSKSSTICInstruction" -fmskXDSstOut.txt
abt -z"MSKICInstructions,MSKSeasideICInstruction" -fmskXDSeasideOut.txt
rem And now the small application
abt -z"MSKICInstructions,MSKBaseComponentICInstructions" -fmskXDBaseComponentOut.txt
abt -z"MSKICInstructions,MSKSeasideExample01ICInstruction" -fmskXDSeasideExampleOut.txt
abt -z"MSKICInstructions,MSKExampleComponentPartA" -fmskXDSeasideComponentAOut.txt

and I get the needed ICs of the base system and my own example application. This will take a while ….

D:\PROGRA~1\INSTAN~1\VASMAL~1\8.5\image850>dir *.ic
 Datenträger in Laufwerk D: ist Volume
 Volumeseriennummer: B8E1-62C3

 Verzeichnis von D:\PROGRA~1\INSTAN~1\VASMAL~1\8.5\image850

29.09.2011  18:20         3.322.132 mskBaseKernel.ic
29.09.2011  18:27             6.992 mskSeasideExample01.ic
29.09.2011  18:22            15.128 mskXDAnnouncement.ic
29.09.2011  18:26             5.664 mskXDBaseComponent.ic
29.09.2011  18:22           154.056 mskXDBaseTCPIP.ic
29.09.2011  18:28             5.692 mskXDExampleComponent01.ic
29.09.2011  18:23           108.284 mskXDGreaseLayer.ic
29.09.2011  18:21           374.252 mskXDKernelExtension.ic
29.09.2011  18:25         2.280.844 mskXDSeaside.ic
29.09.2011  18:24         1.073.752 mskXDSst.ic
              10 Datei(en),      7.346.796 Bytes
               0 Verzeichnis(se), 250.702.229.504 Bytes frei

now I may start my application via:

esvio -imskSeasideExample01.ic

and see the result in my browser at: localhost:7777/mskExample. As I posted in my previous posting: the example simply says hello and demonstrate the ability to load and unload ic’s on the server side.

A remark about the large Seaside IC. I talked with Sebastian Heidbrink about this and he suggested to build a “new” Seaside config map – throwing away all those javascript libraries. Simply due to the fact, that one may use already Apache and let Apache transfer the js-files. That would be a way to go.

There is still lots to do:

– a builing process, which does NOT exit after the creation of the output (at least when packaging XD componentes). Perhaps just destroys the passive image and loads a new one ….

– more information (timestamp) info about the already produced ICs and do NOT create a new one, if the key of the IC has not changed.

etc …..

This entry was posted in Smalltalk and tagged , , . Bookmark the permalink.

One Response to VASmalltalk – IC’s and headless Seaside apps

  1. Tom K says:

    Marten, where can one get this updated image startup code? I’d like like to integrate it with some of my more recent changes.


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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s