[aida] URL duplicates (was Tutorial bug with preferedUrl?)
janko.mivsek at eranova.si
Fri Jan 27 19:32:50 CET 2012
S, Robert Calco piše:
> You must have been right, because adding modifying actionAdd to:
> self observee parent addAddress: self observee.
> *self site urlResolver changeToPreferedURL: self observee.*
> self redirectToView: #main.
> ...works; but I don't understand why there would have been a duplicate
When you were redirected to empty address form, Aida needed an URL
already and because you didn't have a chance to enter surname yet, a
duplicate situation occurred.
> Incidentally, the update to the tutorial page lost the formatting for
> code samples, such that nearly all of them show no indenting (most lines
> in code samples start at col 0).
Yes, that damn TinyMCE editor doesn't edit preformated text corectly and
loosing spaces. I'm just raw editing raw HTML to restore formatting...
> On Fri, Jan 27, 2012 at 6:02 PM, Robert Calco <bobcalco na gmail.com
> <mailto:bobcalco na gmail.com>> wrote:
> 2012/1/27 Janko Mivšek <janko.mivsek na eranova.si
> <mailto:janko.mivsek na eranova.si>>
> S, Robert Calco piše:
> > I have implemented the Aida tutorial but notice a quirk when
> adding new
> > entries, namely, the URL of the new object is always "-c". For
> > if you add 'Jack', 'Beanstalk', '1234567890',
> 'jack na beanstalk.com <mailto:jack na beanstalk.com>
> > <mailto:jack na beanstalk.com <mailto:jack na beanstalk.com>>', the
> URL of the new entity is
> > '/address/-c'. It seems to me it should generate correctly the URL
> > '/address/beanstalk' instead.
> This is how duplicates of URLs are resolved. If you see '-a',
> '-b', '-c'
> etc, in URLs, then you certainly have an URL duplicate situation.
> URL duplicate situation arises when two or more objects suggest
> the same
> URL by their #preferedUrl method.
> This makes sense except for one thing: I don't have any duplicates
> with surname 'Beanstalk' that would have conflicted. I get -c no
> matter what I add. And all is well when I run the URLResolver code;
> if there were a duplicate, then running that should not change matters.
> This is another area of interest, as 'the one and only URI' of an
> object should be guaranteed unique, in terms of the object itself,
> but it could have any number of URLs that are defined by its
> relationships with other objects.
> When an address is created (by an App), we don't know name and
> yet, but Aida already needs his URL. So his #preferedUrl returns
> '/address/'. and because the previous one already registered
> this URL,
> Aida resolvs the duplicate by registering '/address/-a'.
> > In order to fix the situation I have to run
> > book addresses do: [ :each | URLResolver default
> > each ].
> Another possibility is to change new person URL after adding it
> to the
> address book, because at that point name and surname is entered.
> I just updated the tutorial adding and explaining
> for this case.
> Thanks Janko...
> - Bob
> > _______________________________________________
> > Aida mailing list
> > Aida na aidaweb.si <mailto:Aida na aidaweb.si>
> > http://lists.aidaweb.si/mailman/listinfo/aida
> Janko Mivšek
> Smalltalk Web Application Server
> Aida mailing list
> Aida na aidaweb.si <mailto:Aida na aidaweb.si>
> Aida mailing list
> Aida na aidaweb.si
Smalltalk Web Application Server
More information about the Aida