contentstorage/castorage/conf/castoragedb_templates/castoragedb_variant.sql
changeset 94 dbb8300717f7
parent 93 82b66994846c
child 106 e78d6e055a5b
child 109 e0aa398e6810
equal deleted inserted replaced
93:82b66994846c 94:dbb8300717f7
     4 {% for col in range(feat_tree.CaStorageDbSetting.Collections._value|length) -%}
     4 {% for col in range(feat_tree.CaStorageDbSetting.Collections._value|length) -%}
     5     {%- set Name = feat_tree.CaStorageDbSetting.Collections.Name._value[col] or '' -%}
     5     {%- set Name = feat_tree.CaStorageDbSetting.Collections.Name._value[col] or '' -%}
     6     {%- set GroupName = feat_tree.CaStorageDbSetting.Collections.GroupName._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 '' -%}
     7     {%- set Flags = feat_tree.CaStorageDbSetting.Collections.Flags._value[col] or '' -%}
     8     {%- set LocName = feat_tree.CaStorageDbSetting.Collections.LocName._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 '' -%}
     9     {%- set IconFileName = feat_tree.CaStorageDbSetting.Collections.IconFileName._value[col] or '' -%}
    10 INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, FLAGS {% if LocName -%}, COL_LOCNAME{%- endif %}{% if Icon -%}, ICON{%- endif %}) 
    10     {%- set IconSkinId = feat_tree.CaStorageDbSetting.Collections.IconSkinId._value[col] or '' -%}
    11 VALUES ( '{{Name}}', '{{GroupName}}', {{Flags}} {% if LocName -%},  "{{LocName}}"{%- endif %}{% if Icon -%}, "{{Icon}}"{%- endif %});
    11 INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, FLAGS {% if LocName -%}, COL_LOCNAME{%- endif %}{% if IconFileName -%}, ICON_FILENAME{%- endif %}{% if IconSkinId -%}, ICON_SKIN_ID{%- endif %}) 
       
    12 VALUES ( '{{Name}}', '{{GroupName}}', {{Flags}} {% if LocName -%},  "{{LocName}}"{%- endif %}{% if IconFileName -%}, "{{IconFileName}}"{%- endif %}{% if IconSkinId -%}, "{{IconSkinId}}"{%- endif %});
    12 
    13 
    13 {% endfor %}
    14 {% endfor %}
    14 
    15 
    15 {% for index in range(feat_tree.CaStorageDbSetting.Items._value|length) -%}
    16 {% for index in range(feat_tree.CaStorageDbSetting.Items._value|length) -%}
    16     {%- set Type = feat_tree.CaStorageDbSetting.Items.Type._value[index] or '' -%}
    17     {%- set Type = feat_tree.CaStorageDbSetting.Items.Type._value[index] or '' -%}
    17     {%- set Name = feat_tree.CaStorageDbSetting.Items.Name._value[index] or '' -%}
    18     {%- set Name = feat_tree.CaStorageDbSetting.Items.Name._value[index] or '' -%}
    18     {%- set Icon = feat_tree.CaStorageDbSetting.Items.Icon._value[index] or '' -%}
    19     {%- set IconFileName = feat_tree.CaStorageDbSetting.Items.IconFileName._value[index] or '' -%}
    19     {%- set Destination = feat_tree.CaStorageDbSetting.Items.Destination._value[index] or '' -%}
    20     {%- set IconSkinId = feat_tree.CaStorageDbSetting.Items.IconSkinId._value[index] or '' -%}
       
    21     {%- set DestinationUid = feat_tree.CaStorageDbSetting.Items.DestinationUid._value[index] or '' -%}
       
    22     {%- set DestinationUrl = feat_tree.CaStorageDbSetting.Items.DestinationUrl._value[index] or '' -%}
       
    23     {%- set DestinationWidgetUri = feat_tree.CaStorageDbSetting.Items.DestinationWidgetUri._value[index] or '' -%}
    20     {%- set Collection = feat_tree.CaStorageDbSetting.Items.Col_Name._value[index] or '' -%}
    24     {%- 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) 
    25 {% if Type == "application" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
    22   VALUES ("{{Type}}", '{{Name}}', {{Destination}},  '{{Collection}}' );{%- endif %}
    26   VALUES ("{{Type}}", '{{Name}}', {{DestinationUid}},  '{{Collection}}' );{%- endif %}
    23 {% if Type == "url" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, ICON, COLLECTION_NAME) 
    27 {% if Type == "url" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, ICON_FILENAME, ICON_SKIN_ID, COLLECTION_NAME) 
    24   VALUES ("{{Type}}", '{{Name}}', "{{Destination}}", "{{Icon}}",  '{{Collection}}' ); {%- endif %}
    28   VALUES ("{{Type}}", '{{Name}}', "{{DestinationUrl}}", "{{IconFileName}}", "{{IconSkinId}}",  '{{Collection}}' ); {%- endif %}
    25 {% if Type == "widget" -%} INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON, URI, COLLECTION_NAME ) 
    29 {% if Type == "widget" -%} INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON_FILENAME, ICON_SKIN_ID, URI, COLLECTION_NAME ) 
    26   VALUES ("{{Type}}", '{{Name}}', "{{Icon}}", "{{Destination}}", '{{Collection}}' ); {%- endif %}
    30   VALUES ("{{Type}}", '{{Name}}', "{{IconFileName}}", "{{IconSkinId}}", "{{DestinationWidgetUri}}", '{{Collection}}' ); {%- endif %}
    27 {% endfor %}
    31 {% endfor %}
    28 
    32 
    29 SELECT "castoragedb_variant - END" AS " ";
    33 SELECT "castoragedb_variant - END" AS " ";
    30 SELECT "------------------------------------" AS " ";
    34 SELECT "------------------------------------" AS " ";
    31 
    35