[FIX][Celeste][3.7g2] createDB fails

Lantz Rowland LantzR at comcast.net
Mon Aug 30 03:57:51 UTC 2004


Celeste v1.23 fails on open when it needs to create a new MailDB.

This error exists in Squeak3.7g2Full.image. It also occurs if you install
Celeste 1.23 from SqueakMap and have no MailDB.

You can open an EMail Reader in 37g2 which will show up looking fine.
Selecting the OPEN link in the text displayed will created you a new
database for you with three files: EMAIL.index, EMAIL.messages and
EMAIL.categories. The new categories file is the issue.

Changed MailDB>>createDB to add category '.tosend.' to the new database
since it is required by Celeste>>outBoxStatus.

If you install Celeste from SqueakMap it presents a bit different since the
CelesteAddressBook opens the MailDB as it is initialized.

Lantz
-- 
  Lantz Rowland <LantzR at comcast.net>
  Think Different! Think YottaHertz!

-------------- next part --------------
'From Squeak3.7gamma of ''17 July 2004'' [latest update: #5985] on 29 August 2004 at 8:31:18 pm'!
"Change Set:		CelesteCrtDbFix-zL
Date:			29 August 2004
Author:			Lantz Rowland

Celeste v1.23 fails on open when it needs to create a new MailDB.

This error exists in Squeak3.7g2Full.image. It also occurs if you install Celeste 1.23 from SqueakMap and have no MailDB.

You can open an EMail Reader in 37g2 which will show up looking fine. Selecting the OPEN link in the text displayed will created you new database for you with three files: EMAIL.index, EMAIL.messages and EMAIL.categories. The new categories file is the issue.

Changed MailDB>>createDB to add category '.tosend.' to the new database since it is required by Celeste>>outBoxStatus.

If you install Celeste from SqueakMap it presents a bit different since the CelesteAddressBook opens the MailDB as it is initialized. 

Lantz
"!


!Celeste methodsFor: 'other' stamp: 'zL 8/29/2004 20:13'!
outBoxStatus
	| outgoing |
	"zL - NoChg - For reviewer. 
	 zL - Dependency - MailDB>>createDB must add .tosend. category"
	outgoing := mailDB
				ifNil: [#()]
				ifNotNil: [mailDB messagesIn: '.tosend.'].
	outgoing isEmpty
		ifTrue: [^ 'no mail to be sent'].
	^ 'messages in queue: ' , outgoing size printString! !

!Celeste methodsFor: 'open-close' stamp: 'zL 8/29/2004 14:58'!
openDefaultDatabase
	"open the default database, creating it if it isn't present"
	
	"zL - NoChg - for reviewer"
	self openOnDatabase: (MailDB openOn: Celeste defaultDBName).
	self changed: #categoryList.! !


!Celeste class methodsFor: 'instance creation' stamp: 'zL 8/29/2004 15:01'!
openOn: rootFilename
	"Open a MailReader on the mail database with the given root filename."
	|database |

	"zL - NoChg - For reviewer
	zL - Perhaps the ifFalse block style here is preferable to the style
	      used in CelesteAddressBook class open"
	
	(MailDB isADBNamed: rootFilename)
		ifTrue: [ database _  MailDB openOn: rootFilename. ]
		ifFalse: [ database _ nil.  "open an empty Celeste with a welcome message" ].

	^self openOnDatabase: database! !


!CelesteAddressBook class methodsFor: 'instance creation' stamp: 'zL 8/29/2004 20:21'!
open
	"Open it with the standard db:"
	
	"zL - Aug 27 - no code changed.  
	- Issue when installing into image from SqueakMap 1st time when no db exists. 
	- initialize opens a help doc for AddressBook, but no MailDB exists yet"
	
	| database dbName |
	
	dbName := Celeste defaultDBName.
	(MailDB isADBNamed: dbName)
		ifTrue: [database := MailDB openOn: dbName]
		ifFalse: [self error: 'I need a valid Mail DB to process: Please setup Celeste before opening CelesteAddressBook'].
	
	"zL - Ok but if none of the files exist (virgin) openOn: dbName would 
	create them"
	
	^ self new openOn: database! !


!MailDB methodsFor: 'open-create-save' stamp: 'zL 8/27/2004 07:42'!
createDB
	"Create a new mail database."
	
	
	self openDB.							"creates new DB files"
	"gg: adding base categories:"
	self addCategory:'new'.
	
	"zL - Add Aug 27 - Celeste>>outBoxStatus requires .tosend. category to exist also."
	self addCategory:'.tosend.'.

	self saveDB.							"save the new mail database to disk"! !



More information about the Squeak-dev mailing list