ArchGenXML 1.6

Here is where we will gather notes about what we need to do to move to using the newer version of AGX that's intended to support Plone 2.5/3.0, instead of the Plone 2.5-and-before versions we've been using up till now. We're looking at this in the context of ticket #301.

At present, we have to get this from SVN as there is no release yet.

Installation

  • AGX has switched with 1.6 to using setuptools, so:
    • The setuptools-based install requires setuptools >=0.6c3 or the install will error off
    • Note: this switch will clobber/obviate user of the "agxit" scripts we've been customizing and putting in our ProductName?/utils directories, but that's no big deal (see the section on Running AGX below)
  • AGX now has a zope 3.3 / zope 2.10 dependency, though this will not prevent a successful install. On run, AGX will complain if it can't find the libraries it needs and will tell you what to do, but here's what I had to do:
    • Get and install Zope 3.3 or 2.10 (there's no winders installer available yet for 2.10.3 so go for http://www.zope.org/Products/Zope3/3.3.1) and then use that python when installing AGX so that it automatically finds the right libraries. Alternatively, tell AGX where to look for the high-end zope by creating a .agx_zope_path file in your user directory.

Run

  • The install script successfully creates an "archgenxml" script on the execution path, so this does fire up agx (output is written in a subdirectory of the current directory, named according to the model name encoded in the UML):
archgenxml TryMyProduct/models/TryMyProduct.xmi

What's Different

Running the new AGX on an old product and then diffing against the version generated with the previous AGX reveals the following differences:

  • __init__.py
    • import logging and set up a logger, instead of using the deprecated zLOG import
    • put import of os and os.path higher in the file
    • from Products.CMFCore import permissions as cmfpermissions instead of from Products.CMFCore import CMFCorePermissions
    • from config import * instead of from Products.ProductName.config import *
    • eliminate code that attempts to apply a customization policy for the product
  • config.py
    • from Products.CMFCore.permissions import setDefaultRoles instead of from Products.CMFCore.CMFCorePermissions import setDefaultRoles
  • content/TypeName.py (note: this assumes that content types are defined in the UML inside a package called "content")
    • no longer writes text from tagged value "documentation" on a field as a comment before the field definition in the schema definition ... this text no longer appears anywhere in the output file ... maybe we're supposed to use the documentation tab in argo instead of this tagged value?
      • the "documentation" tagged value has been eliminated; it has been removed from TaggedValueSupport?.py
  • Extensions/Install.py
    • the install and uninstall methods have an additional parameter (reinstall), with a default value of False
    • when attempting to install dependencies (as defined in config.py of the generated product), instead of using get_transaction().commit(1), we import transaction then call transaction.savepoint(optimistic=True)
    • when attempting to install product-specific stylesheets (as defined in config.py of the generated product), instead of using portal_css.manage_addStylesheet(**defaults) we use portal_css.registerStylesheet(**defaults)
    • error handling for a TypeError? added when attempting a custom install or uninstall (if there is a AppInstall.py file for the product)