[Erp5-report] r9366 - in /erp5/trunk/bt5/erp5_web: SkinTemplateItem/portal_skins/erp5_web/ bt/

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Aug 23 18:43:24 CEST 2006


Author: kevin
Date: Wed Aug 23 18:43:20 2006
New Revision: 9366

URL: http://svn.erp5.org?rev=9366&view=rev
Log:
Updated version (by Stefan)

Modified:
    erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getDocumentValueList.xml
    erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDefaultWebPageValue.xml
    erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml
    erp5/trunk/bt5/erp5_web/bt/revision
    erp5/trunk/bt5/erp5_web/bt/version

Modified: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getDocumentValueList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getDocumentValueList.xml?rev=9366&r1=9365&r2=9366&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getDocumentValueList.xml (original)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_getDocumentValueList.xml Wed Aug 23 18:43:20 2006
@@ -94,7 +94,6 @@
 # in each section if necessary\n
 \n
 portal_catalog = container.portal_catalog\n
-# New implementation.\n
 \n
 # First find the web section we are in\n
 current_node = context\n
@@ -105,7 +104,7 @@
 section_categories = current_node.getMembershipCriterionCategoryList()\n
 \n
 \n
-def membercheck(x):\n
+def checkMember(x):\n
   the_categories = x.getCategoriesList()\n
   if the_categories:\n
     for the_category in the_categories:\n
@@ -113,18 +112,26 @@
         if x.getValidationState()==\'published\':\n
           return x\n
 \n
-# this is just for debugging purposes, not used at the moment\n
-def displaytitle(x):\n
-  return x.title\n
-\n
 # get all web pages and check if their publication category is in the category list of the web section\n
 #reference_list = map(lambda x:x.getReference(), context.getSourceValueList(portal_type="Web Page"))\n
 reference_list = map(lambda x:x.getReference(), portal_catalog(portal_type=(\'Web Page\',)))\n
 if reference_list:\n
-  li = filter(membercheck, list(context.portal_catalog(portal_type="Web Page")) )\n
-  #li = map (displaytitle,li)\n
-  return li\n
-return "[] Empty reference_list"\n
+  li = filter(checkMember, list(context.portal_catalog(portal_type="Web Page")) )\n
+  my_list=li\n
+else:\n
+  my_list=[]\n
+\n
+if hasattr(context,\'getAggregateList\'):\n
+  aggregate_values = context.getAggregateList()\n
+  aggregate_values = map(context.restrictedTraverse,aggregate_values)\n
+  li.extend(aggregate_values) # this causes a crash\n
+  context.log("AVVVVVV",aggregate_values)\n
+\n
+\n
+def abcd(x):\n
+  return x#.getPortalType()\n
+\n
+return map(abcd,my_list)\n
 \n
 \n
 ## FYI - old implementation - broken\n
@@ -228,13 +235,16 @@
                             <string>context</string>
                             <string>current_node</string>
                             <string>section_categories</string>
-                            <string>membercheck</string>
-                            <string>displaytitle</string>
+                            <string>checkMember</string>
                             <string>map</string>
                             <string>reference_list</string>
                             <string>filter</string>
                             <string>list</string>
                             <string>li</string>
+                            <string>my_list</string>
+                            <string>hasattr</string>
+                            <string>aggregate_values</string>
+                            <string>abcd</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDefaultWebPageValue.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDefaultWebPageValue.xml?rev=9366&r1=9365&r2=9366&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDefaultWebPageValue.xml (original)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDefaultWebPageValue.xml Wed Aug 23 18:43:20 2006
@@ -68,9 +68,7 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string encoding="cdata"><![CDATA[
-
-# This script is part of ERP5 Web\n
+            <value> <string># This script is part of ERP5 Web\n
 #\n
 # ERP5 Web is an extension to ERP5 which provides a way\n
 # to create web sites which can display selected\n
@@ -89,28 +87,22 @@
 # language rather than the latest version in a different\n
 # language)\n
 \n
-nextsection=context\n
-while hasattr(nextsection,\'getParent\') and hasattr(nextsection,\'getPortalType\'):\n
-  if nextsection.getPortalType() == \'Web Section\':\n
+next_section=context\n
+while hasattr(next_section,\'getParent\') and hasattr(next_section,\'getPortalType\'):\n
+  if next_section.getPortalType() == \'Web Section\':\n
     break\n
   else:\n
-    nextsection = nextsection.aq_parent\n
-context.log("krumb",nextsection)\n
+    next_section = next_section.aq_parent\n
 \n
+if not hasattr(next_section,\'getCategories\'):\n
+  return None # Context is not a Section, so no default Value available.\n
 \n
-if not hasattr(nextsection,\'getCategories\'):\n
-  return None # Context is not a Section. Changed later\n
-\n
-context.log("Kontexttitle",context.title)\n
-myaggregate = context.getAggregateValue()\n
-context.log("My Aggegate => ",myaggregate)\n
-if myaggregate==None:\n
-  context.log("No aggregate found","!!!")\n
+my_aggregate = next_section.getAggregateValue()\n
+if my_aggregate==None:\n
+  #context.log("No aggregate found","!!!")\n
   return None\n
-return myaggregate\n
-
-
-]]></string> </value>
+return my_aggregate\n
+</string> </value>
         </item>
         <item>
             <key> <string>_code</string> </key>
@@ -159,11 +151,11 @@
                         <value>
                           <tuple>
                             <string>context</string>
-                            <string>nextsection</string>
+                            <string>next_section</string>
                             <string>hasattr</string>
                             <string>_getattr_</string>
                             <string>None</string>
-                            <string>myaggregate</string>
+                            <string>my_aggregate</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml?rev=9366&r1=9365&r2=9366&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml (original)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_getDocumentUrl.xml Wed Aug 23 18:43:20 2006
@@ -137,7 +137,8 @@
 if context.getPortalType()=="Web Page":\n
   billl=context.WebSite_getBreadcrumbItemList()\n
   billl=billl[1][1].WebSite_getDocumentUrl() #get the URL of the section\n
-  context.log("bc",billl)\n
+  if context.getReference() is None:\n
+    return "ERROR: Reference-Attribute Missing for"+repr(context)\n
   return billl+"/"+context.getReference()\n
 #context.log("hello",context.title+"==>"+context.aq_parent.WebSite_getDocumentUrl()+"--"+context.aq_inner.getUrl()+"--"+context.aq_inner.absolute_url()+"--"+context.aq_parent.absolute_url())\n
 \n
@@ -203,6 +204,7 @@
                             <string>object</string>
                             <string>billl</string>
                             <string>_getitem_</string>
+                            <string>repr</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_web/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/bt/revision?rev=9366&r1=9365&r2=9366&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/bt/revision (original)
+++ erp5/trunk/bt5/erp5_web/bt/revision Wed Aug 23 18:43:20 2006
@@ -1,1 +1,1 @@
-190
+193

Modified: erp5/trunk/bt5/erp5_web/bt/version
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/bt/version?rev=9366&r1=9365&r2=9366&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/bt/version (original)
+++ erp5/trunk/bt5/erp5_web/bt/version Wed Aug 23 18:43:20 2006
@@ -1,1 +1,1 @@
-0.3.1
+0.3.2




More information about the Erp5-report mailing list