[Erp5-report] r21486 - in /erp5/trunk/bt5/erp5_web: SkinTemplateItem/portal_skins/erp5_web/...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jun 11 04:15:00 CEST 2008


Author: yo
Date: Wed Jun 11 04:14:59 2008
New Revision: 21486

URL: http://svn.erp5.org?rev=21486&view=rev
Log:
2008-06-11 yo
* Make WebSection_getPermanentURL consistent.

Modified:
    erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getPermanentURL.xml
    erp5/trunk/bt5/erp5_web/bt/change_log
    erp5/trunk/bt5/erp5_web/bt/revision

Modified: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getPermanentURL.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getPermanentURL.xml?rev=21486&r1=21485&r2=21486&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getPermanentURL.xml (original)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getPermanentURL.xml Wed Jun 11 04:14:59 2008
@@ -3,11 +3,8 @@
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
       <tuple>
-        <tuple>
-          <string>Products.PythonScripts.PythonScript</string>
-          <string>PythonScript</string>
-        </tuple>
-        <none/>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
       </tuple>
     </pickle>
     <pickle>
@@ -106,19 +103,25 @@
  - change the behaviour of WebSection_getPermanentURL\n
    for documents which are not published.\n
 """\n
+# If no reference is defined, no way to build a permanent URL.\n
+reference = document.getReference()\n
+if not reference:\n
+  return document.absolute_url()\n
+\n
 # Return absolute URL if this is not an appropriate portal_type\n
-valid_portal_type_list = [\'Web Page\', ] # WARNING - this is a copy from WebSection_getDocumentValue\n
+portal = context.getPortalObject()\n
+valid_portal_type_list = portal.getPortalDocumentTypeList()\n
 if document.getPortalType() not in valid_portal_type_list:\n
   return document.absolute_url()\n
 \n
 # Return absolute URL if this is not a \'live\' document\n
-validation_state = [\'draft\', \'submitted\', \'shared\',     # WARNING - this is a copy from WebSection_getDocumentValueList\n
-                    \'released\', \'published\', \'restricted\']\n
-if not document.getReference() or document.getValidationState() not in validation_state:\n
+validation_state = (\'released\', \'released_alive\', \'published\', \'published_alive\',\n
+                    \'shared\', \'shared_alive\', \'public\', \'validated\')\n
+if document.getValidationState() not in validation_state:\n
   return document.absolute_url()\n
 \n
 # Return the URL\n
-return "%s/%s" % (context.absolute_url(), document.getReference())\n
+return "%s/%s" % (context.absolute_url(), reference)\n
 </string> </value>
         </item>
         <item>
@@ -168,10 +171,12 @@
                         <value>
                           <tuple>
                             <string>document</string>
+                            <string>_getattr_</string>
+                            <string>reference</string>
+                            <string>context</string>
+                            <string>portal</string>
                             <string>valid_portal_type_list</string>
-                            <string>_getattr_</string>
                             <string>validation_state</string>
-                            <string>context</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_web/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/bt/change_log?rev=21486&r1=21485&r2=21486&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/bt/change_log (original)
+++ erp5/trunk/bt5/erp5_web/bt/change_log Wed Jun 11 04:14:59 2008
@@ -1,3 +1,6 @@
+2008-06-11 yo
+* Make WebSection_getPermanentURL consistent.
+
 2008-06-11 yo
 * Make the scripts for retrieving documents more consistent.
 

Modified: erp5/trunk/bt5/erp5_web/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/bt/revision?rev=21486&r1=21485&r2=21486&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/bt/revision (original)
+++ erp5/trunk/bt5/erp5_web/bt/revision Wed Jun 11 04:14:59 2008
@@ -1,1 +1,1 @@
-641
+642




More information about the Erp5-report mailing list