7006
|
1 |
"{ Package: 'stx:libtool' }"
|
|
2 |
|
|
3 |
"{ NameSpace: Tools }"
|
|
4 |
|
|
5 |
ApplicationModel subclass:#StoreProjectBrowser
|
7010
|
6 |
instanceVariableNames:'dbInfo connection commentTextHolder packagesList
|
|
7 |
selectedVersionHolder versionsList selectedPackageHolder
|
|
8 |
packagesFilterHolder infoLabelHolder selectedBundleOrPackage
|
|
9 |
selectedVersion'
|
7006
|
10 |
classVariableNames:''
|
|
11 |
poolDictionaries:''
|
|
12 |
category:'System-SourceCodeManagement'
|
|
13 |
!
|
|
14 |
|
7008
|
15 |
Object subclass:#Pundle
|
|
16 |
instanceVariableNames:'name'
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
privateIn:StoreProjectBrowser
|
|
20 |
!
|
|
21 |
|
|
22 |
StoreProjectBrowser::Pundle subclass:#Package
|
|
23 |
instanceVariableNames:''
|
|
24 |
classVariableNames:''
|
|
25 |
poolDictionaries:''
|
|
26 |
privateIn:StoreProjectBrowser
|
|
27 |
!
|
|
28 |
|
|
29 |
StoreProjectBrowser::Pundle subclass:#Bundle
|
|
30 |
instanceVariableNames:''
|
|
31 |
classVariableNames:''
|
|
32 |
poolDictionaries:''
|
|
33 |
privateIn:StoreProjectBrowser
|
|
34 |
!
|
|
35 |
|
|
36 |
Object subclass:#PundleVersion
|
7010
|
37 |
instanceVariableNames:'id pundle version user timestamp comment timestampInt commentId
|
8731
|
38 |
isBundle blessingLevel'
|
|
39 |
classVariableNames:''
|
|
40 |
poolDictionaries:''
|
|
41 |
privateIn:StoreProjectBrowser
|
|
42 |
!
|
|
43 |
|
|
44 |
Object subclass:#StoreProjectChangeSetReader
|
|
45 |
instanceVariableNames:'browser dbConnection bundleOrPackage version changeSet'
|
7008
|
46 |
classVariableNames:''
|
|
47 |
poolDictionaries:''
|
|
48 |
privateIn:StoreProjectBrowser
|
|
49 |
!
|
|
50 |
|
7006
|
51 |
!StoreProjectBrowser class methodsFor:'documentation'!
|
|
52 |
|
|
53 |
documentation
|
|
54 |
"
|
7011
|
55 |
An experimental first attempt to access a Store database.
|
|
56 |
As I dont have (and dont want) access to a VW implementation for reference,
|
|
57 |
the layout and contents of the tables has been guessed.
|
|
58 |
The goal is to be able to read public domain code from a store DB.
|
7006
|
59 |
"
|
|
60 |
!
|
|
61 |
|
|
62 |
examples
|
|
63 |
"
|
|
64 |
Starting the application:
|
|
65 |
[exBegin]
|
|
66 |
Tools::StoreProjectBrowser open
|
|
67 |
|
|
68 |
[exEnd]
|
|
69 |
|
|
70 |
more examples to be added:
|
|
71 |
[exBegin]
|
|
72 |
... add code fragment for
|
|
73 |
... executable example here ...
|
|
74 |
[exEnd]
|
|
75 |
"
|
|
76 |
! !
|
|
77 |
|
8731
|
78 |
!StoreProjectBrowser class methodsFor:'image specs'!
|
|
79 |
|
|
80 |
bundleImage
|
|
81 |
"This resource specification was automatically generated
|
|
82 |
by the ImageEditor of ST/X."
|
|
83 |
|
|
84 |
"Do not manually edit this!! If it is corrupted,
|
|
85 |
the ImageEditor may not be able to read the specification."
|
|
86 |
|
|
87 |
"
|
|
88 |
self bundleImage inspect
|
|
89 |
ImageEditor openOnClass:self andSelector:#bundleImage
|
|
90 |
Icon flushCachedIcons
|
|
91 |
"
|
|
92 |
|
|
93 |
<resource: #image>
|
|
94 |
|
|
95 |
^Icon
|
|
96 |
constantNamed:'Tools::StoreProjectBrowser class bundleImage'
|
|
97 |
ifAbsentPut:[(Depth8Image new) width: 17; height: 16; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
|
|
98 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BP$IBP$IBP$IBP$IBP@@@@@INS$9A!!\$BQ$YFRDI@@@@@@$9KSX?MP4IFP@*K0$@@@@@BS$C
|
|
99 |
E@PIEP$YJ#0VBP@@@@@IA!!PDBQ$IBSL<LP8I@@@@@@$WI@4IFQ$3N \XI $@@@@@BS SGP$@J!!DGL!!@^BP@@@@@IAQ,%BRDIBTMDN3\I@@@@@@%AH2,ABQHI
|
|
100 |
JS,(K $@@@@@BT@4OP(Z@ $*LB@''BP@@@@@IJ00\KC8KBRH_C4HI@@@@@@$IBP$IBP$IBP$IBP$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
101 |
@@@b') ; colorMapFromArray:#[229 232 255 221 221 160 202 203 179 252 253 186 222 223 196 240 241 213 247 248 218 219 223 255 255 255 255 0 0 0 216 216 156 200 201 178 209 210 185 219 220 194 192 194 214 178 181 214 209 214 255 224 226 255 212 211 153 240 241 177 249 249 184 217 217 192 194 196 214 245 246 217 214 219 255 241 243 255 212 212 153 235 236 173 206 207 183 216 217 192 186 189 214 181 184 214 194 200 255 227 229 255 199 204 255 231 231 169 245 245 181 214 214 190 189 192 214 178 182 214 199 205 255 231 233 255 227 230 255 226 225 164 204 205 181 255 255 189 180 184 214 196 198 214 198 205 255 219 222 255 215 218 255 240 241 255 225 226 164 245 245 180 253 252 187 183 187 214 243 244 215 249 249 219 223 226 255 204 209 255 223 227 255 221 220 160 202 202 179 250 249 184 235 237 208 238 239 211 176 180 214 215 219 255 210 214 255]; mask:((Depth1Image new) width: 17; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@A?@@A?O?9?O?9?O?9?O?9?O?9?O?9?O?9?O?9?O?9?O?9?O?9?O?9?@@A?@@A?') ; yourself); yourself]
|
8739
|
102 |
!
|
|
103 |
|
|
104 |
packageImage
|
|
105 |
"This resource specification was automatically generated
|
|
106 |
by the ImageEditor of ST/X."
|
|
107 |
|
|
108 |
"Do not manually edit this!! If it is corrupted,
|
|
109 |
the ImageEditor may not be able to read the specification."
|
|
110 |
|
|
111 |
"
|
|
112 |
self packageImage inspect
|
|
113 |
ImageEditor openOnClass:self andSelector:#packageImage
|
|
114 |
Icon flushCachedIcons
|
|
115 |
"
|
|
116 |
|
|
117 |
<resource: #image>
|
|
118 |
|
|
119 |
^Icon
|
|
120 |
constantNamed:'Tools::StoreProjectBrowser class packageImage'
|
|
121 |
ifAbsentPut:[(Depth8Image new) width: 17; height: 16; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
|
|
122 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@BL#H2L#H2L#@@@@@@@@@@@#ECPRHB0CDQ #@@@@@@@@H20,KB0,KB0XH"L@@@@@@BLT
|
|
123 |
A@,''KCLJG0T)H0@@@@@#K!!PTEB TEAP[AR<#@@@@@BLYE18%GQ@IJ2$ECBL@@@@@H24ALPD]@PDHMPTZH0@@@@@#I"P$IA4OIAXSARL@@@@@@BL2@B(0GP\N
|
|
124 |
A2D#@@@@@@@@H0H\M!!T]CPX6H0@@@@@@@@@@H2L#H2L#H2L@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
|
125 |
@@@b') ; colorMapFromArray:#[185 185 131 197 197 141 211 212 153 238 239 175 253 253 187 109 109 109 180 180 127 184 185 132 197 198 141 202 203 146 234 234 172 250 249 185 155 155 108 179 180 128 184 185 131 191 191 137 203 202 146 235 235 171 250 250 185 154 155 109 255 255 255 179 179 128 191 190 136 203 202 145 232 232 170 249 249 184 149 149 105 173 172 122 180 179 128 136 136 136 202 202 146 231 231 169 247 247 182 149 150 104 172 172 122 0 0 0 191 191 136 202 202 145 230 231 169 246 246 181 194 194 194 167 167 118 185 185 132 203 203 145 165 165 165 241 241 177 255 255 189 160 160 113 185 184 131 197 197 142 221 221 160 238 238 175 253 253 188 161 161 113 180 180 128]; mask:((Depth1Image new) width: 17; height: 16; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@A?@@A?@?1?A?9?C?9?G?9?O?9?O?9?O?9?O?1?O?!!?O?A?G>A?@@A?@@A?@@A?') ; yourself); yourself]
|
8731
|
126 |
! !
|
|
127 |
|
7006
|
128 |
!StoreProjectBrowser class methodsFor:'interface specs'!
|
|
129 |
|
|
130 |
windowSpec
|
|
131 |
"This resource specification was automatically generated
|
|
132 |
by the UIPainter of ST/X."
|
|
133 |
|
|
134 |
"Do not manually edit this!! If it is corrupted,
|
|
135 |
the UIPainter may not be able to read the specification."
|
|
136 |
|
|
137 |
"
|
|
138 |
UIPainter new openOnClass:Tools::StoreProjectBrowser andSelector:#windowSpec
|
|
139 |
Tools::StoreProjectBrowser new openInterface:#windowSpec
|
|
140 |
Tools::StoreProjectBrowser open
|
|
141 |
"
|
|
142 |
|
|
143 |
<resource: #canvas>
|
|
144 |
|
|
145 |
^
|
|
146 |
#(FullSpec
|
|
147 |
name: windowSpec
|
|
148 |
window:
|
|
149 |
(WindowSpec
|
|
150 |
label: 'Tools::StoreProjectBrowser'
|
|
151 |
name: 'Tools::StoreProjectBrowser'
|
|
152 |
min: (Point 10 10)
|
|
153 |
max: (Point 1024 768)
|
|
154 |
bounds: (Rectangle 0 0 527 369)
|
|
155 |
menu: mainMenu
|
|
156 |
)
|
|
157 |
component:
|
|
158 |
(SpecCollection
|
|
159 |
collection: (
|
|
160 |
(VariableHorizontalPanelSpec
|
|
161 |
name: 'VariableHorizontalPanel1'
|
|
162 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
|
|
163 |
snapMode: both
|
|
164 |
handlePosition: right
|
|
165 |
component:
|
|
166 |
(SpecCollection
|
|
167 |
collection: (
|
|
168 |
(ViewSpec
|
|
169 |
name: 'Box1'
|
|
170 |
component:
|
|
171 |
(SpecCollection
|
|
172 |
collection: (
|
|
173 |
(LabelSpec
|
|
174 |
label: 'Bundles and Packages:'
|
|
175 |
name: 'Label1'
|
|
176 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0)
|
|
177 |
translateLabel: true
|
|
178 |
adjust: left
|
|
179 |
)
|
|
180 |
(InputFieldSpec
|
7008
|
181 |
name: 'PackageFilterEntryField'
|
7006
|
182 |
layout: (LayoutFrame 2 0 30 0 -2 1 58 0)
|
|
183 |
model: packagesFilterHolder
|
|
184 |
immediateAccept: true
|
|
185 |
acceptOnReturn: true
|
|
186 |
acceptOnTab: true
|
|
187 |
acceptOnLostFocus: true
|
|
188 |
acceptOnPointerLeave: false
|
|
189 |
)
|
|
190 |
(SequenceViewSpec
|
7008
|
191 |
name: 'PackageList'
|
7006
|
192 |
layout: (LayoutFrame 0 0 60 0 0 1 0 1)
|
|
193 |
model: selectedPackageHolder
|
7028
|
194 |
menu: packageListMenu
|
7006
|
195 |
hasHorizontalScrollBar: true
|
|
196 |
hasVerticalScrollBar: true
|
7008
|
197 |
valueChangeSelector: packageSelectionChanged
|
7006
|
198 |
useIndex: true
|
|
199 |
sequenceList: packagesList
|
|
200 |
)
|
|
201 |
)
|
|
202 |
|
|
203 |
)
|
|
204 |
)
|
|
205 |
(ViewSpec
|
|
206 |
name: 'Box3'
|
|
207 |
component:
|
|
208 |
(SpecCollection
|
|
209 |
collection: (
|
|
210 |
(LabelSpec
|
|
211 |
label: 'Versions:'
|
|
212 |
name: 'Label2'
|
|
213 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0)
|
|
214 |
translateLabel: true
|
|
215 |
adjust: left
|
|
216 |
)
|
|
217 |
(VariableVerticalPanelSpec
|
|
218 |
name: 'VariableVerticalPanel1'
|
|
219 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1)
|
|
220 |
component:
|
|
221 |
(SpecCollection
|
|
222 |
collection: (
|
|
223 |
(SequenceViewSpec
|
|
224 |
name: 'VersionsList'
|
|
225 |
model: selectedVersionHolder
|
7028
|
226 |
menu: versionsListMenu
|
7006
|
227 |
hasHorizontalScrollBar: true
|
|
228 |
hasVerticalScrollBar: true
|
7028
|
229 |
valueChangeSelector: versionSelectionChanged
|
7006
|
230 |
useIndex: true
|
|
231 |
sequenceList: versionsList
|
|
232 |
)
|
|
233 |
(ViewSpec
|
|
234 |
name: 'Box2'
|
|
235 |
component:
|
|
236 |
(SpecCollection
|
|
237 |
collection: (
|
|
238 |
(LabelSpec
|
|
239 |
label: 'Comment:'
|
|
240 |
name: 'Label3'
|
|
241 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0)
|
|
242 |
translateLabel: true
|
|
243 |
adjust: left
|
|
244 |
)
|
|
245 |
(TextEditorSpec
|
|
246 |
name: 'CommentTextEditor'
|
|
247 |
layout: (LayoutFrame 0 0 30 0 0 1 -1 1)
|
|
248 |
model: commentTextHolder
|
|
249 |
hasHorizontalScrollBar: true
|
|
250 |
hasVerticalScrollBar: true
|
|
251 |
)
|
|
252 |
)
|
|
253 |
|
|
254 |
)
|
|
255 |
)
|
|
256 |
)
|
|
257 |
|
|
258 |
)
|
|
259 |
handles: (Any 0.5 1.0)
|
|
260 |
)
|
|
261 |
)
|
|
262 |
|
|
263 |
)
|
|
264 |
)
|
|
265 |
)
|
|
266 |
|
|
267 |
)
|
|
268 |
handles: (Any 0.5 1.0)
|
|
269 |
)
|
|
270 |
(LabelSpec
|
|
271 |
name: 'InfoLabel'
|
|
272 |
layout: (LayoutFrame 2 0 -28 1 -1 1 -1 1)
|
|
273 |
level: -1
|
|
274 |
translateLabel: true
|
|
275 |
labelChannel: infoLabelHolder
|
|
276 |
adjust: left
|
|
277 |
)
|
|
278 |
)
|
|
279 |
|
|
280 |
)
|
|
281 |
)
|
|
282 |
! !
|
|
283 |
|
|
284 |
!StoreProjectBrowser class methodsFor:'internationalization'!
|
|
285 |
|
|
286 |
resourcePackName
|
|
287 |
^ 'StoreProjectBrowser'
|
|
288 |
! !
|
|
289 |
|
|
290 |
!StoreProjectBrowser class methodsFor:'menu specs'!
|
|
291 |
|
|
292 |
mainMenu
|
|
293 |
"This resource specification was automatically generated
|
|
294 |
by the MenuEditor of ST/X."
|
|
295 |
|
|
296 |
"Do not manually edit this!! If it is corrupted,
|
|
297 |
the MenuEditor may not be able to read the specification."
|
|
298 |
|
|
299 |
"
|
|
300 |
MenuEditor new openOnClass:Tools::StoreProjectBrowser andSelector:#mainMenu
|
|
301 |
(Menu new fromLiteralArrayEncoding:(Tools::StoreProjectBrowser mainMenu)) startUp
|
|
302 |
"
|
|
303 |
|
|
304 |
<resource: #menu>
|
|
305 |
|
|
306 |
^
|
|
307 |
#(Menu
|
|
308 |
(
|
|
309 |
(MenuItem
|
|
310 |
label: 'File'
|
|
311 |
translateLabel: true
|
|
312 |
submenu:
|
|
313 |
(Menu
|
|
314 |
(
|
|
315 |
(MenuItem
|
|
316 |
label: 'Fileout As...'
|
|
317 |
itemValue: menuFileoutAs
|
|
318 |
translateLabel: true
|
|
319 |
)
|
|
320 |
(MenuItem
|
|
321 |
label: '-'
|
|
322 |
)
|
|
323 |
(MenuItem
|
|
324 |
label: 'Update'
|
|
325 |
itemValue: menuUpdate
|
|
326 |
translateLabel: true
|
|
327 |
)
|
|
328 |
(MenuItem
|
|
329 |
label: '-'
|
|
330 |
)
|
|
331 |
(MenuItem
|
|
332 |
label: 'Exit'
|
|
333 |
itemValue: closeRequest
|
|
334 |
translateLabel: true
|
|
335 |
)
|
|
336 |
)
|
|
337 |
nil
|
|
338 |
nil
|
|
339 |
)
|
|
340 |
)
|
|
341 |
(MenuItem
|
7010
|
342 |
label: 'Connection'
|
|
343 |
translateLabel: true
|
|
344 |
submenu:
|
|
345 |
(Menu
|
|
346 |
(
|
|
347 |
(MenuItem
|
|
348 |
label: 'Connect'
|
|
349 |
itemValue: menuConnect
|
|
350 |
translateLabel: true
|
|
351 |
isVisible: notConnectedHolder
|
|
352 |
)
|
|
353 |
(MenuItem
|
|
354 |
label: 'Disconnect'
|
|
355 |
itemValue: menuDisconnect
|
|
356 |
translateLabel: true
|
|
357 |
isVisible: isConnectedHolder
|
|
358 |
)
|
|
359 |
)
|
|
360 |
nil
|
|
361 |
nil
|
|
362 |
)
|
|
363 |
)
|
|
364 |
(MenuItem
|
7006
|
365 |
label: 'Help'
|
|
366 |
translateLabel: true
|
|
367 |
startGroup: right
|
|
368 |
submenu:
|
|
369 |
(Menu
|
|
370 |
(
|
|
371 |
(MenuItem
|
|
372 |
label: 'Documentation'
|
|
373 |
itemValue: openDocumentation
|
|
374 |
translateLabel: true
|
|
375 |
)
|
|
376 |
(MenuItem
|
|
377 |
label: '-'
|
|
378 |
)
|
|
379 |
(MenuItem
|
|
380 |
label: 'About this Application...'
|
|
381 |
itemValue: openAboutThisApplication
|
|
382 |
translateLabel: true
|
|
383 |
)
|
|
384 |
)
|
|
385 |
nil
|
|
386 |
nil
|
|
387 |
)
|
|
388 |
)
|
|
389 |
)
|
|
390 |
nil
|
|
391 |
nil
|
|
392 |
)
|
7028
|
393 |
!
|
|
394 |
|
|
395 |
packageListMenu
|
|
396 |
"This resource specification was automatically generated
|
|
397 |
by the MenuEditor of ST/X."
|
|
398 |
|
|
399 |
"Do not manually edit this!! If it is corrupted,
|
|
400 |
the MenuEditor may not be able to read the specification."
|
|
401 |
|
|
402 |
"
|
|
403 |
MenuEditor new openOnClass:Tools::StoreProjectBrowser andSelector:#packageListMenu
|
|
404 |
(Menu new fromLiteralArrayEncoding:(Tools::StoreProjectBrowser packageListMenu)) startUp
|
|
405 |
"
|
|
406 |
|
|
407 |
<resource: #menu>
|
|
408 |
|
|
409 |
^
|
|
410 |
#(Menu
|
|
411 |
(
|
|
412 |
(MenuItem
|
|
413 |
label: 'Update'
|
|
414 |
itemValue: menuUpdatePackageList
|
|
415 |
translateLabel: true
|
|
416 |
)
|
|
417 |
)
|
|
418 |
nil
|
|
419 |
nil
|
|
420 |
)
|
|
421 |
!
|
|
422 |
|
|
423 |
versionsListMenu
|
|
424 |
"This resource specification was automatically generated
|
|
425 |
by the MenuEditor of ST/X."
|
|
426 |
|
|
427 |
"Do not manually edit this!! If it is corrupted,
|
|
428 |
the MenuEditor may not be able to read the specification."
|
|
429 |
|
|
430 |
"
|
|
431 |
MenuEditor new openOnClass:Tools::StoreProjectBrowser andSelector:#versionsListMenu
|
|
432 |
(Menu new fromLiteralArrayEncoding:(Tools::StoreProjectBrowser versionsListMenu)) startUp
|
|
433 |
"
|
|
434 |
|
|
435 |
<resource: #menu>
|
|
436 |
|
|
437 |
^
|
|
438 |
#(Menu
|
|
439 |
(
|
|
440 |
(MenuItem
|
|
441 |
label: 'Load'
|
|
442 |
itemValue: versionsListMenuLoad
|
|
443 |
translateLabel: true
|
|
444 |
)
|
|
445 |
(MenuItem
|
8731
|
446 |
label: 'Browse'
|
|
447 |
itemValue: versionsListMenuBrowse
|
|
448 |
translateLabel: true
|
|
449 |
)
|
|
450 |
(MenuItem
|
7028
|
451 |
label: '-'
|
|
452 |
)
|
|
453 |
(MenuItem
|
|
454 |
label: 'Update'
|
|
455 |
itemValue: versionsListMenuUpdate
|
|
456 |
translateLabel: true
|
|
457 |
)
|
|
458 |
)
|
|
459 |
nil
|
|
460 |
nil
|
|
461 |
)
|
7006
|
462 |
! !
|
|
463 |
|
|
464 |
!StoreProjectBrowser class methodsFor:'startup'!
|
|
465 |
|
|
466 |
openOn:aDBInfo
|
|
467 |
|newApp|
|
|
468 |
|
|
469 |
newApp := self new.
|
|
470 |
newApp allButOpen.
|
|
471 |
newApp dbInfo:aDBInfo.
|
|
472 |
newApp open.
|
|
473 |
^ newApp
|
|
474 |
! !
|
|
475 |
|
7008
|
476 |
!StoreProjectBrowser methodsFor:'actions'!
|
|
477 |
|
|
478 |
packageSelectionChanged
|
7009
|
479 |
|newest|
|
7008
|
480 |
|
7010
|
481 |
self withReadCursorDo:[
|
|
482 |
selectedBundleOrPackage := packagesList value at:(selectedPackageHolder value).
|
|
483 |
self updateVersionsListFor:selectedBundleOrPackage.
|
7008
|
484 |
|
7028
|
485 |
versionsList value notEmptyOrNil ifTrue:[
|
7010
|
486 |
newest := versionsList value first.
|
|
487 |
self updateCommentFor:newest
|
|
488 |
]
|
7008
|
489 |
].
|
|
490 |
!
|
|
491 |
|
|
492 |
versionSelectionChanged
|
8731
|
493 |
|selIndex|
|
7008
|
494 |
|
7010
|
495 |
selIndex := selectedVersionHolder value.
|
|
496 |
selIndex isNil ifTrue:[
|
8731
|
497 |
self commentTextHolder value:nil.
|
|
498 |
selectedVersion := nil.
|
7010
|
499 |
] ifFalse:[
|
8731
|
500 |
selectedVersion := versionsList value at:selIndex.
|
7010
|
501 |
self withReadCursorDo:[
|
8731
|
502 |
self updateBlessingCommentFor:selectedVersion
|
7010
|
503 |
].
|
|
504 |
]
|
7008
|
505 |
! !
|
|
506 |
|
7006
|
507 |
!StoreProjectBrowser methodsFor:'aspects'!
|
|
508 |
|
|
509 |
commentTextHolder
|
|
510 |
"automatically generated by UIPainter ..."
|
|
511 |
|
|
512 |
"*** the code below creates a default model when invoked."
|
|
513 |
"*** (which may not be the one you wanted)"
|
|
514 |
"*** Please change as required and accept it in the browser."
|
|
515 |
"*** (and replace this comment by something more useful ;-)"
|
|
516 |
|
|
517 |
commentTextHolder isNil ifTrue:[
|
|
518 |
commentTextHolder := '' asValue.
|
|
519 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
520 |
"/ commentTextHolder addDependent:self.
|
|
521 |
"/ commentTextHolder onChangeSend:#commentTextHolderChanged to:self.
|
|
522 |
].
|
|
523 |
^ commentTextHolder.
|
|
524 |
!
|
|
525 |
|
|
526 |
infoLabelHolder
|
|
527 |
"automatically generated by UIPainter ..."
|
|
528 |
|
|
529 |
"*** the code below creates a default model when invoked."
|
|
530 |
"*** (which may not be the one you wanted)"
|
|
531 |
"*** Please change as required and accept it in the browser."
|
|
532 |
"*** (and replace this comment by something more useful ;-)"
|
|
533 |
|
|
534 |
infoLabelHolder isNil ifTrue:[
|
|
535 |
infoLabelHolder := ValueHolder new.
|
|
536 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
537 |
"/ infoLabelHolder addDependent:self.
|
|
538 |
"/ infoLabelHolder onChangeSend:#infoLabelHolderChanged to:self.
|
|
539 |
].
|
|
540 |
^ infoLabelHolder.
|
|
541 |
!
|
|
542 |
|
7010
|
543 |
isConnected
|
|
544 |
^ connection notNil and:[ connection isConnected ].
|
|
545 |
!
|
|
546 |
|
|
547 |
isConnectedHolder
|
|
548 |
^ [ self isConnected ]
|
|
549 |
!
|
|
550 |
|
|
551 |
notConnectedHolder
|
|
552 |
^ [ self isConnected not ]
|
|
553 |
!
|
|
554 |
|
7006
|
555 |
packagesFilterHolder
|
|
556 |
"automatically generated by UIPainter ..."
|
|
557 |
|
|
558 |
"*** the code below creates a default model when invoked."
|
|
559 |
"*** (which may not be the one you wanted)"
|
|
560 |
"*** Please change as required and accept it in the browser."
|
|
561 |
"*** (and replace this comment by something more useful ;-)"
|
|
562 |
|
|
563 |
packagesFilterHolder isNil ifTrue:[
|
|
564 |
packagesFilterHolder := ValueHolder new.
|
|
565 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
566 |
"/ packagesFilterHolder addDependent:self.
|
|
567 |
"/ packagesFilterHolder onChangeSend:#packagesFilterHolderChanged to:self.
|
|
568 |
].
|
|
569 |
^ packagesFilterHolder.
|
|
570 |
!
|
|
571 |
|
|
572 |
packagesList
|
|
573 |
"automatically generated by UIPainter ..."
|
|
574 |
|
|
575 |
"*** the code below creates a default model when invoked."
|
|
576 |
"*** (which may not be the one you wanted)"
|
|
577 |
"*** Please change as required and accept it in the browser."
|
|
578 |
"*** (and replace this comment by something more useful ;-)"
|
|
579 |
|
|
580 |
packagesList isNil ifTrue:[
|
|
581 |
packagesList := ValueHolder new.
|
|
582 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
583 |
"/ packagesList addDependent:self.
|
|
584 |
"/ packagesList onChangeSend:#packagesListChanged to:self.
|
|
585 |
].
|
|
586 |
^ packagesList.
|
|
587 |
!
|
|
588 |
|
|
589 |
selectedPackageHolder
|
|
590 |
"automatically generated by UIPainter ..."
|
|
591 |
|
|
592 |
"*** the code below creates a default model when invoked."
|
|
593 |
"*** (which may not be the one you wanted)"
|
|
594 |
"*** Please change as required and accept it in the browser."
|
|
595 |
"*** (and replace this comment by something more useful ;-)"
|
|
596 |
|
|
597 |
selectedPackageHolder isNil ifTrue:[
|
|
598 |
selectedPackageHolder := ValueHolder new.
|
|
599 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
600 |
"/ selectedPackageHolder addDependent:self.
|
|
601 |
"/ selectedPackageHolder onChangeSend:#selectedPackageHolderChanged to:self.
|
|
602 |
].
|
|
603 |
^ selectedPackageHolder.
|
|
604 |
!
|
|
605 |
|
|
606 |
selectedVersionHolder
|
|
607 |
"automatically generated by UIPainter ..."
|
|
608 |
|
|
609 |
"*** the code below creates a default model when invoked."
|
|
610 |
"*** (which may not be the one you wanted)"
|
|
611 |
"*** Please change as required and accept it in the browser."
|
|
612 |
"*** (and replace this comment by something more useful ;-)"
|
|
613 |
|
|
614 |
selectedVersionHolder isNil ifTrue:[
|
|
615 |
selectedVersionHolder := ValueHolder new.
|
|
616 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
617 |
"/ selectedVersionHolder addDependent:self.
|
|
618 |
"/ selectedVersionHolder onChangeSend:#selectedVersionHolderChanged to:self.
|
|
619 |
].
|
|
620 |
^ selectedVersionHolder.
|
|
621 |
!
|
|
622 |
|
|
623 |
versionsList
|
|
624 |
"automatically generated by UIPainter ..."
|
|
625 |
|
|
626 |
"*** the code below creates a default model when invoked."
|
|
627 |
"*** (which may not be the one you wanted)"
|
|
628 |
"*** Please change as required and accept it in the browser."
|
|
629 |
"*** (and replace this comment by something more useful ;-)"
|
|
630 |
|
|
631 |
versionsList isNil ifTrue:[
|
|
632 |
versionsList := ValueHolder new.
|
|
633 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
634 |
"/ versionsList addDependent:self.
|
|
635 |
"/ versionsList onChangeSend:#versionsListChanged to:self.
|
|
636 |
].
|
|
637 |
^ versionsList.
|
|
638 |
! !
|
|
639 |
|
|
640 |
!StoreProjectBrowser methodsFor:'db access'!
|
|
641 |
|
7008
|
642 |
getBlob:id
|
8747
|
643 |
^ self getBlob:id withPrefix:nil
|
|
644 |
!
|
|
645 |
|
|
646 |
getBlob:id withPrefix:prefixOrNil
|
|
647 |
|item cursor row blobType blobData rawData|
|
7008
|
648 |
|
|
649 |
item := Set new.
|
|
650 |
cursor := connection
|
8747
|
651 |
execute:('SELECT blobtype,blobdata FROM tw_blob where primarykey = %1;' bindWith:id)
|
7008
|
652 |
release:false.
|
|
653 |
|
|
654 |
cursor next notNil ifTrue:[
|
|
655 |
row := cursor rowAsArray.
|
|
656 |
blobType := (row at:1).
|
8747
|
657 |
rawData := (row at:2).
|
|
658 |
blobData := Base64Coder decode:rawData.
|
7008
|
659 |
].
|
|
660 |
cursor release.
|
|
661 |
|
8747
|
662 |
blobType < 0 ifTrue:[
|
|
663 |
"/ this data is a prefix...
|
|
664 |
self halt.
|
|
665 |
^ self getBlob:(blobType negated) withPrefix:blobData
|
|
666 |
].
|
|
667 |
|
7008
|
668 |
blobType == 1 ifTrue:[
|
|
669 |
"binary"
|
|
670 |
^ blobData
|
|
671 |
].
|
|
672 |
blobType == 2 ifTrue:[
|
|
673 |
"string"
|
|
674 |
^ blobData asString
|
|
675 |
].
|
|
676 |
blobType == 3 ifTrue:[
|
|
677 |
"2-byte string"
|
|
678 |
self halt.
|
|
679 |
^ nil
|
|
680 |
].
|
|
681 |
self halt.
|
8747
|
682 |
^ nil
|
7008
|
683 |
!
|
|
684 |
|
|
685 |
getBundles
|
|
686 |
|items cursor row|
|
|
687 |
|
|
688 |
items := Set new.
|
|
689 |
cursor := connection
|
|
690 |
execute:'SELECT DISTINCT name FROM tw_bundle;'
|
|
691 |
release:false.
|
|
692 |
|
|
693 |
[cursor next notNil] whileTrue:[
|
|
694 |
row := cursor rowAsArray.
|
|
695 |
Transcript showCR:row.
|
|
696 |
items add:(Bundle new name:(row at:1)).
|
|
697 |
].
|
|
698 |
cursor release.
|
|
699 |
^ items asOrderedCollection sort:[:a :b| a name < b name]
|
|
700 |
!
|
|
701 |
|
7010
|
702 |
getConnection
|
|
703 |
|session|
|
|
704 |
|
7028
|
705 |
dbInfo isNil ifTrue:[
|
|
706 |
self askForDatabaseInfo
|
|
707 |
].
|
|
708 |
|
7010
|
709 |
session := SQL::ODBCSession new.
|
8739
|
710 |
SQL::ODBCError handle:[:ex |
|
|
711 |
^ nil.
|
|
712 |
] do:[
|
|
713 |
session
|
|
714 |
connectWithUsername:(dbInfo userName)
|
|
715 |
password:(dbInfo password)
|
|
716 |
dbname:(dbInfo dbName).
|
|
717 |
].
|
7010
|
718 |
|
|
719 |
(session isConnected) ifFalse:[
|
|
720 |
^ nil.
|
|
721 |
].
|
|
722 |
^ session.
|
|
723 |
!
|
|
724 |
|
7008
|
725 |
getPackages
|
|
726 |
|items cursor row|
|
|
727 |
|
|
728 |
items := Set new.
|
|
729 |
cursor := connection
|
|
730 |
execute:'SELECT DISTINCT name FROM tw_package;'
|
|
731 |
release:false.
|
|
732 |
|
|
733 |
[cursor next notNil] whileTrue:[
|
|
734 |
row := cursor rowAsArray.
|
|
735 |
Transcript showCR:row.
|
|
736 |
items add:(Package new name:(row at:1)).
|
|
737 |
].
|
|
738 |
cursor release.
|
|
739 |
^ items asOrderedCollection sort:[:a :b| a name < b name]
|
|
740 |
!
|
|
741 |
|
|
742 |
getVersionsForBundle:aBundle
|
7010
|
743 |
^ self getVersionsForBundleOrPackage:aBundle isBundle:true
|
|
744 |
!
|
|
745 |
|
|
746 |
getVersionsForBundleOrPackage:aBundle isBundle:isBundle
|
|
747 |
|items cursor row table|
|
7008
|
748 |
|
7028
|
749 |
connection isNil ifTrue:[^ #() ].
|
7008
|
750 |
|
7010
|
751 |
table := isBundle ifTrue:'tw_bundle' ifFalse:'tw_package'.
|
|
752 |
|
7008
|
753 |
items := Set new.
|
|
754 |
cursor := connection
|
8731
|
755 |
execute:'SELECT name,version,username,timestamp,commentid,primarykey,blessinglevel
|
8729
|
756 |
FROM ',table,
|
|
757 |
"/ ' WHERE name = ''',aBundle name,''' ',
|
|
758 |
';'
|
7008
|
759 |
release:false.
|
|
760 |
|
|
761 |
[cursor next notNil] whileTrue:[
|
8731
|
762 |
|v name version username timestamp commentid primarykey blessinglevel|
|
7008
|
763 |
|
|
764 |
row := cursor rowAsArray.
|
8731
|
765 |
Transcript showCR:row.
|
8729
|
766 |
name := row at:1.
|
|
767 |
version := row at:2.
|
|
768 |
username := row at:3.
|
|
769 |
timestamp := row at:4.
|
|
770 |
commentid := row at:5.
|
|
771 |
primarykey := row at:6.
|
8731
|
772 |
blessinglevel := row at:7.
|
8729
|
773 |
name = aBundle name ifTrue:[
|
|
774 |
v := PundleVersion new.
|
|
775 |
v pundle:aBundle version:version user:username.
|
|
776 |
v timestampInt:timestamp commentId:commentid.
|
8731
|
777 |
v blessingLevel:blessinglevel.
|
8729
|
778 |
v id:primarykey.
|
|
779 |
v isBundle:isBundle.
|
|
780 |
items add:v.
|
|
781 |
]
|
7008
|
782 |
].
|
|
783 |
cursor release.
|
|
784 |
^ items asOrderedCollection sort:[:a :b| a isVersionAfter: b]
|
|
785 |
!
|
|
786 |
|
|
787 |
getVersionsForPackage:aPackage
|
7010
|
788 |
^ self getVersionsForBundleOrPackage:aPackage isBundle:false
|
7008
|
789 |
!
|
|
790 |
|
7009
|
791 |
updateBlessingCommentFor:aPundleVersion
|
7010
|
792 |
|versionId commentId user comment cursor row recType|
|
7009
|
793 |
|
|
794 |
versionId := aPundleVersion id.
|
7010
|
795 |
recType := aPundleVersion isBundle ifTrue:'B' ifFalse:'P'.
|
7009
|
796 |
|
|
797 |
cursor := connection
|
7010
|
798 |
execute:'SELECT username,commentid FROM tw_blessing
|
|
799 |
WHERE pkgid = ',versionId printString,' AND rectype = ''',recType,''';'
|
7009
|
800 |
release:false.
|
7010
|
801 |
cursor isNil ifTrue:[
|
|
802 |
commentId :=0
|
|
803 |
] ifFalse:[
|
|
804 |
row := cursor next rowAsArray.
|
|
805 |
cursor release.
|
7009
|
806 |
|
7010
|
807 |
user := row at:1.
|
|
808 |
commentId := row at:2.
|
|
809 |
].
|
7009
|
810 |
|
|
811 |
commentId == 0 ifTrue:[
|
|
812 |
comment := 'No comment' allItalic
|
|
813 |
] ifFalse:[
|
|
814 |
comment := self getBlob:commentId.
|
7010
|
815 |
comment := comment asCollectionOfSubCollectionsSeparatedBy:Character return.
|
|
816 |
comment := comment asStringCollection asString.
|
7009
|
817 |
].
|
|
818 |
self commentTextHolder value:comment.
|
|
819 |
!
|
|
820 |
|
7008
|
821 |
updateCommentFor:aPundleVersion
|
7009
|
822 |
|comment id|
|
7008
|
823 |
|
7009
|
824 |
id := aPundleVersion commentId.
|
|
825 |
id == 0 ifTrue:[
|
|
826 |
comment := 'No comment' allItalic
|
|
827 |
] ifFalse:[
|
|
828 |
comment := self getBlob:(aPundleVersion commentId).
|
|
829 |
].
|
7008
|
830 |
self commentTextHolder value:comment.
|
|
831 |
!
|
|
832 |
|
7006
|
833 |
updatePackagesList
|
7008
|
834 |
|bundles packages|
|
|
835 |
|
|
836 |
connection isNil ifTrue:[^ self ].
|
|
837 |
|
|
838 |
self withReadCursorDo:[
|
|
839 |
bundles := self getBundles.
|
|
840 |
packages := self getPackages.
|
|
841 |
].
|
|
842 |
packagesList value:(bundles , packages).
|
|
843 |
!
|
|
844 |
|
|
845 |
updateVersionsListFor:aBundleOrPackage
|
|
846 |
|items|
|
|
847 |
|
7010
|
848 |
aBundleOrPackage isBundle ifTrue:[
|
|
849 |
items := self getVersionsForBundle:aBundleOrPackage
|
|
850 |
] ifFalse:[
|
|
851 |
items := self getVersionsForPackage:aBundleOrPackage
|
7008
|
852 |
].
|
7010
|
853 |
self selectedVersionHolder value:nil.
|
7008
|
854 |
versionsList value:items.
|
7006
|
855 |
! !
|
|
856 |
|
|
857 |
!StoreProjectBrowser methodsFor:'help'!
|
|
858 |
|
|
859 |
aboutThisApplicationText
|
|
860 |
^ super aboutThisApplicationText ,
|
|
861 |
'\\Written by Claus Gittinger, eXept Software AG.' withCRs
|
|
862 |
! !
|
|
863 |
|
|
864 |
!StoreProjectBrowser methodsFor:'initialization & release'!
|
|
865 |
|
|
866 |
dbInfo:aDBInfo
|
|
867 |
|session|
|
|
868 |
|
7010
|
869 |
dbInfo := aDBInfo.
|
|
870 |
session := self getConnection.
|
|
871 |
(session notNil) ifFalse:[
|
7006
|
872 |
^ self.
|
|
873 |
].
|
|
874 |
connection := session.
|
7028
|
875 |
self updateInfo.
|
7006
|
876 |
^ self
|
|
877 |
!
|
|
878 |
|
7008
|
879 |
postOpenWith:aBuilder
|
8727
|
880 |
super postOpenWith:aBuilder.
|
7006
|
881 |
self updatePackagesList.
|
|
882 |
!
|
|
883 |
|
|
884 |
release
|
|
885 |
connection notNil ifTrue:[
|
|
886 |
connection disconnect.
|
|
887 |
connection := nil.
|
|
888 |
]
|
7028
|
889 |
!
|
|
890 |
|
|
891 |
updateInfo
|
|
892 |
self isConnected ifTrue:[
|
|
893 |
self window label:('Store Browser: ',dbInfo dbName).
|
|
894 |
self infoLabelHolder value:('Connected to ',dbInfo dbName).
|
|
895 |
] ifFalse:[
|
|
896 |
self window label:'Store Browser'.
|
|
897 |
self infoLabelHolder value:nil.
|
|
898 |
]
|
7006
|
899 |
! !
|
|
900 |
|
|
901 |
!StoreProjectBrowser methodsFor:'menu actions'!
|
|
902 |
|
7028
|
903 |
askForDatabaseInfo
|
|
904 |
|defaultInfo|
|
|
905 |
|
|
906 |
defaultInfo := StoreSourceCodeManager defaultDBInfo.
|
|
907 |
defaultInfo dbName isNil ifTrue:[
|
8727
|
908 |
defaultInfo := StoreSourceCodeManager repositoryInfoPerModule firstIfEmpty:nil.
|
7028
|
909 |
].
|
|
910 |
dbInfo := defaultInfo
|
|
911 |
!
|
|
912 |
|
7010
|
913 |
menuConnect
|
|
914 |
|session|
|
|
915 |
|
|
916 |
connection isNil ifTrue:[
|
|
917 |
session := self getConnection.
|
|
918 |
(session notNil) ifFalse:[
|
|
919 |
^ self.
|
|
920 |
].
|
|
921 |
connection := session.
|
7028
|
922 |
self updateInfo.
|
8727
|
923 |
self updatePackagesList.
|
7010
|
924 |
]
|
|
925 |
!
|
|
926 |
|
|
927 |
menuDisconnect
|
|
928 |
connection notNil ifTrue:[
|
|
929 |
connection disconnect.
|
|
930 |
connection := nil.
|
7028
|
931 |
self updateInfo.
|
7010
|
932 |
]
|
|
933 |
!
|
|
934 |
|
7006
|
935 |
menuFileoutAs
|
|
936 |
"automatically generated by UIPainter ..."
|
|
937 |
|
|
938 |
"*** the code below performs no action"
|
|
939 |
"*** (except for some feedback on the Transcript)"
|
|
940 |
"*** Please change as required and accept in the browser."
|
|
941 |
|
|
942 |
"action to be added ..."
|
|
943 |
|
|
944 |
Transcript showCR:self class name, ': menu action for menuFileoutAs ...'.
|
|
945 |
!
|
|
946 |
|
|
947 |
menuOpen
|
|
948 |
"This method was generated by the Browser.
|
|
949 |
It will be invoked when the menu-item 'open' is selected."
|
|
950 |
|
|
951 |
"/ change below and add any actions as required here ...
|
|
952 |
self warn:'no action for ''open'' available.'.
|
|
953 |
!
|
|
954 |
|
|
955 |
menuUpdate
|
|
956 |
self updatePackagesList
|
|
957 |
!
|
|
958 |
|
|
959 |
openDocumentation
|
|
960 |
"This method was generated by the Browser.
|
|
961 |
It will be invoked when the menu-item 'help-documentation' is selected."
|
|
962 |
|
|
963 |
"/ change below as required ...
|
|
964 |
|
|
965 |
"/ to open an HTML viewer on some document (under 'doc/online/<language>/' ):
|
|
966 |
HTMLDocumentView openFullOnDocumentationFile:'TOP.html'.
|
|
967 |
|
|
968 |
"/ add application-specific help files under the 'doc/online/<language>/help/appName'
|
|
969 |
"/ directory, and open a viewer with:
|
|
970 |
"/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'.
|
8731
|
971 |
!
|
|
972 |
|
|
973 |
versionsListMenuBrowse
|
|
974 |
|reader changeSet environment|
|
|
975 |
|
|
976 |
reader := StoreProjectChangeSetReader new.
|
|
977 |
reader
|
|
978 |
browser:self dbConnection:connection
|
|
979 |
bundleOrPackage:selectedBundleOrPackage version:selectedVersion.
|
|
980 |
changeSet :=reader changeSet.
|
|
981 |
ChangeSetBrowser openOn:changeSet.
|
|
982 |
self halt.
|
|
983 |
|
|
984 |
environment := StoreProjectEnvironment for:selectedVersion connection:connection.
|
|
985 |
SystemBrowser
|
|
986 |
openOn:environment
|
|
987 |
label:(resources string:'%1' with:selectedBundleOrPackage name , ' ' , selectedVersion version)
|
|
988 |
!
|
|
989 |
|
|
990 |
versionsListMenuLoad
|
|
991 |
self halt.
|
|
992 |
!
|
|
993 |
|
|
994 |
versionsListMenuUpdate
|
|
995 |
self halt.
|
7006
|
996 |
! !
|
|
997 |
|
7008
|
998 |
!StoreProjectBrowser::Pundle methodsFor:'accessing'!
|
|
999 |
|
|
1000 |
name
|
|
1001 |
^ name
|
|
1002 |
!
|
|
1003 |
|
|
1004 |
name:something
|
|
1005 |
name := something.
|
|
1006 |
! !
|
|
1007 |
|
|
1008 |
!StoreProjectBrowser::Pundle methodsFor:'printing'!
|
|
1009 |
|
|
1010 |
displayString
|
|
1011 |
^ name
|
|
1012 |
! !
|
|
1013 |
|
|
1014 |
!StoreProjectBrowser::Pundle methodsFor:'testing'!
|
|
1015 |
|
|
1016 |
isBundle
|
|
1017 |
^ false
|
|
1018 |
!
|
|
1019 |
|
|
1020 |
isPackage
|
|
1021 |
^ false
|
|
1022 |
! !
|
|
1023 |
|
|
1024 |
!StoreProjectBrowser::Package methodsFor:'testing'!
|
|
1025 |
|
|
1026 |
isPackage
|
|
1027 |
^ true
|
|
1028 |
! !
|
|
1029 |
|
|
1030 |
!StoreProjectBrowser::Bundle methodsFor:'printing'!
|
|
1031 |
|
|
1032 |
displayString
|
|
1033 |
^ name ,' (Bundle)'
|
|
1034 |
! !
|
|
1035 |
|
|
1036 |
!StoreProjectBrowser::Bundle methodsFor:'testing'!
|
|
1037 |
|
|
1038 |
isBundle
|
|
1039 |
^ true
|
|
1040 |
! !
|
|
1041 |
|
|
1042 |
!StoreProjectBrowser::PundleVersion methodsFor:'accessing'!
|
|
1043 |
|
8731
|
1044 |
blessingLevel
|
|
1045 |
^ blessingLevel
|
|
1046 |
!
|
|
1047 |
|
|
1048 |
blessingLevel:something
|
|
1049 |
blessingLevel := something.
|
|
1050 |
!
|
|
1051 |
|
7008
|
1052 |
commentId
|
|
1053 |
^ commentId
|
|
1054 |
!
|
|
1055 |
|
|
1056 |
id
|
|
1057 |
^ id
|
|
1058 |
!
|
|
1059 |
|
|
1060 |
id:something
|
|
1061 |
id := something.
|
|
1062 |
!
|
|
1063 |
|
7010
|
1064 |
isBundle
|
|
1065 |
^ isBundle
|
|
1066 |
!
|
|
1067 |
|
|
1068 |
isBundle:aBoolean
|
|
1069 |
isBundle := aBoolean
|
|
1070 |
!
|
|
1071 |
|
|
1072 |
isPackage
|
|
1073 |
^ isBundle not
|
|
1074 |
!
|
|
1075 |
|
7008
|
1076 |
pundle
|
|
1077 |
^ pundle
|
|
1078 |
!
|
|
1079 |
|
|
1080 |
pundle:pundleArg version:versionArg user:userArg
|
|
1081 |
pundle := pundleArg.
|
|
1082 |
version := versionArg.
|
|
1083 |
user := userArg.
|
|
1084 |
!
|
|
1085 |
|
|
1086 |
timestamp
|
|
1087 |
|deltaSeconds|
|
|
1088 |
|
|
1089 |
timestamp isNil ifTrue:[
|
|
1090 |
"/ to compute the timestamp, we have to do this:
|
|
1091 |
"/ the timestampInt are seconds since 1993 + 10d + 19min + 47sec"
|
|
1092 |
"/ can anyone explain this ????
|
|
1093 |
deltaSeconds := 23*365 * 24*60*60. "/ 23 years
|
|
1094 |
deltaSeconds := deltaSeconds + (233*24*60*60). "/ 10 days
|
|
1095 |
deltaSeconds := deltaSeconds + (19*60). "/ 19 minutes
|
|
1096 |
deltaSeconds := deltaSeconds + (47). "/ 47 seconds
|
|
1097 |
|
|
1098 |
timestamp := Timestamp secondsSince1970:(timestampInt + deltaSeconds).
|
|
1099 |
].
|
|
1100 |
^ timestamp
|
|
1101 |
!
|
|
1102 |
|
|
1103 |
timestampInt:timestampIntArg commentId:commentIdArg
|
|
1104 |
timestampInt := timestampIntArg.
|
|
1105 |
commentId := commentIdArg.
|
|
1106 |
!
|
|
1107 |
|
|
1108 |
user
|
|
1109 |
^ user
|
|
1110 |
!
|
|
1111 |
|
|
1112 |
version
|
|
1113 |
^ version
|
|
1114 |
! !
|
|
1115 |
|
|
1116 |
!StoreProjectBrowser::PundleVersion methodsFor:'comparing'!
|
|
1117 |
|
|
1118 |
isVersionAfter:anotherVersion
|
|
1119 |
|myMajor othersMajor myMinor othersMinor|
|
|
1120 |
|
|
1121 |
myMajor := self majorVersion.
|
|
1122 |
othersMajor := anotherVersion majorVersion.
|
|
1123 |
|
|
1124 |
myMajor > othersMajor ifTrue:[^ true].
|
|
1125 |
myMajor < othersMajor ifTrue:[^ false].
|
|
1126 |
|
|
1127 |
myMinor := self minorVersion.
|
|
1128 |
othersMinor := anotherVersion minorVersion.
|
|
1129 |
|
|
1130 |
myMinor > othersMinor ifTrue:[^ true].
|
|
1131 |
myMinor < othersMinor ifTrue:[^ false].
|
|
1132 |
|
|
1133 |
^ version > anotherVersion version
|
|
1134 |
!
|
|
1135 |
|
|
1136 |
majorVersion
|
|
1137 |
^ Integer readFrom:(version upTo:$:)
|
|
1138 |
!
|
|
1139 |
|
|
1140 |
minorVersion
|
|
1141 |
^ Integer readFrom:((version restAfter:$.) upTo:$.)
|
|
1142 |
! !
|
|
1143 |
|
|
1144 |
!StoreProjectBrowser::PundleVersion methodsFor:'printing'!
|
|
1145 |
|
|
1146 |
displayString
|
|
1147 |
^ version , ' (',user,') ' , self timestamp printString
|
|
1148 |
! !
|
|
1149 |
|
8731
|
1150 |
!StoreProjectBrowser::StoreProjectChangeSetReader methodsFor:'accessing'!
|
|
1151 |
|
|
1152 |
browser:browserArg dbConnection:dbConnectionArg bundleOrPackage:bundleOrPackageArg version:versionArg
|
|
1153 |
browser := browserArg.
|
|
1154 |
dbConnection := dbConnectionArg.
|
|
1155 |
bundleOrPackage := bundleOrPackageArg.
|
|
1156 |
version := versionArg.
|
|
1157 |
! !
|
|
1158 |
|
|
1159 |
!StoreProjectBrowser::StoreProjectChangeSetReader methodsFor:'reading'!
|
|
1160 |
|
|
1161 |
allClassesDo:aBlock
|
|
1162 |
|packageId cursor row entries classes|
|
|
1163 |
|
|
1164 |
packageId := bundleOrPackage id.
|
|
1165 |
|
|
1166 |
entries := OrderedCollection new.
|
|
1167 |
cursor := dbConnection
|
|
1168 |
execute:('SELECT classref,metaclassref,definitionorder FROM tw_pkgclasses WHERE packageref = %1'
|
|
1169 |
bindWith:packageId)
|
|
1170 |
release:false.
|
|
1171 |
|
|
1172 |
[cursor next notNil] whileTrue:[
|
|
1173 |
row := cursor rowAsObject.
|
|
1174 |
entries add:row.
|
|
1175 |
].
|
|
1176 |
cursor release.
|
|
1177 |
|
|
1178 |
classes := entries collect:[:entry |
|
|
1179 |
|records classRecord metaclassRecord|
|
|
1180 |
|
|
1181 |
"/ entry classref
|
|
1182 |
"/ entry metaclassref
|
|
1183 |
"/ entry definitionorder
|
|
1184 |
cursor := dbConnection
|
|
1185 |
execute:('SELECT name,definitionid,commentid,environmentstring,superclass
|
|
1186 |
FROM tw_classrecord WHERE primarykey = %1'
|
|
1187 |
bindWith:entry classref)
|
|
1188 |
release:false.
|
|
1189 |
records := OrderedCollection new.
|
|
1190 |
[cursor next notNil] whileTrue:[
|
|
1191 |
row := cursor rowAsObject.
|
|
1192 |
records add:row.
|
|
1193 |
].
|
|
1194 |
cursor release.
|
|
1195 |
self assert:(records size == 1).
|
|
1196 |
classRecord := records first.
|
|
1197 |
|
|
1198 |
cursor := dbConnection
|
|
1199 |
execute:('SELECT name,definitionid,commentid,environmentstring,superclass
|
|
1200 |
FROM tw_classrecord WHERE primarykey = %1'
|
|
1201 |
bindWith:entry metaclassref)
|
|
1202 |
release:false.
|
|
1203 |
records := OrderedCollection new.
|
|
1204 |
[cursor next notNil] whileTrue:[
|
|
1205 |
row := cursor rowAsObject.
|
|
1206 |
records add:row.
|
|
1207 |
].
|
|
1208 |
cursor release.
|
|
1209 |
self assert:(records size == 1).
|
|
1210 |
metaclassRecord := records first.
|
|
1211 |
|
|
1212 |
{ classRecord. metaclassRecord. entry definitionorder }
|
|
1213 |
].
|
|
1214 |
!
|
|
1215 |
|
|
1216 |
changeSet
|
|
1217 |
"build a changeSet from the bundle or package
|
|
1218 |
Return the changeSet."
|
|
1219 |
|
|
1220 |
changeSet := ChangeSet new.
|
|
1221 |
self fetchClassDefinitions.
|
|
1222 |
"/ changesFromStream:aStream
|
|
1223 |
"/ for:changeSet
|
|
1224 |
"/ reader:(ChangeFileReader new)
|
|
1225 |
"/ do:[:aChange :lineNumberOrNil :posOrNil |
|
|
1226 |
"/ changeSet add:aChange.
|
|
1227 |
"/ (aConditionBlock value:aChange) ifFalse:[^ changeSet].
|
|
1228 |
"/ ].
|
|
1229 |
|
|
1230 |
^ changeSet
|
|
1231 |
!
|
|
1232 |
|
|
1233 |
fetchClassDefinitions
|
|
1234 |
|packageId cursor row entries classes change|
|
|
1235 |
|
|
1236 |
packageId := version id.
|
|
1237 |
|
|
1238 |
entries := OrderedCollection new.
|
|
1239 |
cursor := dbConnection
|
|
1240 |
execute:('SELECT classref,metaclassref,definitionorder FROM tw_pkgclasses WHERE packageref = %1'
|
|
1241 |
bindWith:packageId)
|
|
1242 |
release:false.
|
|
1243 |
|
|
1244 |
[cursor next notNil] whileTrue:[
|
|
1245 |
row := cursor rowAsObject.
|
|
1246 |
entries add:row.
|
|
1247 |
].
|
|
1248 |
cursor release.
|
|
1249 |
|
|
1250 |
classes := entries collect:[:entry |
|
|
1251 |
|records classRecord metaclassRecord definitionString|
|
|
1252 |
|
|
1253 |
"/ entry classref
|
|
1254 |
"/ entry metaclassref
|
|
1255 |
"/ entry definitionorder
|
|
1256 |
cursor := dbConnection
|
|
1257 |
execute:('SELECT name,definitionid,commentid,environmentstring,superclass
|
|
1258 |
FROM tw_classrecord WHERE primarykey = %1'
|
|
1259 |
bindWith:entry classref)
|
|
1260 |
release:false.
|
|
1261 |
records := OrderedCollection new.
|
|
1262 |
[cursor next notNil] whileTrue:[
|
|
1263 |
row := cursor rowAsObject.
|
|
1264 |
records add:row.
|
|
1265 |
].
|
|
1266 |
cursor release.
|
|
1267 |
self assert:(records size == 1).
|
|
1268 |
classRecord := records first.
|
|
1269 |
|
|
1270 |
cursor := dbConnection
|
|
1271 |
execute:('SELECT name,definitionid,commentid,environmentstring,superclass
|
|
1272 |
FROM tw_classrecord WHERE primarykey = %1'
|
|
1273 |
bindWith:entry metaclassref)
|
|
1274 |
release:false.
|
|
1275 |
records := OrderedCollection new.
|
|
1276 |
[cursor next notNil] whileTrue:[
|
|
1277 |
row := cursor rowAsObject.
|
|
1278 |
records add:row.
|
|
1279 |
].
|
|
1280 |
cursor release.
|
|
1281 |
self assert:(records size == 1).
|
|
1282 |
metaclassRecord := records first.
|
|
1283 |
|
|
1284 |
change := ClassDefinitionChange new.
|
|
1285 |
definitionString := browser getBlob:(classRecord definitionid).
|
|
1286 |
change source:definitionString.
|
|
1287 |
change className:classRecord name.
|
|
1288 |
"/ change superClassName:metaclassRecord name.
|
|
1289 |
change package:bundleOrPackage name.
|
|
1290 |
changeSet add:change.
|
|
1291 |
|
|
1292 |
{ classRecord. metaclassRecord. entry definitionorder }
|
|
1293 |
].
|
|
1294 |
! !
|
|
1295 |
|
7006
|
1296 |
!StoreProjectBrowser class methodsFor:'documentation'!
|
|
1297 |
|
|
1298 |
version
|
8747
|
1299 |
^ '$Header: /cvs/stx/stx/libtool/Tools__StoreProjectBrowser.st,v 1.13 2009-09-21 21:29:29 cg Exp $'
|
7006
|
1300 |
! !
|