! install Seaside
!  installMonticello.topaz should have already been run.
!
!  expects .mcz files to be found in $GEMSTONE/seaside/monticello/repository
!  or ./seaside/monticello/repository
!
ifError where
errorCount
output push seasideInstall.out only
display resultcheck
errorCount

! install into UserGlobals
run
| policy |
policy := GsPackagePolicy current.
policy homeSymbolDict:  UserGlobals.
policy externalSymbolList: Array new.
true
%

errorCount
commit

run
| basePath dir repository spec |
basePath := GsPackageLibrary getMonticelloRepositoryDirectory .
dir := FileDirectory on: basePath.
repository := MCDirectoryRepository new directory: dir.
MCRepositoryGroup default addRepository: repository.
spec := #[	
    'Seaside2.8g1-dkh.590.mcz',
       'http://www.squeaksource.com/Seaside',
       'http://seaside.gemstone.com/ss/seaside',

    'Scriptaculous.g-dkh.241.mcz',
       'http://www.squeaksource.com/Seaside',
       'http://seaside.gemstone.com/ss/seaside',
    'SeasideAsync.g-dkh.74.mcz',
       'http://www.squeaksource.com/Seaside',
       'http://seaside.gemstone.com/ss/seaside',

    'CSSDock-tbn.1.mcz',
       'http://www.squeaksource.com/SeasideExamples',
       '',
    'CallDemo-pmm.1.mcz',
       'http://www.squeaksource.com/SeasideExamples',
       '',
    'CheckboxExample-pmm.1.mcz',
       'http://www.squeaksource.com/SeasideExamples',
       '',
    'ErrorHandler-dkh.4.mcz',
       'http://www.squeaksource.com/SeasideExamples',
       '',
    'HelloWorld-pmm.1.mcz',
       'http://www.squeaksource.com/SeasideExamples',
       '',
    'ImageDemo-pmm.1.mcz',
       'http://www.squeaksource.com/SeasideExamples',
       '',
    'LogoutDemo-pmm.1.mcz',
       'http://www.squeaksource.com/SeasideExamples',
       '',
    'MarqueeDemo-tbn.2.mcz',
       'http://www.squeaksource.com/SeasideExamples',
       '',
    'MenuDemo-MiguelCoba.4.mcz',
       'http://www.squeaksource.com/SeasideExamples',
       '',
    'ScreenResolution-lr.1.mcz',
       'http://www.squeaksource.com/SeasideExamples',
       '',
    'Store-dkh.2.mcz',
       'http://www.squeaksource.com/SeasideExamples',
       '',
    'GemStone-Store-dkh.3.mcz',
       'http://seaside.gemstone.com/ss/GemStoneExamples',
       '',
    'GemStone-Examples-dkh.13.mcz',
       'http://seaside.gemstone.com/ss/GemStoneExamples',
       '',

].
1 to: spec size by: 3 do: [:i | | fileName httpRepository primaryRepository version rg |
    fileName := spec at: i.
    primaryRepository := MCHttpRepository
      location: (spec at: i + 1)
      user: ''
      password: ''.
    (spec at: i + 2) isEmpty not
      ifTrue: [
        httpRepository := MCHttpRepository
          location: (spec at: i + 2)
          user: ''
          password: ''].
    version := repository loadVersionFromFileNamed: fileName.
    version load.
    rg := version workingCopy repositoryGroup.
    rg addRepository: repository.
    rg addRepository: primaryRepository.
    (spec at: i + 2) isEmpty not
      ifTrue: [ rg addRepository: httpRepository ].
].
true
%

errorCount

run
"Need this to make sure that the Seaside packageInfo is correct"
(Seaside2Info new packageName: 'Seaside2') register.
true
%

errorCount
commit

output pop
errorCount
