Subclassing ATContentTypes with ArchGenXML

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.

removed <<archetype>> and worked

Posted by Ben Best at Oct 10, 2006 02:43 PM
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 Sep 26, 2007 05:21 PM
Where's the diagram? ;)

reordering...

Posted by Reinout van Rees at Sep 29, 2007 11:29 PM
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 Oct 02, 2007 05:31 PM
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/im[…]lla: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 Oct 29, 2007 07:02 PM
sorry, we may integrate it into the new archgenxml 2.0 manual.

have a look here:

Posted by Philipp Wagner at May 19, 2008 03:51 PM

have a look here:

Posted by Mike Takahashi at Jan 02, 2009 04:36 AM
That link no longer works. Here is a link to a more detailed How-to:

https://weblion.psu.edu/[…]/SubclassingAnExistingContentType