Commit 9fe709d8 authored by Ivan Tyagov's avatar Ivan Tyagov

Use caching to optimise.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28131 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5aa3ce31
...@@ -53,7 +53,9 @@ ...@@ -53,7 +53,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>def getModuleActionInformationDict(**kw):\n <value> <string>from Products.ERP5Type.Cache import CachingMethod\n
\n
def getModuleActionInformationDict(**kw):\n
Base_translateString = context.Base_translateString\n Base_translateString = context.Base_translateString\n
result_dict = {}\n result_dict = {}\n
\n \n
...@@ -201,14 +203,12 @@ ...@@ -201,14 +203,12 @@
\n \n
return result_dict\n return result_dict\n
\n \n
from Products.ERP5Type.Cache import CachingMethod\n
from AccessControl import getSecurityManager\n
\n
getModuleActionInformationDict = CachingMethod(getModuleActionInformationDict,\n getModuleActionInformationDict = CachingMethod(getModuleActionInformationDict,\n
id=\'ERP5Site_getModuleActionInformationDict\',\n id=\'ERP5Site_getModuleActionInformationDict\',\n
cache_factory=\'erp5_ui_long\')\n cache_factory=\'erp5_ui_long\')\n
return getModuleActionInformationDict(user=getSecurityManager().getUser(),\n return getModuleActionInformationDict(\n
language=context.Localizer.get_selected_language())\n user = context.portal_membership.getAuthenticatedMember().getId(), \\\n
language = context.Localizer.get_selected_language())\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -245,11 +245,9 @@ return getModuleActionInformationDict(user=getSecurityManager().getUser(),\n ...@@ -245,11 +245,9 @@ return getModuleActionInformationDict(user=getSecurityManager().getUser(),\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>getModuleActionInformationDict</string>
<string>Products.ERP5Type.Cache</string> <string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string> <string>CachingMethod</string>
<string>AccessControl</string> <string>getModuleActionInformationDict</string>
<string>getSecurityManager</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
</tuple> </tuple>
......
...@@ -53,72 +53,78 @@ ...@@ -53,72 +53,78 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>def getTabList(**kw):\n <value> <string>from Products.ERP5Type.Cache import CachingMethod\n
tab_list = []\n
\n \n
status_dict = context.ERP5Site_getConfiguredStatusDict()\n def getTabList(status_dict, info_dict):\n
tab_list = []\n
basic_mode = status_dict[\'basic_mode\']\n basic_mode = status_dict[\'basic_mode\']\n
dms_mode = status_dict[\'dms_mode\']\n dms_mode = status_dict[\'dms_mode\']\n
express_mode = status_dict[\'express_mode\']\n express_mode = status_dict[\'express_mode\']\n
\n
info_dict = context.ERP5Site_getCategorizedModuleActionInformationDict()\n
\n \n
if dms_mode:\n if dms_mode:\n
tab_list.append({\'id\': \'quick_search_tab\',\n tab_list.append({\'id\': \'quick_search_tab\',\n
\t \'icon\': \'tab_icon/access_search.png\',\n \'icon\': \'tab_icon/access_search.png\',\n
\'renderer\': \'ERP5Site_renderQuickSearchDialog\',\n \'renderer\': \'ERP5Site_renderQuickSearchDialog\',\n
\'title\': \'Quick Search\'})\n \'title\': \'Quick Search\'})\n
\n \n
tab_list.append({\'id\': \'contribution_tab\',\n tab_list.append({\'id\': \'contribution_tab\',\n
\t \'icon\': \'tab_icon/share.png\',\n \'icon\': \'tab_icon/share.png\',\n
\'renderer\': \'ERP5Site_renderContributionDialog\',\n \'renderer\': \'ERP5Site_renderContributionDialog\',\n
\'title\': \'Contribute\'})\n \'title\': \'Contribute\'})\n
\n \n
if basic_mode:\n if basic_mode:\n
if info_dict.get(\'view\'):\n if info_dict.get(\'view\'):\n
tab_list.append({\'id\': \'browse_tab\',\n tab_list.append({\'id\': \'browse_tab\',\n
\t \'icon\': \'tab_icon/list.png\',\n \'icon\': \'tab_icon/list.png\',\n
\'renderer\': \'ERP5Site_renderViewActionList\',\n \'renderer\': \'ERP5Site_renderViewActionList\',\n
\'title\': \'Browse\'})\n \'title\': \'Browse\'})\n
if info_dict.get(\'add\'):\n if info_dict.get(\'add\'):\n
tab_list.append({\'id\': \'document_creation_tab\',\n tab_list.append({\'id\': \'document_creation_tab\',\n
\t \'icon\': \'tab_icon/filenew.png\',\n \'icon\': \'tab_icon/filenew.png\',\n
\'renderer\': \'ERP5Site_renderDocumentCreationActionList\',\n \'renderer\': \'ERP5Site_renderDocumentCreationActionList\',\n
\'title\': \'New\'})\n \'title\': \'New\'})\n
\n \n
if info_dict.get(\'search\'):\n if info_dict.get(\'search\'):\n
tab_list.append({\'id\': \'document_search_tab\',\n tab_list.append({\'id\': \'document_search_tab\',\n
\t \'icon\': \'tab_icon/filefind.png\',\n \'icon\': \'tab_icon/filefind.png\',\n
\'renderer\': \'ERP5Site_renderDocumentSearchActionList\',\n \'renderer\': \'ERP5Site_renderDocumentSearchActionList\',\n
\'title\': \'Dig\'})\n \'title\': \'Dig\'})\n
\n \n
if info_dict.get(\'report\'):\n if info_dict.get(\'report\'):\n
tab_list.append({\'id\': \'report_tab\',\n tab_list.append({\'id\': \'report_tab\',\n
\t \'icon\': \'tab_icon/webexport.png\',\n \'icon\': \'tab_icon/webexport.png\',\n
\'renderer\': \'ERP5Site_renderReportActionList\',\n \'renderer\': \'ERP5Site_renderReportActionList\',\n
\'title\': \'Reports\'})\n \'title\': \'Reports\'})\n
\n \n
if info_dict.get(\'print\'):\n if info_dict.get(\'print\'):\n
tab_list.append({\'id\': \'printout_tab\',\n tab_list.append({\'id\': \'printout_tab\',\n
\t \'icon\': \'tab_icon/ps.png\',\n \'icon\': \'tab_icon/ps.png\',\n
\'renderer\': \'ERP5Site_renderPrintActionList\',\n \'renderer\': \'ERP5Site_renderPrintActionList\',\n
\'title\': \'Printouts\'})\n \'title\': \'Printouts\'})\n
\n \n
if info_dict.get(\'exchange\'):\n if info_dict.get(\'exchange\'):\n
tab_list.append({\'id\': \'exchange_tab\',\n tab_list.append({\'id\': \'exchange_tab\',\n
\t \'icon\': \'tab_icon/imp-exp.png\',\n \'icon\': \'tab_icon/imp-exp.png\',\n
\'renderer\': \'ERP5Site_renderExchangeActionList\',\n \'renderer\': \'ERP5Site_renderExchangeActionList\',\n
\'title\': \'Exchange\'})\n \'title\': \'Exchange\'})\n
\n \n
if express_mode in (\'support_enabled\', \'advertisement_enabled\'):\n if express_mode in (\'support_enabled\', \'advertisement_enabled\'):\n
tab_list.append({\'id\': \'express_support_tab\',\n tab_list.append({\'id\': \'express_support_tab\',\n
\t \'icon\': \'tab_icon/support.png\',\n \'icon\': \'tab_icon/support.png\',\n
\'renderer\': \'ERP5Site_renderExpressSupport\',\n \'renderer\': \'ERP5Site_renderExpressSupport\',\n
\'title\': \'Express Support\'})\n \'title\': \'Express Support\'})\n
\n
return tab_list\n return tab_list\n
\n \n
return getTabList()\n getTabList = CachingMethod(getTabList, \\\n
id = \'ERP5Site_getTabListInternal\', \\\n
cache_factory = \'erp5_ui_long\')\n
\n
ERP5Site_getConfiguredStatusDict = CachingMethod(context.ERP5Site_getConfiguredStatusDict, \\\n
id = \'ERP5Site_getConfiguredStatusDict\', \\\n
cache_factory = \'erp5_ui_long\')\n
\n
return getTabList(status_dict = ERP5Site_getConfiguredStatusDict(), \\\n
info_dict = context.ERP5Site_getCategorizedModuleActionInformationDict())\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -155,7 +161,12 @@ return getTabList()\n ...@@ -155,7 +161,12 @@ return getTabList()\n
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
<value> <value>
<tuple> <tuple>
<string>Products.ERP5Type.Cache</string>
<string>CachingMethod</string>
<string>getTabList</string> <string>getTabList</string>
<string>_getattr_</string>
<string>context</string>
<string>ERP5Site_getConfiguredStatusDict</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
778 779
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment