[Erp5-report] r14253 - /erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Apr 26 20:32:35 CEST 2007


Author: ivan
Date: Thu Apr 26 20:32:31 2007
New Revision: 14253

URL: http://svn.erp5.org?rev=14253&view=rev
Log:
Code cleanup. Comments added.

Added:
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getPopupInfo.xml
Modified:
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_countMyContentList.xml
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getCandidateTypeListByExtension.xml
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getLatestContentList.xml
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getMyContentList.xml
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getPropertyDictFromFileName.xml
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_newContent.xml
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_convert.xml
    erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_finishIngestion.xml

Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_countMyContentList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_countMyContentList.xml?rev=14253&r1=14252&r2=14253&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_countMyContentList.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_countMyContentList.xml Thu Apr 26 20:32:31 2007
@@ -77,12 +77,10 @@
   that owner is being indexed.\n
 """\n
 if user is None:\n
-  from AccessControl import getSecurityManager\n
-  sm = getSecurityManager()\n
-  user = sm.getUser()\n
+  user = context.portal_membership.getAuthenticatedMember()\n
 \n
+kw[\'owner\'] = user\n
 kw[\'portal_type\'] = context.getPortalMyDocumentTypeList()\n
-kw[\'owner\'] = str(user)\n
 return context.portal_catalog.countResults(**kw)\n
 </string> </value>
         </item>
@@ -135,13 +133,9 @@
                             <string>user</string>
                             <string>kw</string>
                             <string>None</string>
-                            <string>AccessControl</string>
-                            <string>getSecurityManager</string>
-                            <string>sm</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>_write_</string>
-                            <string>str</string>
                             <string>_apply_</string>
                           </tuple>
                         </value>
@@ -164,6 +158,10 @@
             <value> <string>ContributionTool_countMyContentList</string> </value>
         </item>
         <item>
+            <key> <string>title</string> </key>
+            <value> <string>Counts the number of documents for current user</string> </value>
+        </item>
+        <item>
             <key> <string>warnings</string> </key>
             <value>
               <tuple/>

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=14253&r1=14252&r2=14253&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 Thu Apr 26 20:32:31 2007
@@ -68,7 +68,12 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>pt = context.content_type_registry.findTypeName(\'a.%s\' %ext, None, None)\n
+            <value> <string>"""\n
+  Find by give filename extension which portal_type is the right one.\n
+  Use content_type_registry for that. \n
+"""\n
+\n
+pt = context.content_type_registry.findTypeName(\'a.%s\' %ext, None, None)\n
 return (pt,)\n
 </string> </value>
         </item>
@@ -136,6 +141,10 @@
             <value> <string>ContributionTool_getCandidateTypeListByExtension</string> </value>
         </item>
         <item>
+            <key> <string>title</string> </key>
+            <value> <string>Find portal be filename extension</string> </value>
+        </item>
+        <item>
             <key> <string>warnings</string> </key>
             <value>
               <tuple/>

Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getLatestContentList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getLatestContentList.xml?rev=14253&r1=14252&r2=14253&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getLatestContentList.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getLatestContentList.xml Thu Apr 26 20:32:31 2007
@@ -69,13 +69,12 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>"""\n
-  Get latest documents sort.\n
+  Get latest documents sorted.\n
 """\n
-\n
 kw[\'portal_type\'] = context.getPortalDocumentTypeList()\n
-kw[\'sort_on\'] = ((\'creation_date\',\'descending\'),)\n
-res = context.portal_catalog(**kw)\n
-return res\n
+kw[\'sort_on\'] = ((\'creation_date\', \'descending\'),)\n
+result = context.portal_catalog(**kw)\n
+return result\n
 </string> </value>
         </item>
         <item>
@@ -124,7 +123,7 @@
                             <string>context</string>
                             <string>_write_</string>
                             <string>_apply_</string>
-                            <string>res</string>
+                            <string>result</string>
                           </tuple>
                         </value>
                     </item>
@@ -144,6 +143,10 @@
             <value> <string>ContributionTool_getLatestContentList</string> </value>
         </item>
         <item>
+            <key> <string>title</string> </key>
+            <value> <string>Get latest documents</string> </value>
+        </item>
+        <item>
             <key> <string>warnings</string> </key>
             <value>
               <tuple/>

Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getMyContentList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getMyContentList.xml?rev=14253&r1=14252&r2=14253&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getMyContentList.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getMyContentList.xml Thu Apr 26 20:32:31 2007
@@ -164,6 +164,10 @@
             <value> <string>ContributionTool_getMyContentList</string> </value>
         </item>
         <item>
+            <key> <string>title</string> </key>
+            <value> <string>Get my documents</string> </value>
+        </item>
+        <item>
             <key> <string>warnings</string> </key>
             <value>
               <tuple/>

Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getPropertyDictFromFileName.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getPropertyDictFromFileName.xml?rev=14253&r1=14252&r2=14253&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getPropertyDictFromFileName.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_getPropertyDictFromFileName.xml Thu Apr 26 20:32:31 2007
@@ -81,13 +81,11 @@
 """\n
 \n
 new_dict = {}\n
