[Zope-CMF] Re: Major action exhancements

Tres Seaver tseaver at zope.com
Sat Mar 6 16:46:09 EST 2004

Andy McKay wrote:
>>>      This way, actions can get arbitrary additional attributes.
>> Do we need arbitrary additional attributes per item?
> Yes so that we can stop the splurge of action like tools like Plone's 
> Control Panel tool to do the same job. By allowing arbitrary attributes 
> you extend any action anyway you like. Really an action is nothing more 
> than a collection of values anyway.
> My personal bug bear and I one we'll probably just implement anyway is:
> - make actions FS based and overrideable in the ZODB (rather like the 
> skins tool). This will make multiple instance deployments so much easier.
> I know there is the portal setup tool that Tres has spoken about for 
> Boston.com, but I'm just really not enjoying my ZODB configuration 
> management as rants on many web sites :)

Extracting that tool from the Boston.com software is likely to be my 
major contribution to CMF 1.5.  I am hopeful that I can find the day or 
so to do that by St. Patrick's day.  Here is a sample of what the action 
tool config looks like now:

<?xml version="1.0"?>
  <action-provider id="portal_membership">
   <action action_id="preferences" title="Preferences"
           condition_expr="member" visible="1"
           permission="View" />
   <action action_id="addFavorite" title="Add to favorites"
portal.portal_membership.getHomeFolder() and object.portal_type != 
'Standalone Palette'"
           visible="1" permission="View" />
   <action action_id="mystuff" title="My Stuff"
           condition_expr="python: member and 
           visible="1" permission="View" />
   <action action_id="favorites" title="My Favorites"
           condition_expr="python: member and 
hasattr(portal.portal_membership.getHomeFolder(), &quot;Favorites&quot;)"
           visible="1" permission="View" />
   <action action_id="addFavorite"
           title="Subscribe to Palette" category="object"
portal.portal_membership.getHomeFolder() and object.portal_type == 
'Standalone Palette'"
           visible="1" permission="View" />
  <!-- snip -->

and the types tool config:

<?xml version="1.0"?>
   <type-info id="Photo"
              kind="Factory-based Type Information" title=""
              icon="photo.gif" meta_type="Original Photo"
              product="BCWorkbench" factory="addOriginalPhoto"
              global_allow="1" filter_content_types="1"
              allowed_content_types="" allow_discussion="0">
    <description>Photos are created by internal staff.</description>
    <action action_id="edit" title="Edit" category="object"
            permission="Modify portal content" visible="1" />
    <action action_id="metadata" title="Metadata"
            permission="Modify portal content" visible="1" />
    <action action_id="scheduling" title="Scheduling"
            category="object" action_expr="scheduling_form"
            permission="Modify portal content" visible="1" />
    <action action_id="preview" title="Preview"
            category="object" action_expr="image_preview"
            permission="View" visible="1" />
   <!-- snip -->

The skins tool exports as something like:

<?xml version="1.0"?>

  <skin-directory id="Images"
                  path="Products/CMFDefault/skins/Images" />
  <skin-directory id="content"
                  path="Products/CMFDefault/skins/content" />
  <skin-directory id="control"
                  path="Products/CMFDefault/skins/control" />
  <skin-directory id="generic"
                  path="Products/CMFDefault/skins/generic" />
  <skin-directory id="no_css"
                  path="Products/CMFDefault/skins/no_css" />
  <skin-directory id="nouvelle"
                  path="Products/CMFDefault/skins/nouvelle" />
  <skin-directory id="zpt_content"
                  path="Products/CMFDefault/skins/zpt_content" />
  <skin-directory id="zpt_control"
                  path="Products/CMFDefault/skins/zpt_control" />
  <skin-directory id="zpt_generic"
                  path="Products/CMFDefault/skins/zpt_generic" />
  <skin-directory id="topic"
                  path="Products/CMFTopic/skins/topic" />
  <skin-directory id="zpt_topic"
                  path="Products/CMFTopic/skins/zpt_topic" />

  <skin-path id="Basic">
     <layer name="custom" />
     <layer name="zpt_topic" />
     <layer name="zpt_content" />
     <layer name="zpt_generic" />
     <layer name="zpt_control" />
     <layer name="topic" />
     <layer name="content" />
     <layer name="generic" />
     <layer name="control" />
     <layer name="Images" />


The workflow tool assumes DCWorkflows, exporting like:
<?xml version="1.0"?>


     <!-- snip -->
     <workflow type="DCWorkflow"
               title="Immediatly available Site Element Workflow">

         <permission name="View" />

       <variables state_variable="state">
         <variable id="user" description="" for_catalog="1"
                   for_status="1" update_always="1"
str(here.portal_membership.getAuthenticatedMember())" />
         <variable id="time" description="" for_catalog="1"
                   for_status="1" update_always="1"
                   default_expression="python: DateTime().ISO()" />


       <states initial="Available">
         <state id="Available" title="" transitions="">
           <permission-map permission="View" acquired="1"



   <chains default="">
     <type name="Article Folder"
           chain="immediately_available_workflow" />
     <!-- snip -->


Scripts for workflows get dumped into workflow-specific directories 
under a 'workflow_scripts' subdirectory.

The role-permission map dumps as:

<?xml version="1.0"?>
     <role name="Member" />
     <role name="Reviewer" />
     <role name="ContentAuthor" />
     <role name="SiteDesigner" />
     <role name="Producer" />
     <role name="TechProducer" />
     <role name="SiteAdmin" />
     <role name="UserAdmin" />
   <permission name="" acquire="1"
               roles="" />

   <permission name="Access Transient Objects" acquire="1"
roles="ContentAuthor,SiteDesigner,Producer,TechProducer,SiteAdmin" />
   <permission name="Access arbitrary user session data" acquire="1"
               roles="UserAdmim" />
   <!-- snip -->

The memberdata tool dumps as:

<?xml version="1.0"?>

     <property name="email" type="string" value="" />
     <property name="portal_skin" type="string" value="" />
     <property name="listed" type="boolean" value="" />
     <property name="login_time" type="date" value="2000/01/01" />
     <property name="last_login_time" type="date" value="2000/01/01" />


And the setup tool's configuration itself:

<?xml version="1.0"?>
   <data-directory id="base" path="base" />
   <data-directory id="common" path="common" />
   <data-directory id="sandbox" path="sandbox" />
   <data-directory id="production" path="production" />
   <data-directory id="public" path="public" />
   <data-directory id="private" path="private" />

   <path id="Sandbox">
     <layer name="common" />
     <layer name="base" />
     <layer name="sandbox" />

   <path id="Public">
     <layer name="common" />
     <layer name="production" />
     <layer name="public" />

   <path id="Private">
     <layer name="common" />
     <layer name="base" />
     <layer name="production" />
     <layer name="private" />

Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com

More information about the Zope-CMF mailing list