« Return to Thread: preferredUrl usage

Re: preferedUrl usage

by Leon Smith :: Rate this Message:

Reply to Author | View in Thread

Thanks Janko and Giuseppe for your responses. Janko's response explained the caching behavior thats been driving me mad. Now I have another problem. I stopped my site, removed it, re-created it, stopped the SwazooServer, and evaluated this in a workspace:

| site  |

site := UwaliContestSite demo.
(AIDASite named: 'uwali') urlResolver defaultURL: '/uwali.html' forObject: site .
(AIDASite named: 'uwali')
        urlResolver changeToPreferedURL: site.
site contests do:[ :aContest |
(AIDASite named: 'uwali')
        urlResolver changeToPreferedURL: aContest].


The demo method creates some dummy contest objects, adds them to the contestSite and persists the site as the root object to a GOODS database,

The preferedURL method is on the instance side of ContestApp and looks like this:

preferedUrl
        | aTitle |
        aTitle := self title trimBlanks.
        aTitle := aTitle copyReplaceAll: ' ' with: '-'.
        ^'/uwali/', aTitle, '.html'.

The view method of ContestSite looks like this:

viewMain
        | e |
        e := WebElement new.
        e addTextH1: 'Uwali Contest Site'.
        e table class: #webGrid.
       self observee contests do: [:each |
            e cell addText: each title.
          e newCell addText: each categoryTitle.
            e newCell addText: ', ', each shortDescription.
                e newCell addLinkTo: each  text: each title.
            e newRow].
        self pageFrameWith: e title: 'Contest Site'

Now the link looks good (eg. /uwali/dummy-contest-one.html ), but when I click on it, I get an error message that says "Cannot find aWebApplication for object aContest". I'm sure that the problem is with my addLinkTo: syntax above, but I'm not sure how to fix it.

Thanks

Leon

 « Return to Thread: preferredUrl usage

LightInTheBox - Buy quality products at wholesale price