Commit 103c1f5d authored by Julien Muchembled's avatar Julien Muchembled

ERP5Catalog: remove obsolete SQL methods

parent 01f5f01a
...@@ -292,102 +292,6 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject): ...@@ -292,102 +292,6 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
else: else:
return id return id
security.declareProtected('Import/Export objects', 'addDefaultSQLMethods')
def addDefaultSQLMethods(self, config_id='erp5'):
"""
Add default SQL methods for a given configuration.
"""
# For compatibility.
if config_id.lower() == 'erp5':
config_id = 'erp5_mysql'
elif config_id.lower() == 'cps3':
config_id = 'cps3_mysql'
addSQLCatalog = self.manage_addProduct['ZSQLCatalog'].manage_addSQLCatalog
if config_id not in self.objectIds():
addSQLCatalog(config_id, '')
catalog = self.getSQLCatalog(config_id)
addSQLMethod = catalog.manage_addProduct['ZSQLMethods'].manage_addZSQLMethod
product_path = package_home(globals())
zsql_dirs = []
# Common methods - for backward compatibility
# SQL code distribution is supposed to be business template based nowadays
if config_id.lower() == 'erp5_mysql':
zsql_dirs.append(os.path.join(product_path, 'sql', 'common_mysql'))
zsql_dirs.append(os.path.join(product_path, 'sql', 'erp5_mysql'))
elif config_id.lower() == 'cps3_mysql':
zsql_dirs.append(os.path.join(product_path, 'sql', 'common_mysql'))
zsql_dirs.append(os.path.join(product_path, 'sql', 'cps3_mysql'))
# Iterate over the sql directory. Add all sql methods in that directory.
for directory in zsql_dirs:
for entry in os.listdir(directory):
if entry.endswith('.zsql'):
id = entry[:-5]
# Create an empty SQL method first.
addSQLMethod(id = id, title = '', connection_id = '', arguments = '', template = '')
#LOG('addDefaultSQLMethods', 0, 'catalog = %r' % (catalog.objectIds(),))
sql_method = getattr(catalog, id)
# Set parameters of the SQL method from the contents of a .zsql file.
sql_method.fromFile(os.path.join(directory, entry))
elif entry == 'properties.xml':
# This sets up the attributes. The file should be generated by manage_exportProperties.
catalog.manage_importProperties(os.path.join(directory, entry))
# Make this the default.
self.default_sql_catalog_id = config_id
security.declareProtected('Import/Export objects', 'exportSQLMethods')
def exportSQLMethods(self, sql_catalog_id=None, config_id='erp5'):
"""
Export SQL methods for a given configuration.
"""
# For compatibility.
if config_id.lower() == 'erp5':
config_id = 'erp5_mysql'
elif config_id.lower() == 'cps3':
config_id = 'cps3_mysql'
catalog = self.getSQLCatalog(sql_catalog_id)
product_path = package_home(globals())
common_sql_dir = os.path.join(product_path, 'sql', 'common_mysql')
config_sql_dir = os.path.join(product_path, 'sql', config_id)
common_sql_list = ('z0_drop_record', 'z_read_recorded_object_list', 'z_catalog_paths',
'z_record_catalog_object', 'z_clear_reserved', 'z_record_uncatalog_object',
'z_create_record', 'z_delete_recorded_object_list',
'z_reserve_uid', 'z_getitem_by_path', 'z_show_columns', 'z_getitem_by_path',
'z_show_tables', 'z_getitem_by_uid', 'z_unique_values', 'z_produce_reserved_uid_list',)
msg = ''
for id in catalog.objectIds(spec=('Z SQL Method',)):
if id in common_sql_list:
d = common_sql_dir
else:
d = config_sql_dir
sql = catalog._getOb(id)
# First convert the skin to text
text = sql.manage_FTPget()
name = os.path.join(d, '%s.zsql' % (id,))
msg += 'Writing %s\n' % (name,)
f = open(name, 'w')
try:
f.write(text)
finally:
f.close()
properties = self.manage_catalogExportProperties(sql_catalog_id=sql_catalog_id)
name = os.path.join(config_sql_dir, 'properties.xml')
msg += 'Writing %s\n' % (name,)
f = open(name, 'w')
try:
f.write(properties)
finally:
f.close()
return msg
def _listAllowedRolesAndUsers(self, user): def _listAllowedRolesAndUsers(self, user):
# We use ERP5Security PAS based authentication # We use ERP5Security PAS based authentication
try: try:
......
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE record
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:100000
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
select distinct path from catalog
\ No newline at end of file
<dtml-comment>
title:Clear Reserved Uids
connection_id:erp5_sql_connection
max_rows:1
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>count:int
thread_id
date</params>
DELETE FROM
catalog
WHERE
path = "reserved"
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
# Host:
# Database: test
# Table: 'record'
#
CREATE TABLE `record` (
`uid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`path` varchar(255) NOT NULL default '',
`catalog` BOOL NOT NULL default 0,
`played` BOOL NOT NULL default 0,
`date` DATETIME NOT NULL,
PRIMARY KEY (`uid`),
KEY `played` (`played`),
KEY `date` (`date`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid_list</params>
<dtml-comment>Do not delete rows really, but just mark them as "played" to avoid dead locks</dtml-comment>
<dtml-if path>
UPDATE
record
SET
played = 1
WHERE
<dtml-in uid_list>
uid = <dtml-sqlvar sequence-item type="string"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
</dtml-if>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:10
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>path
uid_only</params>
select <dtml-if uid_only>uid<dtml-else>*</dtml-if> from catalog where <dtml-sqltest path op=eq type="string">
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1
max_cache:0
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>uid</params>
select * from catalog where <dtml-sqltest uid op=eq type="int">
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:0
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>count:int
instance_id</params>
INSERT INTO
catalog (id, path)
VALUES
<dtml-in "_.range(count - 1)">
( <dtml-sqlvar instance_id type="string"> , 'reserved' ) ,
</dtml-in>
( <dtml-sqlvar instance_id type="string"> , 'reserved' );
<dtml-var "'\0'">
SELECT
uid
FROM
catalog
WHERE
path = 'reserved'
AND
id = <dtml-sqlvar instance_id type="string">
LIMIT
10000
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>catalog</params>
SELECT
uid, path
FROM
record
WHERE
played = 0
AND catalog = <dtml-sqlvar catalog type="int">
ORDER BY
date
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>path_list
catalog</params>
INSERT INTO
record (path, catalog, played, date)
VALUES
<dtml-in path_list>
(
<dtml-sqlvar sequence-item type="string">,
<dtml-sqlvar catalog type="int">,
0,
NOW()
)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.uid = catalog.security_uid
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:0
max_cache:0
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid:list</params>
REPLACE INTO
catalog (uid, id, path)
VALUES
<dtml-in uid>
(<dtml-sqlvar sequence-item type="int">, 'used', 'reserved')
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table</params>
show columns from <dtml-var table>
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table</params>
show tables
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>column</params>
SELECT DISTINCT <dtml-var column> FROM catalog
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE cps
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE local_users_with_roles
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM cps WHERE <dtml-sqltest uid op=eq type=int>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM local_users_with_roles WHERE <dtml-sqltest uid op=eq type=int>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
PrincipiaSearchSource
SearchableText
Title
start
end
time
relative_path_depth
container_path
portal_type
getPhysicalPath</params>
INSERT INTO
cps
SET
uid = <dtml-sqlvar uid type="int">,
PrincipiaSearchSource=<dtml-sqlvar PrincipiaSearchSource type="string">,
SearchableText=<dtml-sqlvar SearchableText type="string">,
ZCTitle = <dtml-sqlvar Title type="string">,
start = <dtml-sqlvar start type="string">,
end = <dtml-sqlvar end type="string">,
time = <dtml-sqlvar time type="string">,
<dtml-if relative_path_depth >relative_path_depth = <dtml-sqlvar relative_path_depth type="int">,</dtml-if>
container_path = <dtml-sqlvar container_path type="string">,
leaves = <dtml-sqlvar "portal_type not in ('Section', 'Workspace')" type="int">,
searchable = <dtml-sqlvar "not filter(lambda s:s.startswith('portal_') or s and s[0] in ('.', '_'), getPhysicalPath)" type="int">
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>localUsersWithRoles</params>
<dtml-if localUsersWithRoles>
INSERT INTO local_users_with_roles VALUES
<dtml-in localUsersWithRoles>
(<dtml-sqlvar uid type="int">, <dtml-sqlvar sequence-item type=string>)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
;
</dtml-if>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
# Host: localhost
# Database: cps
# Table: 'cps'
#
CREATE TABLE `cps` (
`uid` int(11) NOT NULL default '0',
`searchable` int(11) default NULL,
`leaves` int(11) default NULL,
`ZCTitle` varchar(255) default NULL,
`start` datetime default '0000-00-00 00:00:00',
`end` datetime default '0000-00-00 00:00:00',
`time` datetime default '0000-00-00 00:00:00',
`relative_path_depth` int(11) default NULL,
`container_path` varchar(255) default NULL,
`PrincipiaSearchSource` text,
`SearchableText` text,
KEY (`uid`),
KEY `start` (`start`),
KEY `leaves` (`leaves`),
KEY `relative_path_depth` (`relative_path_depth`,`container_path`),
KEY `time` (`time`),
KEY `searchable` (`searchable`),
KEY `end` (`end`),
KEY `container_path` (`container_path`),
FULLTEXT KEY `PrincipiaSearchSource` (`PrincipiaSearchSource`),
FULLTEXT KEY `SearchableText` (`SearchableText`),
FULLTEXT KEY `ZCTitle` (`ZCTitle`)
) ENGINE=MyISAM;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
CREATE TABLE local_users_with_roles (
uid INT,
localUsersWithRoles VARCHAR(40),
KEY `uid` (`uid`),
KEY `localUsersWithRoles` (`localUsersWithRoles`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
PrincipiaSearchSource
SearchableText
Title
start
end
time
relative_path_depth
container_path
portal_type
getPhysicalPath</params>
UPDATE
cps
SET
PrincipiaSearchSource=<dtml-sqlvar PrincipiaSearchSource type="string">,
SearchableText=<dtml-sqlvar SearchableText type="string">,
ZCTitle = <dtml-sqlvar Title type="string">,
start = <dtml-sqlvar start type="string">,
end = <dtml-sqlvar end type="string">,
time = <dtml-sqlvar time type="string">,
<dtml-if relative_path_depth>relative_path_depth = <dtml-sqlvar relative_path_depth type="int">,</dtml-if>
container_path = <dtml-sqlvar container_path type="string">,
leaves = <dtml-sqlvar "portal_type not in ('Section', 'Workspace')" type="int">,
searchable = <dtml-sqlvar "not filter(lambda s:s.startswith('portal_') or s and s[0] in ('.', '_'), getPhysicalPath)" type="int">
WHERE
uid = <dtml-sqlvar uid type="int">
<?xml version="1.0"?>
<SQLCatalogData>
<property id="sql_catalog_clear_reserved" type="str">z_clear_reserved</property>
<property id="sql_catalog_full_text_search_keys" type="tuple">
<item type="str">full_text.SearchableText</item>
</property>
<property id="sql_catalog_keyword_search_keys" type="tuple">
<item type="str">catalog.description</item>
<item type="str">catalog.title</item>
<item type="str">description</item>
<item type="str">title</item>
</property>
<property id="sql_catalog_multivalue_keys" type="tuple">
</property>
<property id="sql_catalog_object_list" type="tuple">
<item type="str">z_catalog_delivery_list</item>
<item type="str">z_catalog_fulltext_list</item>
<item type="str">z_catalog_item_list</item>
<item type="str">z_catalog_movement_category_list</item>
<item type="str">z_catalog_movement_list</item>
<item type="str">z_catalog_non_movement_category_list</item>
<item type="str">z_catalog_object_list</item>
<item type="str">z_catalog_predicate_category_list</item>
<item type="str">z_catalog_predicate_list</item>
<item type="str">z_catalog_roles_and_users_list</item>
<item type="str">z_catalog_stock_list</item>
</property>
<property id="sql_catalog_paths" type="str">z_catalog_paths</property>
<property id="sql_catalog_produce_reserved" type="str">z_produce_reserved_uid_list</property>
<property id="sql_catalog_related_keys" type="tuple">
<item type="str">allowedRolesAndUsers | roles_and_users/allowedRolesAndUsers/z_related_security</item>
<item type="str">base_category_id | category,catalog/id/z_related_base_category_id</item>
<item type="str">career_skill_id | category,catalog,catalog/id/z_related_career_skill</item>
<item type="str">career_skill_title | category,catalog,catalog/title/z_related_career_skill</item>
<item type="str">default_destination_id | category,catalog/id/z_related_default_destination</item>
<item type="str">default_destination_section_id | category,catalog/id/z_related_default_destination_section</item>
<item type="str">default_destination_section_title | category,catalog/title/z_related_default_destination_section</item>
<item type="str">default_destination_title | category,catalog/title/z_related_default_destination</item>
<item type="str">default_source_id | category,catalog/id/z_related_default_source</item>
<item type="str">default_source_section_id | category,catalog/id/z_related_default_source_section</item>
<item type="str">default_source_section_title | category,catalog/title/z_related_default_source_section</item>
<item type="str">default_source_title | category,catalog/title/z_related_default_source</item>
<item type="str">deliveryLineType | movement,catalog/portal_type/z_related_uid_or_parent_uid</item>
<item type="str">destination_id | category,catalog/id/z_related_default_destination</item>
<item type="str">destination_section_id | category,catalog/id/z_related_default_destination_section</item>
<item type="str">destination_section_title | category,catalog/title/z_related_default_destination_section</item>
<item type="str">destination_title | category,catalog/title/z_related_default_destination</item>
<item type="str">explanation_portal_type | movement,catalog/portal_type/z_related_explanation</item>
<item type="str">grand_parent_portal_type | catalog,catalog/portal_type/z_related_grand_parent</item>
<item type="str">grand_parent_simulation_state | catalog,catalog/simulation_state/z_related_grand_parent</item>
<item type="str">item_node_category_uid | category/category_uid/z_related_node_uid_from_item</item>
<item type="str">item_resource_category_uid | category/category_uid/z_related_resource_uid_from_item</item>
<item type="str">item_section_category_uid | category/category_uid/z_related_section_uid_from_item</item>
<item type="str">parent_specialise_portal_type | category,catalog/portal_type/z_related_parent_specialise</item>
<item type="str">predicate_uid | predicate/uid/z_related_predicate</item>
<item type="str">resourceType | movement,catalog/portal_type/z_related_resource</item>
<item type="str">source_id | category,catalog/id/z_related_default_source</item>
<item type="str">source_section_id | category,catalog/id/z_related_default_source_section</item>
<item type="str">source_section_title | category,catalog/title/z_related_default_source_section</item>
<item type="str">source_title | category,catalog/title/z_related_default_source</item>
<item type="str">stock_mirror_section_category_uid | category/category_uid/z_related_mirror_section_uid_from_stock</item>
<item type="str">stock_node_category_uid | category/category_uid/z_related_node_uid_from_stock</item>
<item type="str">stock_payment_category_uid | category/category_uid/z_related_payment_uid_from_stock</item>
<item type="str">stock_resource_category_uid | category/category_uid/z_related_resource_uid_from_stock</item>
<item type="str">stock_section_category_uid | category/category_uid/z_related_section_uid_from_stock</item>
<item type="str">subordination_title | category,catalog/title/z_related_subordination</item>
<item type="str">translated_opportunity_state | translation/translated_message/z_related_translated_opportunity_state</item>
<item type="str">translated_opportunity_state_title | translation/translated_message/z_related_translated_opportunity_state</item>
<item type="str">translated_portal_type | translation/translated_message/z_related_translated_portal_type</item>
<item type="str">translated_simulation_state | translation/translated_message/z_related_translated_simulation_state_title</item>
<item type="str">translated_simulation_state_title | translation/translated_message/z_related_translated_simulation_state</item>
<item type="str">translated_validation_state | translation/translated_message/z_related_translated_validation_state</item>
<item type="str">translated_validation_state_title | translation/translated_message/z_related_translated_validation_state</item>
<item type="str">variationCategory | category/category_uid/z_related_uid</item>
</property>
<property id="sql_catalog_request_keys" type="tuple">
</property>
<property id="sql_catalog_reserve_uid" type="str">z_reserve_uid</property>
<property id="sql_catalog_schema" type="str">z_show_columns</property>
<property id="sql_catalog_tables" type="str">z_show_tables</property>
<property id="sql_catalog_topic_search_keys" type="tuple">
</property>
<property id="sql_catalog_translation_list" type="str">z_catalog_translation_list</property>
<property id="sql_clear_catalog" type="tuple">
<item type="str">z0_drop_catalog</item>
<item type="str">z0_drop_category</item>
<item type="str">z0_drop_compatibility</item>
<item type="str">z0_drop_delivery</item>
<item type="str">z0_drop_fulltext</item>
<item type="str">z0_drop_item</item>
<item type="str">z0_drop_movement</item>
<item type="str">z0_drop_predicate</item>
<item type="str">z0_drop_predicate_category</item>
<item type="str">z0_drop_record</item>
<item type="str">z0_drop_roles_and_users</item>
<item type="str">z0_drop_stock</item>
<item type="str">z0_drop_subject</item>
<item type="str">z0_drop_translation</item>
<item type="str">z_create_catalog</item>
<item type="str">z_create_category</item>
<item type="str">z_create_compatibility</item>
<item type="str">z_create_delivery</item>
<item type="str">z_create_fulltext</item>
<item type="str">z_create_item</item>
<item type="str">z_create_movement</item>
<item type="str">z_create_predicate</item>
<item type="str">z_create_predicate_category</item>
<item type="str">z_create_record</item>
<item type="str">z_create_roles_and_users</item>
<item type="str">z_create_stock</item>
<item type="str">z_create_subject</item>
<item type="str">z_create_translation</item>
</property>
<property id="sql_count_results" type="str">z_count_results</property>
<property id="sql_delete_recorded_object_list" type="str">z_delete_recorded_object_list</property>
<property id="sql_delete_translation_list" type="str">z_delete_translation_list</property>
<property id="sql_getitem_by_path" type="str">z_getitem_by_path</property>
<property id="sql_getitem_by_uid" type="str">z_getitem_by_uid</property>
<property id="sql_read_recorded_object_list" type="str">z_read_recorded_object_list</property>
<property id="sql_record_object_list" type="str">z_record_object_list</property>
<property id="sql_search_result_keys" type="tuple">
<item type="str">catalog.path</item>
<item type="str">catalog.uid</item>
</property>
<property id="sql_search_results" type="str">z_search_results</property>
<property id="sql_search_tables" type="tuple">
<item type="str">catalog</item>
<item type="str">category</item>
<item type="str">delivery</item>
<item type="str">full_text</item>
<item type="str">item</item>
<item type="str">movement</item>
<item type="str">predicate</item>
<item type="str">predicate_category</item>
<item type="str">roles_and_users</item>
<item type="str">stock</item>
</property>
<property id="sql_uncatalog_object" type="tuple">
<item type="str">z0_uncatalog_category</item>
<item type="str">z0_uncatalog_fulltext</item>
<item type="str">z0_uncatalog_item</item>
<item type="str">z0_uncatalog_movement</item>
<item type="str">z0_uncatalog_predicate</item>
<item type="str">z0_uncatalog_predicate_category</item>
<item type="str">z0_uncatalog_stock</item>
<item type="str">z_uncatalog_delivery</item>
<item type="str">z_uncatalog_object</item>
</property>
<property id="sql_unique_values" type="str">z_unique_values</property>
<property id="title" type="str">ERP5/MySQL</property>
<filter id="z_catalog_delivery_list" expression="python: isDelivery" />
<filter id="z_catalog_item_list" expression="python: isMovement" />
<filter id="z_catalog_movement_category_list" expression="python: isMovement" />
<filter id="z_catalog_movement_list" expression="python: isMovement" />
<filter id="z_catalog_non_movement_category_list" expression="python: not isMovement" />
<filter id="z_catalog_predicate_category_list" expression="python: isPredicate" />
<filter id="z_catalog_predicate_list" expression="python: isPredicate" />
<filter id="z_catalog_stock_list" expression="python: isMovement" />
</SQLCatalogData>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE catalog
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE category
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE compatibility
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE delivery
<dtml-comment>
title:
connection_id:erp5_sql_deferred_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE full_text
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE item
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE movement
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE predicate
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE predicate_category
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE roles_and_users
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE stock
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE subject
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DROP TABLE translation
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM category WHERE <dtml-sqltest uid op=eq type=int>
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM compatibility WHERE <dtml-sqltest uid op=eq type=int>
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_deferred_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM full_text WHERE <dtml-sqltest uid op=eq type=int>
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM item WHERE <dtml-sqltest uid op=eq type=int>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM movement WHERE <dtml-sqltest uid op=eq type=int>
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM predicate WHERE <dtml-sqltest uid op=eq type=int>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM predicate_category WHERE <dtml-sqltest uid op=eq type=int>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM stock WHERE <dtml-sqltest uid op=eq type=int>
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM subject WHERE <dtml-sqltest uid op=eq type=int>
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
Creator
Date
PrincipiaSearchSource
SearchableText
CreationDate
EffectiveDate
ExpiresDate
ModificationDate
Type
bobobase_modification_time
created
effective
expires
getIcon
in_reply_to
modified
review_state
summary
</params>
REPLACE INTO
compatibility
VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="Creator[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="Date[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="PrincipiaSearchSource[loop_item]" type="string" optional>,
<dtml-sqlvar expr="SearchableText[loop_item]" type="string" optional>,
<dtml-sqlvar expr="CreationDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="EffectiveDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="ExpiresDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="ModificationDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="Type[loop_item]" type="string" optional>,
<dtml-sqlvar expr="bobobase_modification_time[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="created[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="effective[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="expires[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getIcon[loop_item]" type="string" optional>,
<dtml-sqlvar expr="in_reply_to[loop_item]" type="string" optional>,
<dtml-sqlvar expr="modified[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="review_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="summary[loop_item]" type="string" optional>
)
<dtml-if sequence-end>
<dtml-else>
,
</dtml-if>
</dtml-in>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>isDelivery
uid
getSourceUid
getDestinationUid
getSourceSectionUid
getDestinationSectionUid
getResourceUid
getStartDate
getStartDateRangeMin
getStartDateRangeMax
getStopDate
getStopDateRangeMin
getStopDateRangeMax</params>
<dtml-let delivery_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isDelivery[loop_item]">
<dtml-call expr="delivery_list.append(loop_item)">
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(delivery_list) > 0">
REPLACE INTO
delivery
VALUES
<dtml-in prefix="loop" expr="delivery_list">
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="getSourceUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getDestinationUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getSourceSectionUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getDestinationSectionUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getResourceUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getStartDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getStartDateRangeMin[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getStartDateRangeMax[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getStopDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getStopDateRangeMin[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getStopDateRangeMax[loop_item]" type="datetime" optional>
)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
</dtml-if>
</dtml-let>
<dtml-comment>
title:
connection_id:erp5_sql_deferred_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
SearchableText</params>
REPLACE INTO
full_text
VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="SearchableText[loop_item]" type="string" optional>
)
<dtml-if sequence-end>
<dtml-else>
,
</dtml-if>
</dtml-in>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>isMovement
isAccountable
uid
getStopDate
getDestinationUid
getDestinationSectionUid
getResourceUid
getVariationText
getAggregateUidList</params>
DELETE FROM
item
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let movement_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item] and isAccountable[loop_item] and getAggregateUidList[loop_item]">
<dtml-call expr="movement_list.append(loop_item)">
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(movement_list) > 0">
INSERT INTO
item
VALUES
<dtml-in prefix="loop" expr="movement_list">
<dtml-in "getAggregateUidList[loop_item]">
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="getStopDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getDestinationUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getDestinationSectionUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getResourceUid[loop_item]" type="int" optional>,
<dtml-sqlvar sequence-item type="int" optional>,
<dtml-sqlvar expr="getVariationText[loop_item]" type="string" optional>
)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
</dtml-if>
</dtml-let>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
isMovement
getCategoryList</params>
DELETE FROM
category
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO category VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if expr="getCategoryList[loop_item]">
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getCategoryList[loop_item])">
<dtml-if uid_list>
<dtml-in prefix="uid" expr="uid_list">
<dtml-if sequence-start><dtml-else>,</dtml-if>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="uid_item[0]" type="int">,
<dtml-sqlvar expr="uid_item[1]" type="int">,
<dtml-sqlvar expr="uid_item[2]" type="int">
)
</dtml-in>
<dtml-else>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
NULL,
NULL,
1
)
</dtml-if>
</dtml-let>
<dtml-else>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
NULL,
NULL,
1
)
</dtml-if>
</dtml-in>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>isMovement
uid
getExplanationUid
getSourceUid
getDestinationUid
getResourceUid
getInventoriatedQuantity
getStartDate
getStopDate
getPrice
isAccountable
isOrderable
isDeliverable
isDivergent
getVariationText</params>
<dtml-let movement_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item]">
<dtml-call expr="movement_list.append(loop_item)">
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(movement_list) > 0">
REPLACE INTO
movement
VALUES
<dtml-in prefix="loop" expr="movement_list">
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="getExplanationUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getSourceUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getDestinationUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getResourceUid[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getInventoriatedQuantity[loop_item]" type="float" optional>,
<dtml-sqlvar expr="getStartDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getStopDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getPrice[loop_item]" type="float" optional>,
<dtml-sqlvar expr="isAccountable[loop_item]" type="int" optional>,
<dtml-sqlvar expr="isOrderable[loop_item]" type="int" optional>,
<dtml-sqlvar expr="isDeliverable[loop_item]" type="int" optional>,
<dtml-sqlvar expr="isDivergent[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getVariationText[loop_item]" type="string" optional>
)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
</dtml-if>
</dtml-let>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
getAcquiredCategoryList</params>
DELETE FROM
category
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
INSERT INTO category VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if expr="getAcquiredCategoryList[loop_item]">
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getAcquiredCategoryList[loop_item])">
<dtml-if uid_list>
<dtml-in prefix="uid" expr="uid_list">
<dtml-if sequence-start><dtml-else>,</dtml-if>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="uid_item[0]" type="int">,
<dtml-sqlvar expr="uid_item[1]" type="int">,
<dtml-sqlvar expr="uid_item[2]" type="int">
)
</dtml-in>
<dtml-else>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
NULL,
NULL,
1
)
</dtml-if>
</dtml-let>
<dtml-else>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
NULL,
NULL,
1
)
</dtml-if>
</dtml-in>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
security_uid
getPath
getRelativeUrl
getParentUid
id
getDescription
getTitle
meta_type
getPortalType
opportunity_state
getCorporateRegistrationCode
getEan13Code
getSimulationState
causality_state
invoice_state
validation_state
payment_state
event_state
getImmobilisationState
getReference
getGroupingReference
getSourceReference
getDestinationReference
getStringIndex
getIntIndex
getFloatIndex
hasCellContent
getCreationDate
getModificationDate</params>
REPLACE INTO
catalog
VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="security_uid[loop_item]" type="int">,
<dtml-sqlvar expr="getPath[loop_item]" type="string">,
<dtml-sqlvar expr="getRelativeUrl[loop_item]" type="string">,
<dtml-sqlvar expr="getParentUid[loop_item]" type="int">,
<dtml-sqlvar expr="id[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getDescription[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getTitle[loop_item]" type="string" optional>,
<dtml-sqlvar expr="meta_type[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getPortalType[loop_item]" type="string" optional>,
<dtml-sqlvar expr="opportunity_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getCorporateRegistrationCode[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getEan13Code[loop_item]" type="string" optional>,
<dtml-sqlvar expr="validation_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getSimulationState[loop_item]" type="string" optional>,
<dtml-sqlvar expr="causality_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="invoice_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="payment_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="event_state[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getImmobilisationState[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getReference[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getGroupingReference[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getSourceReference[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getDestinationReference[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getStringIndex[loop_item]" type="string" optional>,
<dtml-sqlvar expr="getIntIndex[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getFloatIndex[loop_item]" type="float" optional>,
<dtml-sqlvar expr="hasCellContent[loop_item]" type="int" optional>,
<dtml-sqlvar expr="getCreationDate[loop_item]" type="datetime" optional>,
<dtml-sqlvar expr="getModificationDate[loop_item]" type="datetime" optional>
)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
predicate_property_dict
isPredicate</params>
DELETE FROM
predicate_category
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let predicate_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isPredicate[loop_item]">
<dtml-call expr="predicate_list.append(loop_item)">
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(predicate_list) > 0">
INSERT INTO predicate_category VALUES
<dtml-in prefix="loop" expr="predicate_list">
<dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-if "predicate_property_dict[loop_item].has_key('membership_criterion_category_list')">
<dtml-let uid_list="portal_categories.getCategoryParentUidList(predicate_property_dict[loop_item]['membership_criterion_category_list'])">
<dtml-if uid_list>
<dtml-in "uid_list">
(<dtml-sqlvar expr="uid[loop_item]" type="int">, <dtml-var "_['sequence-item'][0]" >, <dtml-var "_['sequence-item'][1]" >, <dtml-var "_['sequence-item'][2]" >)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
<dtml-else>
(<dtml-sqlvar expr="uid[loop_item]" type="int">, NULL, NULL,1)
</dtml-if>
</dtml-let>
<dtml-else>
(<dtml-sqlvar expr="uid[loop_item]" type="int">, NULL, NULL,1)
</dtml-if>
</dtml-in>
</dtml-if>
</dtml-let>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
isPredicate
predicate_property_dict</params>
<dtml-let predicate_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isPredicate[loop_item]">
<dtml-call expr="predicate_list.append(loop_item)">
</dtml-if>
</dtml-in>
<dtml-if expr="_.len(predicate_list) > 0">
REPLACE INTO predicate VALUES
<dtml-in prefix="loop" expr="predicate_list">
<dtml-if sequence-start><dtml-else>,</dtml-if>
(
<dtml-sqlvar expr="uid[loop_item]" type="int">,
<dtml-sqlvar expr="predicate_property_dict[loop_item].get('quantity', None)" type="float" optional>,
<dtml-sqlvar expr="predicate_property_dict[loop_item].get('quantity_range_min', None)" type="float" optional>,
<dtml-sqlvar expr="predicate_property_dict[loop_item].get('quantity_range_max', None)" type="float" optional>,
<dtml-sqlvar expr="predicate_property_dict[loop_item].get('start_date', None)" type="datetime" optional>,
<dtml-sqlvar expr="predicate_property_dict[loop_item].get('start_date_range_min', None)" type="datetime" optional>,
<dtml-sqlvar expr="predicate_property_dict[loop_item].get('start_date_range_max', None)" type="datetime" optional>
)
</dtml-in>
</dtml-if>
</dtml-let>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>security_uid
optimised_roles_and_users</params>
<dtml-let row_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(security_uid))">
<dtml-if expr="optimised_roles_and_users[loop_item]">
<dtml-in prefix="role" expr="optimised_roles_and_users[loop_item]">
<dtml-call expr="row_list.append([security_uid[loop_item], role_item])">
</dtml-in>
</dtml-if>
</dtml-in>
<dtml-if expr="row_list">
INSERT INTO
roles_and_users
VALUES
<dtml-in prefix="row" expr="row_list">
(<dtml-sqlvar expr="row_item[0]" type="string">, <dtml-sqlvar expr="row_item[1]" type="string">)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
</dtml-if>
</dtml-let>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:0
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
getResourceUid
getInventoriatedQuantity
getSourceUid
getDestinationUid
getSourceSectionUid
getDestinationSectionUid
isMovement
getSourcePaymentUid
getDestinationPaymentUid
getSourceFunctionUid
getDestinationFunctionUid
getSourceProjectUid
getDestinationProjectUid
getSimulationState
getSourceInventoriatedTotalAssetPrice
getDestinationInventoriatedTotalAssetPrice
getStartDate
getStopDate
isAccountable
getPortalType
getVariationText
getSubVariationText</params>
DELETE FROM
stock
WHERE
<dtml-in uid>
uid=<dtml-sqlvar sequence-item type="int"><dtml-if sequence-end><dtml-else> OR </dtml-if>
</dtml-in>
;
<dtml-var "'\0'">
<dtml-let row_list="[]">
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if "isMovement[loop_item]">
<dtml-if "isAccountable[loop_item]">
<dtml-if "getResourceUid[loop_item]">
<dtml-if "getDestinationUid[loop_item]">
<dtml-call expr="row_list.append([uid[loop_item], getDestinationUid[loop_item], getDestinationSectionUid[loop_item], getDestinationPaymentUid[loop_item], getDestinationFunctionUid[loop_item], getDestinationProjectUid[loop_item], getSourceSectionUid[loop_item], getSourceUid[loop_item], getResourceUid[loop_item], getInventoriatedQuantity[loop_item], getStopDate[loop_item], getDestinationInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getVariationText[loop_item],getSubVariationText[loop_item]])">
</dtml-if>
<dtml-if "getSourceUid[loop_item]">
<dtml-call expr="row_list.append([uid[loop_item], getSourceUid[loop_item], getSourceSectionUid[loop_item], getSourcePaymentUid[loop_item], getSourceFunctionUid[loop_item], getSourceProjectUid[loop_item], getDestinationSectionUid[loop_item], getDestinationUid[loop_item], getResourceUid[loop_item], -(getInventoriatedQuantity[loop_item] or 0), getStartDate[loop_item], getSourceInventoriatedTotalAssetPrice[loop_item], getPortalType[loop_item], getSimulationState[loop_item], getVariationText[loop_item], getSubVariationText[loop_item]])">
</dtml-if>
</dtml-if>
</dtml-if>
</dtml-if>
</dtml-in>
<dtml-if "row_list">
INSERT INTO
stock
VALUES
<dtml-in prefix="row" expr="row_list">
(
<dtml-sqlvar expr="row_item[0]" type="int">,
<dtml-sqlvar expr="row_item[1]" type="int">,
<dtml-sqlvar expr="row_item[2]" type="int" optional>,
<dtml-sqlvar expr="row_item[3]" type="int" optional>,
<dtml-sqlvar expr="row_item[4]" type="int" optional>,
<dtml-sqlvar expr="row_item[5]" type="int" optional>,
<dtml-sqlvar expr="row_item[6]" type="int" optional>,
<dtml-sqlvar expr="row_item[7]" type="int" optional>,
<dtml-sqlvar expr="row_item[8]" type="int">,
<dtml-sqlvar expr="row_item[9]" type="float" optional>,
<dtml-sqlvar expr="row_item[10]" type="datetime" optional>,
<dtml-sqlvar expr="row_item[11]" type="float" optional>,
<dtml-sqlvar expr="row_item[12]" type="string" optional>,
<dtml-sqlvar expr="row_item[13]" type="string" optional>,
<dtml-sqlvar expr="row_item[14]" type="string" optional>,
<dtml-sqlvar expr="row_item[15]" type="string" optional>
)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
</dtml-if>
</dtml-let>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>Subject
uid</params>
REPLACE INTO subject VALUES
<dtml-in prefix="loop" expr="_.range(_.len(uid))">
<dtml-if sequence-start><dtml-else>,</dtml-if>
<dtml-let subject="Subject[loop_item]">
<dtml-if subject>
<dtml-in prefix="word" expr="subject.split()">
<dtml-if sequence-start><dtml-else>,</dtml-if>
(<dtml-sqlvar "uid[loop_item]" type="int">, <dtml-sqlvar word_item type="string">)
</dtml-in>
<dtml-else>
(<dtml-sqlvar "uid[loop_item]" type="int">, NULL)
</dtml-if>
</dtml-let>
</dtml-in>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>language
message_context
original_message
translated_message</params>
INSERT INTO translation VALUES
<dtml-in prefix="loop" expr="_.range(_.len(language))">
(
<dtml-sqlvar expr="language[loop_item]" type="string">,
<dtml-sqlvar expr="message_context[loop_item]" type="string">,
<dtml-sqlvar expr="original_message[loop_item]" type="string">,
<dtml-sqlvar expr="translated_message[loop_item]" type="string">
)
<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1
max_cache:1000
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>from_table_list
where_expression
select_expression
selection_domain
selection_report</params>
SELECT
COUNT(DISTINCT catalog.uid) <dtml-comment>We need subselect for better statistics</dtml-comment>
<dtml-if select_expression>
, <dtml-var select_expression>
</dtml-if>
FROM
<dtml-in from_table_list> <dtml-var sequence-item> AS <dtml-var sequence-key><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
<dtml-if selection_domain>
<dtml-let expression="selection_domain.asSqlJoinExpression()">
<dtml-if expression> , <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
<dtml-if selection_report>
<dtml-let expression="selection_report.asSqlJoinExpression()">
<dtml-if expression> , <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
WHERE
1 = 1
<dtml-if where_expression>
AND <dtml-var where_expression>
</dtml-if>
<dtml-if selection_domain>
<dtml-let expression="selection_domain.asSqlExpression()">
<dtml-if expression> AND <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
<dtml-if selection_report>
<dtml-let expression="selection_report.asSqlExpression(strict_membership=1)">
<dtml-if expression> AND <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
<dtml-if sort_on>
ORDER BY
<dtml-var sort_on>
</dtml-if>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
# Host:
# Database: test
# Table: 'catalog'
#
CREATE TABLE `catalog` (
`uid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`security_uid` INT UNSIGNED,
`path` varchar(255) NOT NULL default '',
`relative_url` varchar(255) NOT NULL default '',
`parent_uid` BIGINT UNSIGNED default '0',
`id` varchar(255) default '',
`description` text,
`title` varchar(255) default '',
`meta_type` varchar(255) default '',
`portal_type` varchar(255) default '',
`opportunity_state` varchar(255) default '',
`corporate_registration_code` varchar(255),
`ean13_code` varchar(255),
`validation_state` varchar(255) default '',
`simulation_state` varchar(255) default '',
`causality_state` varchar(255) default '',
`invoice_state` varchar(255) default '',
`payment_state` varchar(255) default '',
`event_state` varchar(255) default '',
`immobilisation_state` varchar(255) default '',
`reference` varchar(255) default '',
`grouping_reference` varchar(255) default '',
`source_reference` varchar(255) default '',
`destination_reference` varchar(255) default '',
`string_index` varchar(255),
`int_index` INT,
`float_index` real,
`has_cell_content` bool,
`creation_date` datetime,
`modification_date` datetime,
PRIMARY KEY (`uid`),
KEY `security_uid` (`security_uid`),
KEY `Parent` (`parent_uid`),
KEY `Path` (`path`),
KEY `relative_url` (`relative_url`),
KEY `Type` (`meta_type`,`portal_type`),
KEY `Type1` (`portal_type`),
KEY `Type2` (`meta_type`),
KEY `opportunity_state` (`opportunity_state`),
KEY `validation_state` (`validation_state`),
KEY `simulation_state` (`simulation_state`),
KEY `causality_state` (`causality_state`),
KEY `invoice_state` (`invoice_state`),
KEY `payment_state` (`payment_state`),
KEY `event_state` (`event_state`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
# Host:
# Database: test
# Table: 'category'
#
CREATE TABLE `category` (
`uid` BIGINT UNSIGNED NOT NULL,
`category_uid` BIGINT UNSIGNED default '0',
`base_category_uid` BIGINT UNSIGNED default '0',
`category_strict_membership` tinyint(1) default '0',
KEY `uid` (`uid`),
KEY `category_strict_membership` (`category_strict_membership`),
KEY `Membership` (`category_uid`,`base_category_uid`),
KEY `FuzzyMembership` (`category_uid`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
# Host:
# Database: test
# Table: 'compatibility'
#
CREATE TABLE `compatibility` (
`uid` BIGINT UNSIGNED NOT NULL,
`Creator` varchar(255) default '',
`Date` datetime default '0000-00-00 00:00:00',
`PrincipiaSearchSource` text,
`SearchableText` text,
`CreationDate` datetime default '0000-00-00 00:00:00',
`EffectiveDate` datetime default '0000-00-00 00:00:00',
`ExpiresDate` datetime default '0000-00-00 00:00:00',
`ModificationDate` datetime default '0000-00-00 00:00:00',
`Type` varchar(255) default '',
`bobobase_modification_time` datetime default '0000-00-00 00:00:00',
`created` datetime default '0000-00-00 00:00:00',
`effective` datetime default '0000-00-00 00:00:00',
`expires` datetime default '0000-00-00 00:00:00',
`getIcon` varchar(255) default '',
`in_reply_to` varchar(255) default '',
`modified` datetime default '0000-00-00 00:00:00',
`review_state` varchar(255) default '',
`summary` text,
PRIMARY KEY (`uid`),
KEY `Type` (`Type`),
KEY `review_state` (`review_state`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
CREATE TABLE `delivery` (
`uid` BIGINT UNSIGNED NOT NULL,
`source_uid` BIGINT UNSIGNED default '0',
`destination_uid` BIGINT UNSIGNED default '0',
`source_section_uid` BIGINT UNSIGNED default '0',
`destination_section_uid` BIGINT UNSIGNED default '0',
`resource_uid` BIGINT UNSIGNED default '0',
`start_date` datetime default NULL,
`start_date_range_min` datetime default NULL,
`start_date_range_max` datetime default NULL,
`stop_date` datetime default NULL,
`stop_date_range_min` datetime default NULL,
`stop_date_range_max` datetime default NULL,
PRIMARY KEY (`uid`),
KEY `source_uid` (`source_uid`),
KEY `destination_uid` (`destination_uid`),
KEY `source_section_uid` (`source_section_uid`),
KEY `destination_section_uid` (`destination_section_uid`),
KEY `resource_uid` (`resource_uid`)
) ENGINE=InnoDB
<dtml-comment>
title:
connection_id:erp5_sql_deferred_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
# Host:
# Database: test
# Table: 'full_text'
#
CREATE TABLE `full_text` (
`uid` BIGINT UNSIGNED NOT NULL,
`SearchableText` text,
PRIMARY KEY (`uid`),
FULLTEXT `SearchableText` (`SearchableText`)
);
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
# Host:
# Database: test
# Table: 'item'
#
CREATE TABLE `item` (
`uid` BIGINT UNSIGNED NOT NULL,
`date` datetime,
`node_uid` BIGINT UNSIGNED default '0',
`section_uid` BIGINT UNSIGNED default '0',
`resource_uid` BIGINT UNSIGNED default '0',
`aggregate_uid` BIGINT UNSIGNED default '0',
`variation_text` VARCHAR(255),
KEY `uid` (`uid`),
KEY `node_uid` (`node_uid`),
KEY `section_uid` (`section_uid`),
KEY `resource_uid` (`resource_uid`),
KEY `variation_text` (`variation_text`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
# Host:
# Database: test
# Table: 'movement'
#
CREATE TABLE `movement` (
`uid` BIGINT UNSIGNED NOT NULL,
`explanation_uid` BIGINT UNSIGNED default '0',
`source_uid` BIGINT UNSIGNED default '0',
`destination_uid` BIGINT UNSIGNED default '0',
`resource_uid` BIGINT UNSIGNED default '0',
`quantity` real default '0.0',
`start_date` datetime,
`stop_date` datetime,
`price` real,
`is_accountable` bool,
`is_orderable` bool,
`is_deliverable` bool,
`is_divergent` bool,
`variation_text` VARCHAR(255),
PRIMARY KEY `uid` (`uid`),
KEY `explanation_uid` (`explanation_uid`),
KEY `source_uid` (`source_uid`),
KEY `destination_uid` (`destination_uid`),
KEY `resource_uid` (`resource_uid`),
KEY `is_accountable` (`is_accountable`),
KEY `is_orderable` (`is_orderable`),
KEY `is_deliverable` (`is_deliverable`),
KEY `variation_text` (`variation_text`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
CREATE TABLE predicate (
uid BIGINT UNSIGNED NOT NULL,
`quantity` real ,
`quantity_range_min` real ,
`quantity_range_max` real ,
`start_date` datetime,
`start_date_range_min` datetime ,
`start_date_range_max` datetime ,
PRIMARY KEY `uid` (`uid`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
# Host:
# Database: test
# Table: 'category'
#
CREATE TABLE `predicate_category` (
`uid` BIGINT UNSIGNED NOT NULL,
`category_uid` BIGINT UNSIGNED default '0',
`base_category_uid` BIGINT UNSIGNED default '0',
`category_strict_membership` tinyint(1) default '0',
KEY `uid` (`uid`),
KEY `category_strict_membership` (`category_strict_membership`),
KEY `Membership` (`category_uid`,`base_category_uid`),
KEY `FuzzyMembership` (`category_uid`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
CREATE TABLE roles_and_users (
uid INT UNSIGNED,
allowedRolesAndUsers VARCHAR(255),
KEY `uid` (`uid`),
KEY `allowedRolesAndUsers` (`allowedRolesAndUsers`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
# Host:
# Database: test
# Table: 'stock'
#
CREATE TABLE `stock` (
`uid` BIGINT UNSIGNED NOT NULL,
`node_uid` BIGINT UNSIGNED,
`section_uid` BIGINT UNSIGNED,
`payment_uid` BIGINT UNSIGNED,
`function_uid` BIGINT UNSIGNED,
`project_uid` BIGINT UNSIGNED,
`mirror_section_uid` BIGINT UNSIGNED,
`mirror_node_uid` BIGINT UNSIGNED,
`resource_uid` BIGINT UNSIGNED,
`quantity` real ,
`date` datetime,
`total_price` real ,
`portal_type` VARCHAR(255),
`simulation_state` varchar(255) default '',
`variation_text` VARCHAR(255),
`sub_variation_text` VARCHAR(255),
KEY `uid` (`uid`),
KEY `quantity` (`quantity`),
KEY `section_uid` (`section_uid`),
KEY `mirror_section_uid` (`mirror_section_uid`),
KEY `mirror_node_uid` (`mirror_node_uid`),
KEY `node_uid` (`node_uid`),
KEY `payment_uid` (`payment_uid`),
KEY `function_uid` (`function_uid`),
KEY `project_uid` (`project_uid`),
KEY `resource_uid` (`resource_uid`),
KEY `simulation_state` (`simulation_state`),
KEY `resource_node_uid` (`resource_uid`, `node_uid`),
KEY `resource_section_node_uid` (`resource_uid`, `section_uid`, `node_uid`, `simulation_state`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
CREATE TABLE subject (
uid BIGINT UNSIGNED NOT NULL,
subject VARCHAR(255),
PRIMARY KEY `uid` (`uid`),
KEY `allowedRolesAndUsers` (`Subject`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
CREATE TABLE translation (
language VARCHAR(255),
message_context VARCHAR(50),
original_message VARCHAR(255),
translated_message VARCHAR(255),
KEY `message` (`translated_message`),
KEY `original_message` (`original_message`)
) ENGINE=InnoDB;
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
DELETE FROM translation
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1</params>
<dtml-var table_1>.portal_type = 'Base Category' AND
<dtml-var table_1>.uid = <dtml-var table_0>.base_category_uid AND
<dtml-var table_0>.category_strict_membership = 1 AND
<dtml-var table_0>.uid = catalog.uid
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1
table_2
</params>
<dtml-var table_2>.uid = <dtml-var table_0>.category_uid
AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.skill.getUid()">
AND <dtml-var table_0>.uid = <dtml-var table_1>.uid
AND <dtml-var table_1>.parent_uid = catalog.uid
AND <dtml-var table_1>.portal_type = 'Career'
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:0
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1</params>
<dtml-var table_1>.uid = <dtml-var table_0>.category_uid
AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.destination.getUid()">
AND <dtml-var table_0>.uid = catalog.uid
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:0
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1</params>
<dtml-var table_1>.uid = <dtml-var table_0>.category_uid
AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.destination_section.getUid()">
AND <dtml-var table_0>.uid = catalog.uid
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:0
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1</params>
<dtml-var table_1>.uid = <dtml-var table_0>.category_uid
AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.source.getUid()">
AND <dtml-var table_0>.uid = catalog.uid
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:0
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1</params>
<dtml-var table_1>.uid = <dtml-var table_0>.category_uid
AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.source_section.getUid()">
AND <dtml-var table_0>.uid = catalog.uid
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1</params>
<dtml-var table_0>.uid = catalog.uid
AND <dtml-var table_1>.uid = <dtml-var table_0>.explanation_uid
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1</params>
<dtml-var table_0>.uid = catalog.parent_uid
AND <dtml-var table_1>.uid = <dtml-var table_0>.parent_uid
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.uid = stock.mirror_section_uid
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.uid = item.node_uid
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.uid = stock.node_uid
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1</params>
<dtml-var table_1>.uid = <dtml-var table_0>.category_uid
AND <dtml-var table_0>.base_category_uid = <dtml-var "portal_categories.specialise.getUid()">
AND <dtml-var table_0>.uid = catalog.parent_uid
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.uid = stock.payment_uid
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.uid = catalog.uid
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1</params>
<dtml-var table_0>.uid = catalog.uid
AND <dtml-var table_1>.uid = <dtml-var table_0>.resource_uid
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.uid = item.resource_uid
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.uid = stock.resource_uid
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.uid = item.section_uid
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.uid = stock.section_uid
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1</params>
<dtml-var table_0>.uid = catalog.uid
AND <dtml-var table_0>.base_category_uid = <dtml-sqlvar expr="portal_categories.subordination.getUid()" type="int">
AND <dtml-var table_1>.uid = <dtml-var table_0>.category_uid
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.original_message = catalog.opportunity_state
AND <dtml-var table_0>.message_context = "opportunity_state_title"
AND <dtml-var table_0>.language = <dtml-sqlvar "Localizer.get_selected_language()" type="string">
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.original_message = catalog.portal_type
AND <dtml-var table_0>.message_context = "portal_type"
AND <dtml-var table_0>.language = <dtml-sqlvar "Localizer.get_selected_language()" type="string">
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.original_message = catalog.simulation_state
AND <dtml-var table_0>.message_context = "simulation_state"
AND <dtml-var table_0>.language = <dtml-sqlvar "Localizer.get_selected_language()" type="string">
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.original_message = catalog.simulation_state
AND <dtml-var table_0>.message_context = "simulation_state_title"
AND <dtml-var table_0>.language = <dtml-sqlvar "Localizer.get_selected_language()" type="string">
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.original_message = catalog.validation_state
AND <dtml-var table_0>.message_context = "validation_state"
AND <dtml-var table_0>.language = <dtml-sqlvar "Localizer.get_selected_language()" type="string">
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0</params>
<dtml-var table_0>.uid = catalog.uid
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>table_0
table_1</params>
((<dtml-var table_0>.is_accountable = 0
AND <dtml-var table_0>.uid = catalog.parent_uid
AND <dtml-var table_0>.uid = <dtml-var table_1>.uid)
OR
(<dtml-var table_0>.is_accountable = 1
AND <dtml-var table_0>.uid = catalog.uid
AND <dtml-var table_0>.uid = <dtml-var table_1>.uid))
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:10
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>sort_on
query
parent_uid</params>
<dtml-if sort_on>
<dtml-if query>
SELECT DISTINCT catalog.* FROM catalog, category, roles_and_users WHERE catalog.uid=category.uid AND catalog.uid=roles_and_users.uid AND <dtml-var query> AND <dtml-sqltest parent_uid op=eq column=catalog.parent_uid type=int> ORDER BY <dtml-var sort_on>
<dtml-else>
SELECT * FROM catalog WHERE <dtml-sqltest parent_uid op=eq column=catalog.parent_uid type=int> ORDER BY <dtml-var sort_on>
</dtml-if>
<dtml-else>
<dtml-if query>
SELECT DISTINCT catalog.* FROM catalog, category, roles_and_users WHERE <dtml-sqltest parent_uid op=eq column=catalog.parent_uid type=int> AND catalog.uid=category.uid AND catalog.uid=roles_and_users.uid AND <dtml-var query>
<dtml-else>
SELECT * FROM catalog WHERE <dtml-sqltest parent_uid op=eq column=catalog.parent_uid type=int>
</dtml-if>
</dtml-if>
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:0
max_cache:100
cache_time:0
class_name:ZSQLBrain
class_file:zsqlbrain.py
</dtml-comment>
<params>selection
selection_domain
selection_report
where_expression
select_expression
from_table_list:list
sort_on
limit_expression</params>
SELECT DISTINCT
<dtml-in getCatalogSearchResultKeys> <dtml-var sequence-item><dtml-if sequence-end> <dtml-else>, </dtml-if> </dtml-in>
FROM
<dtml-in from_table_list> <dtml-var sequence-item> AS <dtml-var sequence-key><dtml-if sequence-end><dtml-else>,</dtml-if></dtml-in>
<dtml-if selection_domain>
<dtml-let expression="selection_domain.asSqlJoinExpression()">
<dtml-if expression> , <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
<dtml-if selection_report>
<dtml-let expression="selection_report.asSqlJoinExpression()">
<dtml-if expression> , <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
WHERE
1 = 1
<dtml-if where_expression>
AND <dtml-var where_expression>
</dtml-if>
<dtml-if selection_domain>
<dtml-let expression="selection_domain.asSqlExpression()">
<dtml-if expression> AND <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
<dtml-if selection_report>
<dtml-let expression="selection_report.asSqlExpression(strict_membership=1)">
<dtml-if expression> AND <dtml-var expression> </dtml-if>
</dtml-let>
</dtml-if>
<dtml-if sort_on>
ORDER BY
<dtml-var sort_on>
</dtml-if>
<dtml-if limit_expression>
LIMIT <dtml-var "limit_expression">
<dtml-else>
LIMIT 1000
</dtml-if>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params></params>
show columns from category
\ No newline at end of file
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM delivery WHERE <dtml-sqltest uid op=eq type=int>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid</params>
DELETE FROM catalog WHERE <dtml-sqltest uid op=eq type=int>
\ 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