Magik on Java (SW5)

Background

The release of Smallworld 5.0 (SWV) is a game changer for Smallworld and the community. This introduces a whole new realm. GE has combined the power & flexibility of Magik with the wide spread talent pool & existing functionality of Java. However this is a dramatic change to how things are done with Smallworld including, but not limited to, builds, 3rd Party deliveries, Java Interfaces, and more!

Please include your thoughts, experiences, and tricks here for the community to quickly come up to speed with SWV!

Release Specific Pages

Install Information

The install is done thru a JAR file delivered in the ISO file. You run it by double clicking the JAR file or using "java -jar <product>_installer.jar"

Java

From Version 5.1.9 on, newer java releases are required. With Oracle's new Java release restrictions, you need to get your own Java. Here are a few…

Help

Help for 5.0 is only available online with user/password… Kind of good in that it may be kept up to date.. Very bad that you need internet connectivity to access help… Hopefully they will offer a download or something…

The link to 5.0 help is: https://smallworld.gedigitalenergy.com/docs/en/swDocs5.htm

Data Model Upgrades

This link is a chart of releases and the data model upgrades: https://smallworld.gedigitalenergy.com/docs/sw52/en/swDocs5.htm#../Subsystems/Smallworld/Content/ReleaseInfo/UpgradeHistory.htm

Application Help

The Professional Application module does have application help pages that is installed locally at <sw5_install>/core/sw_core/modules/sw_swaf/swaf_professional_application/resources/en_gb/help/Default.htm

Class Documentaion

Class Documentaion that was in the form of CHM files in pre 5 release are no longer available. There is a Enhancement request (CBG00160330) that may re-introduce the documentation somewhere. You can see the class notes (the ## comments before the exemplar definition in Magik files) using the class browser in Emacs. With the *cb* buffer active, you can position your cursor on the class of interest. You will need to open the Family Tree (CB->Family Tree or f3-f), confirm in mini-buffer. This shows the ancestry and hierarchy of the class. The class documentation is at the bottom.

Update March 2017 Cambridge in their mighty wisdom have denied the Enhancement request. So For you to see class comments you must use f3-f in Emacs. I don't know how MDT works with class comments, but if it doesn't, I guess unless you use emacs all the statements in the public comments in the class browser that say "See Class Documentation" are worthless!

Update January 2018 Class Details from the Object Inspector has this information as well. The Object Inspector is loaded with the Development Tools

Update March 2023 As replacement of the chm files you may generate your own html class documentation (including the public class comments) with the following two commands:

sw_module_manager.load_module(:html_class_doc_creator)

html_class_doc_creator.make_files("<target directory>",
:topics_file,sw_module_manager.module(:html_class_doc_creator).get_resource_file("topics.xml",:data),
:include_bad_topics,_true,
:verbose,_true)

More optiones for this commmand, are written in the public comment.
Style sheets for the 'classic' format are available in a SW 4 installation in the directory %SMALLWORLD_GIS%\data\doc\swcore_class_doc
With the paramter ':format, :swift' you may change to the swift format and ask the support for the fitting style sheets. But I didn't see an advantage over the classic variant.

Install Issues

Bad Colors

We have run into an issue with Smallworld 5/Java on a windows 7 virtual machine. When starting Smallworld, the application manager is all distorted and unusable. We have tracked it down to a java issue, but still have no solution. A way to test for correct colors is to open the about Java screen. You can do this from the Smallworld JRE:

sw510\core\jre\x64\bin\javacpl.exe -tab about
We will see something like:
aboutJava.PNG

A solution to this was to up the VM capabilities to 32 bit color. You will need to select 32bit color when connecting thru remote desktop.

Upgrade Information

This link provides additional information for Smallworld 5 Upgrades

Required Code Changes

Be on the Look Out (BOLOs)

BOLOs are upgrade tidbits that may cause problems in SWV that wasn't seen in previous versions

3rd Party BOLOs

Some 3rd Party BOLOs

Configuration

This link provides information for Smallworld 5 Configurations.

Builds

This link provides additional information for Smallworld 5 builds

5.1 Method Changes (at bottom, expand section)
5.2 Method Changes (at bottom)

Database Contexts

There is a new concept of Database Contexts that save the exemplar and join information that used to be save in the open images.

  • For Version 5.1.9+ you use smallworld_product.save_database_context(directory). Typically the directory will be system.getenv("SW_DB_CONTEXT_DIR"). This creates SER files.
  • When remove the SER files, there is an index.txt file that must be removed also. If the SERs don't exist and the index does, you will see a ds_incompatible_database_context error/TB and will be given a prompt to enter the ACE directory.

Sessions

Debugging/Tools

The Eclipsed based MDT is the recommended IDE by GE.

But you can still use Emacs.

There is no more profiling tools delivered in SW5 (xprf in 4.x). A suggested profiling tool is Java VisualVM.

Smallworld 5 Debugging Tips

3rd Party Deliverables

From what I understand 3rd Party Vendors will be delivering JAR files now… <HOW DO WE CREATE JARS?> <WHAT ABOUT RESOURCES?>

Reciprocal Calls Magik from/to Java

There is now a way to call Magik code directly from Java, and I believe Java code directly from Magik. Gone is the requirement of ACPs for Magik-Java functionality! <NEED EXAMPLES OF THIS HERE>

One thing I know of is the fact magik methods can support camel case by using '|' The following is an example, though not 100% positive on the arguments…

_method an_exemplar.|camelCaseMethod|(_gather args)

Viewing JavaDoc JAR Files

Firefox supports opening JavaDoc JAR files with the need to decompress them.. Use the following example in a BAT file next to your javadoc.jar. Don't forget the '!/' at the end!

"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" jar:file:///%~dp0sanselan-0.97-incubator-javadoc.jar!/index.html

Smallworld 5 Coding

This link contains additional coding information specifically associated to Smallworld 5. Magik Language is the page for general magik programming.

Smallworld 5 Bugs

This link contains information about bugs and other issues with Smallworld 5.

Smallworld 5 Compatibility

This link contains information about coding and configuring your source tree to build and compile in both 4.3 and 5.X environments.

Bibliography
1. Jorge Marta
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License