353ac4e1c0ad8374d8a73ca5be5170586d211754
[ccsdk/cds.git] /
1 /*
2 ============LICENSE_START==========================================
3 ===================================================================
4 Copyright (C) 2019 Orange. All rights reserved.
5 ===================================================================
6
7 Unless otherwise specified, all software contained herein is licensed
8 under the Apache License, Version 2.0 (the License);
9 you may not use this software except in compliance with the License.
10 You may obtain a copy of the License at
11
12     http://www.apache.org/licenses/LICENSE-2.0
13
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19 ============LICENSE_END============================================
20 */
21
22
23 export class MetaDataTab {
24
25     mode: string;
26     dictionaryLibraryInstance?: null;
27     name: string;
28     description: string;
29     version: string;
30     tags: string;
31     mapOfCustomKey: Map<string, string> = new Map<string, string>();
32     entryFileName: string;
33     templateName: string;
34
35 }
36
37 /*TOSCA-Meta-File-Version: 1.0.0
38 CSAR-Version: 1.0
39 Created-By: PLATANIA, MARCO <platania@research.att.com>
40 Entry-Definitions: Definitions/vLB_CDS.json
41 Template-Name: baseconfiguration
42 Template-Version: 1.0.0
43 Template-Type: DEFAULT
44 Template-Tags: vDNS-CDS-test1
45 Content-Type: application/vnd.oasis.bpmn*/
46
47 export class MetaDataFile {
48
49     static getObjectInstance(metaDataTab: MetaDataTab): string {
50         return 'TOSCA-Meta-File-Version: 1.0.0\n' +
51             'CSAR-Version: 1.0\n' +
52             'Created-By: Shaaban Ebrahim <shaaban.eltanany.ext@orange.con>\n' +
53             'Entry-Definitions:' + metaDataTab.entryFileName + '\n' +
54             'Template-Name:' + metaDataTab.templateName + '\n' +
55             'Template-Version: 1.0.0\n' +
56             'Template-Type: DEFAULT\n' +
57             'Template-Tags:' + metaDataTab.tags;
58
59     }
60
61 }
62
63
64 export interface FolderNodes {
65     name: string;
66     children?: FolderNodes[];
67 }
68
69 export class FolderNodeElement {
70     TREE_DATA: FolderNodes[] = [
71         {
72             name: 'Definitions',
73             children: [
74                 {name: 'activation-blueprint.json'},
75                 {name: 'artifacts_types.json'},
76                 {name: 'data_types.json'},
77                 {name: 'vLB_CDS.json'},
78             ]
79         },
80         {
81             name: 'Scripts',
82             children: [
83                 {
84                     name: 'kotlin',
85                     children: [
86                         {name: 'ScriptComponent.cba.kts'},
87                         {name: 'ResourceAssignmentProcessor.cba.kts'},
88                     ]
89                 }
90             ]
91         },
92         {
93             name: 'Templates',
94             children: [
95                 {
96                     name: 'baseconfig-template'
97                 }
98             ]
99         },
100         {
101             name: 'TOSCA-Metadata',
102             children: [
103                 {
104                     name: 'TOSCA.meta'
105                 }
106             ]
107         },
108     ];
109 }
110
111 export class FilesContent {
112
113     public static mapOfFilesNamesAndContent: Map<string, string> = new Map<string, string>();
114
115     public static getMapOfFilesNamesAndContent(): Map<string, string> {
116         return FilesContent.mapOfFilesNamesAndContent;
117     }
118
119     public static putData(fileName: string, content: string) {
120         FilesContent.mapOfFilesNamesAndContent.set(fileName, content);
121     }
122 }