'From etoys4.0 of 5 November 2008 [latest update: #2319] on 3 October 2009 at 6:28:57 pm'! "Change Set: useSymbolKey-sw Date: 3 October 2009 Author: Scott Wallace Addresses SQ-488 'Prev-URI not set in manifest'. Use symbol keys for the project-info items stored in project parameters. Thanks to Yoshiki for pointing out the root of the problem."! !Project methodsFor: 'file in/out' stamp: 'sw 10/3/2009 17:56'! noteManifestDetailsIn: manifestInfo "The receiver is a project being loaded. From the dictionary provided, absorb and remember whether it's an 'old' (pre-olpc) project, and remember the GUID, user, and prev-GUID associated with the project when these data are available in the incoming manifest." | manifestDict oldProject | manifestInfo isEmptyOrNil ifTrue: [^ self projectParameterAt: #oldProject put: true]. manifestDict := (manifestInfo isKindOf: Dictionary) ifTrue: [manifestInfo] ifFalse: [manifestInfo first]. oldProject := ((manifestDict at: 'Squeak-Version' ifAbsent: ['']) beginsWith: 'etoys') not. self projectParameterAt: #oldProject put: oldProject. manifestDict at: #URI ifPresent: [:aUri | self projectParameterAt: #URI put: aUri]. manifestDict at: #user ifPresent: [:aUser | self projectParameterAt: #user put: aUser]. manifestDict at: #'prev-URI' ifPresent: [:aUri | self projectParameterAt: #'prev-URI' put: aUri]! ! !Project methodsFor: 'file in/out' stamp: 'sw 10/3/2009 18:20'! storeAttributesOn: aStream "For the manifest: write a series of cr-delimited records of the form : to a stream." | details loggedInAs incomingUser existingUri uri uriPrefix | self storeAttributeKey: 'Squeak-Version' value: SystemVersion current version on: aStream. self storeAttributeKey: 'Squeak-LatestUpdate' value: SystemVersion current highestUpdate printString on: aStream. self storeAttributeKey: 'File-Name-Encoding' value: LanguageEnvironment defaultFileNameConverter class encodingNames first on: aStream. self storeAttributeKey: 'Project-Language' value: Locale current localeID printString on: aStream. loggedInAs := 'unknown'. Utilities loggedIn ifTrue: [ServerDirectory servers at: 'My Squeakland' ifPresent: [:server | loggedInAs := server userPerSe ifNil: ['unknown']]]. incomingUser := self projectParameterAt: #user ifAbsent: ['unknown']. "If the project was loaded from outside, this will be the user associated with that outside version" existingUri := self projectParameterAt: #URI ifAbsent: [nil]. uriPrefix := 'http://squeakland.org/etoys/'. uri := uriPrefix, loggedInAs, '-', Time totalSeconds printString. existingUri ifNotNil: [incomingUser = loggedInAs ifTrue: [uri := existingUri. (self projectParameterAt: #'prev-URI') ifNotNilDo: [:prior | self storeAttributeKey: #'prev-URI' value: prior on: aStream]] ifFalse: [incomingUser = 'unknown' ifTrue: "saved as unknown user, now publishing as registered user; teefal wants new uri but using original epoch in this case." [uri := String streamContents: [:str | str nextPutAll: uriPrefix. str nextPutAll: loggedInAs, ':'. str nextPutAll: (existingUri copyAfterLast: $:)]]. self storeAttributeKey: 'prev-URI' value: existingUri on: aStream]]. self storeAttributeKey: 'URI' value: uri on: aStream. self storeAttributeKey: 'user' value: loggedInAs on: aStream. details _ self world valueOfProperty: #ProjectDetails ifAbsent: [Dictionary new]. Project publishInSexp ifTrue: [ self storeAttributeKey: 'Project-Format' value: 'S-Expression' on: aStream. self storeAttributeKey: 'Project-Format-Version' value: '1.0' on: aStream. ] ifFalse: [ self storeAttributeKey: 'Project-Format' value: 'ImageSegment' on: aStream. ]. details associationsDo: [:assoc | self storeAttributeKey: assoc key asString value: assoc value asString on: aStream.]! !