[Checkins] SVN: Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/ - checking in actions link target work

Jens Vagelpohl jens at dataflake.org
Fri May 15 09:56:24 EDT 2009


Log message for revision 99979:
  - checking in actions link target work
  

Changed:
  U   Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/ActionInformation.py
  U   Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/ActionProviderBase.py
  U   Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/TypesTool.py
  U   Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/dtml/editToolsActions.dtml
  U   Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/exportimport/tests/test_actions.py
  U   Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/exportimport/tests/test_typeinfo.py
  U   Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/exportimport/typeinfo.py
  U   Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_ActionInformation.py
  U   Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_ActionProviderBase.py
  U   Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_ActionsTool.py
  U   Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_TypesTool.py

-=-
Modified: Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/ActionInformation.py
===================================================================
--- Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/ActionInformation.py	2009-05-15 13:54:35 UTC (rev 99978)
+++ Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/ActionInformation.py	2009-05-15 13:56:23 UTC (rev 99979)
@@ -74,6 +74,7 @@
     implements(IAction)
 
     i18n_domain = 'cmf_default'
+    link_target = ''
 
     security = ClassSecurityInfo()
 
@@ -92,6 +93,8 @@
          'label': 'Condition (Expression)'},
         {'id': 'permissions', 'type': 'multiple selection', 'mode': 'w',
          'label': 'Permissions', 'select_variable': 'possible_permissions'},
+        {'id':'link_target', 'type': 'string', 'mode':'w',
+         'label':'Link Target'},
         {'id': 'visible', 'type': 'boolean', 'mode': 'w',
          'label': 'Visible?'},
         )
@@ -109,6 +112,7 @@
         self._setPropValue( 'icon_expr', kw.get('icon_expr', '') )
         self._setPropValue( 'available_expr', kw.get('available_expr', '') )
         self._setPropValue( 'permissions', kw.get('permissions', () ) )
+        self._setPropValue( 'link_target', kw.get('link_target', '') )
         self._setPropValue( 'visible', kw.get('visible', True) )
 
     def _setPropValue(self, id, value):
@@ -177,6 +181,7 @@
             self.data.setdefault( 'category', 'object' )
             self.data.setdefault( 'visible', True )
             self.data['available'] = True
+            self.data.setdefault('link_target', '')
         else:
             # if action isn't a dict, it has to implement IAction
             (lazy_map, lazy_keys) = action.getInfoData()
@@ -263,6 +268,7 @@
                 , visible=True
                 , action=''
                 , icon_expr=''
+                , link_target=''
                 ):
         """ Set up an instance.
         """
@@ -276,6 +282,7 @@
                  , visible
                  , action
                  , icon_expr
+                 , link_target
                  )
 
     security.declarePrivate('edit')
@@ -290,6 +297,7 @@
             , visible=_unchanged
             , action=_unchanged
             , icon_expr=_unchanged
+            , link_target=_unchanged
             ):
         """Edit the specified properties.
         """
@@ -322,6 +330,8 @@
             if icon_expr and isinstance(icon_expr, basestring):
                 icon_expr = Expression(icon_expr)
             self.setIconExpression(icon_expr)
+        if link_target is not _unchanged:
+            self.link_target = link_target
 
     security.declareProtected( View, 'Title' )
     def Title(self):
@@ -453,6 +463,12 @@
         """
         return bool(self.visible)
 
+    security.declarePublic('getLinkTarget')
+    def getLinkTarget(self):
+        """ Return the rendered link tag's target attribute value
+        """
+        return self.link_target
+
     security.declarePrivate('getMapping')
     def getMapping(self):
         """ Get a mapping of this object's data.
@@ -466,7 +482,8 @@
                  'permissions': self.permissions,
                  'visible': bool(self.visible),
                  'action': self.getActionExpression(),
-                 'icon_expr' : self.getIconExpression() }
+                 'icon_expr' : self.getIconExpression(),
+                 'link_target' : self.getLinkTarget() }
 
     security.declarePrivate('clone')
     def clone( self ):

