Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Standalone Client Application(Using Eclipse Scout without the Server)
icon5.gif  Standalone Client Application [message #674104] Wed, 25 May 2011 20:38 Go to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 124
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 09:28]

Report message to a moderator

Re: Standalone Client Application [message #674646 is a reply to message #674104] Fri, 27 May 2011 17:25 Go to previous messageGo to next message
Eclipse UserFriend
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 21:27 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 124
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 11:34 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
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 18:44 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 124
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 13:21 Go to previous messageGo to next message
Pietro Bonanno is currently offline Pietro BonannoFriend
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 14:04 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
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 11:03 Go to previous messageGo to next message
Pietro Bonanno is currently offline Pietro BonannoFriend
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 14:06 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
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 21:27 Go to previous messageGo to next message
Pietro Bonanno is currently offline Pietro BonannoFriend
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 07:33 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
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 08:09 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
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

Edit: update the broken link.

[Updated on: Tue, 16 September 2014 08:23]

Report message to a moderator

icon6.gif  Re: Standalone Client Application [message #1111619 is a reply to message #1008959] Wed, 18 September 2013 13:17 Go to previous messageGo to next message
Chris Monty is currently offline Chris MontyFriend
Messages: 26
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 15:23 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
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.
Re: Standalone Client Application [message #1424661 is a reply to message #1008959] Tue, 16 September 2014 08:35 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Jeremie Bresson wrote on Thu, 14 February 2013 09:09

Sandro just published a possible implementation for a CodeService that works on client side (no caching, no partition): LocalCodeService


Proposition to have something like this in the framework: Bug 444213. I do not think that LocalCodeService is a good name.
Re: Standalone Client Application [message #1428299 is a reply to message #1111686] Sun, 21 September 2014 16:11 Go to previous messageGo to next message
nat Gross is currently offline nat GrossFriend
Messages: 10
Registered: July 2009
Junior Member
Jeremie Bresson wrote on Wed, 18 September 2013 11:23
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.


[I just finished and deployed mini-crm and am impressed! but..]
How does one run a smartphone app with a server? What do I need to do to get my complete minicrm app running on Android? (As said I have it running on Windows a-ok via the downloaded zip file[neat idea!].)
Also, is the dev server Scout uses in the ide, Tomcat?
Thanks,
nat
Re: Standalone Client Application [message #1428509 is a reply to message #1428299] Mon, 22 September 2014 00:24 Go to previous message
nat Gross is currently offline nat GrossFriend
Messages: 10
Registered: July 2009
Junior Member
Ok. By now I have read main portions of the ebook:)
It seems to me that in order to have a decent mobile app, the rap server should be deployed on a scaled cloud service. I understand that this is still work in progress. Can you please add Openshift (JBoss) cloud service to the list of supported services? The JBoss IDE allows me to automatically deploy JEE apps to Openshift. Also, Openshift is FREE:)
So, it would be nice to have a Scout wizard: deploy [Rap] to Openshift. (The JBoss Studio ide is open source, and you can basically use their pkg's for all that plumbing.)
Anyhow, keep up the good work.
nat
Previous Topic:Note to the "Scout/Tutorial/4.0/Minicrm/Add a form to edit the data"
Next Topic:Programmatically open the date picker's calendar popup
Goto Forum:
  


Current Time: Fri Mar 29 13:27:01 GMT 2024

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

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

Back to the top