Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Wtp-wst-dev] How to modify/disable sections or controls within the [server] editor overview page?

Title: Re: [Wtp-wst-dev] How to modify/disable sections or controls within the [server] editor overview page?
Hi Angel,

First of all, thank you very much for your reply! And many appologies for my late reaction.

>> ... it sounds like you guys went the other way around :)

Seems so. :) But it has its reasons. Unlike other server, Swordfish is integrated in Eclipse (Equinox respectively). For developing Swordfish participants you just need to use Swordfish Tooling which contains a Swordfish Runtime as target platform. You can easily run the participants within the development environment choosing the right target platform. So there is no need for local publishing support. And supporting administrative actions like starting or stopping is normally avoided in connection with remotly installed servers. We decided to follow this habit. ;)

>> As far timeouts, our framework doesn't support disabling the timeout ...

That's ok for us at this moment - as we don't support server actions like start or stop. Publishing is done over HTTP and therefor has it's own timeout. But of course it is confusing that the section appears within the UI.

>> AutoPublishing can be disabled by implementing ServerDelegate.setDefault ...

Cool tip. Thank's a lot! I was searching for the possibility to change the default setting. But as it seems I was searching at the wrong place. This is working now.

>>  This doesn't give you the entire desired effect as user will still be able to modify the UI ... In your scenario it sounds to me like you are interested in disabling the publish and timeout sections within the editor.

Yes. This is exactly what we want(ed) to do.

>> There isn't a createGeneralSection method, but I assumed you are talking about the createControl method.

No. Sorry. Perhaps I wasn't clear enough. ServerEditorOverviewPageModifier.createControl() is the method to be implemented by the extension point. Right. But I was talking about the place where createControl() method is been invoked.

This happens within the class org.eclipse.wst.server.ui.internal.editor.OverviewEditorPart. In this class the method createPartControl invokes three operations:

- createGeneralSection
- createPublishSection
- createTimeoutsSection

which correspond to the parts within the server editor overview page.

Currently ServerEditorOverviewPageModifier extensions are only been executed at the end of the method "createGeneralSection" allowing for modifications within the section providing the host name control.

I wondered if you would accept to also allow modifications within the publish and the timeout section by executing ServerEditorOverviewPageModifier.createControl() at the end of OverviewEditorPart.createPublishSection() and OverviewEditorPart.createTimeoutSection(). This would involve the following changes (as far as I can see):

- Change ServerEditorOverviewPageModifier UI_LOCATION enum to support more concrete sections: OVERVIEW_GENERAL, OVERVIEW_PUBLISH, OVERVIEW_TIMEOUT, OTHER in order to be able to distinguish.

- Change OverviewEditorPart:

    * Pass "OVERVIEW_GENERAL" as UI_LOCATION within "createGeneralSection()" method when invoking ServerEditorOverviewPageModifier.createControl() method.
    * Add corresponding code to the end of the methods "createPublishSection()" and "createTimeoutSection()" executing ServerEditorOverviewPageModifier.createControl() with there own UI_LOCATION. (No need to set the UIChangeListener again, of course).

- Optionally adjust org.eclipse.wst.server.ui.AbstractUIControl to react on property change within the publish section and possibly also timeout section.

- Adjust the documentation about the supported fields/sections in the schema of the extension point.

I already tried this out. This enabled me to set all controls within the publish and the timeout section to visible = false and add a label informing the user that this section is not supported for the Swordfish server (which requires to be able to access serverWc in order to find out if the current server id is matching my own server ... with regard to this please see below).

So this would be working so far. But I think you might not accept the changability of the additional sections (publish and timeout) as there might not be any other reason for it - except disabling it, which probably could be done differently. - On the other hand this would be an easy and straight forward change. :-)

>> We currently don't have support for controlling this sections.

As an other alternative it would be also sufficiant to enhance AbstractUIControl a little bit to inform my ServerEditorOverviewPageModifier about property changes within the publish and the timeout section. If this would happen I could react  by popping up a message which informs the user that this change has no effect in case of a Swordfish server.

Of course this is not very nice. :-) It would be just a workaround.

>> 'ServerEditorOverviewPageModifier' and the 'ServerCreationWizardPageExtension' apply to all servers, perhaps the ServerEditorOverviewPageModifier can be server type specific, but not the ServerCreationWizardPageExtension due to how the wizard is designed (server types is displayed within the same page where we allow for insertion of widgets).

Good point. I missed this detail with regard to ServerCreationWizardPageExtension. :-)

>> For now you can get server type from the serverWc within the extension point class (although there is a bug that I just found out see bug 311580) and if Server Type is not one that you are interested then exit.

Thanks for the tip. I also missed this possibility. (What I did "not" miss...? I have to think about it. ;-)) This is a sufficient solution. And I have seen that your fix has been commited to the HEAD. Cool! I've updated to the newest sources and use them to run my ServerEditorOverviewPageModifier implementation.

But serverWc is still null in my case. It seems that the fix assigns the serverWc reference to late for several situations - in my case after ServerEditorOverviewPageModifier.createControl has been invoked:

- The fix sets the serverWc reference near the end of OverviewEditorPart.initialize() method.
- OverviewEditorPart.initialize() is been invoked within two methods:
    * OverviewEditorPart.init()
    * At the end of OverviewEditorPart.createPartControl()
- When opening the server editor page in the IDE OverviewEditorPart.init() is been invoked first.
- The first thing OverviewEditorPart.init() is doing is to check wether serverName is assigned. If not, it returns immediatelly.
- serverName is been assigned within OverviewEditorPart.createGeneralSection().
- createGeneralSection() is been invoked in createPartControl().
- createPartControl() has not been invoked yet when init() is been called.
- So serverName is null at this moment and init() returns immediatelly without reaching the code in which serverWc is been assigned within ServerEditorOverviewPageModifier.
- Later OverviewEditorPart.createPartControl() is been invoked.
- It first calls OverviewEditorPart.createGeneralSection()
- This again results in the fact that ServerEditorOverviewPageModifier.createControl() will be invoked before initialize() is been called at the end of the method createGeneralSection().

Hence serverWc is still null when the extension point implementation gets the control over the program flow. It never has the chance to access serverWc.

Do I miss something?

>> It is too late to accept a patch for Helios.

This is a pitty. It would have been such an easy patch. ;-)

Thank you very much for your attantion!

Best regards

Back to the top