Modified: Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/ActionProviderBase.py
===================================================================
--- Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/ActionProviderBase.py	2009-05-15 13:54:35 UTC (rev 99978)
+++ Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/ActionProviderBase.py	2009-05-15 13:56:23 UTC (rev 99979)
@@ -182,6 +182,7 @@
                  , category
                  , visible=1
                  , icon_expr=''
+                 , link_target=''
                  , REQUEST=None
                  ):
         """ Add an action to our list.
@@ -205,6 +206,7 @@
                                       , visible=bool(visible)
                                       , action=action
                                       , icon_expr=icon_expr
+                                      , link_target=link_target
                                       )
 
         new_actions.append( new_action )
@@ -332,6 +334,7 @@
         category    = str( properties.get( 'category_%d'    % index, '' ))
         visible     = bool( properties.get('visible_%d'     % index, False) )
         permissions =      properties.get( 'permission_%d'  % index, () )
+        link_target = str( properties.get( 'link_target_%d' % index, '' ) )
 
         if not title:
             raise ValueError('A title is required.')
@@ -350,6 +353,7 @@
                                 , category=category
                                 , visible=visible
                                 , icon_expr=icon_expr
+                                , link_target=link_target
                                 )
 
     def _getOAI(self, object):

Modified: Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/TypesTool.py
===================================================================
--- Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/TypesTool.py	2009-05-15 13:54:35 UTC (rev 99978)
+++ Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/TypesTool.py	2009-05-15 13:56:23 UTC (rev 99979)
@@ -99,6 +99,8 @@
     _advanced_properties = (
         {'id': 'add_view_expr', 'type': 'string', 'mode': 'w',
          'label': 'Add view URL (Expression)'},
+        {'id': 'link_target', 'type': 'string', 'mode': 'w',
+         'label': 'Add view link target'},
         {'id':'immediate_view', 'type': 'string', 'mode':'w',
          'label':'Initial view name'},
         {'id':'global_allow', 'type': 'boolean', 'mode':'w',
@@ -128,6 +130,7 @@
     allowed_content_types = ()
     allow_discussion = False
     global_allow = True
+    link_target = ''
 
     def __init__(self, id, **kw):
 
@@ -161,6 +164,7 @@
                 , category=action.get('category', 'object')
                 , visible=action.get('visible', True)
                 , icon_expr=action.get('icon_expr', '')
+                , link_target=action.get('link_target', '')
                 )
 
         self.setMethodAliases(kw.get('aliases', {}))
@@ -376,6 +380,7 @@
             lazy_keys.append('icon')
         else:
             lazy_map['icon'] = ''
+        lazy_map['link_target'] = self.link_target
         lazy_map['visible'] = True
         lazy_map['available'] = self._checkAvailable
         lazy_map['allowed'] = self._checkAllowed

Modified: Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/dtml/editToolsActions.dtml
===================================================================
--- Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/dtml/editToolsActions.dtml	2009-05-15 13:54:35 UTC (rev 99978)
+++ Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/dtml/editToolsActions.dtml	2009-05-15 13:56:23 UTC (rev 99979)
@@ -108,6 +108,21 @@
 <td></td>
 <td>
   <div class="form-label">
+  Link target
+  </div>
+</td>
+<td>
+  <div class="form-element">
+  <input type="text" name="link_target_&dtml-index;" value="&dtml-link_target;" size="80"/>
+  </div>
+</td>
+</tr>
+
+
+<tr>
+<td></td>
+<td>
+  <div class="form-label">
   Permission
   </div>
 </td>
@@ -262,6 +277,20 @@
 <td></td>
 <td>
   <div class="form-label">
+  Link target
+  </div>
+</td>
+<td>
+  <div class="form-element">
+  <input type="text" name="link_target" value="" size="80" />
+  </div>
+</td>
+</tr>
+
+<tr>
+<td></td>
+<td>
+  <div class="form-label">
   Permission
   </div>
 </td>

Modified: Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/exportimport/tests/test_actions.py
===================================================================
--- Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/exportimport/tests/test_actions.py	2009-05-15 13:54:35 UTC (rev 99978)
+++ Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/exportimport/tests/test_actions.py	2009-05-15 13:56:23 UTC (rev 99979)
@@ -43,6 +43,7 @@
  <property name="icon_expr"></property>
  <property name="available_expr">python:1</property>
  <property name="permissions"/>
+ <property name="link_target"></property>
  <property name="visible">True</property>
 </object>
 """
