<div dir="ltr"><div><div><div><div><div><div><div><div>Sorry, I just read what I wrote and it makes no sense to me- never mind anyone else:<br><br>"<i>A <span class="">grok</span>.Component, and classes inheriting from it
implement an IContainer, and because of the ContainerTraverser
implementing an ITraverser for an IContainer, we "magically" get the
ContainerTraverser implementation for <span class="">grok</span>.Container instances.</i>"<br><br></div>That should be:<br><br></div>- A grok.Container, and derived classes, implement IContainer<br></div>- ContainerTraverser is an adapter which provides an ITraverser interface for IContainer instances<br>
</div>- So when we need to traverse a container, we find the traverser by asking the component architecture for an ITraverser(context) where the context is a container instance.<br><br></div>To override the behaviour, we can create our own adapter:<br>
</div><br>class MyTraverser(grok.Adapter):<br></div> grok.context(IContainer)<br></div> grok.implements(ITraverser)<br> ....<br><div><div><br><div><div>which effectively replaces the original traverser for containers. Although I query your need for doing so.<br>
</div><div><br></div><div><u>Disclaimer</u><br></div><div>Please note: I am not an expert here and it is entirely possible that I have the wrong end of the stick.<br><br></div><div><div><div><div><div><br><br></div></div>
</div></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 19, 2014 at 12:40 PM, Paul Sephton <span dir="ltr"><<a href="mailto:prsephton@gmail.com" target="_blank">prsephton@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div><div>Hi, Christopher,<br><br></div>I cannot claim to be certain of what you are getting at, but to the best of my understanding you are proposing two things:<br>
</div>
a) A change to the traverser method for the IContainer and IContext interfaces<br></div>b) Some default javascript/jquery added which automates AJAX queries for URL's containing '#'.<br><br></div><div>Did I get this part right?<br>
</div><div><br></div>You mentioned that you are unsure as to why IContainer and IContext have ContainerTraverser and ContextTraverser as two separate classes. Well, how I understand it, is that the component architecture is the big differentiator here. A grok.Component, and classes inheriting from it implement an IContainer, and because of the ContainerTraverser implementing an ITraverser for an IContainer, we "magically" get the ContainerTraverser implementation for grok.Container instances.<br>
<br></div>I do not believe you would need to change the grok source to override the traverser behaviour. You can simply derive a new interface from IContainer or IContext and implement an adapter for it. (<i>If I am wrong here, can someone correct me?</i>)<br>
<br></div>Of course, you can also just implement a class inheriting grok.Traverser with a grok.context(your model or container), but you probably already know about this and it's not what you are after, right?<br><br>
</div>My personal feeling about frameworks with "built-in" javascript is that it gets ugly pretty quickly. I like the fact that if I need to use Javascript or AJAX the framework itself does not implement any of that. For example, since JQueryMobile already uses '#' in URL's to handle AJAX pages, your use of '#' as well would clash. It's actually a rather horrible approach to identifying AJAX views IMO.<br>
<br>It's not actually all that hard to implement AJAX specific areas of your site, and I don't like being prescribed by a framework as to the method I must use to figure out which parts of the site are AJAX loadable. Personally, I add an 'AjaxLoad' class to divs which must be populated, and add a 'ref' attribute containing a view reference. My JQuery runs through the page looking for div.classname and sets up event handlers for the AJAX areas.<br>
<br></div>Have fun,<br></div>Paul<br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Wed, Aug 13, 2014 at 12:00 PM, <span dir="ltr"><<a href="mailto:grok-dev-request@zope.org" target="_blank">grok-dev-request@zope.org</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">Send Grok-dev mailing list submissions to<br>
<a href="mailto:grok-dev@zope.org" target="_blank">grok-dev@zope.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">https://mail.zope.org/mailman/listinfo/grok-dev</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:grok-dev-request@zope.org" target="_blank">grok-dev-request@zope.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:grok-dev-owner@zope.org" target="_blank">grok-dev-owner@zope.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Grok-dev digest..."<br>
<br></div></div>Today's Topics:<br>
<br>
1. Grok.traverser Code Documentation Feedback and proposal.<br>
(Christopher Lozinski)<br>
<br><br>---------- Forwarded message ----------<br>From: Christopher Lozinski <<a href="mailto:lozinski@freerecruiting.com" target="_blank">lozinski@freerecruiting.com</a>><br>To: <a href="mailto:grok-dev@zope.org" target="_blank">grok-dev@zope.org</a><br>
Cc: <br>Date: Tue, 12 Aug 2014 20:15:38 +0300<br>Subject: [Grok-dev] Grok.traverser Code Documentation Feedback and proposal.<br>
<div text="#000000" bgcolor="#FFFFFF">
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6">I put up three web
pages about grokcore.traverser.</font></p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"><br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6">Here is my page
documenting the source code. </font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6"><a href="http://zopache.com/Grokcore.traverserCodeDocumentation" target="_blank">http://zopache.com/Grokcore.traverserCodeDocumentation</a></font></p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"><br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6">Here are my
comments about the source code from a Human Factors point of
view. </font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6"><a href="http://zopache.com/HumanFactors#preview" target="_blank">http://zopache.com/HumanFactors</a></font></p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"><br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6">And here is my
proposal as to what should be done to improve the code. </font>
</p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6"><a href="http://zopache.com/GrokCoreTraverserProposal" target="_blank">http://zopache.com/GrokCoreTraverserProposal</a></font></p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"><br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"><br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6">Why am I writing
this? Well I am just implementing parental acquisition for
Zopache, and so I need <br>
</font></p>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6">to modify the
default traversal software. </font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"><br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6">I find that
documenting software helps me to understand it better.
Describing it, crystallizes my <br>
</font></p>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6"><br>
concepts. And other people care, and so they read carefully, and
correct any mistakes.<br>
<br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6">And finally these
mailing lists are so quiet, I am sure that many people are happy
that something <br>
</font></p>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6"><br>
new, albeit controversial, is happening. </font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"><br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6">So I invite you to
go ahead and read the documentation I wrote, and the comments.</font></p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"><br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"> <font style="font-size:26pt" face="Arial" size="6">But before you
begin, let me say I am just amazed at the brilliance of the
People who wrote Grok. I <br>
</font></p>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6"><br>
could never have even imagined this framework, let alone written
such high quality bug-free code. <br>
</font></p>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6"><br>
Thank you enormously for those who did it. </font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"><br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"></font></p>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6"><br>
And of course if anyone wants to talk to me about what I am
doing for Parental Acquisition during <br>
</font></p>
<p style="margin-bottom:0in;line-height:100%"><font style="font-size:26pt" face="Arial" size="6"><br>
traversal, I am happy to chat privately off of this mailing
list. </font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"><br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"><br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><font face="Arial"><br>
</font> </p>
<font face="Arial"> </font>
<p style="margin-bottom:0in;line-height:100%"><br>
</p>
</div>
<br>_______________________________________________<br>
Grok-dev mailing list<br>
<a href="mailto:Grok-dev@zope.org" target="_blank">Grok-dev@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">https://mail.zope.org/mailman/listinfo/grok-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>