[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"?>
<actions-tool>
  <action-provider id="portal_membership">
   <action action_id="preferences" title="Preferences"
           category="user"
           action_expr="string:${portal_url}/personalize_form"
           condition_expr="member" visible="1"
           permission="View" />
   <action action_id="addFavorite" title="Add to favorites"
           category="object"
           action_expr="string:${object_url}/addtoFavorites"
           condition_expr="python: 
portal.portal_membership.getHomeFolder() and object.portal_type != 
'Standalone Palette'"
           visible="1" permission="View" />
   <action action_id="mystuff" title="My Stuff"
           category="user"
 
action_expr="string:${portal/portal_membership/getHomeUrl}/folder_contents"
           condition_expr="python: member and 
portal.portal_membership.getHomeFolder()"
           visible="1" permission="View" />
   <action action_id="favorites" title="My Favorites"
           category="user"
 
action_expr="string:${portal/portal_membership/getHomeUrl}/Favorites/folder_contents"
           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"
           action_expr="string:${object_url}/subscribePalette"
           condition_expr="python: 
portal.portal_membership.getHomeFolder() and object.portal_type == 
'Standalone Palette'"
           visible="1" permission="View" />
  </action-provider>
  <!-- snip -->
</actions-tool>

and the types tool config:

<?xml version="1.0"?>
<types-tool>
   <type-info id="Photo"
              kind="Factory-based Type Information" title=""
              icon="photo.gif" meta_type="Original Photo"
              product="BCWorkbench" factory="addOriginalPhoto"
              immediate_view="image_edit_form"
              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"
            action_expr="image_edit_form"
            permission="Modify portal content" visible="1" />
    <action action_id="metadata" title="Metadata"
            category="object"
            action_expr="generic_metadata_form"
            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" />
   </type-info>
   <!-- snip -->
</types-tool>

The skins tool exports as something like:

<?xml version="1.0"?>
<skins-tool>

  <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" />
  </skin-path>

</skins-tool>


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

   <workflows>

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

         <permission name="View" />
       </permissions>

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

       <worklists>
       </worklists>


       <states initial="Available">
         <state id="Available" title="" transitions="">
           <permission-map permission="View" acquired="1"
 
roles="Anonymous,Authenticated,ContentProducer,Manager,Member,Owner,Reviewer,SeniorProducer" 
/>
         </state>
       </states>

       <transitions>
       </transitions>
     </workflow>

   </workflows>

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

</workflow-tool>

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

The role-permission map dumps as:

<?xml version="1.0"?>
<rolespermissions>
   <roles>
     <role name="Member" />
     <role name="Reviewer" />
     <role name="ContentAuthor" />
     <role name="SiteDesigner" />
     <role name="Producer" />
     <role name="TechProducer" />
     <role name="SiteAdmin" />
     <role name="UserAdmin" />
   </roles>
   <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 -->
</rolespermissions>

The memberdata tool dumps as:

<?xml version="1.0"?>
<memberdata-tool>

     <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" />

</memberdata-tool>

And the setup tool's configuration itself:

<?xml version="1.0"?>
<setup-tool>
   <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>

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

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



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




More information about the Zope-CMF mailing list