@@ -57,6 +58,7 @@
   <property name="icon_expr"></property>
   <property name="available_expr"></property>
   <property name="permissions"/>
+  <property name="link_target"></property>
   <property name="visible">True</property>
  </object>
 </object>
@@ -76,6 +78,7 @@
    <property name="icon_expr"></property>
    <property name="available_expr"></property>
    <property name="permissions"/>
+   <property name="link_target"></property>
    <property name="visible">True</property>
   </object>
  </object>
@@ -156,6 +159,7 @@
    <property name="icon_expr"></property>
    <property name="available_expr">python:1</property>
    <property name="permissions"></property>
+   <property name="link_target"></property>
    <property name="visible">True</property>
   </object>
  </object>
@@ -176,6 +180,7 @@
    <property name="icon_expr"></property>
    <property name="available_expr">python:1</property>
    <property name="permissions"></property>
+   <property name="link_target"></property>
    <property name="visible">True</property>
   </object>
  </object>

Modified: Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/exportimport/tests/test_typeinfo.py
===================================================================
--- Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/exportimport/tests/test_typeinfo.py	2009-05-15 13:54:35 UTC (rev 99978)
+++ Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/exportimport/tests/test_typeinfo.py	2009-05-15 13:56:23 UTC (rev 99979)
@@ -45,6 +45,7 @@
  <property name="product"></property>
  <property name="factory"></property>
  <property name="add_view_expr"></property>
+ <property name="link_target"></property>
  <property name="immediate_view"></property>
  <property name="global_allow">True</property>
  <property name="filter_content_types">True</property>
@@ -54,7 +55,7 @@
  <alias from="view" to="foo"/>
  <action title="Foo" action_id="foo_action" category="Bar"
     condition_expr="python:1" icon_expr="string:${portal_url}/icon.png"
