When I merged the latest Pier code with the Pier for Seaside 3.0 branch I
noticed that the Pier logo wasn't appearing on the initial screen, although
it appeared on the 3.0 branch prior to the merge.
I traced the difference in behaviour down to a code change in
PRViewCommand>>initialRequest
the pre-merge version:
initialRequest: aRequest
| viewClass |
super initialRequest: aRequest.
viewClass := PRPierFrame
classFromRequest: aRequest
name: 'view'
base: PRViewComponent.
(viewClass isNil and: [ self structure isFile ])
ifTrue: [ viewClass := PRDownloadView ].
(viewClass notNil and: [ viewClass isValidIn: self context ])
ifTrue: [ self viewComponentClass: viewClass ].
self viewComponent visiblePresentersDo: [ :each | each initialRequest:
aRequest ].
(self viewComponent isFullResponse)
ifTrue: [ self viewComponent handle: WACurrentRequestContext value ]
post-merge version:
initialRequest: aRequest
| viewClass |
super initialRequest: aRequest.
viewClass := PRPierFrame
classFromRequest: aRequest
name: 'view'
base: PRViewComponent.
(viewClass notNil and: [ viewClass isValidIn: self context ])
ifTrue: [ self viewComponentClass: viewClass ].
self viewComponent visiblePresentersDo: [ :each | each initialRequest:
aRequest ].
(self viewComponent isFullResponse)
ifTrue: [ self viewComponent handle: WACurrentRequestContext value ]
the pre-merge version has the addition of the code: (viewClass isNil and: [
self structure isFile ]) ifTrue: [ viewClass := PRDownloadView ].
However this code isn't present in the main 2.8 code-base. The problem is
more subtle. The pier environment stylesheet requests an image from:
'/seaside/pier/environment/pier.png?view=PRDownloadView' this is trapped by
the code in WAOldPathComptibilityRequestHandler which issues a 301 moved
permanently redirect to '/pier/environment/pier.png'. The problem is that
during the redirection the url parameters have been lost. I've fixed the
problem locally by changing
WAOldPathComptibilityRequestHandler>>handleFiltered: from:
handleFiltered: aRequestContext
| url |
url := aRequestContext request url copy.
url path removeFirst.
aRequestContext response
movedPermanently;
location: url.
aRequestContext respond
to:
handleFiltered: aRequestContext
| url |
url := aRequestContext request url copy.
url path removeFirst.
url parameters: aRequestContext request fields.
aRequestContext response
movedPermanently;
location: url.
aRequestContext respond
I copy the parameters from the request to the url. Should I save this change
into seaside 3.0 repositories? Or is there something else that needs fixing
higher up the call stack to account for why the parameters haven't been
added to the WAUrl object?
Hope this all makes sense
Nick
I reviewed all my merges and discovered I'd lost changes in:
PRPierFrame>>initialRequest
PRViewCommand>>initialRequest
MAOneToManyComponent>>add
With the corrections in place, Pier appears to working once again. There are
a couple of anomalies - the Pier logo doesn't appear on the home screen and
I received one walkback while clicking around. I'll investigate these
problems later. I've also yet to look at any add-ons including the
Pier-Blog.
I've loaded the code into a fresh seaside3.0a5 image (with updated Gofer)
and the code loads cleanly.
For reference the load script I used was:
"Load Magritte for Seaside 3"
Gofer new
renggli: 'magritte2';
package: 'Magritte-Model';
package: 'Magritte-Pharo-Model';
package: 'Magritte-Tests-Model';
package: 'Magritte-Tests-Pharo-Model';
package: 'Magritte-Seaside';
package: 'Magritte-Pharo-Seaside';
package: 'Magritte-Morph';
load.
"Load Pier for Seaside 3"
Gofer new
renggli: 'pier2';
package: 'Pier-Core';
package: 'Pier-Pharo-Core';
package: 'Pier-Model';
package: 'Pier-Pharo-Model';
package: 'Pier-Tests-Model';
package: 'Pier-Seaside';
package: 'Pier-Pharo-Seaside';
package: 'Pier-Security';
package: 'Pier-Pharo-Persistency';
package: 'Pier-Tests-Security';
load.
PRPierFrame registerAsApplication: 'pier' kernel: (PRKernel new root:
(PRPage new title: 'test'; contents: 'Pier on Seaside 3.0'))
As I'm still not terribly comfortable with the merging tools in Pharo, I've
tried to be as cautious as possible:
1) check there are no changes against in my image from magritte2 or pier2
repositories.
2) merge with magritte or pier repository - if uncertain check changes over
last few months in 2.8 repositories
3) check the merged code for expected differences in the magritte2 or pier2
repositories
Magritte-Model & Magritte-Pharo-Model
Merge was straightforward. examining the differences after merge between the
two repositories I noticed:
MACompatibility doesn't exist with most of the methods being moved to
GRPlatform. However request:default: has been added in MACompatibility for
which there doesn't appear to be a equivalent in GRPlatform Also I couldn't
find an equivalent of openWorkspace:titled: in GRPlatform. So I added
magritteRequest:default: and magritteOpenWorkspace:title to GRPlatform with
Pharo implementations in GRPharoPlatform.
Magritte-Tests
Lots of merge conflicts, but then I realised that I'd only
loaded Magritte-Tests-Model and Magritte-Tests-Pharo-Model
*not* Magritte-Tests - Suddenly what was being said previously in the list
about maintaining version history made sense. I reloaded the tests and tried
to merge again. No merge conflicts, only three updated methods.
-all tests pass-
Magritte-Morph
No changes - though I fixed the load error in MAFileMorph>>choose I changed
FileList2 -> FileList
Magritte-Seaside & Magritte-Pharo-Seaside
Straightforward merge, didn't spot anything which needed to be changed for
cross-platform
Pier
------
What's the purpose of the Magritte-Model, Magritte-Seaside and
Magritte-Tests packages in the pier2 repository? I used the packages in the
magritte2 repository. Hope that was the plan.
Pier-Core - empty package
Pier-Model
lots of changes but only a couple of merge conflicts and a couple of
s/asString/greaseString/ and one
s/allSubInstancesOf:do:/magritteAllSubInstancesOf:do:/
Pier-Seaside
lots of changes, but again only a couple of merge conflicts and one
s/displayString/greaseString/
Pier-Security
only a couple of methods had changed, one merge conflict
Pier-Tests
lots of changes, only one merge conflict
-all tests pass-
I'm about the save the merged code, but when I try I get an Error: HTTP1.1
401 Unauthorized
Does someone need to give me write permissions to
http://source.lukas-renggli.ch/magritte2 and
http://source.lukas-renggli.ch/pier2
Cheers
Nick
Happy New Year to the list.
I've been developing a site using vanilla seaside 3.0a5, and have belated
released that there's much functionality in base Pier and the add-ons which
would save me significant time. From what I can gather from a brief search
of the list there is an early port to 3.0, though I've struggled to load it
into my image. Is there a load script I can use for 3.0? Is it really
sensible to try an early 3.0 port when I'm still struggling to get to grips
with the basic concepts - would I be better off using 2.8 and revert my
jQuery code to prototype/scriptaculous?
Thanks Nick