-\n
 for k, v in property_dict.items():\n
   if v:\n
     if k == \'language\':\n
       v = v.lower()\n
     new_dict[k] = v\n
-\n
 return new_dict\n
 </string> </value>
         </item>

Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_newContent.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_newContent.xml?rev=14253&r1=14252&r2=14253&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_newContent.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/ContributionTool_newContent.xml Thu Apr 26 20:32:31 2007
@@ -74,34 +74,22 @@
   redirects to what is returned\n
 """\n
 \n
-from Products.Formulator.Errors import FormValidationError\n
+translateString = context.Base_translateString\n
 \n
-translateString = context.Base_translateString\n
-request = context.REQUEST\n
-\n
-# a workaround for a strange problem\n
-# (if this line is not here, ZODB raises an exception when\n
-# committing transaction)\n
-del(kw[\'field_your_file\'])\n
+# clean up kw from file field otherwise \n
+# ZODB raises an exception when committing transaction\n
+kw.pop(\'field_your_file\', None)\n
 \n
 if kw[\'portal_type\'] == \'\':\n
   # we don\'t want to set portal_type to \'\' :)\n
-  del(kw[\'portal_type\'])\n
+  kw.pop(\'portal_type\', None)\n
 \n
+# ingest file\n
 doc = context.portal_contributions.newContent(file=file, **kw)\n
 \n
-msg = translateString("${portal_type} created successfully.",  mapping = {\'portal_type\':doc.getPortalType()})\n
+msg = translateString("${portal_type} created successfully.",\n
+                       mapping = {\'portal_type\':doc.getPortalType()})\n
 return context.Base_redirect(\'view\', keep_items = {\'portal_status_message\':msg})\n
-\n
-  \n
-# we leave this for later, because this way it is easier to debug\n
-try:\n
-  doc = context.portal_contributions.newContent(file=file, **kw)\n
-  if doc is None:\n
-    raise ValueError(\'new content could not be generated for unknown reason (check system log)\')\n
-except Exception, e:\n
-  msg = translateString("Sorry, object could not be created. Error returned was: ${exception}.", mapping = {\'exception\':str(e)})\n
-  return context.Base_redirect(dialog_id, keep_items={\'portal_status_message\':msg})\n
 </string> </value>
         </item>
         <item>
@@ -154,22 +142,14 @@
                             <string>form_id</string>
                             <string>file</string>
                             <string>kw</string>
-                            <string>Products.Formulator.Errors</string>
-                            <string>FormValidationError</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>translateString</string>
-                            <string>request</string>
-                            <string>_write_</string>
+                            <string>None</string>
                             <string>_getitem_</string>
                             <string>_apply_</string>
                             <string>doc</string>
                             <string>msg</string>
-                            <string>None</string>
-                            <string>ValueError</string>
-                            <string>Exception</string>
-                            <string>e</string>
-                            <string>str</string>
                           </tuple>
                         </value>
                     </item>
@@ -193,6 +173,10 @@
             <value> <string>ContributionTool_newContent</string> </value>
         </item>
         <item>
+            <key> <string>title</string> </key>
+            <value> <string>Contribute new file</string> </value>
+        </item>
+        <item>
             <key> <string>warnings</string> </key>
             <value>
               <tuple/>

Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_convert.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_convert.xml?rev=14253&r1=14252&r2=14253&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_convert.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_convert.xml Thu Apr 26 20:32:31 2007
@@ -83,7 +83,6 @@
 if typ == \'application/zip\':\n
   filename += \'.zip\'\n
 \n
-\n
 request.RESPONSE.setHeader(\'Content-disposition\', \'attachment;; filename="%s"\' % filename)\n
 return data\n
 </string> </value>
@@ -160,6 +159,10 @@
             <value> <string>Document_convert</string> </value>
         </item>
         <item>
+            <key> <string>title</string> </key>
+            <value> <string>Convert document to given format</string> </value>
+        </item>
+        <item>
             <key> <string>warnings</string> </key>
             <value>
               <tuple/>

Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_finishIngestion.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_finishIngestion.xml?rev=14253&r1=14252&r2=14253&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_finishIngestion.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_finishIngestion.xml Thu Apr 26 20:32:31 2007
@@ -69,11 +69,11 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>"""\n
-Implementation layer - operations to be perfomed after converting data to text\n
-by discoverMetadata method or script.\n
+  This script is called after successful data ingestion.\n
+  XXX: It\'s possible to hook here some asynchrounous \n
+       notification for user that the ingestion was successful.\n
 """\n
-\n
-return\n
+pass\n
 </string> </value>
         </item>
         <item>
@@ -140,6 +140,10 @@
             <value> <string>Document_finishIngestion</string> </value>
         </item>
         <item>
+            <key> <string>title</string> </key>
+            <value> <string>Finish ingestion hook script</string> </value>
+        </item>
+        <item>
             <key> <string>warnings</string> </key>
             <value>
               <tuple/>

Added: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getPopupInfo.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getPopupInfo.xml?rev=14253&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getPopupInfo.xml (added)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/Document_getPopupInfo.xml Thu Apr 26 20:32:31 2007
@@ -1,0 +1,196 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <tuple>
+          <string>Products.PythonScripts.PythonScript</string>
+          <string>PythonScript</string>
+        </tuple>
+        <none/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Python_magic</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>""" \n
+    Generate current document\'s information structure needed to be rendered \n
+    by web widget Document_viewPopupTemplate.\n
+"""\n
+\n
+translateString = context.Base_translateString\n
+\n
+vals = {}\n
+owner_list = context.Base_getOwnerInfoList()\n
+vals[\'owner\'] = \'; \'.join([owner[\'title\'] for owner in owner_list])\n
+vals[\'moddate\'] = context.WebSite_getFancyRelativeDate(context.getModificationDate())\n
+publdate = context.Document_getLastWorkflowStateEntryDate(state=(\'public,\'), state_name=\'validation_state\')\n
+vals[\'publdate\'] = context.WebSite_getFancyRelativeDate(publdate)\n
+reldate = context.Document_getLastWorkflowStateEntryDate(state=(\'released,\'), state_name=\'validation_state\')\n
+vals[\'reldate\'] = context.WebSite_getFancyRelativeDate(reldate)\n
+try:\n
+  vals[\'status\'] = context.getTranslatedValidationStateTitle() or \'\'\n
+except AttributeError:\n
+  vals[\'status\'] = \'\'\n
+try:\n
+  vals[\'group\'] = context.getGroup() or \'\'\n
+except AttributeError:\n
+  vals[\'group\'] = \'\'\n
+try:\n
+  vals[\'project\'] = context.getSourceProjectTitle() or \'\'\n
+except AttributeError:\n
+  vals[\'project\'] = \'\'\n
+\n
+return context.Document_viewPopupTemplate(**vals)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_filepath</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_owner</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>translateString</string>
+                            <string>vals</string>
+                            <string>owner_list</string>
+                            <string>append</string>
+                            <string>$append0</string>
+                            <string>_getiter_</string>
+                            <string>owner</string>
+                            <string>_getitem_</string>
+                            <string>_write_</string>
+                            <string>publdate</string>
+                            <string>reldate</string>
+                            <string>AttributeError</string>
+                            <string>_apply_</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Document_getPopupInfo</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>




More information about the Erp5-report mailing list