Since Squeak 2.0 is imminent, this page will only be useful for a short while.
X-Sender: guzdial@cleon.cc.gatech.edu
Mime-Version: 1.0
Date: Wed, 20 May 1998 12:34:10 -0400
To: pws@cc.gatech.edu
From: Mark Guzdial
Noel's fixed PSwikiAction>>restore: is at
http://guzdial.cc.gatech.edu/st/PSwikiAction-restore.st
Mark
From: "WILLIAM JAMES MCLAUGHLIN"
Hi all,
First of all I'd like to say Swiki is really neat. I admire people
who can turn ideas like this into practical programs that people like
me can learn from and use.
I set up a PSwiki server without too much trouble except that I could
not get it to restore a PSwiki from the file. I kept getting a syntax
error "PSwikiPage as yet unclassified self" where it starts to
construct the PSwikiPage from the file using self name:.... etc.
Anyhow, after a bit of head scratching I traced it to a missing ' in
the file. The method chunk1 in PSwikiPage has missed putting a(n) '
after the time. The new method is listed below.
(William's fix is also at http://guzdial.cc.gatech.edu/st/PSwikiPage-chunk1.st )
'From Squeak 2.0 BETA of May 8, 1998 on 21 May 1998 at 11:44:30 am'!
!PSwikiPage methodsFor: 'all' stamp: 'wjmcl 5/21/1998 11:42'!
chunk1
| who |
^ String streamContents: [:ss |
ss nextPutAll: 'self name: '; nextPutAll: name printString;
nextPutAll: ' date: '''; nextPutAll: date mmddyyyy.
ss nextPutAll: ''' time: '''. Time now print24: true on: ss.
who _ user class == String ifFalse: [address] ifTrue: [user].
who ifNil: [who _ 'unknown user']. "must be a string!!!!"
ss nextPutAll: ''' by: '; nextPutAll: who printString. "!!! Here!"
ss nextPutAll: ' authName: '; nextPutAll: username printString.
ss nextPutAll: ' authPW: '; nextPutAll: password printString.
ss nextPutAll: ' privs: '; nextPutAll: privs printString.
ss nextPutAll: ' text: ']! !
I can now restore a PSwiki!
P.S. I also filed in PSwikiAction-restore.st.
BTW, the latest server update altered PSwikiAction restore.
William McLaughlin
Technician,School of Behavioural & Communication Sciences
University of Ulster, N.Ireland
WJ.McLaughlin@ulst.ac.uk
From: "WILLIAM JAMES MCLAUGHLIN"
Hi All,
This isn't so much a fix as a method rearrangement. PURLmap newpage:
from: method saves the new page before the username, password and
privs have been initialized, resulting in nil values being saved.
This creates a problem when a new page is created and the server is
shut down. If the PSwiki is then 'restored' and the new page browsed
a "Message not understood: includesSubString" error is reported. This
does not occur if the page is edited before the server is shut down
as the proper values have been assigned at this stage.
The new method is listed below:
(Now available at http://guzdial.cc.gatech.edu/st/PURLmap-newpage.st )
'From Squeak 2.0 of May 22, 1998 on 28 May 1998 at 10:04:42 am'!
!PURLmap methodsFor: 'all' stamp: 'wjmcl 5/26/1998 16:44'!
newpage: label from: peer
| newpage newfile |
newpage _ PSwikiPage new.
self at: label put: newpage.
newfile _ pages size printString.
newpage address: peer.
newpage date: (Date today).
newpage coreID: newfile.
newpage name: label.
newpage username: ''.
newpage password: ''.
newpage privs: ''.
newpage file: ((ServerAction serverDirectory),
directory, (ServerAction pathSeparator), newfile).
newpage text: 'Describe ',label,' here'.
newpage map: self.
newpage url: (action name),'.',newfile.
^newpage
! !
William McLaughlin
Technician,School of Behavioural & Communication Sciences
University of Ulster, N.Ireland
WJ.McLaughlin@ulst.ac.uk
More About Squeak...
Last modified at 5/28/98; 10:24:44 AM
Home Page for How To Squeak
Other Links of Interest
College of Computing | EduTech Institute | GVU Center
Mark Guzdial | CS2390, Modeling and Design | STABLE