MetacelloResolveProjectUpgrade.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 03 Sep 2012 13:10:51 +0000
changeset 3 504152ada1fc
parent 1 9e312de5f694
permissions -rw-r--r--
fixed stc-compilability

"{ Package: 'stx:goodies/metacello' }"

MetacelloScriptNotification subclass:#MetacelloResolveProjectUpgrade
	instanceVariableNames:'existingProjectRegistration newProjectRegistration'
	classVariableNames:''
	poolDictionaries:''
	category:'Metacello-Core-Scripts'
!


!MetacelloResolveProjectUpgrade methodsFor:'accessing'!

existingProjectRegistration
	^ existingProjectRegistration
!

existingProjectRegistration: anObject
	existingProjectRegistration := anObject
!

newProjectRegistration
	^ newProjectRegistration
!

newProjectRegistration: anObject
	newProjectRegistration := anObject
!

operationString
    self subclassResponsibility
! !

!MetacelloResolveProjectUpgrade methodsFor:'exception handling'!

allow
    self checkAllowed.
    self resume: self newProjectRegistration
!

allowEvenIfLocked
    self resume: self newProjectRegistration
!

defaultAction
    "Result of signal should be the projectRegistration to be used to perform the load ... default is to disallow"

    ^ self existingProjectRegistration
!

disallow
    "default action"

    self resume: self existingProjectRegistration
! !

!MetacelloResolveProjectUpgrade methodsFor:'handlers'!

handleOnDownGrade: onDownGradeBlock onUpgrade: onUpgradeBlock
    self subclassResponsibility
! !

!MetacelloResolveProjectUpgrade methodsFor:'private'!

checkAllowed
    self existingProjectRegistration locked
        ifTrue: [ 
            MetacelloLockedProjectError
                signal:
                    'Attempt to perform' , self operationString printString , ' a locked project: '
                        , self existingProjectRegistration printString ]
! !

!MetacelloResolveProjectUpgrade class methodsFor:'documentation'!

version_SVN
    ^ '$Id::                                                                                                                        $'
! !