'From etoys4.0 of 9 October 2008 [latest update: #2257] on 1 September 2009 at 2:17:53 am'! "Change Set: noGifThumbnail-sw Date: 1 September 2009 Author: Scott Wallace No longer write out the gif thumbnail. No longer include the filename of the gif thumbnail in info transmitted to the SuperSwikiServer. Consequences for existing superSwikiServers and other project servers unknown -- need help testing. Project servers are now expected to cut over to using the .png thumbnail embededded in the outer .pr file."! !Project methodsFor: 'file in/out' stamp: 'sw 9/1/2009 02:08'! writeFileNamed: localFileName fromDirectory: localDirectory toServer: primaryServerDirectory | local resp gifFileName f | local _ localDirectory oldFileNamed: localFileName. resp _ primaryServerDirectory upLoadProject: local named: localFileName resourceUrl: self resourceUrl retry: false. local close. resp == true ifFalse: [ "abandon resources that would've been stored with the project" self resourceManager abandonResourcesThat: [:loc| loc urlString beginsWith: self resourceUrl]. self error: 'the primary server of this project seems to be down (', resp printString,')'. ^ self ]. "**** NB: Commented code that made a gif thumbnail file: gifFileName _ self name,'.gif'. localDirectory deleteFileNamed: gifFileName ifAbsent: []. local _ localDirectory fileNamed: gifFileName. thumbnail ifNil: [ (thumbnail _ Form extent: 100@80) fillColor: Color orange ] ifNotNil: [ thumbnail unhibernate. ]. f _ thumbnail colorReduced. f depth > 8 ifTrue: [ f _ thumbnail asFormOfDepth: 8 ]. GIFReadWriter putForm: f onStream: local. local close. [local _ StandardFileStream readOnlyFileNamed: (localDirectory fullNameFor: gifFileName). (primaryServerDirectory isKindOf: FileDirectory) ifTrue: [primaryServerDirectory deleteFileNamed: gifFileName ifAbsent: []]. resp _ primaryServerDirectory putFile: local named: gifFileName retry: false. ] on: Error do: [:ex |]. local close. **** " primaryServerDirectory updateProjectInfoFor: self. primaryServerDirectory sleep. "if ftp, close the connection" ! ! !SuperSwikiServer methodsFor: 'for real' stamp: 'sw 9/1/2009 01:57'! updateProjectInfoFor: aProject | data details projectLinks linkString uploader | data _ OrderedCollection new. data add: 'action: updatepage'. data add: 'password: ',ProjectPasswordNotification signal. "***NB - Commented out the following line: data add: 'projectimage: ', (aProject name convertToEncoding: self encodingName) , '.gif'. ****" uploader _ Utilities authorNamePerSe. uploader isEmptyOrNil ifTrue: [uploader _ Utilities authorInitialsPerSe]. uploader isEmptyOrNil ifFalse: [ data add: ('submittedBy: ',uploader convertToEncoding: self encodingName). ]. projectLinks _ Set new. aProject world allMorphsDo: [ :each | (each isKindOf: ProjectViewMorph) ifTrue: [ projectLinks add: each safeProjectName. ]. ]. details _ aProject world valueOfProperty: #ProjectDetails ifAbsent: [Dictionary new]. details at: 'projectname' ifAbsentPut: [aProject name]. projectLinks isEmpty ifTrue: [ details removeKey: 'projectlinks' ifAbsent: [] ] ifFalse: [ linkString _ String streamContents: [ :strm | projectLinks asSortedCollection do: [ :each | strm nextPutAll: each ] separatedBy: [ strm nextPut: $. ]. ]. details at: 'projectlinks' put: linkString ]. details keysAndValuesDo: [ :k :v | data add: k , ': ' , (v convertToEncoding: self encodingName). self flag: #yoFlag. ]. ^self sendToSwikiProjectServer: data! !