-    url_expr="string:${object_url}/foo" visible="True"/>
+    link_target="" url_expr="string:${object_url}/foo" visible="True"/>
 </object>
 """
 
@@ -77,6 +78,7 @@
     'product':               'CMFSetup',
     'factory':               'addFoo',
     'add_view_expr':         'string:${folder_url}/foo_add_view',
+    'link_target':           '_new',
     'immediate_view':        'foo_view',
     'filter_content_types':  False,
     'allowed_content_types': (),
@@ -89,6 +91,7 @@
                  'title':  'View',
                  'action': 'string:${object_url}/foo_view',
                  'icon_expr': 'string:${portal_url}/preview_icon.png',
+                 'link_target': '_new',
                  'permissions': (View,),
                  },
                 {'id':     'edit',
@@ -114,6 +117,7 @@
     'constructor_path':      'make_bar',
     'permission':            'Add portal content',
     'add_view_expr':         'string:${folder_url}/bar_add_view',
+    'link_target':           '',
     'immediate_view':        'bar_view',
     'filter_content_types':  True,
     'allowed_content_types': ('foo',),
@@ -196,6 +200,7 @@
  <property name="product">CMFSetup</property>
  <property name="factory">addFoo</property>
  <property name="add_view_expr">string:${folder_url}/foo_add_view</property>
+ <property name="link_target">_new</property>
  <property name="immediate_view">foo_view</property>
  <property name="global_allow">False</property>
  <property name="filter_content_types">False</property>
@@ -205,17 +210,20 @@
  <alias from="view" to="foo_view"/>
  <action title="View" action_id="view" category="object" condition_expr=""
     url_expr="string:${object_url}/foo_view" 
-    icon_expr="string:${portal_url}/preview_icon.png" visible="True">
+    icon_expr="string:${portal_url}/preview_icon.png" link_target="_new" 
+    visible="True">
   <permission value="View"/>
  </action>
  <action title="Edit" action_id="edit" category="object" condition_expr=""
     url_expr="string:${object_url}/foo_edit_form" 
-    icon_expr="string:${portal_url}/edit_icon.png" visible="True">
+    icon_expr="string:${portal_url}/edit_icon.png" link_target="" 
+    visible="True">
   <permission value="Modify portal content"/>
  </action>
  <action title="Metadata" action_id="metadata" category="object"
     condition_expr="" url_expr="string:${object_url}/metadata_edit_form"
-    icon_expr="string:${portal_url}/metadata_icon.png" visible="True">
+    icon_expr="string:${portal_url}/metadata_icon.png" link_target="" 
+    visible="True">
   <permission value="Modify portal content"/>
  </action>
 </object>
@@ -233,6 +241,7 @@
  <property name="permission">Add portal content</property>
  <property name="constructor_path">make_bar</property>
  <property name="add_view_expr">string:${folder_url}/bar_add_view</property>
+ <property name="link_target"/>
  <property name="immediate_view">bar_view</property>
  <property name="global_allow">True</property>
  <property name="filter_content_types">True</property>
@@ -244,22 +253,22 @@
  <alias from="view" to="bar_view"/>
  <action title="View" action_id="view" category="object" condition_expr=""
     url_expr="string:${object_url}/bar_view" 
-    icon_expr="" visible="True">
+    icon_expr="" link_target="" visible="True">
   <permission value="View"/>
  </action>
  <action title="Edit" action_id="edit" category="object" condition_expr=""
     url_expr="string:${object_url}/bar_edit_form"
-    icon_expr="" visible="True">
+    icon_expr="" link_target="" visible="True">
   <permission value="Modify portal content"/>
  </action>
  <action title="Contents" action_id="contents" category="object"
     condition_expr="" url_expr="string:${object_url}/folder_contents"
-    icon_expr="" visible="True">
+    icon_expr="" link_target="" visible="True">
   <permission value="Access contents information"/>
  </action>
  <action title="Metadata" action_id="metadata" category="object"
     condition_expr="" url_expr="string:${object_url}/metadata_edit_form"
-    icon_expr="" visible="True">
+    icon_expr="" link_target="" visible="True">
   <permission value="Modify portal content"/>
  </action>
 </object>

Modified: Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/exportimport/typeinfo.py
===================================================================
--- Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/exportimport/typeinfo.py	2009-05-15 13:54:35 UTC (rev 99978)
+++ Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/exportimport/typeinfo.py	2009-05-15 13:56:23 UTC (rev 99979)
@@ -102,6 +102,7 @@
             child.setAttribute('condition_expr', ai_info['condition'])
             child.setAttribute('url_expr', ai_info['action'])
             child.setAttribute('icon_expr', ai_info['icon_expr'])
+            child.setAttribute('link_target', ai_info['link_target'])
             child.setAttribute('visible', str(bool(ai_info['visible'])))
             for permission in ai_info['permissions']:
                 sub = self._doc.createElement('permission')
@@ -123,6 +124,10 @@
             condition = str(child.getAttribute('condition_expr'))
             action = str(child.getAttribute('url_expr'))
             icon_expr = str(child.getAttribute('icon_expr'))
+            if child.hasAttribute('link_target'):
+                link_target = str(child.getAttribute('link_target'))
+            else:
+                link_target = ''
             visible = self._convertToBoolean(child.getAttribute('visible'))
             remove = child.hasAttribute('remove') and True or False
             permissions = []
@@ -143,12 +148,13 @@
                 if action_obj is None:
                     self.context.addAction(id, title, action, condition,
                                            tuple(permissions), category, visible,
-                                           icon_expr=icon_expr)
+                                           icon_expr=icon_expr, 
+                                           link_target=link_target)
                 else:
                     action_obj.edit(title=title, action=action,
                                     icon_expr=icon_expr, condition=condition,
                                     permissions=tuple(permissions),
-                                    visible=visible)
+                                    visible=visible, link_target=link_target)
 
 
 class TypesToolXMLAdapter(XMLAdapterBase, ObjectManagerHelpers,

Modified: Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_ActionInformation.py
===================================================================
--- Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_ActionInformation.py	2009-05-15 13:54:35 UTC (rev 99978)
+++ Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_ActionInformation.py	2009-05-15 13:56:23 UTC (rev 99979)
@@ -72,7 +72,7 @@
     def test_getInfoData_empty(self):
         WANTED = ( {'available': True, 'category': '', 'description': '',
                     'id': 'foo', 'icon': '', 'permissions': (), 'title': '',
-                    'url': '', 'visible': True}, [] )
+                    'url': '', 'visible': True, 'link_target': ''}, [] )
         a = self._makeOne('foo')
         self.assertEqual( a.getInfoData(), WANTED )
 
@@ -84,12 +84,14 @@
                           icon_expr='string:foo_icon',
                           available_expr='',
                           permissions=('View',),
-                          visible=False)
+                          visible=False,
+                          link_target='_top')
         WANTED = ( {'available': True, 'category': '',
                     'description': 'Foo description.',
                     'id': 'foo', 'icon': a.icon_expr_object,
                     'permissions': ('View',), 'title': 'Foo Title',
-                    'url': a.url_expr_object, 'visible': False},
+                    'url': a.url_expr_object, 'visible': False,
+                    'link_target': a.link_target },
                    ['url', 'icon'] )
         self.assertEqual( a.getInfoData(), WANTED )
 
@@ -146,7 +148,7 @@
 
         WANTED = {'allowed': True, 'available': True, 'category': '',
                   'description': '', 'icon': '', 'id': 'foo', 'title': '',
-                  'url': '', 'visible': True}
+                  'url': '', 'visible': True, 'link_target': ''}
 
         action = Action(id='foo')
         ec = None
@@ -167,7 +169,7 @@
 
         WANTED = {'allowed': True, 'available': True, 'category': 'object',
                   'description': '', 'id': 'foo', 'title': 'foo', 'url': '',
-                  'visible': True, 'icon': ''}
+                  'visible': True, 'icon': '', 'link_target': ''}
 
         action = ActionInformation(id='foo')
         ec = None
@@ -187,7 +189,7 @@
     def test_create_from_dict(self):
         WANTED = {'allowed': True, 'available': True, 'category': 'object',
                   'id': 'foo', 'title': 'foo', 'url': '', 'visible': True,
-                  'icon': '' }
+                  'icon': '' , 'link_target': ''}
 
         action = {'name': 'foo', 'url': ''}
         ec = None
@@ -219,7 +221,7 @@
     def test_create_from_dict(self):
         WANTED = {'allowed': True, 'available': True, 'category': 'object',
                   'id': 'foo', 'title': 'foo', 'url': '', 'visible': True,
-                  'icon': ''}
+                  'icon': '', 'link_target': ''}
 
         action = {'name': 'foo', 'url': '', 'permissions': ('View',)}
         ec = createExprContext(self.site, self.site, None)
@@ -423,7 +425,8 @@
     def test_getInfoData_empty(self):
         WANTED = ( {'available': True, 'category': 'object',
                     'description': '', 'id': 'foo', 'permissions': (),
-                    'title': 'foo', 'url': '', 'visible': True, 'icon': ''},[])
+                    'title': 'foo', 'url': '', 'visible': True, 'icon': '',
+                    'link_target': ''},[])
         a = self._makeOne('foo')
         self.assertEqual( a.getInfoData(), WANTED )
 
@@ -435,12 +438,14 @@
                           icon_expr='string:${object_url}/icon.gif',
                           condition='',
                           permissions=('View',),
-                          visible=False)
+                          visible=False,
+                          link_target='_top')
         WANTED = ( {'available': True, 'category': 'object',
                     'description': 'Foo description.', 'id': 'foo',
                     'permissions': ('View',), 'title': 'Foo Title',
                     'url': a._getActionObject(), 'visible': False,
-                    'icon': a._getIconExpressionObject(), },
+                    'icon': a._getIconExpressionObject(), 
+                    'link_target': a.link_target },
                    ['url', 'icon'] )
         self.assertEqual( a.getInfoData(), WANTED )
 

Modified: Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_ActionProviderBase.py
===================================================================
--- Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_ActionProviderBase.py	2009-05-15 13:54:35 UTC (rev 99978)
+++ Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_ActionProviderBase.py	2009-05-15 13:56:23 UTC (rev 99979)
@@ -242,7 +242,8 @@
     def test_listActionInfos(self):
         wanted = [{'id': 'an_id', 'title': 'A Title', 'description': '',
                    'url': '', 'category': 'object', 'visible': False,
-                   'available': True, 'allowed': True, 'icon': ''}]
+                   'available': True, 'allowed': True, 'link_target': '',
+                   'icon': ''}]
 
         apb = self.site._setObject( 'portal_apb', self._makeProvider(1) )
         rval = apb.listActionInfos()
@@ -263,7 +264,8 @@
     def test_getActionInfo(self):
         wanted = {'id': 'an_id', 'title': 'A Title', 'description': '',
                   'url': '', 'category': 'object', 'visible': False,
-                  'available': True, 'allowed': True, 'icon': ''}
+                  'available': True, 'allowed': True, 'link_target': '',
+                  'icon': ''}
 
         apb = self.site._setObject( 'portal_apb', self._makeProvider(1) )
         rval = apb.getActionInfo( ('object/an_id',) )

Modified: Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_ActionsTool.py
===================================================================
--- Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_ActionsTool.py	2009-05-15 13:54:35 UTC (rev 99978)
+++ Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_ActionsTool.py	2009-05-15 13:56:23 UTC (rev 99979)
@@ -153,6 +153,7 @@
                                                       'folder is not object'),
                                 permissions=('List folder contents',),
                                 category='folder',
+                                link_target='_top',
                                 visible=1)
             ,
             )
@@ -168,7 +169,8 @@
                                       'visible': True,
                                       'available': True,
                                       'allowed': True,
-                                      'category': 'folder'}],
+                                      'category': 'folder',
+                                      'link_target': '_top'}],
                           'global': []})
 
     def tearDown(self):

Modified: Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_TypesTool.py
===================================================================
--- Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_TypesTool.py	2009-05-15 13:54:35 UTC (rev 99978)
+++ Products.CMFCore/branches/jens_actions_linktarget/Products/CMFCore/tests/test_TypesTool.py	2009-05-15 13:56:23 UTC (rev 99979)
@@ -298,12 +298,13 @@
                    'content_meta_type': 'Foo Content',
                    'factory' : 'cmf.foo',
                    'icon_expr' : 'string:${portal_url}/foo_icon_expr.gif',
-                   'add_view_expr': 'string:${folder_url}/foo_add_view'}
+                   'add_view_expr': 'string:${folder_url}/foo_add_view',
+                   'link_target': '_new'}
         ti = self._makeInstance(**ti_data)
         info_data = ti.getInfoData()
         self.assertEqual(len(info_data), 2)
 
-        self.assertEqual(len(info_data[0]), 9)
+        self.assertEqual(len(info_data[0]), 10)
         self.assertEqual(info_data[0]['id'], ti_data['id'])
         self.assertEqual(info_data[0]['category'], 'folder/add')
         self.assertEqual(info_data[0]['title'], ti_data['title'])
@@ -315,6 +316,7 @@
         self.assertEqual(info_data[0]['visible'], True)
         self.assertEqual(info_data[0]['available'], ti._checkAvailable)
         self.assertEqual(info_data[0]['allowed'], ti._checkAllowed)
+        self.assertEqual(info_data[0]['link_target'], ti.link_target)
 
         self.assertEqual(set(info_data[1]),
                          set(['url', 'icon', 'available', 'allowed']))
@@ -329,7 +331,7 @@
         info_data = ti.getInfoData()
         self.assertEqual(len(info_data), 2)
 
-        self.assertEqual(len(info_data[0]), 9)
+        self.assertEqual(len(info_data[0]), 10)
         self.assertEqual(info_data[0]['id'], ti_data['id'])
         self.assertEqual(info_data[0]['category'], 'folder/add')
         self.assertEqual(info_data[0]['title'], ti_data['title'])
@@ -339,6 +341,7 @@
         self.assertEqual(info_data[0]['visible'], True)
         self.assertEqual(info_data[0]['available'], ti._checkAvailable)
         self.assertEqual(info_data[0]['allowed'], ti._checkAllowed)
+        self.assertEqual(info_data[0]['link_target'], '')
 
         self.assertEqual(set(info_data[1]), set(['available', 'allowed']))
 



More information about the Checkins mailing list