Commit e0ac27be authored by Rafael Monnerat's avatar Rafael Monnerat

2008-07-15 rafael

* Updated WebSection_zGetDocumentValueList to support more params and fix some issues.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22466 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 540ae10b
...@@ -43,6 +43,12 @@ ...@@ -43,6 +43,12 @@
<dictionary/> <dictionary/>
</value> </value>
</item> </item>
<item>
<key> <string>all_versions</string> </key>
<value>
<dictionary/>
</value>
</item>
<item> <item>
<key> <string>kw</string> </key> <key> <string>kw</string> </key>
<value> <value>
...@@ -75,6 +81,7 @@ ...@@ -75,6 +81,7 @@
<list> <list>
<string>language</string> <string>language</string>
<string>all_languages</string> <string>all_languages</string>
<string>all_versions</string>
<string>validation_state</string> <string>validation_state</string>
<string>kw</string> <string>kw</string>
</list> </list>
...@@ -101,6 +108,7 @@ ...@@ -101,6 +108,7 @@
<key> <string>arguments_src</string> </key> <key> <string>arguments_src</string> </key>
<value> <string>language\r\n <value> <string>language\r\n
all_languages\r\n all_languages\r\n
all_versions\r\n
validation_state:list\r\n validation_state:list\r\n
kw</string> </value> kw</string> </value>
</item> </item>
...@@ -118,7 +126,9 @@ kw</string> </value> ...@@ -118,7 +126,9 @@ kw</string> </value>
</item> </item>
<item> <item>
<key> <string>connection_hook</string> </key> <key> <string>connection_hook</string> </key>
<value> <string></string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>connection_id</string> </key> <key> <string>connection_id</string> </key>
...@@ -142,13 +152,25 @@ kw</string> </value> ...@@ -142,13 +152,25 @@ kw</string> </value>
<dtml-let query="buildSQLQuery(query=portal_catalog.getSecurityQuery(**kw), validation_state=validation_state, **kw)">\n <dtml-let query="buildSQLQuery(query=portal_catalog.getSecurityQuery(**kw), validation_state=validation_state, **kw)">\n
\n \n
<dtml-comment>\n
the subquery is named catalog to prevent use another LEFT JOIN.\n
</dtml-comment>\n
\n
SELECT\n SELECT\n
t.path AS path, t.uid AS uid, t.version AS version\n catalog.path AS path, catalog.uid AS uid, catalog.modification_date,\n
catalog.reference, catalog.int_index, catalog.creation_date , catalog.title, \n
catalog.priority\n
FROM\n FROM\n
(\n (\n
SELECT\n SELECT\n
catalog.uid, catalog.path, catalog.int_index,\n catalog.uid, catalog.path, catalog.int_index, catalog.modification_date,\n
catalog.reference, my_versioning.language, my_versioning.version\n catalog.reference, my_versioning.language, my_versioning.version,\n
catalog.creation_date, catalog.title\n
, MAX(CONCAT(CASE my_versioning.language\n
WHEN <dtml-sqlvar language type="string"> THEN \'3\'\n
WHEN \'en\' THEN \'2\'\n
ELSE \'1\' END,\n
my_versioning.version)) AS priority\n
FROM\n FROM\n
<dtml-in prefix="table" expr="query[\'from_table_list\']">\n <dtml-in prefix="table" expr="query[\'from_table_list\']">\n
<dtml-var table_item> AS <dtml-var table_key>,\n <dtml-var table_item> AS <dtml-var table_key>,\n
...@@ -157,29 +179,46 @@ FROM\n ...@@ -157,29 +179,46 @@ FROM\n
WHERE\n WHERE\n
my_versioning.uid = catalog.uid\n my_versioning.uid = catalog.uid\n
<dtml-if "query[\'where_expression\']">\n <dtml-if "query[\'where_expression\']">\n
AND <dtml-var "query[\'where_expression\']">\n AND <dtml-var "query[\'where_expression\']">\n
</dtml-if>\n </dtml-if>\n
<dtml-if all_languages>\n <dtml-if all_languages>\n
\n
<dtml-else>\n
AND my_versioning.language = <dtml-sqlvar language type="string"> \n
</dtml-if>\n
GROUP BY\n
catalog.uid\n
ORDER BY\n
priority DESC\n
) AS catalog, versioning AS my_versioning\n
WHERE\n
catalog.uid = my_versioning.uid\n
<dtml-if all_versions>\n
GROUP BY\n GROUP BY\n
catalog.reference\n catalog.uid\n
HAVING\n
MAX(CASE my_versioning.language WHEN <dtml-sqlvar language type="string"> THEN 3 WHEN \'en\' THEN 2 ELSE 1 END)\n
= CASE my_versioning.language WHEN <dtml-sqlvar language type="string"> THEN 3 WHEN \'en\' THEN 2 ELSE 1 END\n
<dtml-else>\n <dtml-else>\n
AND my_versioning.language = <dtml-sqlvar language type="string">\n GROUP BY\n
catalog.reference\n
HAVING \n
MAX(CONCAT(CASE my_versioning.language\n
WHEN <dtml-sqlvar language type="string"> THEN \'3\'\n
WHEN \'en\' THEN \'2\'\n
ELSE \'1\' END,\n
my_versioning.version)) = catalog.priority\n
</dtml-if>\n </dtml-if>\n
) AS t\n ORDER BY\n
GROUP BY\n <dtml-if "query[\'order_by_expression\']">\n
t.reference\n <dtml-var "query[\'order_by_expression\']">\n
HAVING\n <dtml-else>\n
MAX(t.version) = t.version\n catalog.int_index, catalog.reference\n
ORDER BY\n </dtml-if>\n
t.int_index, t.reference\n \n
<dtml-if "query[\'limit_expression\']">\n <dtml-if "query[\'limit_expression\']">\n
LIMIT <dtml-var "query[\'limit_expression\']">\n LIMIT <dtml-var "query[\'limit_expression\']">\n
<dtml-else>\n <dtml-else>\n
LIMIT 1000\n LIMIT 1000\n
</dtml-if>\n </dtml-if>\n
\n
</dtml-let> </dtml-let>
]]></string> </value> ]]></string> </value>
...@@ -222,13 +261,25 @@ ORDER BY\n ...@@ -222,13 +261,25 @@ ORDER BY\n
<dtml-let query="buildSQLQuery(query=portal_catalog.getSecurityQuery(**kw), validation_state=validation_state, **kw)">\n <dtml-let query="buildSQLQuery(query=portal_catalog.getSecurityQuery(**kw), validation_state=validation_state, **kw)">\n
\n \n
<dtml-comment>\n
the subquery is named catalog to prevent use another LEFT JOIN.\n
</dtml-comment>\n
\n
SELECT\n SELECT\n
t.path AS path, t.uid AS uid, t.version AS version\n catalog.path AS path, catalog.uid AS uid, catalog.modification_date,\n
catalog.reference, catalog.int_index, catalog.creation_date , catalog.title, \n
catalog.priority\n
FROM\n FROM\n
(\n (\n
SELECT\n SELECT\n
catalog.uid, catalog.path, catalog.int_index,\n catalog.uid, catalog.path, catalog.int_index, catalog.modification_date,\n
catalog.reference, my_versioning.language, my_versioning.version\n catalog.reference, my_versioning.language, my_versioning.version,\n
catalog.creation_date, catalog.title\n
, MAX(CONCAT(CASE my_versioning.language\n
WHEN <dtml-sqlvar language type="string"> THEN \'3\'\n
WHEN \'en\' THEN \'2\'\n
ELSE \'1\' END,\n
my_versioning.version)) AS priority\n
FROM\n FROM\n
<dtml-in prefix="table" expr="query[\'from_table_list\']">\n <dtml-in prefix="table" expr="query[\'from_table_list\']">\n
<dtml-var table_item> AS <dtml-var table_key>,\n <dtml-var table_item> AS <dtml-var table_key>,\n
...@@ -237,29 +288,46 @@ FROM\n ...@@ -237,29 +288,46 @@ FROM\n
WHERE\n WHERE\n
my_versioning.uid = catalog.uid\n my_versioning.uid = catalog.uid\n
<dtml-if "query[\'where_expression\']">\n <dtml-if "query[\'where_expression\']">\n
AND <dtml-var "query[\'where_expression\']">\n AND <dtml-var "query[\'where_expression\']">\n
</dtml-if>\n </dtml-if>\n
<dtml-if all_languages>\n <dtml-if all_languages>\n
\n
<dtml-else>\n
AND my_versioning.language = <dtml-sqlvar language type="string"> \n
</dtml-if>\n
GROUP BY\n
catalog.uid\n
ORDER BY\n
priority DESC\n
) AS catalog, versioning AS my_versioning\n
WHERE\n
catalog.uid = my_versioning.uid\n
<dtml-if all_versions>\n
GROUP BY\n GROUP BY\n
catalog.reference\n catalog.uid\n
HAVING\n <dtml-else>\n
MAX(CASE my_versioning.language WHEN <dtml-sqlvar language type="string"> THEN 3 WHEN \'en\' THEN 2 ELSE 1 END)\n GROUP BY\n
= CASE my_versioning.language WHEN <dtml-sqlvar language type="string"> THEN 3 WHEN \'en\' THEN 2 ELSE 1 END\n catalog.reference\n
HAVING \n
MAX(CONCAT(CASE my_versioning.language\n
WHEN <dtml-sqlvar language type="string"> THEN \'3\'\n
WHEN \'en\' THEN \'2\'\n
ELSE \'1\' END,\n
my_versioning.version)) = catalog.priority\n
</dtml-if>\n
ORDER BY\n
<dtml-if "query[\'order_by_expression\']">\n
<dtml-var "query[\'order_by_expression\']">\n
<dtml-else>\n <dtml-else>\n
AND my_versioning.language = <dtml-sqlvar language type="string">\n catalog.int_index, catalog.reference\n
</dtml-if>\n </dtml-if>\n
) AS t\n \n
GROUP BY\n
t.reference\n
HAVING\n
MAX(t.version) = t.version\n
ORDER BY\n
t.int_index, t.reference\n
<dtml-if "query[\'limit_expression\']">\n <dtml-if "query[\'limit_expression\']">\n
LIMIT <dtml-var "query[\'limit_expression\']">\n LIMIT <dtml-var "query[\'limit_expression\']">\n
<dtml-else>\n <dtml-else>\n
LIMIT 1000\n LIMIT 1000\n
</dtml-if>\n </dtml-if>\n
\n
</dtml-let> </dtml-let>
]]></string> </value> ]]></string> </value>
......
2008-07-15 rafael
* Updated WebSection_zGetDocumentValueList to support more params and fix some issues.
2008-07-06 yo 2008-07-06 yo
* Add effective date into Web Page. * Add effective date into Web Page.
......
678 682
\ 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