Hi,

I mentioned about HarvestMoonEnhnaced in my previous posting
because AdvancedDocs inherits from Docs swiki. If you alread
made AdvancedDocs inherit from Refs, it is not required.

You must first file-in Christian Noack's changeset before
my new changeset. Mine is just small patch (fix? I'm not sure yet. :-)
over his new features. Do the same for my changset as you did
for Noack's.

To say about myself, I was using old com47swiki12 version
until recently. And just start learning about new features and
other enhancements. My changeset seems to work for myself
right now, but not tested enough, of course.
You'd better waiting Christian Noack's next release
if more problem happens after update. :-)

By the way, I found some more problems using AdvancedDocs
and added another patches into the changset. I'll attach my
new changeset to this posting.

Have a nice day.

On Thu, Dec 05, 2002 at 10:04:24PM +0900, Derrel Fincher wrote:
> Hi,
> 
> My ignorance of the workings of the Swiki and Squeak is going to show, but 
> I'm not quite sure what to do with the change set that was attached. I have 
> Doc, Image, and Forward from Harvest Moon Enhanced in the Swiki. Is this 
> intended to be filed in without Christian Noack's enhancements or with 
> them? I have moved his AdvancedDocs into the Swiki and made it inherit from 
> Refs as per the change set, but when I save, "unknown" is recorded for the 
> user who is logged in. However, if I file in Noack's change set, the 
> AdvancedDocs does not work at all.
> 
> I must be doing something wrong. Any suggestions? I'm trying this with 
> Swiki 1.3
> 
'From Squeak3.0 of 4 February 2001 [latest update: #3552] on 6 December 2002 at 
3:19:30 am'!

!HttpRequest methodsFor: 'accessing' stamp: 'shr 12/5/2002 15:27'!
postFields
    "Answer the multipart fields for a post request (if in fact this is a  
        POST request"
  ^ self
         propertyAt: #postFields
                
ifAbsentPut: [
                 "parse POST fields in the body of request, if it's 
standard form data"
                 self isPostRequest
                             
ifTrue: [self contentType = MIMEDocument contentTypeFormData
                          
                 ifTrue: [HttpParser
                                                  
          decodeUrlEncodedForm: self rawPostFields multipleValues: true]
              
                           ifFalse: [| postFieldsDict | 
                              
                    postFieldsDict _ Dictionary new.
                                  
                     (self contentType = MIMEDocument contentTypeMultipart
            
                                                      and: [(url alike: '.save')
      
                                                                               = 5])
  
                                                        ifTrue: [self
                 
                                                         multipartFormFieldsDo: 
[:chunk | 
                                                                            
          | chunkStream | 
                                                            
                           chunkStream _ ReadWriteStream on: String new.
              
                                                                    chunk 
saveToStream: chunkStream.
                                                            
                           postFieldsDict at: chunk fieldName put: chunkStream 
contents]].
                                                        postFieldsDict]]
  
                             ifFalse: [Dictionary new]]! !


!XmlSwikiStorage 
methodsFor: 'pages' stamp: 'shr 12/6/2002 03:15'!
loadPage: aPage
     | xml pos0 |
   
xml _ (aPage versionId = 0)
            ifTrue: [(dir readOnlyFileNamed: ((aPage id 
asString), '.xml')) contentsOfEntireFile]
          ifFalse: [dir readOnlyFileNamed: 
((aPage id asString), '.old')].
       (aPage versionId > 0)
          ifTrue: [pos0 _ 
0.
                     1 to: (aPage versionId) do: [:i | pos0 _ xml findString: 
'<page>' startingAt: (pos0 + 1).
                              (pos0 = 0) ifTrue: 
[^nil]]]
            ifFalse: [pos0 _ 1].
   self loadPage: aPage from: xml 
startingAt: pos0! !

!XmlSwikiStorage methodsFor: 'pages' stamp: 'shr 12/6/2002 
03:14'!
loadVersionsFrom: aPage
 | versions xml pos0 version vid |

     versions _ 
OrderedCollection new.
      (dir fileExists: (aPage id asString, '.old'))
          
ifTrue: [xml _ dir readOnlyFileNamed: (aPage id asString, '.old').
                    
 vid _ 1.
                       pos0 _ 0.
                      [0 = (pos0 _ xml  
findString: '<page>' startingAt: (pos0 + 1))] whileFalse: [
                          
version _ aPage class new id: (aPage id); versionId: vid; storage: self.
              
                 self loadPage: version from: xml startingAt: pos0.
                   
          versions add: version.
                         vid _ vid + 1]].
       
^versions! !

"Postscript:
Leave the line above, and replace the rest of this comment 
by a useful one.
Executable statements should follow this comment, and should
be 
separated by periods, with no exclamation points (!!).
Be sure to put any further 
comments in double-quotes, like this one."

" *** NOTICE ***
  You must also edit 
settings.xml for advancedDoc swiki to make it inherit from refs
  instead of docs
"
!

Reply via email to