Personal tools
You are here: Home Products ArchGenXML Documentation How-tos Subclassing ATContentTypes with ArchGenXML
Document Actions

Subclassing ATContentTypes with ArchGenXML

This How-to applies to: Any version.

Subclassing from ATContentTypes is a common task for which you need to know the magic incantations. Once you know them, it is easy, though.
  • Add a class called ATDocument.
  • Give that ATDocument the stereotypes <<stub>> and <<archetype>>. (Stub makes sure the class isn't actually generated into your project, archetype makes sure that archgenxml knows that it doesn't need to re-add archetypes' BaseContent or BaseFolder class.)

  • Add a tagged value import_from with the value Products.ATContentTypes.content.document.
  • Now you can add your own class and inherit from ATDocument.

All you need to know is in the picture below. You can use the same method for ATImage, ATFolder, etc.

 

UML diagram of subclassing from ATCT

Note: The 1.6 beta ArchGenXML has the ATCT stereotypes (<<atdocument>>, <<atnewsitem>>, etc.) that makes this subclassing really simple.

by Reinout van Rees last modified June 24, 2008 - 19:17

removed <<archetype>> and worked

Posted by Ben Best at October 10, 2006 - 14:43
This works great, except I did have to exclude the <<archetype>> stereotype for my subclassing to work. I subclassed ATFile in order to store the files on the local filesystem by using FileSystemStorage.

great, but ...

Posted by John DeStefano at September 26, 2007 - 17:21
Where's the diagram? ;)

reordering...

Posted by Reinout van Rees at September 29, 2007 - 23:29
iirc, Jens reordered the documentation somewhat. A simple howto cannot contain an image, so I placed the image in an agx tutorial somewhere. Which has apparently been (re)moved :-) I just emailed him to find out where it went.

The 1.6 beta archgenxml has a <<atdocument>>, <<atnewsitem>> etc. stereotype that makes this subclassing REAL simple, btw.

ok

Posted by John DeStefano at October 2, 2007 - 17:31
Please let me know if you do find the image; a quick search didn't turn it up. Oddly, Google seems to have it cached, but clicking on its cached thumbnail image (to view a larger version) results in a 404:

http://images.google.com/imgres?imgurl=http://plone.org/products/archgenxml/documentation/reference-manuals/archgenxml-manual/atct-subclassing.png/image_preview&imgrefurl=http://plone.org/products/archgenxml/documentation/how-to/subclassing-atcontenttypes&h=190&w=368&sz=13&hl=en&start=1&sig2=SvCQ7TqDXI1ibYrLmZ4qag&um=1&tbnid=qF3IbFT1u2-MqM:&tbnh=63&tbnw=122&ei=A4ACR-nEK5nWgALWtOTUAw&prev=/images%3Fq%3DUML%2Bdiagram%2Bof%2Bsubclassing%2Bfrom%2BATCT%26svnum%3D10%26um%3D1%26hl%3Den%26client%3Dfirefox-a%26rls%3Dorg.mozilla:en-US:official%26sa%3DN

... showing a preview is even worse than simply saying "we can't find it!" ;)

mea culpa

Posted by Jens W. Klein at October 29, 2007 - 19:02
sorry, we may integrate it into the new archgenxml 2.0 manual.

have a look here:

Posted by Philipp Wagner at May 19, 2008 - 15:51
http://web.archive.org/web/20070529200105/http://plone.org/products/archgenxml/documentation/reference-manuals/archgenxml-manual/atct-subclassing.png/image_preview

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by