Commit 6a1820de authored by Bartek Górny's avatar Bartek Górny

Added language and version to catalog (compatibility), updated scripts accordingly

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9940 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ad3faa02
<catalog_method>
<item key="sql_catalog_object_list" type="int">
<value>1</value>
</item>
</catalog_method>
\ No newline at end of file
<catalog_method>
<item key="sql_clear_catalog" type="int">
<value>1</value>
</item>
</catalog_method>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ZSQLMethods.SQL</string>
<string>SQL</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_arg</string> </key>
<value>
<object>
<klass>
<global name="Args" module="Shared.DC.ZRDB.Aqueduct"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_data</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>_keys</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_col</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>allow_simple_one_argument_traversal</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>cache_time_</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>class_file_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>class_name_</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_hook</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>erp5_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>z_create_compatibility</string> </value>
</item>
<item>
<key> <string>max_cache_</string> </key>
<value> <int>100</int> </value>
</item>
<item>
<key> <string>max_rows_</string> </key>
<value> <int>1000</int> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string># Host:\n
# Database: test\n
# Table: \'compatibility\'\n
#\n
CREATE TABLE `compatibility` (\n
`uid` BIGINT UNSIGNED NOT NULL,\n
`Creator` varchar(255) default \'\',\n
`Date` datetime default \'0000-00-00 00:00:00\',\n
`PrincipiaSearchSource` text,\n
`SearchableText` text,\n
`CreationDate` datetime default \'0000-00-00 00:00:00\',\n
`EffectiveDate` datetime default \'0000-00-00 00:00:00\',\n
`ExpiresDate` datetime default \'0000-00-00 00:00:00\',\n
`ModificationDate` datetime default \'0000-00-00 00:00:00\',\n
`Type` varchar(255) default \'\',\n
`bobobase_modification_time` datetime default \'0000-00-00 00:00:00\',\n
`created` datetime default \'0000-00-00 00:00:00\',\n
`effective` datetime default \'0000-00-00 00:00:00\',\n
`expires` datetime default \'0000-00-00 00:00:00\',\n
`getIcon` varchar(255) default \'\',\n
`in_reply_to` varchar(255) default \'\',\n
`modified` datetime default \'0000-00-00 00:00:00\',\n
`review_state` varchar(255) default \'\',\n
`summary` text,\n
`language` varchar(5) default \'\',\n
`version` varchar(10) default \'\',\n
PRIMARY KEY (`uid`),\n
KEY `Type` (`Type`),\n
KEY `review_state` (`review_state`)\n
) TYPE=InnoDB;\n
</string> </value>
</item>
<item>
<key> <string>template</string> </key>
<value>
<object>
<klass>
<global name="SQL" module="Shared.DC.ZRDB.DA"/>
</klass>
<none/>
<state>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string encoding="cdata"><![CDATA[
<string>
]]></string> </value>
</item>
<item>
<key> <string>_vars</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>globals</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>raw</string> </key>
<value> <string># Host:\n
# Database: test\n
# Table: \'compatibility\'\n
#\n
CREATE TABLE `compatibility` (\n
`uid` BIGINT UNSIGNED NOT NULL,\n
`Creator` varchar(255) default \'\',\n
`Date` datetime default \'0000-00-00 00:00:00\',\n
`PrincipiaSearchSource` text,\n
`SearchableText` text,\n
`CreationDate` datetime default \'0000-00-00 00:00:00\',\n
`EffectiveDate` datetime default \'0000-00-00 00:00:00\',\n
`ExpiresDate` datetime default \'0000-00-00 00:00:00\',\n
`ModificationDate` datetime default \'0000-00-00 00:00:00\',\n
`Type` varchar(255) default \'\',\n
`bobobase_modification_time` datetime default \'0000-00-00 00:00:00\',\n
`created` datetime default \'0000-00-00 00:00:00\',\n
`effective` datetime default \'0000-00-00 00:00:00\',\n
`expires` datetime default \'0000-00-00 00:00:00\',\n
`getIcon` varchar(255) default \'\',\n
`in_reply_to` varchar(255) default \'\',\n
`modified` datetime default \'0000-00-00 00:00:00\',\n
`review_state` varchar(255) default \'\',\n
`summary` text,\n
`language` varchar(5) default \'\',\n
`version` varchar(10) default \'\',\n
PRIMARY KEY (`uid`),\n
KEY `Type` (`Type`),\n
KEY `review_state` (`review_state`)\n
) TYPE=InnoDB;\n
</string> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<key_list>
<key>compatibility</key>
<key>email</key>
</key_list>
\ No newline at end of file
...@@ -76,16 +76,13 @@ ...@@ -76,16 +76,13 @@
# ref[1] is a dict of values from parsed reference string\n # ref[1] is a dict of values from parsed reference string\n
context.log(script.getId(),ref)\n context.log(script.getId(),ref)\n
reference=ref[1][\'reference\']\n reference=ref[1][\'reference\']\n
res=context.portal_catalog(reference=reference,portal_type=context.getPortalDocumentTypeList())\n searchargs=dict(reference=reference,portal_type=context.getPortalDocumentTypeList(),sort_on=\'version\')\n
res=[r.getObject() for r in res]\n
context.log(\'res\',res)\n
lng=ref[1].get(\'language\')\n lng=ref[1].get(\'language\')\n
context.log(\'lng\',lng)\n context.log(\'lng\',lng)\n
if lng is not None:\n if lng is not None:\n
res=filter(lambda o:o.getLanguage()==lng,res)\n searchargs[\'language\']=lng\n
context.log(\'res\',res)\n res=context.portal_catalog(**searchargs)\n
res.sort(key=lambda o:o.getVersion(),reverse=True)\n res.reverse() # can catalog do reverse sorting?\n
context.log(\'res\',res)\n
return res\n return res\n
</string> </value> </string> </value>
</item> </item>
...@@ -135,15 +132,13 @@ return res\n ...@@ -135,15 +132,13 @@ return res\n
<string>script</string> <string>script</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>reference</string> <string>reference</string>
<string>res</string> <string>dict</string>
<string>append</string> <string>searchargs</string>
<string>$append0</string>
<string>_getiter_</string>
<string>r</string>
<string>lng</string> <string>lng</string>
<string>None</string> <string>None</string>
<string>filter</string> <string>_write_</string>
<string>True</string> <string>_apply_</string>
<string>res</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -75,10 +75,8 @@ if ref is None: # this shouldn\'t happen\n ...@@ -75,10 +75,8 @@ if ref is None: # this shouldn\'t happen\n
lng=o.getLanguage()\n lng=o.getLanguage()\n
if lng is None: # ibidem\n if lng is None: # ibidem\n
raise Exception(\'how on earth can language be None?\')\n raise Exception(\'how on earth can language be None?\')\n
res=context.portal_catalog(reference=ref,portal_type=o.getPortalType(),simulation_state=\'published\')\n res=context.portal_catalog(reference=ref,language=lng,simulation_state=\'published\')\n
res=[r.getObject() for r in res]\n for ob in [r.getObject() for r in res]: # again, this should never happen, but still\n
res=filter(lambda o:o.getLanguage()==lng,res)\n
for ob in res: # again, this should never happen, but still\n
o.portal_workflow.doActionFor(ob,\'archive_action\')\n o.portal_workflow.doActionFor(ob,\'archive_action\')\n
</string> </value> </string> </value>
</item> </item>
...@@ -131,11 +129,10 @@ for ob in res: # again, this should never happen, but still\n ...@@ -131,11 +129,10 @@ for ob in res: # again, this should never happen, but still\n
<string>lng</string> <string>lng</string>
<string>context</string> <string>context</string>
<string>res</string> <string>res</string>
<string>_getiter_</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
<string>_getiter_</string>
<string>r</string> <string>r</string>
<string>filter</string>
<string>ob</string> <string>ob</string>
</tuple> </tuple>
</value> </value>
......
...@@ -75,10 +75,8 @@ if ref is None: # this shouldn\'t happen\n ...@@ -75,10 +75,8 @@ if ref is None: # this shouldn\'t happen\n
lng=o.getLanguage()\n lng=o.getLanguage()\n
if lng is None: # ibidem\n if lng is None: # ibidem\n
raise Exception(\'how on earth can language be None?\')\n raise Exception(\'how on earth can language be None?\')\n
res=context.portal_catalog(reference=ref,portal_type=o.getPortalType(),simulation_state=\'released\')\n res=context.portal_catalog(reference=ref,language=lng,simulation_state=\'released\')\n
res=[r.getObject() for r in res]\n for ob in [r.getObject() for r in res]: # again, this should never happen, but still\n
res=filter(lambda o:o.getLanguage()==lng,res)\n
for ob in res: # again, this should never happen, but still\n
o.portal_workflow.doActionFor(ob,\'archive_action\')\n o.portal_workflow.doActionFor(ob,\'archive_action\')\n
</string> </value> </string> </value>
</item> </item>
...@@ -131,11 +129,10 @@ for ob in res: # again, this should never happen, but still\n ...@@ -131,11 +129,10 @@ for ob in res: # again, this should never happen, but still\n
<string>lng</string> <string>lng</string>
<string>context</string> <string>context</string>
<string>res</string> <string>res</string>
<string>_getiter_</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
<string>_getiter_</string>
<string>r</string> <string>r</string>
<string>filter</string>
<string>ob</string> <string>ob</string>
</tuple> </tuple>
</value> </value>
......
...@@ -79,9 +79,8 @@ for req in (\'reference\', \'language\', \'version\'):\n ...@@ -79,9 +79,8 @@ for req in (\'reference\', \'language\', \'version\'):\n
err+=\'E: %s is None \' % req\n err+=\'E: %s is None \' % req\n
if err:\n if err:\n
raise ValidationFailed(err)\n raise ValidationFailed(err)\n
res=context.portal_catalog(reference=o.getReference())\n res=context.portal_catalog(reference=o.getReference(),language=o.getLanguage(),version=o.getVersion(),portal_type=context.getPortalDocumentTypeList())\n
res=[r.getObject() for r in res]\n res=list(res)\n
res=filter(lambda r:r.getLanguage()==o.getLanguage() and r.getVersion()==o.getVersion(),res)\n
if len(res)==2: # this and the other one\n if len(res)==2: # this and the other one\n
raise ValidationFailed(\'E: another object %s - %s - %s exists\' % (o.getReference(),o.getLanguage(),o.getVersion()))\n raise ValidationFailed(\'E: another object %s - %s - %s exists\' % (o.getReference(),o.getLanguage(),o.getVersion()))\n
if len(res)>2:\n if len(res)>2:\n
...@@ -141,10 +140,7 @@ if len(res)>2:\n ...@@ -141,10 +140,7 @@ if len(res)>2:\n
<string>None</string> <string>None</string>
<string>context</string> <string>context</string>
<string>res</string> <string>res</string>
<string>append</string> <string>list</string>
<string>$append0</string>
<string>r</string>
<string>filter</string>
<string>len</string> <string>len</string>
<string>Exception</string> <string>Exception</string>
</tuple> </tuple>
......
2006-09-14 2006-09-14
Fixed some bugs and controls, implemented publication workflow side effects, check unique identifier upon submission. Fixed some bugs and controls, implemented publication workflow side effects, check unique identifier upon submission.
Added language and version to catalog (compatibility), updated scripts accordingly
2006-09-12 2006-09-12
First implementation of External Document (a web page, spidered and cached) First implementation of External Document (a web page, spidered and cached)
......
153 157
\ No newline at end of file \ No newline at end of file
erp5_mysql/z0_drop_email erp5_mysql/z0_drop_email
erp5_mysql/z0_uncatalog_email erp5_mysql/z0_uncatalog_email
erp5_mysql/z_catalog_compatibility_list
erp5_mysql/z_catalog_email_list erp5_mysql/z_catalog_email_list
erp5_mysql/z_create_compatibility
erp5_mysql/z_create_email erp5_mysql/z_create_email
\ No newline at end of file
0.73 0.74
\ 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