Commit d903eac2 authored by Vincent Pelletier's avatar Vincent Pelletier

Drop erp5_dms_mysql_innodb_catalog as the only used scriptable key was moved...

Drop erp5_dms_mysql_innodb_catalog as the only used scriptable key was moved to erp5_mysql_innodb_catalog and nothing depends on this BT anymore.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26807 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5b85b120
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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 encoding="cdata"><![CDATA[
"""\n
This scripts parses a long string and does the following:\n
- processes arguments for searching by any category\n
- selects search mode\n
- adds creation and modification date clauses\n
- searches\n
- if requested, filters result so that only the user\'s docs are returned\n
- if requested, filters result to return only the newest versions\n
\n
At the end the script generates one big complex query to retrieve objects.\n
"""\n
\n
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
\n
if not search_string: \n
return None\n
\n
# extract search arguments\n
args = context.Base_parseSearchString(search_string)\n
\n
# process searching by category\n
bases = context.portal_categories.getBaseCategoryList()\n
for k,v in args.items():\n
if k in bases:\n
args[\'%s_relative_url\' %k] = \'%s/%s\' %(k, v)\n
\n
# expand simplified notation of search mode\n
mode = args.get(\'mode\')\n
modemap = { \'natural\' : 0,\n
\'boolean\' : \'in_boolean_mode\',\n
\'expanded\': \'with_query_expansion\'}\n
if mode and modemap.has_key(mode):\n
args[\'searchabletext\'] = dict(query = args[\'searchabletext\'], \n
search_mode = modemap[mode])\n
\n
# a hack because SQLCatalog wants table.key now \n
# dunno if it is a bug or a feature\n
if args.has_key(\'searchabletext\'):\n
args[\'full_text.SearchableText\'] = args[\'searchabletext\']\n
args.pop(\'searchabletext\')\n
\n
creation_from = kw.get(\'creation_from\')\n
creation_to = kw.get(\'creation_to\')\n
modification_from = kw.get(\'modification_from\')\n
modification_to = kw.get(\'modification_to\')\n
\n
wheres = []\n
if creation_from:\n
wheres.append(\'creation_date >"\' + creation_from.strftime(\'%Y-%m-%d\') + \'"\')\n
if creation_to:\n
wheres.append(\'creation_date <"\' + creation_from.strftime(\'%Y-%m-%d\') + \'"\')\n
if modification_from:\n
wheres.append(\'modification_date >"\' + creation_from.strftime(\'%Y-%m-%d\') + \'"\')\n
if modification_to:\n
wheres.append(\'modification_date <"\' + creation_from.strftime(\'%Y-%m-%d\') + \'"\')\n
if wheres != []:\n
args[\'where_expression\'] = \' AND \'.join(wheres)\n
\n
# We search in any language by default\n
if args.get(\'language\') == \'0\': \n
args.pop(\'language\')\n
\n
# User wants only his documents\n
if args.get(\'mine\'): \n
args[\'owner\'] = context.portal_membership.getAuthenticatedMember()\n
\n
query_list = []\n
for k, v in args.items():\n
query_list.append(Query(**{k:v}))\n
\n
if args.get(\'newest\'):\n
return ComplexQuery(*query_list, **dict(operator = \'AND\',\n
order_by = \'reference\')) \n
\n
return ComplexQuery(*query_list, \n
**dict(operator = \'AND\')) \n
\n
####################################\n
# NOT SUPPORTED YET VERY WELL\n
\n
#...and now we check for only the newest versions\n
# but we need to preserve order\n
if args.get(\'newest\'):\n
idx = {} # for keeping the last version of every reference\n
# this way we do reduce the number of docs very fast (without calling catalog)\n
newest = [] # for keeping order as it was\n
counter = 0\n
for r in res:\n
ref = r.getReference()\n
try:\n
ver = int(r.getVersion())\n
except ValueError:\n
continue\n
if idx.has_key(ref):\n
if idx[ref][0] >= ver:\n
continue\n
else:\n
del newest[idx[ref][1]]\n
counter -= 1\n
newest.append(r)\n
idx[ref] = (ver, counter)\n
counter += 1\n
# now that we have only one per reference, we can play with languages and revisions\n
res = [doc.getLatestVersionValue() for doc in newest]\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>search_string, **kw</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>search_string</string>
<string>kw</string>
<string>Products.ZSQLCatalog.SQLCatalog</string>
<string>Query</string>
<string>ComplexQuery</string>
<string>None</string>
<string>_getattr_</string>
<string>context</string>
<string>args</string>
<string>bases</string>
<string>_getiter_</string>
<string>k</string>
<string>v</string>
<string>_write_</string>
<string>mode</string>
<string>modemap</string>
<string>dict</string>
<string>_getitem_</string>
<string>creation_from</string>
<string>creation_to</string>
<string>modification_from</string>
<string>modification_to</string>
<string>wheres</string>
<string>query_list</string>
<string>_apply_</string>
<string>idx</string>
<string>newest</string>
<string>counter</string>
<string>res</string>
<string>r</string>
<string>ref</string>
<string>int</string>
<string>ver</string>
<string>ValueError</string>
<string>_inplacevar_</string>
<string>append</string>
<string>$append0</string>
<string>doc</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>SQLCatalog_makeAdvancedSearchQuery</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </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>from Products.ZSQLCatalog.SQLCatalog import Query\n
from Products.ZSQLCatalog.SQLCatalog import ComplexQuery\n
\n
# Return \n
return ComplexQuery(Query(title=value),\n
Query(reference=value),\n
Query(short_tile=value),\n
Query(source_reference=value),\n
Query(destination_reference=value),\n
operator="OR")\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>value</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>value</string>
<string>Products.ZSQLCatalog.SQLCatalog</string>
<string>Query</string>
<string>ComplexQuery</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>SQLCatalog_makeQuickSearchQuery</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2009-04-18 Kazuhiko
* Version 5.4.1
2009-04-01 vincentd
* Move versioning table to erp5_mysql_innodb_catalog.
2008-11-13 yusei
* Start to develop version 5.4.
2008-10-14 yusei
* Start to develop version 5.3.
2008-09-24 yusei
* Update xml format.
2008-06-27 yusei
* Start to develop version 5.2.
2008-06-26 yusei
* Revise version to 5.1.
2008-04-17 yusei
* Revise version to 5.0.
2008-03-14 yusei
* Move email and subject table to erp5_ingestion.
* Version up to 0.91.
2007-12-18 yusei
*Fixed wrong field names in erp5_dms.
2007-12-10 yusei
* Update SQLCatalog_makeAdvancedSearchQuery for renaming external method in erp5_dms.
2007-03-12 Initial version
\ No newline at end of file
MySQL tables for ERP5 DMS
\ No newline at end of file
erp5_dms_catalog
\ No newline at end of file
erp5_mysql_innodb/SQLCatalog_makeAdvancedSearchQuery
erp5_mysql_innodb/SQLCatalog_makeQuickSearchQuery
\ No newline at end of file
erp5_dms_mysql_innodb_catalog
\ 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