Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Standalone Client Application(Using Eclipse Scout without the Server)
icon5.gif  Standalone Client Application [message #674104] Wed, 25 May 2011 16:38 Go to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 108
Registered: November 2010
Senior Member
The Hello World tutorial and the last Webinar show how to create Client / Server application.

Is it possible to create with Scout a standalone Client application?

What points needs to be consider to be totally independent from a server (CodeType loading, Session handling, Security, accessing Files...)?

[Updated on: Sun, 05 June 2011 05:28]

Report message to a moderator

Re: Standalone Client Application [message #674646 is a reply to message #674104] Fri, 27 May 2011 13:25 Go to previous messageGo to next message
Andreas Hoegger is currently offline Andreas Hoegger
Messages: 133
Registered: February 2010
Senior Member
Hi Jeremie

Yes it is possible to create a client-; server only application. It
makes sense to create a client/shared or server/shared project.

In case of a server project, the security could be handled the same way
as in a client server app (servlet filters) as well as the session
handling. CodeTypes can be implemented with a local lookup service. File
handling is the same as in client-server apps.

So feel free to implement any application, esb node or even a mp3 player
using Scout ;)

-Andreas

On 25.05.2011 22:38, Jeremie Bresson wrote:
> The Hello World tutorial and the last Webinar show how to create Client
> / Server application.
> Is it possible to create with Scout a standalone Client application?
> What points needs to be consider to be totally independent from a server
> (CodeType loading, Session handling, Security, accessing Files...)?
Re: Standalone Client Application [message #675240 is a reply to message #674646] Mon, 30 May 2011 17:27 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 108
Registered: November 2010
Senior Member
Thanks for your answer. I have tried to create a Project with a Client and a Shared (and a SWT UI)

For the moment, I think that I have a problem with the client-side implementation of ICodeService (throwing a java.lang.reflect.UndeclaredThrowableException, Caused by: ProcessingException, Caused by: java.net.ConnectException Connection refused). I probably need to have an implementation that do not depend on the server.

.
Re: Standalone Client Application [message #683260 is a reply to message #675240] Mon, 13 June 2011 07:34 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio Guglielmo
Messages: 98
Registered: March 2010
Member
Hi Jeremie

When starting a scout app without a server you should remove the code from the ClientSession which connects to the non existing server.

    setServiceTunnel(new HttpServiceTunnel(this, getBundle().getBundleContext().getProperty("server.url")));

    //pre-load all known code types
    CODES.getAllCodeTypes(cgu.clientonly.shared.Activator.PLUGIN_ID);


Remove that code above and you should be able to start the application.

Loading codes without a server is not supported. On the client side there is only an implementation of ICodeService available (CodeServiceClientProxy) which loads the codes from the server and manages a cache.

Instead of using the code service you could use LocalLookupCalls and manage codes and caches yourself. This works fine without a server.

If this is not sufficient and you need to use ICodeService you could either create a dependency from your client plugin to scout-server plugin which makes it necessary to start this plugin and its dependent plugins too. Or you could copy the CodeService class of the server plugin into your client plugin (with CodeTypeCache and CodeTypeStore) and register this one with a higher priority than the default service (CodeServiceClientProxy). Now you should be able to use the ICodeService as normal.

Hope that helps.
Claudio
Re: Standalone Client Application [message #684533 is a reply to message #683260] Wed, 15 June 2011 14:44 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 108
Registered: November 2010
Senior Member
Thanks for your answer. I removed the line from the execLoadSession() function. It works!

To my mind the SDK should not add this lines when you create a Client+Shared only application.
Re: Standalone Client Application [message #709069 is a reply to message #683260] Wed, 03 August 2011 09:21 Go to previous messageGo to next message
Pietro Bonanno is currently offline Pietro Bonanno
Messages: 12
Registered: July 2009
Junior Member
I would like to evaluate Scout for a simple client database app. Is it possibile to write a client/shared only app which connects to a DB server? Can you point me to the right documentation?

Thanks
Re: Standalone Client Application [message #712617 is a reply to message #709069] Sun, 07 August 2011 10:04 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio Guglielmo
Messages: 98
Registered: March 2010
Member
HI Pietro

Beside using plain jdbc like in any other java application you could use the offline support of scout. With this feature you are able to run a regular scout application without a server. This gives you a lot of benefits:

1. Server functionality like transaction handling is available on client side
2. DB access and GUI Logic is well separated out of the box because the application design is the same as with a regular scout client/server application
3. Existing tutorials for client/server applications can be reused since the development process is the same
4. Switching to online mode is possible any time if you want to


To make an application offline capable you need to do following steps:

1. Extend your existing client product with the server plugin and its dependencies.
2. Register the OfflineDispatcherService in your server plugin which actually represents the server on client side and takes care of transactions.
3. Configure the offline support by setting the following property in the config.ini of your client: org.eclipse.scout.rt.server.services.common.offline.OfflineDispatcherService#serverSessionClass=WRITE_HERE_CORRECT_PACKAGE.ServerSession
4. Enable the offline support by adding the following code to beginning of the ClientSession#execLoadSession: ClientSession.get().goOffline();

That's all!

To create a scout application with db access I suggest the following tutorial: http://wiki.eclipse.org/Scout/Tutorial/minicrm

Please let me know if this works for you.

Best regards
Claudio
Re: Standalone Client Application [message #713907 is a reply to message #712617] Tue, 09 August 2011 07:03 Go to previous messageGo to next message
Pietro Bonanno is currently offline Pietro Bonanno
Messages: 12
Registered: July 2009
Junior Member
Claudio Guglielmo wrote on Sun, 07 August 2011 10:04
HI Pietro
To make an application offline capable you need to do following steps:

1. Extend your existing client product with the server plugin and its dependencies.
2. Register the OfflineDispatcherService in your server plugin which actually represents the server on client side and takes care of transactions.
3. Configure the offline support by setting the following property in the config.ini of your client: org.eclipse.scout.rt.server.services.common.offline.OfflineDispatcherService#serverSessionClass=WRITE_HERE_CORRECT_PACKAGE.ServerSession
4. Enable the offline support by adding the following code to beginning of the ClientSession#execLoadSession: ClientSession.get().goOffline();

That's all!

Please let me know if this works for you.

Best regards
Claudio

Claudio, thanks for your kind reply.
I tried it, but I don't understand 1st step (I'm new to Eclipse RCP): I import the server dependencies into client project and redefined the extensions (following an existing client/server app), but I lose the visual outline for configuring the server. Is this expected?

Thanks again
Re: Standalone Client Application [message #713979 is a reply to message #713907] Tue, 09 August 2011 10:06 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio Guglielmo
Messages: 98
Registered: March 2010
Member
Hi Pietro

You need to extend the product (*swt-client-dev.product). There is no need to modify the dependencies of the client plugin.

index.php/fa/3596/0/

I attached a sample project. Import the projects into your workspace and start the ofline-swt-client-dev.product.

Hope that helps.
Claudio
Re: Standalone Client Application [message #715240 is a reply to message #713979] Fri, 12 August 2011 17:27 Go to previous messageGo to next message
Pietro Bonanno is currently offline Pietro Bonanno
Messages: 12
Registered: July 2009
Junior Member
Claudio,
thanks to your demo project (I did't know about product extending...), I finally got an offline application! I'm starting to love Scout Smile
Thanks for your help
Re: Standalone Client Application [message #715681 is a reply to message #715240] Mon, 15 August 2011 03:33 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio Guglielmo
Messages: 98
Registered: March 2010
Member
Good to hear!
Let us know if you have any other problems.
Re: Standalone Client Application [message #1008959 is a reply to message #683260] Thu, 14 February 2013 03:09 Go to previous message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 259
Registered: October 2011
Senior Member
Claudio Guglielmo wrote on Mon, 13 June 2011 13:34

If this is not sufficient and you need to use ICodeService you could either create a dependency from your client plugin to scout-server plugin which makes it necessary to start this plugin and its dependent plugins too. Or you could copy the CodeService class of the server plugin into your client plugin (with CodeTypeCache and CodeTypeStore) and register this one with a higher priority than the default service (CodeServiceClientProxy). Now you should be able to use the ICodeService as normal.


Sandro just published a possible implementation for a CodeService that works on client side (no caching, no partition): LocalCodeService
Previous Topic:Scout 3.9.0 M5 displays "bundle order prefix" warning
Next Topic:Swing discrepancies when using Rayo
Goto Forum:
  


Current Time: Sun May 19 10:02:02 EDT 2013

Powered by FUDForum. Page generated in 0.02074 seconds