Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Multiple scout client applications accessing the same scout server?
Multiple scout client applications accessing the same scout server? [message #1404918] Wed, 06 August 2014 06:29 Go to next message
Henzler Peter is currently offline Henzler PeterFriend
Messages: 19
Registered: July 2009
Junior Member
As it looks to me scout assumed that there is only on client applications (possibly running on different ui technologies) accessing it's own scout server.

I would like to have different client applications (doing different things and therefore requiring diffent user interfaces) accessing one common scout server.
So all the client application would access and modify the same data on the server.

Is this possible with scout?
I couldn't find any information on this respectively it seems that this is not possible...

Thank you for your advice.

Peter Henzler
Re: Multiple scout client applications accessing the same scout server? [message #1405017 is a reply to message #1404918] Wed, 06 August 2014 11:32 Go to previous messageGo to next message
Lukas Steigerwald is currently offline Lukas SteigerwaldFriend
Messages: 47
Registered: July 2014
Member
By using the same database in all your applications you should be able to have the same data in all your applications. Or is there a limitation for you when going for this approach?
Re: Multiple scout client applications accessing the same scout server? [message #1405033 is a reply to message #1405017] Wed, 06 August 2014 12:16 Go to previous messageGo to next message
Henzler Peter is currently offline Henzler PeterFriend
Messages: 19
Registered: July 2009
Junior Member
What I am asking is, if there is a possibility to have only one server (web application) running that can handle different client side applications at the same time.
Re: Multiple scout client applications accessing the same scout server? [message #1405760 is a reply to message #1405033] Fri, 08 August 2014 05:46 Go to previous messageGo to next message
Matthias Nick is currently offline Matthias NickFriend
Messages: 197
Registered: August 2013
Senior Member
Hi Peter,

thanks for your questions. I can think of two different ways:

1) == Reusing Services ==

First, I created a simple client server project (Project A). Afterwards I went to the server node and created a server service called "IServerTimeService", which simply returns the ServerTime:

@InputValidation(IValidationStrategy.PROCESS.class)
public interface IServerTimeService extends IService {
  long getTime() throws ProcessingException;
}


The implementation for the IServerTimeService is very simple:
public class ServerTimeService extends AbstractService implements IServerTimeService {
  @Override
  public long getTime() throws ProcessingException {
    return System.nanoTime();
  }
}

What happens when I create the service is, the IServerTimeService.java will be created in Project A's shared plug-in, the implementation is stored in the server plug-in and a proxy registration is done in the client plug-in.


In Project A's client, I can use the service as usual:
        IServerTimeService service = SERVICES.getService(IServerTimeService.class);
        long serverTime = service.getTime();



Okay, now the interesting part. I create a new scout project, called Project B. Basically Project B does not need a server since we will reuse the server of Project A. After creating I imported Project A's shared plug-in. Open Project B's shared plug-in and add the Project A's shared plug-in as dependency and reexport it. Accordingly the IServerTimeService is now available in our project.

Now, we have to add the proxy registration of IServerTimeService in our client's plugin.xml as well (this can be copy pasted from Project A's client plugin.xml).

Now we open the swing.product and also add Project A's shared plug-in to the dependencies.

As a last step we have to make sure Project B uses the server url of Project A. Therefore we open the swing product's config.ini and look for the line

### URL to the scout backend webapp
server.url=http\://localhost\:8080/Project_B/process


and of course have to change the url to project A:
### URL to the scout backend webapp
#server.url=http\://localhost\:8080/Project_B/process
server.url=http\://localhost\:8080/Project_A/process


Afterwards you can reuse the IServerTimeService in Project B.

2) == Webservices ==
The 2nd solution I can think of is to provide every service which need to be shared across several scout applications as a webservice. See Webservice Tutorial for more information.


Hope this helps. If other users have comments/solutions I would love to hear them.

Best regards,
Matthias
Re: Multiple scout client applications accessing the same scout server? [message #1414733 is a reply to message #1405760] Mon, 01 September 2014 07:16 Go to previous message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Here is how I would solve your problem:

A multi-module scout application:
* Core
** Module A
** Module B

You create 2 client products:
* Client core + Client Module A
* Client core + Client Module B

And one server product:
* Server core + Server Module A + Server Module B

I did not try it, but I think that this solve exactly what you are looking for.

You will have one scout server and different scout clients that connects to the same server.
Previous Topic:Exclude client during server export
Next Topic:Fill table with data in form
Goto Forum:
  


Current Time: Fri Apr 26 07:23:53 GMT 2024

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

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

Back to the top