Tools__StoreProjectBrowser.st
changeset 8747 e6a0a25f6f2d
parent 8739 ab7074522afd
child 12123 4bde08cebd48
equal deleted inserted replaced
8746:ce44d9cba9d3 8747:e6a0a25f6f2d
   638 ! !
   638 ! !
   639 
   639 
   640 !StoreProjectBrowser methodsFor:'db access'!
   640 !StoreProjectBrowser methodsFor:'db access'!
   641 
   641 
   642 getBlob:id
   642 getBlob:id
   643     |item cursor row blobType blobData|
   643     ^ self getBlob:id withPrefix:nil
       
   644 !
       
   645 
       
   646 getBlob:id withPrefix:prefixOrNil
       
   647     |item cursor row blobType blobData rawData|
   644 
   648 
   645     item := Set new.
   649     item := Set new.
   646     cursor := connection 
   650     cursor := connection 
   647                 execute:'SELECT blobtype,blobdata FROM tw_blob where primarykey = ',id printString,';'
   651                 execute:('SELECT blobtype,blobdata FROM tw_blob where primarykey = %1;' bindWith:id)
   648                 release:false.
   652                 release:false.
   649 
   653 
   650     cursor next notNil ifTrue:[
   654     cursor next notNil ifTrue:[
   651         row := cursor rowAsArray.
   655         row := cursor rowAsArray.
   652         blobType := (row at:1).
   656         blobType := (row at:1).
   653         blobData := Base64Coder decode:(row at:2).
   657         rawData := (row at:2).
       
   658         blobData := Base64Coder decode:rawData.
   654     ].
   659     ].
   655     cursor release.
   660     cursor release.
       
   661 
       
   662     blobType < 0 ifTrue:[
       
   663         "/ this data is a prefix...
       
   664 self halt.
       
   665         ^ self getBlob:(blobType negated) withPrefix:blobData
       
   666     ].
   656 
   667 
   657     blobType == 1 ifTrue:[
   668     blobType == 1 ifTrue:[
   658         "binary"
   669         "binary"
   659         ^ blobData
   670         ^ blobData
   660     ].
   671     ].
   666         "2-byte string"
   677         "2-byte string"
   667 self halt.
   678 self halt.
   668         ^ nil
   679         ^ nil
   669     ].
   680     ].
   670 self halt.
   681 self halt.
   671     ^ blobData asString
   682     ^ nil
   672 !
   683 !
   673 
   684 
   674 getBundles
   685 getBundles
   675     |items cursor row|
   686     |items cursor row|
   676 
   687 
  1283 ! !
  1294 ! !
  1284 
  1295 
  1285 !StoreProjectBrowser class methodsFor:'documentation'!
  1296 !StoreProjectBrowser class methodsFor:'documentation'!
  1286 
  1297 
  1287 version
  1298 version
  1288     ^ '$Header: /cvs/stx/stx/libtool/Tools__StoreProjectBrowser.st,v 1.12 2009-09-21 13:57:32 cg Exp $'
  1299     ^ '$Header: /cvs/stx/stx/libtool/Tools__StoreProjectBrowser.st,v 1.13 2009-09-21 21:29:29 cg Exp $'
  1289 ! !
  1300 ! !