0

GWT - PHP on Apache 3rd Review

Yesterday, on the GWT training session at PPK, Ilhamy (one of my internship student) told me he found another way to communicate GWT with PHP. Actually it's very simple solution without need to configure Apache.

In the solution, the project must located in /htdocs folder and compiler argument must be configured.

The original argument:

-remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl GWTPHP.html -logLevel INFO -codeServerPort 9997 -port 8888 -war C:\xampp\htdocs\GWTPHP\war com.vcari.jscadav2.Jscadav2_gwt

New configuration

-noserver -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl http://localhost/GwtPhp/war/GWTPHP.html -logLevel INFO -codeServerPort 9997 -war C:\xampp\htdocs\GWTPHP\war com.peyotest.gwtphp.GWTPHP


Steps :
  1. add -noserver 
  2. change startup url from GWTPHP.html to full url http://localhost/GwtPhp/war/GWTPHP.html
  3. remove server port  -codeServerPort 9997 
The full article about this can be found here:
http://cambiatablog.wordpress.com/2010/11/22/gwt-developing-with-hosted-mode-and-phpxampp/
0

GWT XMLRPC

On my previous work on XMLRPC, I had work with C# and PHP.
This morning I decide to try a library written for GWT.
The project can be found at:

http://code.google.com/p/xmlrpc-gwt/

Since there is no compiled .jar files, so I need create the .jar file myself.
Since I just used Eclipse for 2 weeks (before this using Netbeans + GWT4NB), it take me a long way just to create the .jar file. Actually to create .jar file is very simple step and require less than a minute.

Simply put the library inherits setting in the project.

<inherits name='com.fredhat.gwt.xmlrpc.XMLRPC'>

I just modify the sample given on the project's wiki and call the add function in my previous XMLRPC server sample.


XmlRpcClient client = new XmlRpcClient("http://127.0.0.1/xmlrpc/server.php");
String methodName = "add";
Object[] params = new Object[]{3, 4};
 
XmlRpcRequest<Integer> request = new XmlRpcRequest<Integer>(client, methodName, params, new AsyncCallback<Integer>() {
   public void onSuccess(Integer response) {
           // Handle integer response logic here
     Console.writeLine(response);
   }

   public void onFailure(Throwable response) {
           String failedMsg = response.getMessage();
           // Put other failed response handling logic here
           Console.writeLine(failedMsg);
   }
});
request.execute();


Done and it work just fine.
The .jar file can be found here.

GXT HighCharts

In my project, I had implement GXT chart. It works well on my system but my client wants to print the graph. Since the chart is in Flash, it can't be printed directly from the webpage. Actually I found an article to make it printable, but for it's not a good solution.

I found several project for JavaScript chart, but I to make it work with GWT & GXT is big problem for me.
Luckily, somebody has been working with Highchart (one of my candidate before) and give it a try.
I just follow the sample, and it works.

The project require jquery and highchart library.
After this I will found out whether it is work without jQuery since I can do AJAX query using GWT.

The project can found here: 
http://highcharts-gxt.sourceforge.net/wordpress/

Highchart
http://www.highcharts.com/

I'm going to replace the existing chart. Hopefully, there is no big issues arise.

 
Copyright © peyotest