93
|
1 |
SELECT "------------------------------------" AS " ";
|
|
2 |
SELECT "castoragedb_variant - BEGIN" AS " ";
|
|
3 |
|
116
|
4 |
{%- macro stripPath(IconPath) %}
|
|
5 |
{%- set cont = true -%}
|
|
6 |
{%- set Icon = '' -%}
|
|
7 |
{%- for c in IconPath|reverse|list -%}
|
|
8 |
{%- if c == '\\' or c == '/' -%}
|
|
9 |
{%- set cont = false -%}
|
|
10 |
{%- endif %}
|
|
11 |
{%- if cont %}
|
|
12 |
{%- set Icon = c ~ Icon %}
|
|
13 |
{%- endif %}
|
|
14 |
{%- if loop.last -%}
|
119
|
15 |
{%- if Icon == "dummy" %}
|
|
16 |
{% else -%}
|
|
17 |
{{ "z:\\private\\20022F35\\customsvg\\" ~ Icon }}
|
|
18 |
{%- endif -%}
|
116
|
19 |
{%- endif %}
|
|
20 |
{%- endfor %}
|
|
21 |
{%- endmacro %}
|
107
|
22 |
|
116
|
23 |
{%- macro processURLs(URLs) %}
|
|
24 |
{%- for i in range(feat_tree.CaStorageDbSetting[URLs]._value|length) -%}
|
|
25 |
{%- set URLTitle = feat_tree.CaStorageDbSetting[URLs].URLTitle._value[i] -%}
|
|
26 |
{%- set URLShortTitle = feat_tree.CaStorageDbSetting[URLs].URLShortTitle._value[i] or '' -%}
|
|
27 |
{%- set URL = feat_tree.CaStorageDbSetting[URLs].URL._value[i] or '' -%}
|
|
28 |
{%- set URLIcon = feat_tree.CaStorageDbSetting[URLs].URLIcon.localPath._value[i] or '' -%}
|
|
29 |
{%- set IconSkinId = feat_tree.CaStorageDbSetting[URLs].IconSkinId._value[i] or '' -%}
|
119
|
30 |
{%- if URLIcon != "" -%}
|
116
|
31 |
{%- set URLIcon = stripPath(URLIcon) -%}
|
|
32 |
{%- endif %}
|
|
33 |
INSERT INTO URL ( URL_TITLE, URL_SHORT_TITLE, URL_DEST, ICON_FILENAME, ICON_SKIN_ID )
|
|
34 |
VALUES ( '{{URLTitle}}', "{{URLShortTitle}}", "{{URL}}", "{{URLIcon}}", "{{IconSkinId}}" );
|
|
35 |
{%- endfor %}
|
|
36 |
{%- endmacro %}
|
107
|
37 |
|
116
|
38 |
{% macro processCollections(Collections) -%}
|
|
39 |
{%- for col in range(feat_tree.CaStorageDbSetting[Collections]._value|length) -%}
|
|
40 |
{%- set Name = feat_tree.CaStorageDbSetting[Collections].Name._value[col] or '' -%}
|
|
41 |
{%- set ShortName = feat_tree.CaStorageDbSetting[Collections].ShortName._value[col] or '' -%}
|
|
42 |
{%- set TitleName = feat_tree.CaStorageDbSetting[Collections].TitleName._value[col] or '' -%}
|
|
43 |
{%- set GroupName = feat_tree.CaStorageDbSetting[Collections].GroupName._value[col] or '' -%}
|
|
44 |
{%- set Locked = feat_tree.CaStorageDbSetting[Collections].Locked._value[col] or false -%}
|
|
45 |
{%- set LocalizeNames = false -%}
|
|
46 |
{%- if Collections == "Collections" -%}
|
|
47 |
{%- set LocalizeNames = feat_tree.CaStorageDbSetting[Collections].LocalizeNames._value[col] or false -%}
|
125
|
48 |
{%- set TranslationFile = feat_tree.CaStorageDbSetting[Collections].TranslationFile._value[col] or '' -%}
|
|
49 |
{%- if TranslationFile != "" -%}
|
|
50 |
{%- set TranslationFile = TranslationFile~'_' -%}
|
|
51 |
{%- endif -%}
|
|
52 |
{%- endif -%}
|
116
|
53 |
{%- set IconFileName = feat_tree.CaStorageDbSetting[Collections].Icon.localPath._value[col] or '' -%}
|
|
54 |
{%- set IconSkinId = feat_tree.CaStorageDbSetting[Collections].IconSkinId._value[col] or '' -%}
|
119
|
55 |
{%- if IconFileName != "" -%}
|
116
|
56 |
{%- set IconFileName = stripPath(IconFileName) -%}
|
125
|
57 |
{%- endif -%}
|
119
|
58 |
{%- if ShortName == "" -%}
|
|
59 |
{%- set ShortName = Name -%}
|
125
|
60 |
{%- endif -%}
|
119
|
61 |
{%- if GroupName == "" -%}
|
|
62 |
{%- set GroupName = Name -%}
|
125
|
63 |
{%- endif -%}
|
|
64 |
INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, FLAGS{%- if TitleName -%}, COL_TITLE_NAME{%- endif %} {% if LocalizeNames -%}, TRANSLATION_FILE{%- endif %}, COL_SHORT_NAME, ICON_FILENAME, ICON_SKIN_ID)
|
|
65 |
VALUES ( '{{Name}}', '{{GroupName}}', {% if Locked -%} 0 {% else %} 4 {%- endif %}{%- if TitleName -%}, "{{TitleName}}"{%- endif %}{% if LocalizeNames -%}, "{{TranslationFile}}"{%- endif %}, "{{ShortName}}", "{{IconFileName}}", "{{IconSkinId}}");
|
116
|
66 |
{% endfor %}
|
|
67 |
{%- endmacro %}
|
93
|
68 |
|
116
|
69 |
{% macro processItems(Items) -%}
|
|
70 |
{%- for index in range(feat_tree.CaStorageDbSetting[Items]._value|length) -%}
|
|
71 |
{%- set Type = feat_tree.CaStorageDbSetting[Items].Type._value[index] or '' -%}
|
|
72 |
{%- set Application = feat_tree.CaStorageDbSetting[Items].Application._value[index] or '' -%}
|
|
73 |
{%- set URLTitle = feat_tree.CaStorageDbSetting[Items].URL._value[index] or '' -%}
|
|
74 |
{%- set HomescreenWidget = feat_tree.CaStorageDbSetting[Items].HomescreenWidget._value[index] or '' -%}
|
|
75 |
|
|
76 |
{%- if Items == "Items" %}
|
|
77 |
{%- set Collection = feat_tree.CaStorageDbSetting[Items].ColName._value[index] or '' -%}
|
|
78 |
{%- set URLs = 'URLs' -%}
|
|
79 |
{%- else %} {# Items == "OperatorCollectionItems" #}
|
|
80 |
{%- set Collection = feat_tree.CaStorageDbSetting.OperatorCollections.Name._value[0] %}
|
|
81 |
{%- set URLs = 'OperatorURLs' -%}
|
|
82 |
{%- endif %}
|
|
83 |
|
|
84 |
{% if Type == "1" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME)
|
119
|
85 |
VALUES ("application", '', {{Application|hex2dec}}, '{{Collection}}' );{%- endif %}
|
116
|
86 |
|
|
87 |
{% if Type == "2" -%} INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, URI, COLLECTION_NAME )
|
|
88 |
VALUES ("widget", '{{HomescreenWidget}}', "{{HomescreenWidget}}", '{{Collection}}' ); {%- endif %}
|
|
89 |
|
|
90 |
{% if Type == "3" -%}
|
|
91 |
{% for i in range(feat_tree.CaStorageDbSetting[URLs]._value|length) if URLTitle == feat_tree.CaStorageDbSetting[URLs].URLTitle._value[i] -%}
|
|
92 |
INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, COLLECTION_NAME)
|
|
93 |
VALUES ( "url", '{{URLTitle}}', '{{Collection}}' );
|
|
94 |
{% endfor %}
|
|
95 |
{%- endif %}
|
|
96 |
|
|
97 |
{%- endfor %}
|
|
98 |
{%- endmacro %}
|
93
|
99 |
|
116
|
100 |
{{ processCollections('OperatorCollections') }}
|
|
101 |
|
|
102 |
{{ processURLs('OperatorURLs') }}
|
|
103 |
|
|
104 |
{{ processItems('OperatorCollectionItems') }}
|
|
105 |
|
|
106 |
{{ processCollections('Collections') }}
|
|
107 |
|
|
108 |
{{ processURLs('URLs') }}
|
|
109 |
|
|
110 |
{{ processItems('Items') }}
|
93
|
111 |
|
|
112 |
SELECT "castoragedb_variant - END" AS " ";
|
|
113 |
SELECT "------------------------------------" AS " ";
|
|
114 |
|