Commit 60e90422 authored by Jean-Paul Smets's avatar Jean-Paul Smets

initial upload


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1449 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ca309e43
<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
Title
start
end
time
relative_path_depth
container_path
portal_type
getPhysicalPath</params>
INSERT INTO
cps
SET
uid = <dtml-sqlvar uid type="int">,
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,
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`)
) TYPE=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 local_users_with_roles (
uid INT,
localUsersWithRoles VARCHAR(40),
KEY `uid` (`uid`),
KEY `localUsersWithRoles` (`localUsersWithRoles`)
) TYPE=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
Title
start
end
time
relative_path_depth
container_path
portal_type
getPhysicalPath</params>
UPDATE
cps
SET
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">
<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: coramy
# Table: 'message'
#
CREATE TABLE `message` (
`path` varchar(255) default NULL,
`method_id` varchar(40) default NULL,
`message` blob,
KEY `path` (`path`),
KEY `method_id` (`method_id`)
) TYPE=InnoDB;
\ 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_query </params>
DELETE FROM
catalog
WHERE
<dtml-var uid_query>
<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_query </params>
DELETE FROM
category
WHERE
<dtml-var uid_query>
\ 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_query </params>
DELETE FROM
movement
WHERE
<dtml-var uid_query>
\ 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_query </params>
DELETE FROM
stock
WHERE
<dtml-var uid_query>
\ 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>values</params>
INSERT INTO
catalog(uid, parent_uid, path, relative_url, portal_type)
VALUES
<dtml-var values>;
\ 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>values</params>
INSERT INTO
category(uid, base_category_uid, category_uid, category_strict_membership)
VALUES
<dtml-var values>;
\ 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>values</params>
INSERT INTO
movement
VALUES
<dtml-var values>;
\ 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>values</params>
INSERT INTO
stock
VALUES
<dtml-var values>;
\ 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
getPath
getRelativeUrl
getParentUid
CreationDate
Creator
Date
getDescription
PrincipiaSearchSource
SearchableText
EffectiveDate
ExpiresDate
ModificationDate
getTitle
Type
bobobase_modification_time
created
effective
expires
getIcon
id
in_reply_to
meta_type
getPortalType
modified
review_state
sales_state
modele_state
summary
getDefaultSourceReference
getFormeId
getGammeId
getDefaultDestinationReference
getDefaultSourceTitle
getDefaultDestinationTitle
getDefaultSourceSectionTitle
getDefaultDestinationSectionTitle
getDefaultCausalityId
modele_state_modeliste
modele_state_gestionaire
forme_state
composant_state
vetement_state
transform_state
order_state
delivery_state
getSimulationState
causality_state
discussion_state
getOrderId
samples_delivery_check
modele_state_infos_client
modele_state_accord_technique</params>
INSERT INTO catalog VALUES (
<dtml-sqlvar uid type="int">,
<dtml-sqlvar getPath type="string">,
<dtml-sqlvar getRelativeUrl type="string">,
<dtml-sqlvar getParentUid type="int">,
<dtml-sqlvar CreationDate type="string">,
<dtml-sqlvar Creator type="string">,
<dtml-sqlvar Date type="string">,
<dtml-sqlvar getDescription type="string">,
<dtml-sqlvar PrincipiaSearchSource type="string">,
<dtml-sqlvar SearchableText type="string">,
<dtml-sqlvar EffectiveDate type="string">,
<dtml-sqlvar ExpiresDate type="string">,
<dtml-sqlvar ModificationDate type="string">,
<dtml-sqlvar getTitle type="string">,
<dtml-sqlvar Type type="string">,
<dtml-sqlvar bobobase_modification_time type="string">,
<dtml-sqlvar created type="string">,
<dtml-sqlvar effective type="string">,
<dtml-sqlvar expires type="string">,
<dtml-sqlvar getIcon type="string">,
<dtml-sqlvar id type="string">,
<dtml-sqlvar in_reply_to type="string">,
<dtml-sqlvar meta_type type="string">,
<dtml-sqlvar getPortalType type="string">,
<dtml-sqlvar modified type="string">,
<dtml-sqlvar review_state type="string">,
<dtml-sqlvar sales_state type="string">,
<dtml-sqlvar modele_state type="string">,
<dtml-sqlvar getDefaultSourceReference type="string">,
<dtml-sqlvar getFormeId type="string">,
<dtml-sqlvar getGammeId type="string">,
<dtml-sqlvar getDefaultDestinationReference type="string">,
<dtml-sqlvar getDefaultSourceTitle type="string">,
<dtml-sqlvar getDefaultDestinationTitle type="string">,
<dtml-sqlvar getDefaultSourceSectionTitle type="string">,
<dtml-sqlvar getDefaultDestinationSectionTitle type="string">,
<dtml-sqlvar getDefaultCausalityId type="string">,
<dtml-sqlvar modele_state_modeliste type="string">,
<dtml-sqlvar modele_state_gestionaire type="string">,
<dtml-sqlvar forme_state type="string">,
<dtml-sqlvar composant_state type="string">,
<dtml-sqlvar vetement_state type="string">,
<dtml-sqlvar transform_state type="string">,
<dtml-sqlvar order_state type="string">,
<dtml-sqlvar delivery_state type="string">,
<dtml-sqlvar getSimulationState type="string">,
<dtml-sqlvar causality_state type="string">,
<dtml-sqlvar discussion_state type="string">,
<dtml-sqlvar getOrderId type="string">,
<dtml-if samples_delivery_check>1<dtml-else>0</dtml-if>,
<dtml-sqlvar modele_state_infos_client type="string">,
<dtml-sqlvar modele_state_accord_technique type="string">,
<dtml-sqlvar summary 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></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 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 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>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 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 roles_and_users 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 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
getAcquiredCategoryList
getCategoryList
isMovement</params>
<dtml-if isMovement>
<dtml-if getCategoryList>
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getCategoryList)">
<dtml-if uid_list>
INSERT INTO category VALUES
<dtml-in "uid_list">
(<dtml-sqlvar uid 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>
INSERT INTO category VALUES (<dtml-sqlvar uid type="int">, NULL, NULL,1);
</dtml-if>
</dtml-let>
<dtml-else>
INSERT INTO category VALUES (<dtml-sqlvar uid type="int">, NULL, NULL,1);
</dtml-if>
<dtml-else>
<dtml-if getAcquiredCategoryList>
<dtml-let uid_list="portal_categories.getCategoryParentUidList(getAcquiredCategoryList)">
<dtml-if uid_list>
INSERT INTO category VALUES
<dtml-in "uid_list">
(<dtml-sqlvar uid 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>
INSERT INTO category VALUES (<dtml-sqlvar uid type="int">, NULL, NULL,1);
</dtml-if>
</dtml-let>
<dtml-else>
INSERT INTO category VALUES (<dtml-sqlvar uid type="int">, NULL, NULL,1);
</dtml-if>
</dtml-if>
\ 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>isMovement
uid
getDeliveryUid
getSourceUid
getDestinationUid
getResourceUid
getNetConvertedQuantity
getStartDate
getStopDate
getNetConvertedTargetQuantity
getTargetStartDate
getTargetStopDate
getPrice
getTotalPrice
getTargetTotalPrice
hasCellContent
isAccountable
isOrderable
isDeliverable
getVariationText</params>
<dtml-if isMovement>
INSERT INTO movement VALUES (
<dtml-sqlvar uid type="int">,
<dtml-if getDeliveryUid><dtml-sqlvar getDeliveryUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getSourceUid><dtml-sqlvar getSourceUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getDestinationUid ><dtml-sqlvar getDestinationUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getResourceUid><dtml-sqlvar getResourceUid type="int"><dtml-else>NULL</dtml-if>,
<dtml-if getNetConvertedQuantity><dtml-sqlvar getNetConvertedQuantity type="float"><dtml-else>NULL</dtml-if>,
NULL,
<dtml-if getStartDate><dtml-sqlvar getStartDate type="string"><dtml-else>NULL</dtml-if>,
<dtml-if getStopDate><dtml-sqlvar getStopDate type="string"><dtml-else>NULL</dtml-if>,
<dtml-if getNetConvertedTargetQuantity><dtml-sqlvar getNetConvertedTargetQuantity type="float"><dtml-else>NULL</dtml-if>,
<dtml-if getTargetStartDate><dtml-sqlvar getTargetStartDate type="string"><dtml-else>NULL</dtml-if>,
<dtml-if getTargetStopDate><dtml-sqlvar getTargetStopDate type="string"><dtml-else>NULL</dtml-if>,
<dtml-if getPrice><dtml-sqlvar getPrice type="float"><dtml-else>NULL</dtml-if>,
<dtml-if getTotalPrice><dtml-sqlvar getTotalPrice type="float"><dtml-else>NULL</dtml-if>,
<dtml-if getTargetTotalPrice><dtml-sqlvar getTargetTotalPrice type="float"><dtml-else>NULL</dtml-if>,
<dtml-if "hasCellContent is not None"><dtml-sqlvar hasCellContent type="int"><dtml-else>NULL</dtml-if>,
<dtml-if "isAccountable is not None"><dtml-sqlvar isAccountable type="int"><dtml-else>NULL</dtml-if>,
<dtml-if "isOrderable is not None"><dtml-sqlvar isOrderable type="int"><dtml-else>NULL</dtml-if>,
<dtml-if "isDeliverable is not None"><dtml-sqlvar isDeliverable type="int"><dtml-else>NULL</dtml-if>,
<dtml-if "getVariationText is not None"><dtml-sqlvar getVariationText type="string"><dtml-else>NULL</dtml-if>
);
</dtml-if>
\ 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>security_uid
optimised_roles_and_users</params>
<dtml-if optimised_roles_and_users>
INSERT INTO roles_and_users VALUES
<dtml-in optimised_roles_and_users>
(<dtml-sqlvar security_uid type="int">, <dtml-sqlvar sequence-item type=string>)<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
;
</dtml-if>
\ 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
getInventoriatedQuantity
getSourceUid
getDestinationUid
getSourceSectionUid
getDestinationSectionUid
isMovement</params>
<dtml-if isMovement>
<dtml-if getSourceUid>
<dtml-if getDestinationUid>
INSERT INTO stock VALUES (<dtml-sqlvar uid type="int">, <dtml-sqlvar getDestinationUid type="int">, <dtml-if getDestinationSectionUid><dtml-sqlvar getDestinationSectionUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getInventoriatedQuantity><dtml-sqlvar getInventoriatedQuantity type="float"><dtml-else>NULL</dtml-if>), (<dtml-sqlvar uid type="int">, <dtml-sqlvar getSourceUid type="int">, <dtml-if getSourceSectionUid><dtml-sqlvar getSourceSectionUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getInventoriatedQuantity><dtml-sqlvar "-getInventoriatedQuantity" type="float"><dtml-else>NULL</dtml-if>);
<dtml-else>
INSERT INTO stock VALUES (<dtml-sqlvar uid type="int">, <dtml-if getSourceUid><dtml-sqlvar getSourceUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getSourceSectionUid><dtml-sqlvar getSourceSectionUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getInventoriatedQuantity><dtml-sqlvar "-getInventoriatedQuantity" type="float"><dtml-else>NULL</dtml-if>);
</dtml-if>
<dtml-else>
<dtml-if getDestinationUid>
INSERT INTO stock VALUES (<dtml-sqlvar uid type="int">, <dtml-sqlvar getDestinationUid type="int">, <dtml-if getDestinationSectionUid><dtml-sqlvar getDestinationSectionUid type="int"><dtml-else>NULL</dtml-if>, <dtml-if getInventoriatedQuantity><dtml-sqlvar getInventoriatedQuantity type="float"><dtml-else>NULL</dtml-if>);
</dtml-if>
</dtml-if>
</dtml-if>
\ 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
Subject</params>
<dtml-if Subject>
INSERT INTO subject VALUES
<dtml-try>
<dtml-in "Subject.split()">
(<dtml-sqlvar uid type="int">, <dtml-sqlvar sequence-item
type=string>)<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
;
<dtml-except>
<dtml-in Subject>
(<dtml-sqlvar uid type="int">, <dtml-sqlvar sequence-item
type=string>)<dtml-if sequence-end><dtml-else>,</dtml-if>
</dtml-in>
;
</dtml-try>
</dtml-if>
<dtml-comment>
title:
connection_id:erp5_sql_connection
max_rows:1
max_cache:1000
cache_time:180
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-var "','.join(from_table_list)">
<dtml-if selection_domain>, <dtml-var "selection_domain.asSqlJoinExpression()"> </dtml-if>
<dtml-if selection_report>, <dtml-var "selection_report.asSqlJoinExpression()"> </dtml-if>
WHERE
1 = 1
<dtml-comment>We make sure here that no roles_and_users is not used</dtml-comment>
<dtml-in from_table_list><dtml-if "_['sequence-item']=='roles_and_users'"><dtml-if select_expression><dtml-else> AND catalog.security_uid = <dtml-var sequence-item>.uid</dtml-if> <dtml-else> AND catalog.uid = <dtml-var sequence-item>.uid </dtml-if> </dtml-in>
<dtml-if where_expression>
AND <dtml-var where_expression>
</dtml-if>
<dtml-if selection_domain>
AND <dtml-var "selection_domain.asSqlExpression()">
</dtml-if>
<dtml-if selection_report>
AND <dtml-var "selection_report.asSqlExpression(strict_membership=1)">
</dtml-if>
<dtml-if sort_on>
ORDER BY
<dtml-var sort_on>
</dtml-if>
\ 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>
# Host:
# Database: test
# Table: 'catalog'
#
CREATE TABLE `catalog` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`security_uid` INT UNSIGNED,
`path` varchar(255) NOT NULL default '',
`relative_url` varchar(255) NOT NULL default '',
`parent_uid` int(11) default '0',
`CreationDate` datetime default '0000-00-00 00:00:00',
`Creator` varchar(30) default '',
`Date` datetime default '0000-00-00 00:00:00',
`Description` text,
`PrincipiaSearchSource` text,
`SearchableText` text,
`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',
`Title` varchar(255) default '',
`Type` varchar(30) 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(30) default '',
`id` varchar(30) default '',
`in_reply_to` varchar(255) default '',
`meta_type` varchar(255) default '',
`portal_type` varchar(255) default '',
`modified` datetime default '0000-00-00 00:00:00',
`review_state` varchar(30) default '',
`opportunity_state` varchar(30) default '',
`default_source_reference` varchar(30) default '',
`default_destination_reference` varchar(30) default '',
`default_source_title` varchar(30) default '',
`default_destination_title` varchar(30) default '',
`default_source_section_title` varchar(30) default '',
`default_destination_section_title` varchar(30) default '',
`default_causality_id` varchar(30) default '',
`location` varchar(30),
`ean13_code` varchar(30),
`validation_state` varchar(30) default '',
`simulation_state` varchar(30) default '',
`causality_state` varchar(30) default '',
`discussion_state` varchar(30) default '',
`invoice_state` varchar(30) default '',
`payment_state` varchar(30) default '',
`event_state` varchar(30) default '',
`order_id` varchar(30) default '',
`reference` varchar(30) default '',
`source_reference` varchar(30) default '',
`destination_reference` varchar(30) default '',
`summary` text,
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 `Type3` (`Type`),
KEY `Id` (`id`),
KEY `review_state` (`review_state`),
KEY `opportunity_state` (`opportunity_state`),
KEY `validation_state` (`validation_state`),
KEY `simulation_state` (`simulation_state`),
KEY `causality_state` (`causality_state`),
KEY `discussion_state` (`discussion_state`),
KEY `invoice_state` (`invoice_state`),
KEY `order_id` (`order_id`),
KEY `payment_state` (`payment_state`),
KEY `event_state` (`event_state`),
) TYPE=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` int(11) default '0',
`category_uid` int(11) default '0',
`base_category_uid` int(11) 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`)
) TYPE = InnoDB;
\ 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>
# Host:
# Database: test
# Table: 'movement'
#
CREATE TABLE `movement` (
`uid` int(11) default '0',
`delivery_uid` int(11) default '0',
`source_uid` int(11) default '0',
`destination_uid` int(11) default '0',
`resource_uid` int(11) default '0',
`quantity` real default '0.0',
`inventory` real default NULL,
`start_date` datetime,
`stop_date` datetime,
`target_quantity` real default '0.0',
`target_start_date` datetime,
`target_stop_date` datetime,
`price` real,
`total_price` real,
`target_total_price` real,
`has_cell_content` bool,
`is_accountable` bool,
`is_orderable` bool,
`is_deliverable` bool,
`variation_text` VARCHAR(100),
KEY `uid` (`uid`),
KEY `source_uid` (`source_uid`),
KEY `destination_uid` (`destination_uid`),
KEY `resource_uid` (`resource_uid`),
KEY `has_cell_content` (`has_cell_content`),
KEY `is_accountable` (`is_accountable`),
KEY `is_orderable` (`is_orderable`),
KEY `is_deliverable` (`is_deliverable`),
KEY `variation_text` (`variation_text`)
) TYPE=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,
allowedRolesAndUsers VARCHAR(40),
KEY `uid` (`uid`),
KEY `allowedRolesAndUsers` (`allowedRolesAndUsers`)
) TYPE=InnoDB;
\ 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>
# Host:
# Database: test
# Table: 'stock'
#
CREATE TABLE `stock` (
`uid` int(11) NOT NULL default '0',
`node_uid` int(11),
`section_uid` int(11),
`quantity` real ,
KEY `uid` (`uid`),
KEY `quantity` (`quantity`),
KEY `section_uid` (`section_uid`),
KEY `node_uid` (`node_uid`)
) TYPE = 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 INT,
subject VARCHAR(255),
KEY `uid` (`uid`),
KEY `allowedRolesAndUsers` (`Subject`)
) TYPE=InnoDB;
\ No newline at end of file
<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:500
max_cache:100
cache_time:4
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</params>
SELECT DISTINCT
<dtml-in getCatalogSearchResultKeys> <dtml-var sequence-item><dtml-if sequence-end> <dtml-else>, </dtml-if> </dtml-in>
FROM
<dtml-var "','.join(from_table_list)">
<dtml-if selection_domain>, <dtml-var "selection_domain.asSqlJoinExpression()"> </dtml-if>
<dtml-if selection_report>, <dtml-var "selection_report.asSqlJoinExpression()"> </dtml-if>
WHERE
1 = 1
<dtml-in from_table_list><dtml-if "_['sequence-item']=='roles_and_users'">AND catalog.security_uid = <dtml-var sequence-item>.uid <dtml-else> AND catalog.uid = <dtml-var sequence-item>.uid </dtml-if> </dtml-in>
<dtml-if where_expression>
AND <dtml-var where_expression>
</dtml-if>
<dtml-if selection_domain>
AND <dtml-var "selection_domain.asSqlExpression()">
</dtml-if>
<dtml-if selection_report>
AND <dtml-var "selection_report.asSqlExpression(strict_membership=1)">
</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>
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 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:1000
max_cache:100
cache_time:0
class_name:
class_file:
</dtml-comment>
<params>uid
security_uid
getPath
getRelativeUrl
getParentUid
CreationDate
Creator
Date
getDescription
PrincipiaSearchSource
SearchableText
EffectiveDate
ExpiresDate
ModificationDate
getTitle
Type
bobobase_modification_time
created
effective
expires
getIcon
id
in_reply_to
meta_type
getPortalType
modified
review_state
opportunity_state
summary
getDefaultSourceReference
getDefaultDestinationReference
getDefaultSourceTitle
getDefaultDestinationTitle
getDefaultSourceSectionTitle
getDefaultDestinationSectionTitle
getDefaultCausalityId
getLocation
getEan13Code
getSimulationState
causality_state
discussion_state
invoice_state
getOrderId
validation_state
payment_state
event_state
getReference
getSourceReference
getDestinationReference
insert_catalog_line</params>
<dtml-if insert_catalog_line>
INSERT INTO catalog(uid) VALUES (<dtml-sqlvar uid type="int">);
<dtml-var "'\0'">
</dtml-if>
UPDATE catalog SET uid=<dtml-sqlvar uid type="int">,
security_uid=<dtml-sqlvar security_uid type="int">,
path=<dtml-sqlvar getPath type="string">,
relative_url=<dtml-sqlvar getRelativeUrl type="string">,
parent_uid=<dtml-sqlvar getParentUid type="string">,
CreationDate=<dtml-sqlvar CreationDate type="string">,
Creator=<dtml-sqlvar Creator type="string">,
Date=<dtml-sqlvar Date type="string">,
Description=<dtml-sqlvar getDescription type="string">,
PrincipiaSearchSource=<dtml-sqlvar PrincipiaSearchSource type="string">,
SearchableText=<dtml-sqlvar SearchableText type="string">,
EffectiveDate=<dtml-sqlvar EffectiveDate type="string">,
ExpiresDate=<dtml-sqlvar ExpiresDate type="string">,
ModificationDate=<dtml-sqlvar ModificationDate type="string">,
Title=<dtml-sqlvar getTitle type="string">,
Type=<dtml-sqlvar Type type="string">,
bobobase_modification_time=<dtml-sqlvar bobobase_modification_time type="string">,
created=<dtml-sqlvar created type="string">,
effective=<dtml-sqlvar effective type="string">,
expires=<dtml-sqlvar expires type="string">,
getIcon=<dtml-sqlvar getIcon type="string">,
id=<dtml-sqlvar id type="string">,
in_reply_to=<dtml-sqlvar in_reply_to type="string">,
meta_type=<dtml-sqlvar meta_type type="string">,
portal_type=<dtml-sqlvar getPortalType type="string">,
modified=<dtml-sqlvar modified type="string">,
review_state=<dtml-sqlvar review_state type="string">,
opportunity_state=<dtml-sqlvar opportunity_state type="string">,
default_source_reference=<dtml-sqlvar getDefaultSourceReference type="string">,
default_destination_reference=<dtml-sqlvar getDefaultDestinationReference type="string">,
default_source_title=<dtml-sqlvar getDefaultSourceTitle type="string">,
default_destination_title=<dtml-sqlvar getDefaultDestinationTitle type="string">,
default_source_section_title=<dtml-sqlvar getDefaultSourceSectionTitle type="string">,
default_destination_section_title=<dtml-sqlvar getDefaultDestinationSectionTitle type="string">,
default_causality_id=<dtml-sqlvar getDefaultCausalityId type="string">,
location=<dtml-sqlvar getLocation type="string">,
ean13_code=<dtml-sqlvar getEan13Code type="string">,
validation_state=<dtml-sqlvar validation_state type="string">,
simulation_state=<dtml-sqlvar getSimulationState type="string">,
causality_state=<dtml-sqlvar causality_state type="string">,
discussion_state=<dtml-sqlvar discussion_state type="string">,
payment_state=<dtml-sqlvar payment_state type="string">,
event_state=<dtml-sqlvar event_state type="string">,
invoice_state=<dtml-sqlvar invoice_state type="string">,
order_id=<dtml-sqlvar getOrderId type="string">,
reference=<dtml-sqlvar getReference type="string">,
source_reference=<dtml-sqlvar getSourceReference type="string">,
destination_reference=<dtml-sqlvar getDestinationReference type="string">,
summary=<dtml-sqlvar summary type="string">
WHERE <dtml-sqltest uid op=eq type=int> ;
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