Parcel Framework Change Log
August 4, 2004
I switched item copying from attribute-based to cloud-based copying.
July 19, 2004
Parcel reloading is now supported, and a menu item was added. The loader stores a representation of parcel.xml when it's read in, so that if the parcel.xml gets modified on disk, we can tell exactly what attributes to change on each item.
Also, the "defaultValue" attribute has been deprecated in parcel.xml -- the loader will raise an exception if it sees it. Use initialValue instead.
July 5, 2004
John needs a way to assign an item's UUID to an attribute (as opposed to
assigning a reference), so I added a new form of attribute-assignment to
parcel.xml. For example...
<cm:NamedCollection itsName="myColl">
<inclusions uuidOf="foo:bar"/>
</cm:NamedCollection>
..ends up doing...
myColl.addValue('inclusions', fooBarItem.itsUUID)
I also added a unit test for making sure this works. If anyone objects to
the XML syntax for this, please let me know -- I just wanted to get this in
quickly so John could keep moving.
June 29, 2004
- If a kind doesn't have any superKinds , //Schema/Core/Item will be assigned its superKind.
- Local attributes (i.e., those attributes which are children of a kind) are automatically hooked up to their parent kind -- you don't need to explicitly make the assignment to the "attributes" attribute on the kind.
June 25, 2004
- You may now define "templates" consisting of a hierarchy of items, and create copies of these templates where you need them. An example: say you are creating a hierarchy of Block items that implements a complex widget, and you want to define this hierarchy once but have several "instances" of it. In your parcel.xml, create this hierarchy as you normally would, linking parents and children via parentBlock and childrenBlocks. Where you would like an instance of this template, make a reference to it but add copy= like so:
<childrenBlocks itemref="prefix:MyWidget" copy="foo"/>
- The result will be that a copy of MyWidget? will be added to the repository, that copy's repo name will be "foo" and it will be a repo child of the item that requested the copy. The copy will be a "deep" copy, following all attributes whose copyPolicy is "cascade". See an example in the parcel loader unit tests here.
June 21, 2004
- New parcel loader module, moved from repository.parcel to application.Parcel
- New class: application.Parcel.Manager, responsible for loading in parcels and providing lookup service
- Moved class: repository.parcel.Parcel.Parcel is now application.Parcel.Parcel
- Moved method: repository.parcel.Util.PrintItem is now application.Parcel.PrintItem
- New methods for parcel loading and lookup (see epydoc for details)
- Improved error messages
- XML Changes:
- Parcel namespaces -- A parcel may now define a namespace which may be used to refer to the parcel (via XML or in python); the namespace is declared as an attribute of the parcel in XML (<namespace value="http://morgen.com/foo" />, for example).
- Namespace maps -- A parcel may also define a dictionary mapping strings to repository paths, allowing you to create a "flat" XML element namespace out of a hierarchy of items
- itemName has been replaced by itsName (to match the repository API)
- itemref has been shortened to ref (both itemref and ref will work for now, and if people like using ref I will remove itemref)
- A literal value may now be specified using the value= attribute. For example, <cpia:size>3.0</cpia:size> can now be rewritten as <cpia:size value="3.0" />
June 10, 2004
- If you set an attribute's initialValue using <initialValue />, if cardinality is dict you'll set initialValue = { }, for list, [ ]. If you want to set an initialValue for a single-cardinality attribute, be sure to set the type like this: <initialValue type="String" value="" />
May 28, 2004
- Added the ability to set an initialValue of None to an attribute via:
xmlns:core="//Schema/Core" ...
<initialValue ref="core:None" />
Or, if //Schema/Core happens to be your default namespace then you would do it like this:
<initialValue ref="None" />