overriding RRHandlerEditor for RSS

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

overriding RRHandlerEditor for RSS

Chris Dawson
I want to create a new configuration dialog for my RSS component.  I've already created the proper class deriving from RRComponent and that is working well.  I want to override the RRHandlerEditor as well.  It is not calling my component and I am not sure why or how to debug.

What I did:  I already have a class MyRssComponent (derived from RRComponent) which properly implements isFeed and canBeRoot on the class side.   I added two classes, one called MyRssHandlerEditor (deriving from RRHandlerEditor) and MyRssHandler (deriving from WAEntryPoint).  Inside of MyRssHandler I override only configurationComponent and change it to instantiate an instance of MyRssHandlerEditor:

configurationComponent
    ^MyRssHandlerEditor new
        handler: self;
        yourself

Then, inside of MyRssHandlerEditor I override renderFormOn: so that it is changed slightly from .  I also override registerAsApplication as a class method inside of MyRssComponent that looks like this:

registerAsApplication: aString
    WADispatcher default
        register: ((MyRssHandler named: aString)
            rootComponent: self;
            yourself)

I never see the editor I've defined get called.  I've been browsing around the source for a while and am not sure how to troubleshoot this.  If I call self halt. within registerAsApplication nothing happens, neither with a ' 1 / 0. '

I do notice that if I put a 'self halt' into the registerAsApplication that the icon in the squeak browser changes from a green down arrow to a red flag.  I assume this means something.  I've noticed that the registerAsApplication within RRComponent is a double-headed green arrow.  Can someone point out where I can understand what these mean?  I've been looking over the squeak documentation and not sure where to start looking.

Chris

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: overriding RRHandlerEditor for RSS

jgfoster
Hi Chris,

I'm not able to answer the RSS questions, but I think I can help with  
one question.

On Jul 4, 2008, at 4:20 PM, Chris Dawson wrote:

> I do notice that if I put a 'self halt' into the  
> registerAsApplication that the icon in the squeak browser changes  
> from a green down arrow to a red flag.  I assume this means  
> something.  I've noticed that the registerAsApplication within  
> RRComponent is a double-headed green arrow.  Can someone point out  
> where I can understand what these mean?  I've been looking over the  
> squeak documentation and not sure where to start looking.

The red flag is a signal in the code browser saying "look at me!"--in  
this case, because you have a halt in the code. The green arrows are  
signals in the code browser saying "there is another implementation of  
this method that you might want to investigate." If the method  
overrides a superclass method, then the arrow will point up. If there  
is an override of the method in some subclass, then the arrow will  
point down.

If you expect that you are overriding a method, but the arrow doesn't  
appear, then that can be helpful as well. I often forget whether I'm  
supposed to add a method #'renderContent:' (singular) or  
#'renderContents:' (plural). The arrow tells me that I've got the  
right method name. Also, if there is an arrow that I didn't expect,  
then it invites me to go investigate and/or to include a 'super' send  
in my override.

> Chris

James

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: overriding RRHandlerEditor for RSS

Michael Davies-2
In reply to this post by Chris Dawson
> I do notice that if I put a 'self halt' into the registerAsApplication that
> the icon in the squeak browser changes from a green down arrow to a red
> flag.  I assume this means something.  I've noticed that the
> registerAsApplication within RRComponent is a double-headed green arrow.
> Can someone point out where I can understand what these mean?  I've been
> looking over the squeak documentation and not sure where to start looking.
>

Hi Chris, I see that James has answered the specific question, but I
thought I'd share my experiences in exploring the answer to your
question. Have a look at my post at
http://dreamsofascorpion.blogspot.com/2008/07/digging-into-functionality-behind.html

Cheers, Michael
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: overriding RRHandlerEditor for RSS

Philippe Marschall
In reply to this post by Chris Dawson
2008/7/5 Chris Dawson <[hidden email]>:
> I want to create a new configuration dialog for my RSS component.  I've
> already created the proper class deriving from RRComponent and that is
> working well.  I want to override the RRHandlerEditor as well.  It is not
> calling my component and I am not sure why or how to debug.

RRHandlerEditor (or subclasses) as the name suggests, work on
RRRssHandler instances or subclasses. All the editors never work
directly on components. New components are instantiated at least for
every session.

