ArchGenXML Reference Card
ArchGenXML Reference Card
Standard Elements
Stereotypes
« stub »
Applies to: Package, Class, Attribute, Method
By giving your class the « stub » stereotype, you can prevent it from being generated at all.
This is useful if you wish to show content types which are logically part of your model, but which do not belong to your product.
For instance, you could create a stub for Plone's standard Image type if you wish to include this as an aggregated object inside your content type - that is, your content type will become folderish, with Image as an allowable contained type.
Constraints
Tagged Values
widget:description_msgid
Override the default description message id (i18n).
widget
Applies to: LinkEnd, Attribute
Applies to : LinkEnd
widget:label
Set the label of a widget.
widget:description
Set the widget's description.
widget:label_msgid
Override the default label message id (i18n).
widget:i18n_domain
Set the i18n domain (defaults to the product name).
widget:type
The name of your chosen widget type, such as StringWidget or SelectionWidget.
default:widget:FIELDNAMEABBREVIATION
To change a the widget used for one field-type for the whole model, a product, a package or just for all fields in one class you can set on mode, product, package or class level the tagged value default:widget:FIELDNAMEABBREVIATION to WIDGETNAME.
For example use the tagged value default:widget:Reference and set it to ReferenceBrowserWidget to use the ReferenceBrowserWidget instead of the ReferenceWidget.
imports
Applies to : Package, Class
Additional python packages imports lines.
For a Package, imports statements will be added for each enclosed Class.
# from ReferenceCard/ReferenceCardPackage/ClassA.py # additional imports from ATReferenceBrowserWidget.ATReferenceBrowserWidget import ReferenceBrowserWidget
Comment
Its only utility is in UML modeller : your diagram will me easily to read if well-commented.
Interface
Interfaces are a way of formally documenting the public interface to your code. By convention, they are usually in the interfaces package (see below).
Interfaces do not have most of the added fluff that content types do - they do not even have method bodies.
They do, however, have extensive documentation.
A class is said to "realise" an interface when it provides implementations for the methods defined in the interface.
The UML realisation arrow (a dotted line with an empty arrowhead) will ensure that your content types are linked to the correct interfaces by way of the __implements__ class attribute.
Name
Model
Name
Package
Bring order to your code.
Packages are both a UML concept and a Python concept.
In Python, packages are directories under your product containing a set of modules (.py files).
In UML, a package is a logical grouping of classes, drawn as a large "folder" with classes inside it.
To modularise complex products, you should use packages to group clases together.
Name
Class
Name
Tagged Values
import_from
Derive from other Product.
If you want to derive from a class of an other product create a stub class with a tagged value 'import_from': This will generate a import line from VALUE import CLASSNAME in classes derived from this class.
base_class
All content types in Archetypes are derived from one of the base classes - BaseContent, BaseFolder, OrderedBaseFolder and so on.
If you wish to turn this off, for example because the base class is being inherited from a parent class, you can set the base_class tagged value to 0.
Stereotypes
<>
A portal tool is a unique singleton which other objects may find via getToolByName and utilise.
There are many tools which ship with Plone, such as portal_actions or portal_skins.
Method
To create a method in your class, add a method to the UML diagram, with the desired parameters. The types of the parameters and the type of the return value are ignored, since Python does not support this.
Stereotypes
Archetypes uses actions and forms for generating custom tabs for accessing data of an Archetype object.
ArchGenXML can generate actions and forms for you: Just define a method without any parameters and set its stereotype accordingly.
<