Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Scout/Tutorial/3.7/Advanced Minicrm

Configure the Database Development View

Add new Derby Connection

Open the Database Development perspective, right click on Database Connections and call the wizard for adding a new database connection by clicking on the context menu New....


Db 1.png

From the list of available connection profiles, choose Derby.


Db 2.png

Specify Driver Details

Open the driver deteail editor by clicking on the round icon to the right of the Drivers combobox.


Db 3.png

Choose the embedded derby driver for version 10.2.


Db 4.png

Go to the tab Jar List and there specify the location of the derby.jar. If you don't have any, download it (from the official derby website: http://db.apache.org/derby/, it's inside the zip file) or download the TutorialMiniCrmWorkspaceDerbyDB and click on ok to leave this page.


Db 5.png


Db 6.png


Db 7.png

Add the path to your DerbyDb along with the login data (for the minicrm: minicrm/minicrm).


Db 8.png

When you have entered all the required data, click on Test connection in order to test the connection details you just entered. If everything is fine there will be a message box Ping succeeded.


Db 9.png

Now you can browse through the DerbyDB, modify tables, data, run statements and much more. Please be aware that you cannot have more than one connection to your DerbyDb, therefore either you browse through it in the database development view or you access it using the minicrm, therefore you need to manually disconnect from the database before you can run your application.


Db 10.png


Db 11.png

Access Web Services with Scout Eclipse

Generate Web Service Classes

In Eclipse Scout in it is also pretty easy to access web services. We will use Bing as an example web service. See http://www.bing.com/developers/ for more information.
Go to the server node of your Scout Project, expand the tree until you see the node Axis Web Service Consumers and select New Webservice consumer from the context menu. Paste the following API key into the WSDL URL field http://api.search.live.net/search.wsdl?AppID=F1DFAE1859C73D8B105D99A78F0B027B62C64814 and click ok. An overview will pop-up which you acknowledge.

Consume the Web Service

In order to consume the web service add a new service operation to your StandardOutlineService with the following signature:
Object[][] getBingTableData(String query) throws ProcessingException

public Object[][] getBingTableData(String query) throws ProcessingException{
  String appId = "BE75364456DF97D980FFDC1420E46B941E7D01CB";
  LiveSearchServiceLocator soapClient = new LiveSearchServiceLocator();
  SearchRequest request = new SearchRequest();
  request.setAppId(appId);
  request.setQuery(query);
  SourceType[] sources = {SourceType.Web};
  request.setSources(sources);
  SearchResponse response;
  try{
    response = soapClient.getLiveSearchPort().search(new SearchRequestType1(request)).getParameters();
  } catch(Exception e){
    throw new ProcessingException(e.getMessage(), e);
  }
  WebResult[] result = response.getWeb().getResults();
  Object[][] data = new Object[result.length][3];
  for (int row=0; row < data.length; row++) {
    data[row][0] = result[row].getUrl();
    data[row][1] = result[row].getTitle();
    data[row][2] = result[row].getDescription();
  }
  return data;
}

Create the Client Table

Below your CompanyNodePage add a new BingTablePage, extending AbstractPageWithTable. In order to do that, you have to add a new variable to the CompanyNodePage containing the name of the company, which is used for calling the Bing-Service.

Copyright © Eclipse Foundation, Inc. All Rights Reserved.