Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Multi Modul - Menu Extension(add Menu on Table Page in another modul)
Multi Modul - Menu Extension [message #1554417] Fri, 09 January 2015 07:20 Go to next message
Rene Eigenheer is currently offline Rene EigenheerFriend
Messages: 109
Registered: July 2009
Senior Member
I'm working on a multi modul scout application as described in https://www.eclipse.org/forums/index.php/t/243162/

Actually I'm facing a problem with Menu Extensions.

Lets assume we have a "Masterdata modul" which treats for example customers. Within this masterdata module I have a customer table page and on this customer table page a menu which enables some actions to work on the selected customer.

Now I have an additional "order module" which has a dependency to the "Masterdata modul". Within this "order module" I like to add an action "Create new order" to the menu on the above described customer tale page. In plain Eclipse, this would be done with menu extensions. How can I do this with Scout?

TIA
Rene
Re: Multi Modul - Menu Extension [message #1559697 is a reply to message #1554417] Mon, 12 January 2015 06:30 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
I think that what you are describing is possible. I am not an expert in this area; I will ask a colleague to get more information.

For the Mars Release (Version >= 4.2) we have introduced a new "Extensibility Concept". I think the team will be able to publish some documentation by the end of the month.
Re: Multi Modul - Menu Extension [message #1563417 is a reply to message #1559697] Wed, 14 January 2015 07:23 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
There is a new page in the wiki: Scout Extensibility concept
It describes how this new mechanism works (Scout Version >= 4.2).

I am aware that this is not a direct answer to your question and I am still trying to provide you a precise answer (but like everything that is not my domain, it is hard for me to find the information).

.
Re: Multi Modul - Menu Extension [message #1580076 is a reply to message #1563417] Fri, 23 January 2015 09:11 Go to previous messageGo to next message
Nejc Gasper is currently offline Nejc GasperFriend
Messages: 55
Registered: July 2014
Member
So is this possible on 4.0 (to extend menus)? I know how to add menus from the extension application, but I could not find how to extend menus. This link for extensibility concept seems promising, but we would have to upgrade to mars then and I am not sure we can do that at the moment...
Re: Multi Modul - Menu Extension [message #1630856 is a reply to message #1580076] Mon, 23 February 2015 12:42 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Sorry for the delay. It took me a long time to figure out how it works.

----------------------------------------------------------------------------------
Luna Version
Your PersonsTablePage (in the core) needs to be from type: AbstractExtensiblePageWithTable.
Beside this, nothing else is required.

The Menu "Create New Order" is defined in the Extension. It is from type AbstractMenu (exactly as you would do directly in the Table).

The binding is done in the plugin.xml file: You can define an extension to the extension point "org.eclipse.scout.rt.extension.client.menus". Define an menuContribution (the menu) for the PersonsTablePage.

index.php/fa/20964/0/

If you open plugin.xml, the XML looks like this:
<extension
      point="org.eclipse.scout.rt.extension.client.menus">
   <menuContribution
         active="true"
         class="myext.client.CreateNewOrderMenu">
      <page
            class="mycore.client.pages.PersonsTablePage">
      </page>
   </menuContribution>
</extension>


You can register:
* menuContribution
* menuModification
* menuRemoval

Few remarks:
* We consider the community support for the Luna release over (SR2 will be published by the end of the week).
* We had several troubles with this pattern. This is why we developed something new for mars. If you are starting a project now, you might consider using the Mars Version (for example 4.2 is a non-official intermediary release, preparing the mars version coming up next June. Mars Version will be 5.0).
* We do not know yet how long we want to support this pattern. On the long term, we will only invest in the extensibility pattern introduced with mars.

----------------------------------------------------------------------------------
Mars Version
You have probably seen the wiki page: Scout Extensibility concept

The extension looks like this:

public class PersonsTableExtension extends AbstractTableExtension<PersonsTablePage.Table> {

  public PersonsTableExtension(Table owner) {
    super(owner);
  }

  @Order(2000.0)
  public class CreateNewOrderMenu extends AbstractMenu {

    @Override
    protected String getConfiguredText() {
      return TEXTS.get("CreateNewOrder");
    }

    @Override
    protected void execAction() throws ProcessingException {
      MessageBox.showOkMessage("Simulation", "Info on the person", getOwner().getFirstNameColumn().getSelectedValue() + " " + getOwner().getLastNameColumn().getSelectedValue());
    }
  }
}


For the moment, we have an equinox startup problem. We need to ensure that the extension bundle is loaded soon enough. The current workaround is to add the extension bundle "myext.client" in the osgi.bundles parameter (in config.ini):
osgi.bundles=org.eclipse.equinox.common@2\:start,org.eclipse.update.configurator@3\:start,org.eclipse.core.runtime@start,myext.client@4\:start


I will discuss this with my coworker and come up with a better idea.

.
Re: Multi Modul - Menu Extension [message #1701010 is a reply to message #1630856] Wed, 08 July 2015 15:47 Go to previous message
Matthias Zimmermann is currently offline Matthias ZimmermannFriend
Messages: 208
Registered: June 2015
Senior Member
have a look at the "trick" with client startup services called from the core app [1] and an implementation in an extension bundle [2]. hope this helps

[1] https://github.com/BSI-Business-Systems-Integration-AG/org.eclipse.scout.docs/blob/releases/5.0.x/code/contacts/org.eclipsescout.contacts.client/src/org/eclipsescout/contacts/client/ClientSession.java
[2] https://github.com/BSI-Business-Systems-Integration-AG/org.eclipse.scout.docs/blob/releases/5.0.x/code/contacts/org.eclipsescout.contacts.client.premium/src/org/eclipsescout/contacts/client/premium/services/PremiumClientStartupService.java
Previous Topic:Scout with SQLite
Next Topic:Are you still using 32bit Scout Packages?
Goto Forum:
  


Current Time: Tue Apr 16 17:59:27 GMT 2024

Powered by FUDForum. Page generated in 0.24135 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top