|
Re: Standalone Client Application [message #674646 is a reply to message #674104] |
Fri, 27 May 2011 17:25 |
Eclipse User |
|
|
|
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 #683260 is a reply to message #675240] |
Mon, 13 June 2011 11:34 |
|
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 #712617 is a reply to message #709069] |
Sun, 07 August 2011 14:04 |
|
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 #713979 is a reply to message #713907] |
Tue, 09 August 2011 14:06 |
|
Hi Pietro
You need to extend the product (*swt-client-dev.product). There is no need to modify the dependencies of the client plugin.
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 #1008959 is a reply to message #683260] |
Thu, 14 February 2013 08:09 |
Jeremie Bresson 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
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04561 seconds