contentstorage/castorage/conf/castoragedb_templates/castoragedb_variant.sql
changeset 73 4bc7b118b3df
child 80 397d00875918
equal deleted inserted replaced
66:32469d7d46ff 73:4bc7b118b3df
       
     1 SELECT "------------------------------------" AS " ";
       
     2 SELECT "castoragedb_variant - BEGIN" AS " ";
       
     3 
       
     4 {% for col in range(feat_tree.CaStorageDbSetting.Collections._value|length) -%}
       
     5     {%- set Name = feat_tree.CaStorageDbSetting.Collections.Name._value[col] or '' -%}
       
     6     {%- set GroupName = feat_tree.CaStorageDbSetting.Collections.GroupName._value[col] or '' -%}
       
     7     {%- set Flags = feat_tree.CaStorageDbSetting.Collections.Flags._value[col] or '' -%}
       
     8     {%- set LocName = feat_tree.CaStorageDbSetting.Collections.LocName._value[col] or ''-%}
       
     9     {%- set Icon = feat_tree.CaStorageDbSetting.Collections.Icon._value[col] or '' -%}
       
    10 INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, FLAGS {% if LocName -%}, COL_LOCNAME{%- endif %}{% if Icon -%}, ICON{%- endif %}) 
       
    11 VALUES ( '{{Name}}', '{{GroupName}}', {{Flags}} {% if LocName -%},  "{{LocName}}"{%- endif %}{% if Icon -%}, "{{Icon}}"{%- endif %});
       
    12 
       
    13 {% endfor %}
       
    14 
       
    15 {% for index in range(feat_tree.CaStorageDbSetting.Items._value|length) -%}
       
    16     {%- set Type = feat_tree.CaStorageDbSetting.Items.Type._value[index] or '' -%}
       
    17     {%- set Name = feat_tree.CaStorageDbSetting.Items.Name._value[index] or '' -%}
       
    18     {%- set Icon = feat_tree.CaStorageDbSetting.Items.Icon._value[index] or '' -%}
       
    19     {%- set Destination = feat_tree.CaStorageDbSetting.Items.Destination._value[index] or '' -%}
       
    20     {%- set Collection = feat_tree.CaStorageDbSetting.Items.Col_Name._value[index] or '' -%}
       
    21 {% if Type == "application" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE,ITEM_NAME,ITEM_DEST, COLLECTION_NAME) 
       
    22   VALUES ("{{Type}}", '{{Name}}', {{Destination}},  '{{Collection}}' );{%- endif %}
       
    23 {% if Type == "url" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, ICON, COLLECTION_NAME) 
       
    24   VALUES ("{{Type}}", '{{Name}}', "{{Destination}}", "{{Icon}}",  '{{Collection}}' ); {%- endif %}
       
    25 {% if Type == "widget" -%} INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON, URI, COLLECTION_NAME ) 
       
    26   VALUES ("{{Type}}", '{{Name}}', "{{Icon}}", "{{Destination}}", '{{Collection}}' ); {%- endif %}
       
    27 {% endfor %}
       
    28 
       
    29 SELECT "castoragedb_variant - END" AS " ";
       
    30 SELECT "------------------------------------" AS " ";
       
    31