Jump to: navigation, search

Scout/HowTo/3.9/Create a minimal Standalone Client

< Scout‎ | HowTo‎ | 3.9
Revision as of 08:10, 19 November 2013 by Matthias.zimmermann.bsiag.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Scout
Wiki Home
Website
DownloadGit
Community
ForumsBlogTwitter
Bugzilla
Bugzilla


A common Scout application typically consists of a client part (front end) and a server part (back end). But what if you just need a minimal client application? This How-to guides you through the necessary steps to get there. At the end you will have a client-only "Hello World!" application.


Initial Project Setup

Before you proceed, go through the standard client server Scout "Hello World!" tutorial.

Update the ClientSession and remove the Bookmarks menu

In the Scout Explorer, double click the ClientSession node and in method execLoadSession remove the setting up of to the service tunnel and the fetching of the code types. The resulting method will then be:

  @Override
  public void execLoadSession() throws ProcessingException {
    setDesktop(new Desktop());
  }

The next step is to remove the bookmarks menu entry. For this navigate in the Scout Explorer to the orange client node and expand the Desktop node under it. Then, expand the Menus folder and delete the BookmarkMenu menu entry using the context menu Delete ....

Move the DesktopService from the Server to the Client

First, remove the DesktopService from the Scout server plugin. For this, expand the blue server node and the underlying folder Services and select the contextmenu Delete ... on the entry DesktopService. In the proposal box deselect the item IDesktopService in the shared plugin of the application and click Ok.

Now switch to orange client node. There, use the context menu New Client Service ... on folder Services. In the new service wizard, enter DesktopService into the field Class Name and click Next. In the second wizard step, deselect the element IDesktopService under the orange client node (from before, we already have the IDesktopService in the shared plugin of our application).

After the client service creation double click on the DesktopService to open its implementation in the Java editor. There, change the implementation statement from IService to IDesktopService This will mark the class name DesktopService with an error marker. From the proposed fixes choose add unimplemented methods to add the load method which you can update back to what you had from the hello world tutorial to

  @Override
  public DesktopFormData load(DesktopFormData formData) {
    formData.getMessage().setValue("Hello World!");
    return formData;
  }

To clean up the moving of the desktop service, remove the proxy registration of the original server desktop service from the client's plugin.xml. For this, switch to the package explorer, expand the plugin project org.eclipsescout.helloworld.client and double click on the plugin.xml element. In the opened plugin editor, switch to the tab plugin.xml and remove the proxy service registration element. You will then end up with the following content of the client's plugin.xml file:

  <?xml version="1.0" encoding="UTF-8"?>
  <plugin>
     <extension
           name=""
           point="org.eclipse.scout.service.services">
        <service
              factory="org.eclipse.scout.rt.client.services.ClientServiceFactory"
              class="org.eclipsesccout.standalone.helloworld.client.services.DesktopService"
              session="org.eclipsesccout.standalone.helloworld.client.ClientSession">
        </service>
     </extension>
  </plugin>

Remove the Server

In the package explorer view, select the org.eclipsescout.helloworld.server node and delete it.

Run the standalone Client

Switch back to the Scout Explorer view and select the top level element org.eclipsescout.helloworld. In the Product Launchers section of the Scout Object Property view only the launcher boxes for the different clients are now shown. These launchers can now be used to start your standalone client.

Additional Notes

If you need additonal Scout features including code type services, database access, etc. you probably want to consider the approach described in the How-to for a Standalone Client with DB Access.