Server Guide : Packaging server applications : Packaging a Smalltalk image : Example: Seaside HelloWorld Single Module Packaging
Example: Seaside HelloWorld Single Module Packaging
In this example illustrates the packaging of the Seaside Hello World configuration map (shipped with VA Smalltalk) into a single runtime image. The purpose of this example is to show the basic use of the packager in the context of headless or cross platform development with a more realistic, Seaside-based example. It uses already generated packaging instructions.
Seaside Hello World writes text and the time to a website. The example has no desktop user interface to control what is written or where it is written and is therefore headless.
The Packaging Steps start with a shipped image. Here the steps are repeated with links to how to accomplish each step. Steps unique to cross platform packaging appear in bold.
Launch a clean development image.
Load ‘ST: Server, SST’ feature.
Notice that choosing to load ‘ST: Server, SST’ also selects ‘ST: Server Workbench, Base’ feature for loading. Once the feature is loaded, the Transcript has a new pulldown menu named XD.
Load the packaging instructions.
Use SeasideHelloWorldPackagingInstructions, the predefined packaging instructions for Seaside Hello World, found in the configuration map named ENVY/XD Examples.
Load SeasideHelloWorldPackagingInstructionsApp from ENVY/XD Examples into the development image.
Create the passive (XD) image for the Windows platform.
Create a new passive image making sure to load ‘Server Smalltalk Seaside’ as one of the installed features. This is the XD counterpart of the development image feature ‘ST: Server Smalltalk (SST) – Seaside’. It is available because ‘ST: Server, SST’ is loaded in the development image.
Note: The XD pulldown menu has a new entry after the Development menu item.
Note
If you have a Linux installation as well as a Windows installation, you could choose to package for Linux. If you do, you must also test on Linux.
If the new passive image is not the current one, make it the current image. (See how.)
In the passive image:
Load the Seaside Hello World Configuration Map. (See how.). If it loads without error, continue packaging.
Save the image from the XD Transcript. This saves the passive image together with the development image.
Start the packager from the XD Transcript. (See how.)
Choose the existing instructions from the Instructions in Database.
Choose the radio button Show application hierarchy.
Open the SeasideHelloWorldPackagingInstructionsApp by double clicking it.
Select AbtXDHelloWorldSeasidePackagingInstructions.
At this point it would be informative to take note of the high level differences in the packaging instructions introduced due to the fact that the headless application relies on Seaside. Following the link to “modify” will allow you to see what settings the simple “Hello World” example required. Choose modify step to see the instructions:
observe the SeasideHelloWorld Application is included,
observe the startup class is AbtHeadlessRuntimeStartup and
observe the startup code and
observe seasideHelloWorld.icx is the output file.
Reduce.
Output the reduced runtime image.
Close the packager.
However, you could skip the detailed steps above and simply click Finish and close the packager.
Make the development image the current one. (See how.)
Optionally, save the image. This step is needed to preserve information generated during packaging including information which allows the image to be identified as the one which generated the packaged image. However, it also puts the passive image into state that, in a less restricted case than this example, may prove troublesome. Best practice is not to save the image.
Close the image from the Transcript.
Look at the directory in which you started the development image. You should see seasideHelloWorld.icx. This is the single packaging module, aka the runtime image. The packaging process also creates SEASIDEHELLOWORLD.SNP, and several packaging statistics files (with ES extensions), which are useful in debugging but not required to run the packaged image.
The next thing to do is run the packaged image.
Last modified date: 11/15/2019