[Erp5-report] r10340 - in /erp5/trunk/bt5/erp5_dms: SkinTemplateItem/portal_skins/erp5_dms/...
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Sep 26 19:58:42 CEST 2006
Author: bartek
Date: Tue Sep 26 19:58:37 2006
New Revision: 10340
URL: http://svn.erp5.org?rev=10340&view=rev
Log:
Jump to "similarity cloud" (any ideas for a better name?) - (#21)
Added:
erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSDocument_getLastVersion.xml
erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getSimilarityCloud.xml
Modified:
erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getRelatedDocumentList.xml
erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getRelatedDocumentsListboxTitle.xml
erp5/trunk/bt5/erp5_dms/bt/revision
Added: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSDocument_getLastVersion.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSDocument_getLastVersion.xml?rev=10340&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSDocument_getLastVersion.xml (added)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMSDocument_getLastVersion.xml Tue Sep 26 19:58:37 2006
@@ -1,0 +1,149 @@
+<?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>if context.getReference() is None:\n
+ return context\n
+res=context.DMS_findDocument(reference=context.getReference(),language=context.getLanguage())\n
+return res[0].getObject()\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>_params</string> </key>
+ <value> <string></string> </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>None</string>
+ <string>res</string>
+ <string>_getitem_</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>DMSDocument_getLastVersion</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getRelatedDocumentList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getRelatedDocumentList.xml?rev=10340&r1=10339&r2=10340&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getRelatedDocumentList.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getRelatedDocumentList.xml Tue Sep 26 19:58:37 2006
@@ -68,14 +68,10 @@
</item>
<item>
<key> <string>_body</string> </key>
- <value> <string>def findRecentVersion(doc):\n
- res=context.DMS_findDocument(reference=doc.getReference(),language=doc.getLanguage())\n
- return res[0].getObject()\n
-\n
-def getRelatedLatest(category):\n
+ <value> <string>def getRelatedLatest(category):\n
funcname=\'get%sValueList\' % category.title()\n
func=getattr(context,funcname)\n
- return map(findRecentVersion, func())\n
+ return [o.DMS_getLatestVersion() for o in func()]\n
\n
what=kw.get(\'what\')\n
if what==\'wiki_predecessor\':\n
@@ -84,6 +80,8 @@
return context.getWikiSuccessorValueList()\n
if what.startswith(\'related\'):\n
return getRelatedLatest(what[8:])\n
+if what==\'cloud\':\n
+ return context.DMS_getSimilarityCloud()\n
if what==\'all\':\n
dic={}\n
for ob in context.getWikiPredecessorValueList()+context.getWikiSuccessorValueList()+\\\n
@@ -135,7 +133,6 @@
<tuple>
<string>a</string>
<string>kw</string>
- <string>findRecentVersion</string>
<string>getRelatedLatest</string>
<string>_getattr_</string>
<string>what</string>
Modified: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getRelatedDocumentsListboxTitle.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getRelatedDocumentsListboxTitle.xml?rev=10340&r1=10339&r2=10340&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getRelatedDocumentsListboxTitle.xml (original)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getRelatedDocumentsListboxTitle.xml Tue Sep 26 19:58:37 2006
@@ -77,6 +77,7 @@
\'related_similar\':\'Similar documents\',\n
\'related_successor\':\'Related documents\',\n
\'related_predecessor\':\'Reference documents\',\n
+\'cloud\':\'Similarity cloud\',\n
\'all\':\'All related documents\'}\n
\n
s=mapka.get(what)\n
Added: erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getSimilarityCloud.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getSimilarityCloud.xml?rev=10340&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getSimilarityCloud.xml (added)
+++ erp5/trunk/bt5/erp5_dms/SkinTemplateItem/portal_skins/erp5_dms/DMS_getSimilarityCloud.xml Tue Sep 26 19:58:37 2006
@@ -1,0 +1,175 @@
+<?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># returns all documents related by similarity (either way), recursively\n
+# so all documents related indirectly are also returned\n
+# recursion depth can be limited, to avoid returning all documents\n
+# if there is many similarities\n
+# every doc is returned in its latest version available\n
+\n
+lista={}\n
+depth=int(depth)\n
+\n
+def getSimilarities(self,level=0):\n
+ level+=1\n
+ context.log(self.getRelativeUrl())\n
+ context.log(level)\n
+ res=self.getSimilarValueList()+self.getSimilarRelatedValueList()\n
+ for r in res:\n
+ if lista.get(r) is None:\n
+ lista[r]=True\n
+ if level!=depth:\n
+ getSimilarities(r,level)\n
+\n
+getSimilarities(context)\n
+if lista.has_key(context):lista.pop(context)\n
+return [o.DMSDocument_getLastVersion() for o in lista.keys()]\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>_params</string> </key>
+ <value> <string>depth=0</string> </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>1</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>depth</string>
+ <string>lista</string>
+ <string>int</string>
+ <string>getSimilarities</string>
+ <string>context</string>
+ <string>_getattr_</string>
+ <string>append</string>
+ <string>$append0</string>
+ <string>_getiter_</string>
+ <string>o</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <tuple>
+ <int>0</int>
+ </tuple>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>DMS_getSimilarityCloud</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_dms/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_dms/bt/revision?rev=10340&r1=10339&r2=10340&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_dms/bt/revision (original)
+++ erp5/trunk/bt5/erp5_dms/bt/revision Tue Sep 26 19:58:37 2006
@@ -1,1 +1,1 @@
-196
+199
More information about the Erp5-report
mailing list