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: 117
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: 173
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: 117
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: 126
Registered: March 2010
Senior 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: 117
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: 13
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: 126
Registered: March 2010
Senior 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: 13
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: 126
Registered: March 2010
Senior 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: 13
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: 126
Registered: March 2010
Senior 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 messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 638
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
icon6.gif  Re: Standalone Client Application [message #1111619 is a reply to message #1008959] Wed, 18 September 2013 09:17 Go to previous messageGo to next message
Chris Monty is currently offline Chris Monty
Messages: 24
Registered: July 2013
Junior Member
I have a small, single-user application which doesn't require any login (it's basically a desktop app), and I was thinking about how awkward it would be to have to install Tomcat for it to run.

Needless to say, when I stumbled upon this thread and consequently, the tutorial, I tried it. It works. Right down to deployment.

Not bad, not bad.
Re: Standalone Client Application [message #1111686 is a reply to message #1111619] Wed, 18 September 2013 11:23 Go to previous message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 638
Registered: October 2011
Senior Member
Judith Gull just updated the tutorial.

Because standalone client application is not the primary our primary goal (the majority of applications are client/server) do not hesitate to report any findings in this domain.
Previous Topic:Modifying SWT look and feel for disabled elements
Next Topic:New project wizard doesn't create all assets
Goto Forum:
  


Current Time: Tue Jul 29 14:53:07 EDT 2014

Powered by FUDForum. Page generated in 0.03201 seconds