How to reverse unregister handler?

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

How to reverse unregister handler?

Marco A.
To prepare my image for deployment, I created a "Developer-Only" page on which I have an anchor whose callback executes the following:

unregisterAllHandlers
        (self confirm: 'Are you sure you want to unregister all handlers. This should only be done on an image that will be deployed. This action is irreversible for this image.')
                ifTrue: [
                        WADispatcher default unregister: (WADispatcher default handlerAt: 'examples').
                        WADispatcher default unregister: (WADispatcher default handlerAt: 'comet').
                        WADispatcher default unregister: (WADispatcher default handlerAt: 'tests').
                        WADispatcher default unregister: (WADispatcher default handlerAt: 'tools').
                        WADispatcher default unregister: (WADispatcher default handlerAt: 'welcome').
                        WADispatcher default unregister: (WADispatcher default handlerAt: 'config').
                        WADispatcher default unregister: (WADispatcher default handlerAt: 'status').
                        WADispatcher default unregister: (WADispatcher default handlerAt: 'javascript').
                        WADispatcher default unregister: (WADispatcher default handlerAt: 'files').
                        WADispatcher default unregister: (WADispatcher default handlerAt: 'browse').
                ].

Is there a way to get those handlers back? If so, how is it done?
Is the above a reasonable way to "protect the image" in deployment?

- Marco A.

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

Re: How to reverse unregister handler?

Bob Arning
I take a slightly different approach - remove everything and add back whatever I want to keep:

WAAdmin clearAll.
WAEnvironment registerDefaultRequestHandlers.
MyComponent initialize.    "repeat as needed"
WAAdmin defaultDispatcher defaultName: 'myComponentsName'.

And then, if I want to enable everything again:

WAEnvironment reloadApplications

Cheers,
BOb

On 10/22/11 7:47 AM, Marco A. Gonzalez wrote:
To prepare my image for deployment, I created a "Developer-Only" page on which I have an anchor whose callback executes the following:

unregisterAllHandlers
	(self confirm: 'Are you sure you want to unregister all handlers. This should only be done on an image that will be deployed. This action is irreversible for this image.')
		ifTrue: [
			WADispatcher default unregister: (WADispatcher default handlerAt: 'examples').
			WADispatcher default unregister: (WADispatcher default handlerAt: 'comet').
			WADispatcher default unregister: (WADispatcher default handlerAt: 'tests').
			WADispatcher default unregister: (WADispatcher default handlerAt: 'tools').
			WADispatcher default unregister: (WADispatcher default handlerAt: 'welcome').
			WADispatcher default unregister: (WADispatcher default handlerAt: 'config').
			WADispatcher default unregister: (WADispatcher default handlerAt: 'status').
			WADispatcher default unregister: (WADispatcher default handlerAt: 'javascript').
			WADispatcher default unregister: (WADispatcher default handlerAt: 'files').
			WADispatcher default unregister: (WADispatcher default handlerAt: 'browse').	
		].

Is there a way to get those handlers back? If so, how is it done?
Is the above a reasonable way to "protect the image" in deployment?

- Marco A.

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: How to reverse unregister handler?

Lukas Renggli
Ideally you do not load the examples and the development tools into
your production images. This is the easiest way to be certain that non
of the examples and development tools won't be executed.

That said, for most of my deployments I don't build a separate image.
It is just too convenient to have all tools at hand. Instead I proxy
with apache to one secured entry point (this is described in the
Seaside book how to do it). Like this the outside word can only see  a
properly locked down version, and internally I have access to all
tools.

Lukas

On 22 October 2011 14:11, Bob Arning <[hidden email]> wrote:

> I take a slightly different approach - remove everything and add back
> whatever I want to keep:
>
> WAAdmin clearAll.
> WAEnvironment registerDefaultRequestHandlers.
> MyComponent initialize.    "repeat as needed"
> WAAdmin defaultDispatcher defaultName: 'myComponentsName'.
>
> And then, if I want to enable everything again:
>
> WAEnvironment reloadApplications
>
> Cheers,
> BOb
>
> On 10/22/11 7:47 AM, Marco A. Gonzalez wrote:
>
> To prepare my image for deployment, I created a "Developer-Only" page on
> which I have an anchor whose callback executes the following:
>
> unregisterAllHandlers
> (self confirm: 'Are you sure you want to unregister all handlers. This
> should only be done on an image that will be deployed. This action is
> irreversible for this image.')
> ifTrue: [
> WADispatcher default unregister: (WADispatcher default handlerAt:
> 'examples').
> WADispatcher default unregister: (WADispatcher default handlerAt:
> 'comet').
> WADispatcher default unregister: (WADispatcher default handlerAt:
> 'tests').
> WADispatcher default unregister: (WADispatcher default handlerAt:
> 'tools').
> WADispatcher default unregister: (WADispatcher default handlerAt:
> 'welcome').
> WADispatcher default unregister: (WADispatcher default handlerAt:
> 'config').
> WADispatcher default unregister: (WADispatcher default handlerAt:
> 'status').
> WADispatcher default unregister: (WADispatcher default handlerAt:
> 'javascript').
> WADispatcher default unregister: (WADispatcher default handlerAt:
> 'files').
> WADispatcher default unregister: (WADispatcher default handlerAt:
> 'browse').
> ].
>
> Is there a way to get those handlers back? If so, how is it done?
> Is the above a reasonable way to "protect the image" in deployment?
>
> - Marco A.
>
> _______________________________________________
> 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
>
>



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

Re: How to reverse unregister handler?

Philippe Marschall
In reply to this post by Marco A.
2011/10/22 Marco A. Gonzalez <[hidden email]>:

> To prepare my image for deployment, I created a "Developer-Only" page on which I have an anchor whose callback executes the following:
>
> unregisterAllHandlers
>        (self confirm: 'Are you sure you want to unregister all handlers. This should only be done on an image that will be deployed. This action is irreversible for this image.')
>                ifTrue: [
>                        WADispatcher default unregister: (WADispatcher default handlerAt: 'examples').
>                        WADispatcher default unregister: (WADispatcher default handlerAt: 'comet').
>                        WADispatcher default unregister: (WADispatcher default handlerAt: 'tests').
>                        WADispatcher default unregister: (WADispatcher default handlerAt: 'tools').
>                        WADispatcher default unregister: (WADispatcher default handlerAt: 'welcome').
>                        WADispatcher default unregister: (WADispatcher default handlerAt: 'config').
>                        WADispatcher default unregister: (WADispatcher default handlerAt: 'status').
>                        WADispatcher default unregister: (WADispatcher default handlerAt: 'javascript').
>                        WADispatcher default unregister: (WADispatcher default handlerAt: 'files').
>                        WADispatcher default unregister: (WADispatcher default handlerAt: 'browse').
>                ].
>
> Is there a way to get those handlers back? If so, how is it done?

You can try:

WAEnvironment reloadApplications

> Is the above a reasonable way to "protect the image" in deployment?

As Lukas said we recommend not loading the tests, examples, and tools
into a production image.

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