1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
- <Export generator =" Cache" version =" 25" zv =" Cache for Windows (x86-64) 2016.2 (Build 728U)" >
3
- <Project name =" sc-all" >
4
- <Items >
5
- <ProjectItem name =" sc.all" type =" CLS" ></ProjectItem >
6
- <ProjectItem name =" sc.all.sub" type =" CLS" ></ProjectItem >
7
- </Items >
8
- </Project >
9
-
10
-
2
+ <Export generator =" Cache" version =" 25" >
11
3
<Class name =" sc.all" >
12
4
<Description >
13
5
@@ -18,6 +10,7 @@ d ##class(sc.all).export()
18
10
d ##class(sc.all).import()
19
11
</Description >
20
12
<Abstract >1</Abstract >
13
+ <TimeCreated >64245,54012</TimeCreated >
21
14
22
15
<Method name =" export" >
23
16
<Description >
@@ -173,129 +166,4 @@ gl[obal] n[ame] - storage for settings</Description>
173
166
]]> </Implementation >
174
167
</Method >
175
168
</Class >
176
-
177
-
178
- <Class name =" sc.all.sub" >
179
- <Description >
180
- Export different types of modules in different subfolders</Description >
181
- <Super >sc.all</Super >
182
-
183
- <Method name =" filename" >
184
- <Description ><![CDATA[
185
- test.dfi -> /dfi/test.dfi
186
- test.cls -> /cls/test.cls
187
- etc]]> </Description >
188
- <ClassMethod >1</ClassMethod >
189
- <FormalSpec >code</FormalSpec >
190
- <Implementation ><![CDATA[
191
- s ext = $p( code, ".", * ), ext = $zcvt( ext, "l" )
192
- #; for each type - different directory
193
- s wd = ..workdir() s:ext'="" wd = ##class(%File).NormalizeDirectory( ext, wd )
194
- d:'##class(%File).DirectoryExists( wd ) ##class(%File).CreateDirectoryChain( wd )
195
-
196
- s filename = ##class(%File).NormalizeFilename( code, wd )
197
- #; for *.dfi filename can contain folders
198
- if ext = "dfi" {
199
- s path = ##class(%File).GetDirectory( filename )
200
- d:'##class(%File).DirectoryExists( path ) ##class(%File).CreateDirectoryChain( path )
201
- }
202
- Q filename
203
- ]]> </Implementation >
204
- </Method >
205
-
206
- <Method name =" importUpdated" >
207
- <Description >
208
- import from workdir all files with ts newer than code ts in db</Description >
209
- <ClassMethod >1</ClassMethod >
210
- <FormalSpec ><![CDATA[ qspec="cku-d",&err="",recurse=1,&loaded="",verbose=1]]> </FormalSpec >
211
- <ReturnType >%Status</ReturnType >
212
- <Implementation ><![CDATA[
213
- #define push(%dir) s dirs( $i( dirs ) ) = %dir
214
- #define next(%i,%dir) s %i=$o( dirs( "" ), 1, %dir ) k:%i'="" dirs(%i)
215
- #define isDirectory(%type) ( %type = "D" )
216
- #define log w !, filename, " -> ", codename, " ", +sc
217
-
218
- s sc = 1, dirs = "", dir = ..workdir() $$$push(dir)
219
-
220
- s rs = ##class(%ResultSet).%New( "%Library.File:FileSet" )
221
- for { $$$next(i,dir) Q:i="" Q:dir=""
222
-
223
- s sc = rs.Execute( dir, "*.*" ) Q:'sc
224
-
225
- while rs.Next() {
226
-
227
- s filename = rs.Name
228
-
229
- if $$$isDirectory( rs.Type ) {
230
- if ( recurse ) $$$push(filename) ;push directory
231
- continue
232
- }
233
-
234
- s filets = rs.DateModified
235
- s codename = ..codename( filename, .ext )
236
- s codets = ..codets( codename, ext )
237
-
238
- if ( filets '] codets ) continue
239
-
240
- /*
241
- w !, " ************* import ************** "
242
- w !, "file: ", filets
243
- w !, "code: ", codets
244
- */
245
-
246
- if ext = "dfi" {
247
-
248
- s sc = ##class(%DeepSee.UserLibrary.Utils).%Import( filename, 1, 0, 0, "", .loaded )
249
-
250
- } else {
251
-
252
- s sc = $system.OBJ.Load( filename, qspec, .err, .loaded)
253
-
254
- }
255
-
256
- if verbose $$$log
257
- }
258
- }
259
- Q sc
260
- ]]> </Implementation >
261
- </Method >
262
-
263
- <Method name =" codename" >
264
- <Description >
265
- presumable codename </Description >
266
- <ClassMethod >1</ClassMethod >
267
- <FormalSpec ><![CDATA[ filename,&ext=""]]> </FormalSpec >
268
- <Implementation ><![CDATA[
269
- s ext = $p( filename, ".", * ), ext = $zcvt( ext, "l" )
270
- s path = ##class(%File).NormalizeDirectory( ext, ..workdir() )
271
- s codename = $p( filename, path, 2 )
272
- if ext = "dfi" {
273
- s fullname = $tr( codename, "\", "/" ) ; return fullname for dfi in $$$IsWINDOWS
274
- Q $p( fullname, ".", 1, *-1 ) ;remove extension
275
- }
276
- Q codename
277
- ]]> </Implementation >
278
- </Method >
279
-
280
- <Method name =" codets" >
281
- <ClassMethod >1</ClassMethod >
282
- <FormalSpec >codename,ext</FormalSpec >
283
- <Implementation ><![CDATA[
284
- s ts = ""
285
- if ext'="dfi" {
286
- s ts = ##class(%RoutineMgr).TS( codename )
287
- } else {
288
- s sql="Select timeModified From %DeepSee_UserLibrary.FolderItem Where fullname = ?"
289
- s rs = ##class(%SQL.Statement).%ExecDirect( , sql, codename )
290
- if rs.%Next() {
291
- s utcts = rs.timeModified
292
- s utch = $zdth( utcts, 3, , 3 ) ;utc internal format
293
- s loch = $zdth( utch, -3 ) ; utc to local timezone
294
- s ts = $zdt( loch, 3, ,0 ) ; local timestamp*/
295
- }
296
- }
297
- Q $p( ts, "." ) ;remove ms
298
- ]]> </Implementation >
299
- </Method >
300
- </Class >
301
169
</Export >
0 commit comments