7006
|
1 |
"{ Package: 'stx:libtool' }"
|
|
2 |
|
|
3 |
"{ NameSpace: Tools }"
|
|
4 |
|
|
5 |
ApplicationModel subclass:#StoreProjectBrowser
|
|
6 |
instanceVariableNames:'connection commentTextHolder packagesList selectedVersionHolder
|
|
7 |
versionsList selectedPackageHolder packagesFilterHolder
|
|
8 |
infoLabelHolder'
|
|
9 |
classVariableNames:''
|
|
10 |
poolDictionaries:''
|
|
11 |
category:'System-SourceCodeManagement'
|
|
12 |
!
|
|
13 |
|
7008
|
14 |
Object subclass:#Pundle
|
|
15 |
instanceVariableNames:'name'
|
|
16 |
classVariableNames:''
|
|
17 |
poolDictionaries:''
|
|
18 |
privateIn:StoreProjectBrowser
|
|
19 |
!
|
|
20 |
|
|
21 |
StoreProjectBrowser::Pundle subclass:#Package
|
|
22 |
instanceVariableNames:''
|
|
23 |
classVariableNames:''
|
|
24 |
poolDictionaries:''
|
|
25 |
privateIn:StoreProjectBrowser
|
|
26 |
!
|
|
27 |
|
|
28 |
StoreProjectBrowser::Pundle subclass:#Bundle
|
|
29 |
instanceVariableNames:''
|
|
30 |
classVariableNames:''
|
|
31 |
poolDictionaries:''
|
|
32 |
privateIn:StoreProjectBrowser
|
|
33 |
!
|
|
34 |
|
|
35 |
Object subclass:#PundleVersion
|
|
36 |
instanceVariableNames:'id pundle version user timestamp comment timestampInt commentId'
|
|
37 |
classVariableNames:''
|
|
38 |
poolDictionaries:''
|
|
39 |
privateIn:StoreProjectBrowser
|
|
40 |
!
|
|
41 |
|
7006
|
42 |
!StoreProjectBrowser class methodsFor:'documentation'!
|
|
43 |
|
|
44 |
documentation
|
|
45 |
"
|
|
46 |
documentation to be added.
|
|
47 |
|
|
48 |
[author:]
|
|
49 |
cg (cg@FUSI)
|
|
50 |
|
|
51 |
[instance variables:]
|
|
52 |
|
|
53 |
[class variables:]
|
|
54 |
|
|
55 |
[see also:]
|
|
56 |
|
|
57 |
"
|
|
58 |
!
|
|
59 |
|
|
60 |
examples
|
|
61 |
"
|
|
62 |
Starting the application:
|
|
63 |
[exBegin]
|
|
64 |
Tools::StoreProjectBrowser open
|
|
65 |
|
|
66 |
[exEnd]
|
|
67 |
|
|
68 |
more examples to be added:
|
|
69 |
[exBegin]
|
|
70 |
... add code fragment for
|
|
71 |
... executable example here ...
|
|
72 |
[exEnd]
|
|
73 |
"
|
|
74 |
!
|
|
75 |
|
|
76 |
history
|
|
77 |
"Created: / 26-08-2006 / 12:45:08 / cg"
|
|
78 |
! !
|
|
79 |
|
|
80 |
!StoreProjectBrowser class methodsFor:'interface specs'!
|
|
81 |
|
|
82 |
windowSpec
|
|
83 |
"This resource specification was automatically generated
|
|
84 |
by the UIPainter of ST/X."
|
|
85 |
|
|
86 |
"Do not manually edit this!! If it is corrupted,
|
|
87 |
the UIPainter may not be able to read the specification."
|
|
88 |
|
|
89 |
"
|
|
90 |
UIPainter new openOnClass:Tools::StoreProjectBrowser andSelector:#windowSpec
|
|
91 |
Tools::StoreProjectBrowser new openInterface:#windowSpec
|
|
92 |
Tools::StoreProjectBrowser open
|
|
93 |
"
|
|
94 |
|
|
95 |
<resource: #canvas>
|
|
96 |
|
|
97 |
^
|
|
98 |
#(FullSpec
|
|
99 |
name: windowSpec
|
|
100 |
window:
|
|
101 |
(WindowSpec
|
|
102 |
label: 'Tools::StoreProjectBrowser'
|
|
103 |
name: 'Tools::StoreProjectBrowser'
|
|
104 |
min: (Point 10 10)
|
|
105 |
max: (Point 1024 768)
|
|
106 |
bounds: (Rectangle 0 0 527 369)
|
|
107 |
menu: mainMenu
|
|
108 |
)
|
|
109 |
component:
|
|
110 |
(SpecCollection
|
|
111 |
collection: (
|
|
112 |
(VariableHorizontalPanelSpec
|
|
113 |
name: 'VariableHorizontalPanel1'
|
|
114 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
|
|
115 |
snapMode: both
|
|
116 |
handlePosition: right
|
|
117 |
component:
|
|
118 |
(SpecCollection
|
|
119 |
collection: (
|
|
120 |
(ViewSpec
|
|
121 |
name: 'Box1'
|
|
122 |
component:
|
|
123 |
(SpecCollection
|
|
124 |
collection: (
|
|
125 |
(LabelSpec
|
|
126 |
label: 'Bundles and Packages:'
|
|
127 |
name: 'Label1'
|
|
128 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0)
|
|
129 |
translateLabel: true
|
|
130 |
adjust: left
|
|
131 |
)
|
|
132 |
(InputFieldSpec
|
7008
|
133 |
name: 'PackageFilterEntryField'
|
7006
|
134 |
layout: (LayoutFrame 2 0 30 0 -2 1 58 0)
|
|
135 |
model: packagesFilterHolder
|
|
136 |
immediateAccept: true
|
|
137 |
acceptOnReturn: true
|
|
138 |
acceptOnTab: true
|
|
139 |
acceptOnLostFocus: true
|
|
140 |
acceptOnPointerLeave: false
|
|
141 |
)
|
|
142 |
(SequenceViewSpec
|
7008
|
143 |
name: 'PackageList'
|
7006
|
144 |
layout: (LayoutFrame 0 0 60 0 0 1 0 1)
|
|
145 |
model: selectedPackageHolder
|
|
146 |
hasHorizontalScrollBar: true
|
|
147 |
hasVerticalScrollBar: true
|
7008
|
148 |
valueChangeSelector: packageSelectionChanged
|
7006
|
149 |
useIndex: true
|
|
150 |
sequenceList: packagesList
|
|
151 |
)
|
|
152 |
)
|
|
153 |
|
|
154 |
)
|
|
155 |
)
|
|
156 |
(ViewSpec
|
|
157 |
name: 'Box3'
|
|
158 |
component:
|
|
159 |
(SpecCollection
|
|
160 |
collection: (
|
|
161 |
(LabelSpec
|
|
162 |
label: 'Versions:'
|
|
163 |
name: 'Label2'
|
|
164 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0)
|
|
165 |
translateLabel: true
|
|
166 |
adjust: left
|
|
167 |
)
|
|
168 |
(VariableVerticalPanelSpec
|
|
169 |
name: 'VariableVerticalPanel1'
|
|
170 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1)
|
|
171 |
component:
|
|
172 |
(SpecCollection
|
|
173 |
collection: (
|
|
174 |
(SequenceViewSpec
|
|
175 |
name: 'VersionsList'
|
|
176 |
model: selectedVersionHolder
|
|
177 |
hasHorizontalScrollBar: true
|
|
178 |
hasVerticalScrollBar: true
|
|
179 |
useIndex: true
|
|
180 |
sequenceList: versionsList
|
7008
|
181 |
valueChangeSelector: versionSelectionChanged
|
7006
|
182 |
)
|
|
183 |
(ViewSpec
|
|
184 |
name: 'Box2'
|
|
185 |
component:
|
|
186 |
(SpecCollection
|
|
187 |
collection: (
|
|
188 |
(LabelSpec
|
|
189 |
label: 'Comment:'
|
|
190 |
name: 'Label3'
|
|
191 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0)
|
|
192 |
translateLabel: true
|
|
193 |
adjust: left
|
|
194 |
)
|
|
195 |
(TextEditorSpec
|
|
196 |
name: 'CommentTextEditor'
|
|
197 |
layout: (LayoutFrame 0 0 30 0 0 1 -1 1)
|
|
198 |
model: commentTextHolder
|
|
199 |
hasHorizontalScrollBar: true
|
|
200 |
hasVerticalScrollBar: true
|
|
201 |
)
|
|
202 |
)
|
|
203 |
|
|
204 |
)
|
|
205 |
)
|
|
206 |
)
|
|
207 |
|
|
208 |
)
|
|
209 |
handles: (Any 0.5 1.0)
|
|
210 |
)
|
|
211 |
)
|
|
212 |
|
|
213 |
)
|
|
214 |
)
|
|
215 |
)
|
|
216 |
|
|
217 |
)
|
|
218 |
handles: (Any 0.5 1.0)
|
|
219 |
)
|
|
220 |
(LabelSpec
|
|
221 |
name: 'InfoLabel'
|
|
222 |
layout: (LayoutFrame 2 0 -28 1 -1 1 -1 1)
|
|
223 |
level: -1
|
|
224 |
translateLabel: true
|
|
225 |
labelChannel: infoLabelHolder
|
|
226 |
adjust: left
|
|
227 |
)
|
|
228 |
)
|
|
229 |
|
|
230 |
)
|
|
231 |
)
|
|
232 |
! !
|
|
233 |
|
|
234 |
!StoreProjectBrowser class methodsFor:'internationalization'!
|
|
235 |
|
|
236 |
resourcePackName
|
|
237 |
^ 'StoreProjectBrowser'
|
|
238 |
! !
|
|
239 |
|
|
240 |
!StoreProjectBrowser class methodsFor:'menu specs'!
|
|
241 |
|
|
242 |
mainMenu
|
|
243 |
"This resource specification was automatically generated
|
|
244 |
by the MenuEditor of ST/X."
|
|
245 |
|
|
246 |
"Do not manually edit this!! If it is corrupted,
|
|
247 |
the MenuEditor may not be able to read the specification."
|
|
248 |
|
|
249 |
"
|
|
250 |
MenuEditor new openOnClass:Tools::StoreProjectBrowser andSelector:#mainMenu
|
|
251 |
(Menu new fromLiteralArrayEncoding:(Tools::StoreProjectBrowser mainMenu)) startUp
|
|
252 |
"
|
|
253 |
|
|
254 |
<resource: #menu>
|
|
255 |
|
|
256 |
^
|
|
257 |
#(Menu
|
|
258 |
(
|
|
259 |
(MenuItem
|
|
260 |
label: 'File'
|
|
261 |
translateLabel: true
|
|
262 |
submenu:
|
|
263 |
(Menu
|
|
264 |
(
|
|
265 |
(MenuItem
|
|
266 |
label: 'Fileout As...'
|
|
267 |
itemValue: menuFileoutAs
|
|
268 |
translateLabel: true
|
|
269 |
)
|
|
270 |
(MenuItem
|
|
271 |
label: '-'
|
|
272 |
)
|
|
273 |
(MenuItem
|
|
274 |
label: 'Update'
|
|
275 |
itemValue: menuUpdate
|
|
276 |
translateLabel: true
|
|
277 |
)
|
|
278 |
(MenuItem
|
|
279 |
label: '-'
|
|
280 |
)
|
|
281 |
(MenuItem
|
|
282 |
label: 'Exit'
|
|
283 |
itemValue: closeRequest
|
|
284 |
translateLabel: true
|
|
285 |
)
|
|
286 |
)
|
|
287 |
nil
|
|
288 |
nil
|
|
289 |
)
|
|
290 |
)
|
|
291 |
(MenuItem
|
|
292 |
label: 'Help'
|
|
293 |
translateLabel: true
|
|
294 |
startGroup: right
|
|
295 |
submenu:
|
|
296 |
(Menu
|
|
297 |
(
|
|
298 |
(MenuItem
|
|
299 |
label: 'Documentation'
|
|
300 |
itemValue: openDocumentation
|
|
301 |
translateLabel: true
|
|
302 |
)
|
|
303 |
(MenuItem
|
|
304 |
label: '-'
|
|
305 |
)
|
|
306 |
(MenuItem
|
|
307 |
label: 'About this Application...'
|
|
308 |
itemValue: openAboutThisApplication
|
|
309 |
translateLabel: true
|
|
310 |
)
|
|
311 |
)
|
|
312 |
nil
|
|
313 |
nil
|
|
314 |
)
|
|
315 |
)
|
|
316 |
)
|
|
317 |
nil
|
|
318 |
nil
|
|
319 |
)
|
|
320 |
! !
|
|
321 |
|
|
322 |
!StoreProjectBrowser class methodsFor:'startup'!
|
|
323 |
|
|
324 |
openOn:aDBInfo
|
|
325 |
|newApp|
|
|
326 |
|
|
327 |
newApp := self new.
|
|
328 |
newApp allButOpen.
|
|
329 |
newApp dbInfo:aDBInfo.
|
|
330 |
newApp open.
|
|
331 |
^ newApp
|
|
332 |
! !
|
|
333 |
|
7008
|
334 |
!StoreProjectBrowser methodsFor:'actions'!
|
|
335 |
|
|
336 |
packageSelectionChanged
|
|
337 |
|newest selectedItem|
|
|
338 |
|
|
339 |
selectedItem := packagesList value at:(selectedPackageHolder value).
|
|
340 |
self updateVersionsListFor:selectedItem.
|
|
341 |
|
|
342 |
versionsList notEmptyOrNil ifTrue:[
|
|
343 |
newest := versionsList value first.
|
|
344 |
self updateCommentFor:selectedItem
|
|
345 |
].
|
|
346 |
!
|
|
347 |
|
|
348 |
versionSelectionChanged
|
|
349 |
|selectedItem|
|
|
350 |
|
|
351 |
selectedItem := versionsList value at:(selectedVersionHolder value).
|
|
352 |
self updateCommentFor:selectedItem
|
|
353 |
! !
|
|
354 |
|
7006
|
355 |
!StoreProjectBrowser methodsFor:'aspects'!
|
|
356 |
|
|
357 |
commentTextHolder
|
|
358 |
"automatically generated by UIPainter ..."
|
|
359 |
|
|
360 |
"*** the code below creates a default model when invoked."
|
|
361 |
"*** (which may not be the one you wanted)"
|
|
362 |
"*** Please change as required and accept it in the browser."
|
|
363 |
"*** (and replace this comment by something more useful ;-)"
|
|
364 |
|
|
365 |
commentTextHolder isNil ifTrue:[
|
|
366 |
commentTextHolder := '' asValue.
|
|
367 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
368 |
"/ commentTextHolder addDependent:self.
|
|
369 |
"/ commentTextHolder onChangeSend:#commentTextHolderChanged to:self.
|
|
370 |
].
|
|
371 |
^ commentTextHolder.
|
|
372 |
!
|
|
373 |
|
|
374 |
infoLabelHolder
|
|
375 |
"automatically generated by UIPainter ..."
|
|
376 |
|
|
377 |
"*** the code below creates a default model when invoked."
|
|
378 |
"*** (which may not be the one you wanted)"
|
|
379 |
"*** Please change as required and accept it in the browser."
|
|
380 |
"*** (and replace this comment by something more useful ;-)"
|
|
381 |
|
|
382 |
infoLabelHolder isNil ifTrue:[
|
|
383 |
infoLabelHolder := ValueHolder new.
|
|
384 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
385 |
"/ infoLabelHolder addDependent:self.
|
|
386 |
"/ infoLabelHolder onChangeSend:#infoLabelHolderChanged to:self.
|
|
387 |
].
|
|
388 |
^ infoLabelHolder.
|
|
389 |
!
|
|
390 |
|
|
391 |
packagesFilterHolder
|
|
392 |
"automatically generated by UIPainter ..."
|
|
393 |
|
|
394 |
"*** the code below creates a default model when invoked."
|
|
395 |
"*** (which may not be the one you wanted)"
|
|
396 |
"*** Please change as required and accept it in the browser."
|
|
397 |
"*** (and replace this comment by something more useful ;-)"
|
|
398 |
|
|
399 |
packagesFilterHolder isNil ifTrue:[
|
|
400 |
packagesFilterHolder := ValueHolder new.
|
|
401 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
402 |
"/ packagesFilterHolder addDependent:self.
|
|
403 |
"/ packagesFilterHolder onChangeSend:#packagesFilterHolderChanged to:self.
|
|
404 |
].
|
|
405 |
^ packagesFilterHolder.
|
|
406 |
!
|
|
407 |
|
|
408 |
packagesList
|
|
409 |
"automatically generated by UIPainter ..."
|
|
410 |
|
|
411 |
"*** the code below creates a default model when invoked."
|
|
412 |
"*** (which may not be the one you wanted)"
|
|
413 |
"*** Please change as required and accept it in the browser."
|
|
414 |
"*** (and replace this comment by something more useful ;-)"
|
|
415 |
|
|
416 |
packagesList isNil ifTrue:[
|
|
417 |
packagesList := ValueHolder new.
|
|
418 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
419 |
"/ packagesList addDependent:self.
|
|
420 |
"/ packagesList onChangeSend:#packagesListChanged to:self.
|
|
421 |
].
|
|
422 |
^ packagesList.
|
|
423 |
!
|
|
424 |
|
|
425 |
selectedPackageHolder
|
|
426 |
"automatically generated by UIPainter ..."
|
|
427 |
|
|
428 |
"*** the code below creates a default model when invoked."
|
|
429 |
"*** (which may not be the one you wanted)"
|
|
430 |
"*** Please change as required and accept it in the browser."
|
|
431 |
"*** (and replace this comment by something more useful ;-)"
|
|
432 |
|
|
433 |
selectedPackageHolder isNil ifTrue:[
|
|
434 |
selectedPackageHolder := ValueHolder new.
|
|
435 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
436 |
"/ selectedPackageHolder addDependent:self.
|
|
437 |
"/ selectedPackageHolder onChangeSend:#selectedPackageHolderChanged to:self.
|
|
438 |
].
|
|
439 |
^ selectedPackageHolder.
|
|
440 |
!
|
|
441 |
|
|
442 |
selectedVersionHolder
|
|
443 |
"automatically generated by UIPainter ..."
|
|
444 |
|
|
445 |
"*** the code below creates a default model when invoked."
|
|
446 |
"*** (which may not be the one you wanted)"
|
|
447 |
"*** Please change as required and accept it in the browser."
|
|
448 |
"*** (and replace this comment by something more useful ;-)"
|
|
449 |
|
|
450 |
selectedVersionHolder isNil ifTrue:[
|
|
451 |
selectedVersionHolder := ValueHolder new.
|
|
452 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
453 |
"/ selectedVersionHolder addDependent:self.
|
|
454 |
"/ selectedVersionHolder onChangeSend:#selectedVersionHolderChanged to:self.
|
|
455 |
].
|
|
456 |
^ selectedVersionHolder.
|
|
457 |
!
|
|
458 |
|
|
459 |
versionsList
|
|
460 |
"automatically generated by UIPainter ..."
|
|
461 |
|
|
462 |
"*** the code below creates a default model when invoked."
|
|
463 |
"*** (which may not be the one you wanted)"
|
|
464 |
"*** Please change as required and accept it in the browser."
|
|
465 |
"*** (and replace this comment by something more useful ;-)"
|
|
466 |
|
|
467 |
versionsList isNil ifTrue:[
|
|
468 |
versionsList := ValueHolder new.
|
|
469 |
"/ if your app needs to be notified of changes, uncomment one of the lines below:
|
|
470 |
"/ versionsList addDependent:self.
|
|
471 |
"/ versionsList onChangeSend:#versionsListChanged to:self.
|
|
472 |
].
|
|
473 |
^ versionsList.
|
|
474 |
! !
|
|
475 |
|
|
476 |
!StoreProjectBrowser methodsFor:'db access'!
|
|
477 |
|
7008
|
478 |
getBlob:id
|
|
479 |
|item cursor row blobType blobData|
|
|
480 |
|
|
481 |
item := Set new.
|
|
482 |
cursor := connection
|
|
483 |
execute:'SELECT blobtype,blobdata FROM tw_blob where primarykey = ',id printString,';'
|
|
484 |
release:false.
|
|
485 |
|
|
486 |
cursor next notNil ifTrue:[
|
|
487 |
row := cursor rowAsArray.
|
|
488 |
blobType := (row at:1).
|
|
489 |
blobData := Base64Coder decode:(row at:2).
|
|
490 |
].
|
|
491 |
cursor release.
|
|
492 |
|
|
493 |
blobType == 1 ifTrue:[
|
|
494 |
"binary"
|
|
495 |
^ blobData
|
|
496 |
].
|
|
497 |
blobType == 2 ifTrue:[
|
|
498 |
"string"
|
|
499 |
^ blobData asString
|
|
500 |
].
|
|
501 |
blobType == 3 ifTrue:[
|
|
502 |
"2-byte string"
|
|
503 |
self halt.
|
|
504 |
^ nil
|
|
505 |
].
|
|
506 |
self halt.
|
|
507 |
^ nil
|
|
508 |
!
|
|
509 |
|
|
510 |
getBundles
|
|
511 |
|items cursor row|
|
|
512 |
|
|
513 |
items := Set new.
|
|
514 |
cursor := connection
|
|
515 |
execute:'SELECT DISTINCT name FROM tw_bundle;'
|
|
516 |
release:false.
|
|
517 |
|
|
518 |
[cursor next notNil] whileTrue:[
|
|
519 |
row := cursor rowAsArray.
|
|
520 |
Transcript showCR:row.
|
|
521 |
items add:(Bundle new name:(row at:1)).
|
|
522 |
].
|
|
523 |
cursor release.
|
|
524 |
^ items asOrderedCollection sort:[:a :b| a name < b name]
|
|
525 |
!
|
|
526 |
|
|
527 |
getPackages
|
|
528 |
|items cursor row|
|
|
529 |
|
|
530 |
items := Set new.
|
|
531 |
cursor := connection
|
|
532 |
execute:'SELECT DISTINCT name FROM tw_package;'
|
|
533 |
release:false.
|
|
534 |
|
|
535 |
[cursor next notNil] whileTrue:[
|
|
536 |
row := cursor rowAsArray.
|
|
537 |
Transcript showCR:row.
|
|
538 |
items add:(Package new name:(row at:1)).
|
|
539 |
].
|
|
540 |
cursor release.
|
|
541 |
^ items asOrderedCollection sort:[:a :b| a name < b name]
|
|
542 |
!
|
|
543 |
|
|
544 |
getVersionsForBundle:aBundle
|
|
545 |
|items cursor row|
|
|
546 |
|
|
547 |
connection isNil ifTrue:[^ self ].
|
|
548 |
|
|
549 |
items := Set new.
|
|
550 |
cursor := connection
|
|
551 |
execute:'SELECT version,username,timestamp,commentid FROM tw_bundle WHERE name = ''',aBundle name,''';'
|
|
552 |
release:false.
|
|
553 |
|
|
554 |
[cursor next notNil] whileTrue:[
|
|
555 |
|v|
|
|
556 |
|
|
557 |
row := cursor rowAsArray.
|
|
558 |
Transcript showCR:row.
|
|
559 |
v := PundleVersion new.
|
|
560 |
v pundle:aBundle version:(row at:1) user:(row at:2).
|
|
561 |
v timestampInt:(row at:3) commentId:(row at:4).
|
|
562 |
items add:v.
|
|
563 |
].
|
|
564 |
cursor release.
|
|
565 |
^ items asOrderedCollection sort:[:a :b| a isVersionAfter: b]
|
|
566 |
!
|
|
567 |
|
|
568 |
getVersionsForPackage:aPackage
|
|
569 |
connection isNil ifTrue:[^ self ].
|
|
570 |
self halt.
|
|
571 |
!
|
|
572 |
|
|
573 |
updateCommentFor:aPundleVersion
|
|
574 |
|comment|
|
|
575 |
|
|
576 |
comment := self getBlob:(aPundleVersion commentId).
|
|
577 |
self commentTextHolder value:comment.
|
|
578 |
!
|
|
579 |
|
7006
|
580 |
updatePackagesList
|
7008
|
581 |
|bundles packages|
|
|
582 |
|
|
583 |
connection isNil ifTrue:[^ self ].
|
|
584 |
|
|
585 |
self withReadCursorDo:[
|
|
586 |
bundles := self getBundles.
|
|
587 |
packages := self getPackages.
|
|
588 |
].
|
|
589 |
packagesList value:(bundles , packages).
|
|
590 |
!
|
|
591 |
|
|
592 |
updateVersionsListFor:aBundleOrPackage
|
|
593 |
|items|
|
|
594 |
|
|
595 |
self withReadCursorDo:[
|
|
596 |
aBundleOrPackage isBundle ifTrue:[
|
|
597 |
items := self getVersionsForBundle:aBundleOrPackage
|
|
598 |
] ifFalse:[
|
|
599 |
items := self getVersionsForPackage:aBundleOrPackage
|
|
600 |
].
|
|
601 |
].
|
|
602 |
versionsList value:items.
|
7006
|
603 |
! !
|
|
604 |
|
|
605 |
!StoreProjectBrowser methodsFor:'help'!
|
|
606 |
|
|
607 |
aboutThisApplicationText
|
|
608 |
^ super aboutThisApplicationText ,
|
|
609 |
'\\Written by Claus Gittinger, eXept Software AG.' withCRs
|
|
610 |
! !
|
|
611 |
|
|
612 |
!StoreProjectBrowser methodsFor:'initialization & release'!
|
|
613 |
|
|
614 |
dbInfo:aDBInfo
|
|
615 |
|session|
|
|
616 |
|
|
617 |
session := SQL::ODBCSession new.
|
|
618 |
session
|
|
619 |
connectWithUsername:(aDBInfo userName)
|
|
620 |
password:(aDBInfo password)
|
|
621 |
dbname:(aDBInfo dbName).
|
|
622 |
|
|
623 |
(session isConnected) ifFalse:[
|
|
624 |
^ self.
|
|
625 |
].
|
|
626 |
connection := session.
|
|
627 |
self window label:(aDBInfo dbName).
|
|
628 |
self infoLabelHolder value:('Connected to ',aDBInfo dbName).
|
|
629 |
^ self
|
|
630 |
!
|
|
631 |
|
7008
|
632 |
postOpenWith:aBuilder
|
7006
|
633 |
self updatePackagesList.
|
|
634 |
!
|
|
635 |
|
|
636 |
release
|
|
637 |
connection notNil ifTrue:[
|
|
638 |
connection disconnect.
|
|
639 |
connection := nil.
|
|
640 |
]
|
|
641 |
! !
|
|
642 |
|
|
643 |
!StoreProjectBrowser methodsFor:'menu actions'!
|
|
644 |
|
|
645 |
menuFileoutAs
|
|
646 |
"automatically generated by UIPainter ..."
|
|
647 |
|
|
648 |
"*** the code below performs no action"
|
|
649 |
"*** (except for some feedback on the Transcript)"
|
|
650 |
"*** Please change as required and accept in the browser."
|
|
651 |
|
|
652 |
"action to be added ..."
|
|
653 |
|
|
654 |
Transcript showCR:self class name, ': menu action for menuFileoutAs ...'.
|
|
655 |
!
|
|
656 |
|
|
657 |
menuOpen
|
|
658 |
"This method was generated by the Browser.
|
|
659 |
It will be invoked when the menu-item 'open' is selected."
|
|
660 |
|
|
661 |
"/ change below and add any actions as required here ...
|
|
662 |
self warn:'no action for ''open'' available.'.
|
|
663 |
!
|
|
664 |
|
|
665 |
menuUpdate
|
|
666 |
self updatePackagesList
|
|
667 |
!
|
|
668 |
|
|
669 |
openDocumentation
|
|
670 |
"This method was generated by the Browser.
|
|
671 |
It will be invoked when the menu-item 'help-documentation' is selected."
|
|
672 |
|
|
673 |
"/ change below as required ...
|
|
674 |
|
|
675 |
"/ to open an HTML viewer on some document (under 'doc/online/<language>/' ):
|
|
676 |
HTMLDocumentView openFullOnDocumentationFile:'TOP.html'.
|
|
677 |
|
|
678 |
"/ add application-specific help files under the 'doc/online/<language>/help/appName'
|
|
679 |
"/ directory, and open a viewer with:
|
|
680 |
"/ HTMLDocumentView openFullOnDocumentationFile:'help/<MyApplication>/TOP.html'.
|
|
681 |
! !
|
|
682 |
|
7008
|
683 |
!StoreProjectBrowser::Pundle methodsFor:'accessing'!
|
|
684 |
|
|
685 |
name
|
|
686 |
^ name
|
|
687 |
!
|
|
688 |
|
|
689 |
name:something
|
|
690 |
name := something.
|
|
691 |
! !
|
|
692 |
|
|
693 |
!StoreProjectBrowser::Pundle methodsFor:'printing'!
|
|
694 |
|
|
695 |
displayString
|
|
696 |
^ name
|
|
697 |
! !
|
|
698 |
|
|
699 |
!StoreProjectBrowser::Pundle methodsFor:'testing'!
|
|
700 |
|
|
701 |
isBundle
|
|
702 |
^ false
|
|
703 |
!
|
|
704 |
|
|
705 |
isPackage
|
|
706 |
^ false
|
|
707 |
! !
|
|
708 |
|
|
709 |
!StoreProjectBrowser::Package methodsFor:'testing'!
|
|
710 |
|
|
711 |
isPackage
|
|
712 |
^ true
|
|
713 |
! !
|
|
714 |
|
|
715 |
!StoreProjectBrowser::Bundle methodsFor:'printing'!
|
|
716 |
|
|
717 |
displayString
|
|
718 |
^ name ,' (Bundle)'
|
|
719 |
! !
|
|
720 |
|
|
721 |
!StoreProjectBrowser::Bundle methodsFor:'testing'!
|
|
722 |
|
|
723 |
isBundle
|
|
724 |
^ true
|
|
725 |
! !
|
|
726 |
|
|
727 |
!StoreProjectBrowser::PundleVersion methodsFor:'accessing'!
|
|
728 |
|
|
729 |
commentId
|
|
730 |
^ commentId
|
|
731 |
!
|
|
732 |
|
|
733 |
id
|
|
734 |
^ id
|
|
735 |
!
|
|
736 |
|
|
737 |
id:something
|
|
738 |
id := something.
|
|
739 |
!
|
|
740 |
|
|
741 |
pundle
|
|
742 |
^ pundle
|
|
743 |
!
|
|
744 |
|
|
745 |
pundle:pundleArg version:versionArg user:userArg
|
|
746 |
pundle := pundleArg.
|
|
747 |
version := versionArg.
|
|
748 |
user := userArg.
|
|
749 |
!
|
|
750 |
|
|
751 |
timestamp
|
|
752 |
|deltaSeconds|
|
|
753 |
|
|
754 |
timestamp isNil ifTrue:[
|
|
755 |
"/ to compute the timestamp, we have to do this:
|
|
756 |
"/ the timestampInt are seconds since 1993 + 10d + 19min + 47sec"
|
|
757 |
"/ can anyone explain this ????
|
|
758 |
deltaSeconds := 23*365 * 24*60*60. "/ 23 years
|
|
759 |
deltaSeconds := deltaSeconds + (233*24*60*60). "/ 10 days
|
|
760 |
deltaSeconds := deltaSeconds + (19*60). "/ 19 minutes
|
|
761 |
deltaSeconds := deltaSeconds + (47). "/ 47 seconds
|
|
762 |
|
|
763 |
timestamp := Timestamp secondsSince1970:(timestampInt + deltaSeconds).
|
|
764 |
].
|
|
765 |
^ timestamp
|
|
766 |
!
|
|
767 |
|
|
768 |
timestampInt:timestampIntArg commentId:commentIdArg
|
|
769 |
timestampInt := timestampIntArg.
|
|
770 |
commentId := commentIdArg.
|
|
771 |
!
|
|
772 |
|
|
773 |
user
|
|
774 |
^ user
|
|
775 |
!
|
|
776 |
|
|
777 |
version
|
|
778 |
^ version
|
|
779 |
! !
|
|
780 |
|
|
781 |
!StoreProjectBrowser::PundleVersion methodsFor:'comparing'!
|
|
782 |
|
|
783 |
isVersionAfter:anotherVersion
|
|
784 |
|myMajor othersMajor myMinor othersMinor|
|
|
785 |
|
|
786 |
myMajor := self majorVersion.
|
|
787 |
othersMajor := anotherVersion majorVersion.
|
|
788 |
|
|
789 |
myMajor > othersMajor ifTrue:[^ true].
|
|
790 |
myMajor < othersMajor ifTrue:[^ false].
|
|
791 |
|
|
792 |
myMinor := self minorVersion.
|
|
793 |
othersMinor := anotherVersion minorVersion.
|
|
794 |
|
|
795 |
myMinor > othersMinor ifTrue:[^ true].
|
|
796 |
myMinor < othersMinor ifTrue:[^ false].
|
|
797 |
|
|
798 |
^ version > anotherVersion version
|
|
799 |
!
|
|
800 |
|
|
801 |
majorVersion
|
|
802 |
^ Integer readFrom:(version upTo:$:)
|
|
803 |
!
|
|
804 |
|
|
805 |
minorVersion
|
|
806 |
^ Integer readFrom:((version restAfter:$.) upTo:$.)
|
|
807 |
! !
|
|
808 |
|
|
809 |
!StoreProjectBrowser::PundleVersion methodsFor:'printing'!
|
|
810 |
|
|
811 |
displayString
|
|
812 |
^ version , ' (',user,') ' , self timestamp printString
|
|
813 |
! !
|
|
814 |
|
7006
|
815 |
!StoreProjectBrowser class methodsFor:'documentation'!
|
|
816 |
|
|
817 |
version
|
7008
|
818 |
^ '$Header: /cvs/stx/stx/libtool/Tools__StoreProjectBrowser.st,v 1.2 2006-08-26 17:39:52 cg Exp $'
|
7006
|
819 |
! !
|