[Erp5-report] r14204 - in /erp5/trunk/bt5/erp5_dms: PathTemplateItem/ SkinTemplateItem/port...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Apr 24 22:37:53 CEST 2007


Author: ivan
Date: Tue Apr 24 22:37:51 2007
New Revision: 14204

URL: http://svn.erp5.org?rev=14204&view=rev
Log:
Use only content_type_registry to get portal_type by extension. Define more extensions.

Modified:
    erp5/trunk/bt5/erp5_dms/PathTemplateItem/content_type_registry.xml
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getCandidateTypeListByExtension.xml

Modified: erp5/trunk/bt5/erp5_dms/PathTemplateItem/content_type_registry.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/PathTemplateItem/content_type_registry.xml?rev=14204&r1=14203&r2=14204&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/PathTemplateItem/content_type_registry.xml (original)
+++ erp5/trunk/bt5/erp5_dms/PathTemplateItem/content_type_registry.xml Tue Apr 24 22:37:51 2007
@@ -143,6 +143,7 @@
             <value>
               <list>
                 <string>sxd</string>
+                <string>odg</string>
               </list>
             </value>
         </item>
@@ -202,10 +203,12 @@
               <list>
                 <string>gif</string>
                 <string>jpg</string>
+                <string>jpeg</string>
                 <string>png</string>
                 <string>bmp</string>
                 <string>GIF</string>
                 <string>JPG</string>
+                <string>JPEG</string>
                 <string>PNG</string>
                 <string>BMP</string>
               </list>
@@ -293,6 +296,7 @@
                 <string>xls</string>
                 <string>ods</string>
                 <string>sdc</string>
+                <string>sxc</string>
               </list>
             </value>
         </item>

Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getCandidateTypeListByExtension.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getCandidateTypeListByExtension.xml?rev=14204&r1=14203&r2=14204&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getCandidateTypeListByExtension.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getCandidateTypeListByExtension.xml Tue Apr 24 22:37:51 2007
@@ -68,25 +68,8 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>typetoext = {\n
-  \'Text\':(\'doc\', \'sxw\', \'odt\', \'txt\', \'rtf\'),\n
-  \'Spreadsheet\':(\'xls\', \'sxc\', \'ods\'),\n
-  \'Presentation\':(\'ppt\', \'odp\'),\n
-  \'Drawing\':(\'odg\',),\n
-  \'Image\':(\'jpg\', \'jpeg\', \'gif\', \'bmp\', \'png\'),\n
-  \'PDF\':(\'pdf\',),\n
-}\n
-\n
-multitypes = {\n
-#     \'Text\':(\'Text\', \'Memo\')\n
-}\n
-context.log(ext)\n
-\n
-for ptype, ext_list in typetoext.items():\n
-  if ext in ext_list:\n
-    return multitypes.get(ptype, (ptype,))\n
-\n
-return ()\n
+            <value> <string>pt = context.content_type_registry.findTypeName(\'a.%s\' %ext, None, None)\n
+return pt\n
 </string> </value>
         </item>
         <item>
@@ -130,13 +113,10 @@
                         <value>
                           <tuple>
                             <string>ext</string>
-                            <string>typetoext</string>
-                            <string>multitypes</string>
                             <string>_getattr_</string>
                             <string>context</string>
-                            <string>_getiter_</string>
-                            <string>ptype</string>
-                            <string>ext_list</string>
+                            <string>None</string>
+                            <string>pt</string>
                           </tuple>
                         </value>
                     </item>




More information about the Erp5-report mailing list