> What I did:  I already have a class MyRssComponent (derived from
> RRComponent) which properly implements isFeed and canBeRoot on the class
> side.   I added two classes, one called MyRssHandlerEditor (deriving from
> RRHandlerEditor) and MyRssHandler (deriving from WAEntryPoint).

You should probably derive from RRRssHandler, not WAEntryPoint.

>  Inside of
> MyRssHandler I override only configurationComponent and change it to
> instantiate an instance of MyRssHandlerEditor:
>
> configurationComponent
>     ^MyRssHandlerEditor new
>         handler: self;
>         yourself
>
> Then, inside of MyRssHandlerEditor I override renderFormOn: so that it is
> changed slightly from .  I also override registerAsApplication as a class
> method inside of MyRssComponent that looks like this:
>
> registerAsApplication: aString
>     WADispatcher default
>         register: ((MyRssHandler named: aString)
>             rootComponent: self;
>             yourself)

Are you sure #named: is what you need?

> I never see the editor I've defined get called.  I've been browsing around
> the source for a while and am not sure how to troubleshoot this.  If I call
> self halt. within registerAsApplication nothing happens, neither with a ' 1
> / 0. '

#registerAsApplication: never gets sent automatically, you'll have to
do it yourself. The configuration component should show up in the
configuration interface (in general under /seaside/config).

> I do notice that if I put a 'self halt' into the registerAsApplication that
> the icon in the squeak browser changes from a green down arrow to a red
> flag.  I assume this means something.

It means you put a halt in there.

> I've noticed that the
> registerAsApplication within RRComponent is a double-headed green arrow.
> Can someone point out where I can understand what these mean?

It means it's overriding a method and as well being overridden.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: overriding RRHandlerEditor for RSS

Chris Dawson
Ah, great information Phillipe.  Thanks, I'll review and implement anew tomorrow based on your suggestions.  And, great blog post Michael.

On Tue, Jul 8, 2008 at 9:51 PM, Philippe Marschall <[hidden email]> wrote:
2008/7/5 Chris Dawson <[hidden email]>:
> I want to create a new configuration dialog for my RSS component.  I've
> already created the proper class deriving from RRComponent and that is
> working well.  I want to override the RRHandlerEditor as well.  It is not
> calling my component and I am not sure why or how to debug.

RRHandlerEditor (or subclasses) as the name suggests, work on
RRRssHandler instances or subclasses. All the editors never work
directly on components. New components are instantiated at least for
every session.

> What I did:  I already have a class MyRssComponent (derived from
> RRComponent) which properly implements isFeed and canBeRoot on the class
> side.   I added two classes, one called MyRssHandlerEditor (deriving from
> RRHandlerEditor) and MyRssHandler (deriving from WAEntryPoint).

You should probably derive from RRRssHandler, not WAEntryPoint.

>  Inside of
> MyRssHandler I override only configurationComponent and change it to
> instantiate an instance of MyRssHandlerEditor:
>
> configurationComponent
>     ^MyRssHandlerEditor new
>         handler: self;
>         yourself
>
> Then, inside of MyRssHandlerEditor I override renderFormOn: so that it is
> changed slightly from .  I also override registerAsApplication as a class
> method inside of MyRssComponent that looks like this:
>
> registerAsApplication: aString
>     WADispatcher default
>         register: ((MyRssHandler named: aString)
>             rootComponent: self;
>             yourself)

Are you sure #named: is what you need?

> I never see the editor I've defined get called.  I've been browsing around
> the source for a while and am not sure how to troubleshoot this.  If I call
> self halt. within registerAsApplication nothing happens, neither with a ' 1
> / 0. '

#registerAsApplication: never gets sent automatically, you'll have to
do it yourself. The configuration component should show up in the
configuration interface (in general under /seaside/config).

> I do notice that if I put a 'self halt' into the registerAsApplication that
> the icon in the squeak browser changes from a green down arrow to a red
> flag.  I assume this means something.

It means you put a halt in there.

> I've noticed that the
> registerAsApplication within RRComponent is a double-headed green arrow.
> Can someone point out where I can understand what these mean?

It means it's overriding a method and as well being overridden.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside