-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWG_DUMP_INFORMATION_overview_of_files_to_migrate.pro
321 lines (264 loc) · 8.53 KB
/
WG_DUMP_INFORMATION_overview_of_files_to_migrate.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
601,100
602,"WG_DUMP_INFORMATION_overview_of_files_to_migrate"
562,"NULL"
586,
585,
564,
565,"rUexNk9n1<JqPx2e>Va9J?RGL>FE;B`EY@2ZBDARTdpu[m5X`2K6arXG<pqxW[t7v;s=cCm`U5FaS::9GibPNG8td99geM5T3M=_?RTYp[USm8tQ0qrDZG5OH1k2ZwZ>Z1tZ4fdnlHs]JiLW_qy1]:OoO@v_GmRWz_aas^>aUn`1L;EmTnm?ppHWxRe0N7j[bkkZxJe3"
559,1
928,0
593,
594,
595,
597,
598,
596,
800,
801,
566,0
567,","
588,","
589," "
568,""""
570,
571,
569,0
592,0
599,1000
560,2
pName
pMode
561,2
2
1
590,2
pName,""
pMode,2
637,2
pName,"Dimension name or cube name ?"
pMode,"Mode ? (1 = dimension, 2 = cube. See inside the process for all options.)"
577,0
578,0
579,0
580,0
581,0
582,0
603,0
572,222
#****Begin: Generated Statements***
#****End: Generated Statements****
#Region IntroduceThisProcess
####################################################
# Wim Gielis
# July 2024
# https://www.wimgielis.com
####################################################
#
# This process lists files that you need to backup given an object to delete/remove/ ...
#
# The parameter pMode determines the object:
# If pMode = 1, you treat 1 dimension. Specify the dimension name in pName.
# If pMode = 2, you treat 1 cube. Specify the cube name in pName.
#
# The output is a text file in the TM1 logging directory
#
####################################################
#####
# Add the following process(es) to this TM1 model:
# - TECH_folder for output
#####
#EndRegion IntroduceThisProcess
#Region CallThisProcess
## call this custom process as, for instance:
If( 1 = 0 );
ExecuteProcess( 'WG_DUMP_INFORMATION_overview_of_holds'
, 'pName', 'Dimension name or cube name ?'
, 'pMode', 'Mode ? (1 = dimension, 2 = cube. See inside the process for all options.)'
);
EndIf;
#EndRegion CallThisProcess
DataSourceAsciiQuoteCharacter = '';
# TO DO:
# - application items, views and subsets (both public and private)
# - Also on "auxiliary" cubes like attributes and security but this is most probably overkill to program
# Where do we output text files ?
StringGlobalVariable( 'cDestination_Folder' );
ExecuteProcess( 'TECH_folder for output', 'pSubfolder', 'Overview of files to migrate', 'pMainFolder', '1+' );
vFile = cDestination_Folder | 'backup_' | Timst( Now, '\Y-\m-\d \h\i\s' ) | '.txt';
TextOutput( vFile, 'Object type', 'Object type' );
If( pMode = 2 );
pCube = pName;
# cube itself
If( CubeExists( pCube ) = 1 );
TextOutput( vFile, 'application cube', pCube | '.cub' );
Else;
LogOutput( 'ERROR', 'The cube ''' | pCube | ''' does not exist.');
ProcessQuit;
EndIf;
# cell security cube
If( CubeExists( '}CellSecurity_' | pCube ) = 1 );
TextOutput( vFile, 'cell security cube', '}CellSecurity_' | pCube | '.cub' );
EndIf;
# picklist cube
If( CubeExists( '}Picklist_' | pCube ) = 1 );
TextOutput( vFile, 'picklist cube', '}Picklist_' | pCube | '.cub' );
EndIf;
# picklist dimension
If( DimensionExists( '}PickList' ) = 1 );
TextOutput( vFile, 'picklist dimension', '}PickList.dim' );
EndIf;
# rules
If( FileExists( '}Picklist_' | pCube | '.rux' ) = 1 );
TextOutput( vFile, 'picklist cube rules', '}Picklist_' | pCube | '.rux' );
EndIf;
# cube security
TextOutput( vFile, 'cube security cube', '}CubeSecurity' | '.cub' );
If( FileExists( '}CubeSecurity.rux' ) = 1 );
TextOutput( vFile, 'cube security cube rules', '}CubeSecurity.rux' );
EndIf;
TextOutput( vFile, 'dimension security cube', '}DimensionSecurity' | '.cub' );
If( FileExists( '}DimensionSecurity.rux' ) = 1 );
TextOutput( vFile, 'dimension security cube rules', '}DimensionSecurity.rux' );
EndIf;
# }Drill
# cube drill cube
If( CubeExists( '}CubeDrill_' | pCube ) = 1 );
TextOutput( vFile, 'cube drill cube', '}CubeDrill_' | pCube | '.cub' );
# cube drill dimension
If( DimensionExists( '}CubeDrillString' ) = 1 );
TextOutput( vFile, 'cube drill dimension', '}CubeDrillString.dim' );
EndIf;
# cube drill rules
If( FileExists( '}CubeDrill_' | pCube | '.rux' ) = 1 );
TextOutput( vFile, 'cube drill rules', '}CubeDrill_' | pCube | '.rux' );
EndIf;
# TO DO: other types of data like LOGGING, MEASURES dim, etc. also at the level of the dimensions
If( CubeExists( '}CubeProperties' ) = 1 );
TextOutput( vFile, 'cube properties cube', '}CubeProperties.cub' );
EndIf;
If( CubeExists( '}DimensionProperties' ) = 1 );
TextOutput( vFile, 'dimension properties cube', '}DimensionProperties.cub' );
EndIf;
EndIf;
# rules
If( FileExists( pCube | '.rux' ) = 1 );
TextOutput( vFile, 'cube rules', pCube | '.rux' );
EndIf;
# loop over dimensions
m = 1;
While( m <= CubeDimensionCountGet( pCube ));
vDim = Tabdim( pCube, m );
# dimension header
TextOutput( vFile, ' ' );
TextOutput( vFile, '# dimension name', vDim );
# dimension
TextOutput( vFile, 'dimension', vDim );
# attributes cube
If( CubeExists( '}ElementAttributes_' | vDim ) = 1 );
TextOutput( vFile, 'element attributes cube', '}ElementAttributes_' | vDim | '.cub' );
EndIf;
# attributes dimension
If( DimensionExists( '}ElementAttributes_' | vDim ) = 1 );
TextOutput( vFile, 'element attributes dimension', '}ElementAttributes_' | vDim | '.dim' );
EndIf;
# element attributes cube rules
If( FileExists( '}ElementAttributes_' | vDim | '.rux' ) = 1 );
TextOutput( vFile, 'element attributes cube rules', '}ElementAttributes_' | vDim | '.rux' );
EndIf;
# element security cube
If( CubeExists( '}ElementSecurity_' | vDim ) = 1 );
TextOutput( vFile, 'element security cube', '}ElementSecurity_' | vDim | '.cub' );
EndIf;
# element security dimension
If( DimensionExists( '}ElementSecurity_' | vDim ) = 1 );
TextOutput( vFile, 'element security dimension', '}ElementSecurity_' | vDim | '.dim' );
EndIf;
# element security rules
If( FileExists( '}ElementSecurity_' | vDim | '.rux' ) = 1 );
TextOutput( vFile, 'element security cube rules', '}ElementSecurity_' | vDim | '.rux' );
EndIf;
m = m + 1;
End;
ElseIf( pMode = 1 );
pDimension = pName;
# dimension itself
If( DimensionExists( pDimension ) = 1 );
TextOutput( vFile, 'application dimension', pDimension | '.dim' );
Else;
LogOutput( 'ERROR', 'The dimension ''' | pDimension | ''' does not exist.');
ProcessQuit;
EndIf;
# attributes cube
If( CubeExists( '}ElementAttributes_' | pDimension ) = 1 );
TextOutput( vFile, 'element attributes cube', '}ElementAttributes_' | pDimension | '.cub' );
EndIf;
# attributes dimension
If( DimensionExists( '}ElementAttributes_' | pDimension ) = 1 );
TextOutput( vFile, 'element attributes dimension', '}ElementAttributes_' | pDimension | '.dim' );
EndIf;
# element attributes cube rules
If( FileExists( '}ElementAttributes_' | pDimension | '.rux' ) = 1 );
TextOutput( vFile, 'element attributes cube rules', '}ElementAttributes_' | pDimension | '.rux' );
EndIf;
# element security cube
If( CubeExists( '}ElementSecurity_' | pDimension ) = 1 );
TextOutput( vFile, 'element security cube', '}ElementSecurity_' | pDimension | '.cub' );
EndIf;
# element security dimension
If( DimensionExists( '}ElementSecurity_' | pDimension ) = 1 );
TextOutput( vFile, 'element security dimension', '}ElementSecurity_' | pDimension | '.dim' );
EndIf;
# element security rules
If( FileExists( '}ElementSecurity_' | pDimension | '.rux' ) = 1 );
TextOutput( vFile, 'element security cube rules', '}ElementSecurity_' | pDimension | '.rux' );
EndIf;
EndIf;
573,3
#****Begin: Generated Statements***
#****End: Generated Statements****
574,3
#****Begin: Generated Statements***
#****End: Generated Statements****
575,3
#****Begin: Generated Statements***
#****End: Generated Statements****
576,CubeAction=1511DataAction=1503CubeLogChanges=0_ParameterConstraints=e30=
930,0
638,1
804,0
1217,1
900,
901,
902,
938,0
937,
936,
935,
934,
932,0
933,0
903,
906,
929,
907,
908,
904,0
905,0
909,0
911,
912,
913,
914,
915,
916,
917,0
918,1
919,0
920,50000
921,""
922,""
923,0
924,""
925,""
926,""
927,""