GenericSetup support

Wichert Akkerman <[email protected]> Tue, 9 May 2006 17:17:02 +0200
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Message-ID <[email protected]>
Hi guys,

I've just finished (aside from writing unit tests) the first bit of
GenericSetup support for Archetypes. It only implements importing and
exporting the catalog map for archetype_tool and creating said tool,
but it is a good start.

Currently the extension profile is not very useful since it is missing a
few things:

- creation of the extra catalogs; due to a current limitation in
  GenericSetup this is not possible; once that has been solved it is
  trivial to add that as well.
- registration of the skins and templates
- installation of dependencies; they should be GenericSetup-ized as well

The export/import step for the archetype tool can also be used by registering
it in your base profile. If you want to play with it get the
wichert-genericsetup branch from Archetypes and apply this patch
against CMFPlone 2.5/3.0:

Index: profiles/default/import_steps.xml
===================================================================
--- profiles/default/import_steps.xml   (revision 9682)
+++ profiles/default/import_steps.xml   (working copy)
@@ -138,4 +138,11 @@
     <dependency step="content" />
     Final Plone configuration
   </import-step>
+  <import-step id="archetypetool"
+         version="20060509-01"
+         handler="Products.Archetypes.exportimport.archetypetool.importArchetyp
eTool"
+         title="Archetype Tool">
+         Import Archetype type specific configuration.
+  </import-step>
+
 </import-steps>
Index: profiles/default/export_steps.xml
===================================================================
--- profiles/default/export_steps.xml   (revision 9682)
+++ profiles/default/export_steps.xml   (working copy)
@@ -209,4 +209,10 @@
               title="Content Type Registry">
   Export content type registry's predicates / bindings.
  </export-step>
+ <export-step id="archetypetool"
+        handler="Products.Archetypes.exportimport.archetypetool.exportArchetype
Tool"
+        title="Archetype Tool">
+        Export Archetype type specific configuration.
+ </export-step>
+
 </export-steps>


This feature is useful for packages that have content types that require
types to be cataloged in multiple catalogs. As an example the Ploneboard
product does this with this little bit of XML:

<?xml version="1.0"?>
<archetypetool>
  <catalogmap>
    <type meta_type="Ploneboard">
      <catalog value="portal_catalog"/>
      <catalog value="ploneboard_catalog"/>
    </type>
    <type meta_type="PloneboardComment">
      <catalog value="portal_catalog"/>
      <catalog value="ploneboard_catalog"/>
    </type>
    <type meta_type="PloneboardConversation">
      <catalog value="portal_catalog"/>
      <catalog value="ploneboard_catalog"/>
    </type>
    <type meta_type="PloneboardForum">
      <catalog value="portal_catalog"/>
      <catalog value="ploneboard_catalog"/>
    </type>
  </catalogmap>
</archetypetool>

Once the unittests are in I'ld like to merge this back into the 1.4
branch if there are no objections.


Wichert.

-- 
Wichert Akkerman <[email protected]>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642