[CMF-checkins] CVS: CMF/CMFCore/tests/base - tidata.py:1.2

Yvo Schubbe schubbe@web.de
Sat, 28 Jun 2003 12:31:53 -0400


Update of /cvs-repository/CMF/CMFCore/tests/base
In directory cvs.zope.org:/tmp/cvs-serv21800/CMFCore/tests/base

Added Files:
	tidata.py 
Log Message:
Merged yuppie-ti_aliases-branch:
- Added Method Aliases to TypeInformation.
- Added __before_publishing_traverse__ to DynamicType.
- Made PortalFolder's 'mkdir' hook an alias.

=== CMF/CMFCore/tests/base/tidata.py 1.1 => 1.2 ===
--- /dev/null	Sat Jun 28 12:31:53 2003
+++ CMF/CMFCore/tests/base/tidata.py	Sat Jun 28 12:31:22 2003
@@ -0,0 +1,197 @@
+ManageProperties = 'Manage properties'
+ModifyPortalContent = 'Modify portal content'
+View = 'View'
+
+FTIDATA_ACTIONS = (
+      { 'id' : 'Action Tests'
+      , 'meta_type' : 'Dummy'
+      , 'actions' : (
+            { 'id':'view',
+              'name':'View',
+              'action':'string:',
+              'permissions':('View',),
+              'category':'object',
+              'visible':1 }
+          , { 'name':'Edit',                    # Note: No ID passed
+              'action':'string:${object_url}/foo_edit',
+              'permissions':('Modify',),
+              'category':'object',
+              'visible':1 }
+          , { 'name':'Object Properties',       # Note: No ID passed
+              'action':'string:foo_properties',
+              'permissions':('Modify',),
+              'category':'object',
+              'visible':1 }
+          , { 'id':'slot',
+              'action':'string:foo_slot',
+              'category':'object',
+              'visible':0 }
+          )
+      }
+    ,
+    )
+
+FTIDATA_DUMMY = (
+      { 'id' : 'Dummy Content'
+      , 'title' : 'Dummy Content Title'
+      , 'meta_type' : 'Dummy'
+      , 'product' : 'FooProduct'
+      , 'factory' : 'addFoo'
+      , 'actions' : (
+            { 'name':'View',
+              'action':'string:view',
+              'permissions':('View',) }
+          , { 'name':'View2',
+              'action':'string:view2',
+              'permissions':('View',) }
+          , { 'name':'Edit',
+              'action':'string:edit',
+              'permissions':('forbidden permission',) }
+          )
+      }
+    ,
+    )
+
+FTIDATA_CMF14 = (
+      { 'id' : 'Dummy Content 14'
+      , 'meta_type' : 'Dummy'
+      , 'description' : (
+           'Dummy Content.')
+      , 'icon' : 'dummy_icon.gif'
+      , 'product' : 'FooProduct'
+      , 'factory' : 'addFoo'
+      , 'immediate_view' : 'metadata_edit_form'
+      , 'actions' : (
+            { 'id':'view',
+              'name':'View',
+              'action':'string:${object_url}/dummy_view',
+              'permissions':(View,) }
+          , { 'id':'edit',
+              'name':'Edit',
+              'action':'string:${object_url}/dummy_edit_form',
+              'permissions':(ModifyPortalContent,) }
+          , { 'id':'metadata',
+              'name':'Metadata',
+              'action':'string:${object_url}/metadata_edit_form',
+              'permissions':(ModifyPortalContent,) }
+          )
+      }
+    ,
+    )
+
+FTIDATA_CMF14_FOLDER = (
+      { 'id' : 'Dummy Folder 14'
+      , 'meta_type' : 'Dummy Folder'
+      , 'description' : (
+           'Dummy Folder.')
+      , 'icon' : 'dummy_icon.gif'
+      , 'product' : 'FooProduct'
+      , 'factory' : 'addFoo'
+      , 'filter_content_types' : 0
+      , 'immediate_view' : 'dummy_edit_form'
+      , 'actions' : (
+            { 'id':'view',
+              'name':'View',
+              'action':'string:${object_url}',
+              'permissions':(View,),
+              'category':'folder' }
+          , { 'id':'edit',
+              'name':'Edit',
+              'action':'string:${object_url}/dummy_edit_form',
+              'permissions':(ManageProperties,),
+              'category':'folder' }
+          , { 'id':'localroles',
+              'name':'Local Roles',
+              'action':'string:${object_url}/folder_localrole_form',
+              'permissions':(ManageProperties,),
+              'category':'folder' }
+          )
+      }
+    ,
+    )
+
+FTIDATA_CMF14_SPECIAL = (
+      { 'id' : 'Dummy Content 14'
+      , 'meta_type' : 'Dummy'
+      , 'description' : (
+           'Dummy Content.')
+      , 'icon' : 'dummy_icon.gif'
+      , 'product' : 'FooProduct'
+      , 'factory' : 'addFoo'
+      , 'immediate_view' : 'metadata_edit_form'
+      , 'actions' : (
+            { 'id':'download',
+              'name':'Download',
+              'action':'string:${object_url}/',   # Note: special default view
+              'permissions':(View,) }
+          , { 'id':'edit',
+              'name':'Edit',
+              'action':'string:${object_url}/dummy_edit_form',
+              'permissions':(ModifyPortalContent,) }
+          , { 'id':'view',                  # Note: not first with 'View' perm
+              'name':'View',
+              'action':'string:${object_url}/dummy_view',
+              'permissions':(View,) }
+          , { 'id':'metadata',
+              'name':'Metadata',
+              'action':'string:${object_url}/metadata_edit_form',
+              'permissions':(ModifyPortalContent,) }
+          , { 'id':'mkdir',
+              'name':'MKDIR handler',
+              'action':'string:dummy_mkdir',
+              'category':'folder',
+              'visible':0 }
+          )
+      }
+    ,
+    )
+
+FTIDATA_CMF15 = (
+      { 'id' : 'Dummy Content 15'
+      , 'meta_type' : 'Dummy'
+      , 'description' : (
+           'Dummy Content.')
+      , 'icon' : 'dummy_icon.gif'
+      , 'product' : 'FooProduct'
+      , 'factory' : 'addFoo'
+      , 'immediate_view' : 'metadata.html'
+      , 'aliases' : {
+           '(Default)':'dummy_view',
+           'view':'dummy_view',
+           'view.html':'dummy_view',
+           'edit.html':'dummy_edit_form',
+           'metadata.html':'metadata_edit_form'}
+      , 'actions' : (
+            { 'id':'view',
+              'name':'View',
+              'action':'string:${object_url}/view.html',
+              'permissions':(View,) }
+          , { 'id':'edit',
+              'name':'Edit',
+              'action':'string:${object_url}/edit.html',
+              'permissions':(ModifyPortalContent,) }
+          , { 'id':'metadata',
+              'name':'Metadata',
+              'action':'string:${object_url}/metadata.html',
+              'permissions':(ModifyPortalContent,) }
+          )
+      }
+    ,
+    )
+
+
+STI_SCRIPT = """\
+## Script (Python) "addBaz"
+##bind container=container
+##bind context=context
+##bind namespace=
+##bind script=script
+##bind subpath=traverse_subpath
+##parameters=container, id
+##title=
+##
+product = container.manage_addProduct['FooProduct']
+product.addFoo(id)
+item = getattr(container, id)
+return item
+"""