Personal tools
You are here: Home Documentation Manuals ArchGenXML 2 - Developers Manual Getting Started Hello World
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

1.4. Hello World

Up one level
Create your first minimal content type with ArchGenXML

Open the UML tool of your choice. Make a new UML model and give it a name HelloWorld. Then add a class diagram (most UML tools do this automatically).

Choose the tool for class creation and add a class to the diagram. Give it a name such as "HelloType" and add an attribute HelloText with type String. The helloworld3.zargo (Plone 3.0) / helloworld25.zargo (Plone 2.5) was created with ArgoUML and contains the type as described above.

Example: HelloWorld with HelloType in UML

Generating the product

Save/export your model as an XMI file with the name MyFirstExample.xmi (or in an XMI-container format like .uml, .zargo or .zuml). Then go to the command line and execute:

  $ archgenxml helloworld.zargo

ArchGenXML will begin code generation. When it completes, you will have a new folder HelloWorld on your file system. Its contents looks like:

  HelloWorld/
  |-- Extensions
  |   |-- Install.py
  |   `-- __init__.py
  |-- __init__.py
  |-- config.py
  |-- configure.zcml
  |-- hellotype.py
  |-- interfaces.py
  |-- profiles
  |       |-- cssregistry.xml
  |       |-- factorytool.xml
  |       |-- import_steps.xml
  |       |-- jsregistry.xml
  |       |-- skins.xml
  |       |-- types
  |       |   `-- HelloType.xml
  |       `-- types.xml
  |-- profiles.zcml
  |-- refresh.txt
  |-- setuphandlers.py
  |-- skins
  |   |-- helloworld_images
  |   |-- helloworld_styles
  |   `-- helloworld_templates
  `-- version.txt

Installing and using the generated product

Move the whole folder HelloWorld to your Zope/Plone 3 instance's Products folder. Restart Zope, open Plone in a browser and log in as Manager. Choose Plone Setup from the personal bar and choose Add/Remove Products. A new product HelloWorld should now appear in the list of products available for install. Choose it and click install. Go to your personal folder. In the list of addable items you'll find the new product as an addable content type. Add a test instance to see if it works.

Plone: HelloType in action

Thats the trick. By the way: the title is always part of the schema. But you can hide it or recycle it later, don't worry

by Jens W. Klein last modified November 15, 2007 - 09:02
Contributors: Jens W. Klein (jensens), Reinout van Rees (reinout), Martin Aspelli (optilude), Harald Frisnegger (frisi), Bernhard Snizek (drzoltron), Richard Amerman (fifer), Torsten Dieter Kuehnel, Encolpe Degoute (encolpe), et al
All content is copyright Plone Foundation and the individual contributors.

>> archgenxml helloworld.zargo

Posted by Taras Bulba at February 28, 2008 - 14:34
Generated HelloWorld does not install :( There is no error messages when i install it.

* Plone 3.0.6
* 2.1.1
* Zope (Zope 2.10.5-final, python 2.4.4, win32)
* Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)]
* PIL 1.1.6

* ArchGenXML 2.0 (Beta release 11)
* Windows Server 2003

I got this in my event.log when i try to install in Plone3.0.5

Posted by lbauer at February 28, 2008 - 18:13
2008-02-28T18:16:26 ERROR Zope.SiteErrorLog http://localhost:8080/lifetest/portal_quickinstaller/installProducts
Traceback (innermost last):
Module Products.CMFQuickInstallerTool.QuickInstallerTool, line 364, in installProduct
- __traceback_info__: ('HelloWorld',)
Module Products.ExternalMethod.ExternalMethod, line 231, in __call__
- __traceback_info__: ((<PloneSite at /lifetest>,), {'reinstall': False}, (False,))
Module C:\Programmer\Plone3\Data\Products\HelloWorld\Extensions\Install.py, line 139, in install
Module Products.GenericSetup.tool, line 218, in setImportContext
Module Products.GenericSetup.tool, line 225, in setBaselineContext
Module Products.GenericSetup.tool, line 230, in applyContextById
Module Products.GenericSetup.tool, line 910, in _getImportContext
KeyError: 'Unknown context ""'


Does not work helloworld3.zargo on Plone

Posted by Jose Rivera Merla at March 24, 2008 - 21:43
It does not appear on the options list of products to install.

My configuration is:
---------------------
Plone Version Overview

* Plone 3.0.6
* 2.1.1
* Zope (Zope 2.10.5-final, python 2.4.4, win32)
* Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)]
* PIL 1.1.6

My ArchGenXML version is:
>archgenxml --version
archgenxml-script.py Version 2.0

And the log report this :
------------------------------
2008-03-24T15:43:39 ERROR Application Couldn't install test
Traceback (most recent call last):
File "C:\Archivos de programa\Plone 3\Zope\lib\python\OFS\Application.py", line 786, in install_product
initmethod(context)
File "C:\Archivos de programa\Plone 3\Data\Products\test\__init__.py", line 124, in initialize
import HelloType
File "C:\Archivos de programa\Plone 3\Data\Products\test\HelloType.py", line 22, in ?
from Products.HelloWorld.config import *

The solution was rename the folder

Posted by Jose Rivera Merla at March 24, 2008 - 23:42
The folder was renamed from "test" to "HelloWorld" and that was the solution. Thanks

How to register skin in Plone Tableless / NuPlone

Posted by Kees Hink at April 20, 2008 - 12:46
I noticed that by default, AGX2 generates a skins.xml containing "<skin-path name="Plone Default">" that registers the skin only in Plone Default. Is there any way (a tagged value on the model, perhaps) to make AGX register the skin in Tableless or NuPlone as well?

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