removed gwt-query dependency
fixed bug: enconding on common names git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/speciesdiscovery@85149 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3e32649fca
commit
60a946f709
|
@ -40,6 +40,7 @@ import com.google.gwt.user.client.ui.AbstractImagePrototype;
|
||||||
import com.google.gwt.user.client.ui.Anchor;
|
import com.google.gwt.user.client.ui.Anchor;
|
||||||
import com.google.gwt.user.client.ui.Image;
|
import com.google.gwt.user.client.ui.Image;
|
||||||
|
|
||||||
|
|
||||||
public class ResultRowDetailsFiller implements DetailsFiller {
|
public class ResultRowDetailsFiller implements DetailsFiller {
|
||||||
|
|
||||||
|
|
||||||
|
@ -296,56 +297,95 @@ public class ResultRowDetailsFiller implements DetailsFiller {
|
||||||
lcRRTables.add(loading);
|
lcRRTables.add(loading);
|
||||||
|
|
||||||
String urlRequest = GWT.getModuleBaseURL() + ConstantsSpeciesDiscovery.RESULT_ROW_TABLE + "?" +"oid=" + arrayRowID.get(i);
|
String urlRequest = GWT.getModuleBaseURL() + ConstantsSpeciesDiscovery.RESULT_ROW_TABLE + "?" +"oid=" + arrayRowID.get(i);
|
||||||
|
|
||||||
RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, urlRequest);
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
requestBuilder.sendRequest("", new RequestCallback() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResponseReceived(Request request, Response response) {
|
|
||||||
|
|
||||||
// int status = response.getStatusCode();
|
|
||||||
// System.out.println("status: "+status);
|
// Frame frame = new Frame(urlRequest);
|
||||||
lcRRTables.remove(loading);
|
//
|
||||||
// lcRRTables.setLayout(new FitLayout());
|
// frame.addDomHandler(new LoadHandler() {
|
||||||
Html respHtml = new Html(response.getText());
|
|
||||||
// respHtml.setId("respHtml"+respHtml.getId());
|
|
||||||
// respHtml.setStyleAttribute("width", "99%");
|
|
||||||
// System.out.println("response text is: "+response.getText());
|
|
||||||
lcRRTables.add(respHtml);
|
|
||||||
lcRRTables.layout();
|
|
||||||
// panelDetails.layout();
|
|
||||||
// if(status==200){
|
|
||||||
// lcRRTables.add(new Html(response.getText()));
|
|
||||||
// }else{ //OK STATUS
|
|
||||||
//
|
//
|
||||||
// }
|
// @Override
|
||||||
}
|
// public void onLoad(LoadEvent event) {
|
||||||
|
// lcRRTables.remove(loading);
|
||||||
@Override
|
// lcRRTables.layout();
|
||||||
public void onError(Request request, Throwable exception) {
|
//
|
||||||
lcRRTables.remove(loading);
|
// }
|
||||||
lcRRTables.add(new Html("Sorry, an error occurred while contacting server, try again"));
|
//
|
||||||
}
|
// }, LoadEvent.getType());
|
||||||
});
|
//
|
||||||
|
// lcRRTables.add(frame);
|
||||||
|
|
||||||
|
|
||||||
|
RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, urlRequest);
|
||||||
|
|
||||||
} catch (RequestException e) {
|
try {
|
||||||
lcRRTables.remove(loading);
|
|
||||||
lcRRTables.add(new Html("Sorry, an error occurred while contacting server, try again"));
|
requestBuilder.sendRequest("", new RequestCallback() {
|
||||||
}
|
|
||||||
|
@Override
|
||||||
|
public void onResponseReceived(Request request, Response response) {
|
||||||
|
|
||||||
|
lcRRTables.remove(loading);
|
||||||
|
|
||||||
|
/*
|
||||||
|
String bodyString = "<BODY>";
|
||||||
|
int start = response.getText().indexOf(bodyString)+bodyString.length();
|
||||||
|
int end = response.getText().indexOf("</BODY>");
|
||||||
|
|
||||||
|
// System.out.println("start "+start);
|
||||||
|
// System.out.println("end "+end);
|
||||||
|
|
||||||
|
String text="";
|
||||||
|
|
||||||
|
if(start<end){
|
||||||
|
text = response.getText().substring(start, end);
|
||||||
|
}else
|
||||||
|
text = "Sorry, an error occurred on retrieving item";
|
||||||
|
|
||||||
|
// System.out.println("text "+text);*/
|
||||||
|
|
||||||
|
Html respHtml = new Html(response.getText());
|
||||||
|
|
||||||
|
lcRRTables.add(respHtml);
|
||||||
|
lcRRTables.layout();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Request request, Throwable exception) {
|
||||||
|
lcRRTables.remove(loading);
|
||||||
|
lcRRTables.add(new Html("Sorry, an error occurred while contacting server, try again"));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch (RequestException e) {
|
||||||
|
lcRRTables.remove(loading);
|
||||||
|
lcRRTables.add(new Html("Sorry, an error occurred while contacting server, try again"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// panelDetails.add(lcRRTables);
|
||||||
|
|
||||||
// panelDetails.add(lcRRTables);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// panelDetails.layout(true);
|
// panelDetails.layout(true);
|
||||||
|
|
||||||
panelDetails.layout();
|
panelDetails.layout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// public static native NodeList<Node> getBodyElement(String htmlResponse) /*-{
|
||||||
|
// var el = document.createElement('div');
|
||||||
|
// el.innerHTML = htmlResponse;
|
||||||
|
// alert(el.toString());
|
||||||
|
// return el.getElementsByTagName('BODY');
|
||||||
|
//
|
||||||
|
// }-*/;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getLastlistDataSourceFound() {
|
public List<String> getLastlistDataSourceFound() {
|
||||||
return lastlistDataSourceFound;
|
return lastlistDataSourceFound;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.portlets.user.speciesdiscovery.server;
|
package org.gcube.portlets.user.speciesdiscovery.server;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -47,6 +48,21 @@ public class ResultRowTable extends HttpServlet {
|
||||||
|
|
||||||
protected Logger logger = Logger.getLogger(ResultRowTable.class);
|
protected Logger logger = Logger.getLogger(ResultRowTable.class);
|
||||||
|
|
||||||
|
public static final String DOCTYPE = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">";
|
||||||
|
public static final String HTML = "<HTML>";
|
||||||
|
public static final String HTMLCLOSE = "</HTML>";
|
||||||
|
public static final String HEAD = "<HEAD>";
|
||||||
|
public static final String HEADCLOSE = "</HEAD>";
|
||||||
|
public static final String TITLE = "<TITLE>";
|
||||||
|
public static final String TITLECLOSE = "</TITLE>";
|
||||||
|
public static final String BODY = "<BODY>";
|
||||||
|
public static final String BODYCLOSE = "</BODY>";
|
||||||
|
|
||||||
|
public static String headWithTitle(String title) {
|
||||||
|
// return (DOCTYPE + "\n" + HTML+"\n<link type=\"text/css\" rel=\"stylesheet\" href=\"SpeciesDiscovery.css\">" + HEAD+TITLE + title + TITLECLOSE+HEADCLOSE+"\n");
|
||||||
|
return (DOCTYPE + "\n" + HTML+ "\n"+HEAD + "\n"+TITLE + title + TITLECLOSE+"\n"+HEADCLOSE+"\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
protected ASLSession getASLSession(HttpServletRequest req)
|
protected ASLSession getASLSession(HttpServletRequest req)
|
||||||
{
|
{
|
||||||
|
@ -60,11 +76,15 @@ public class ResultRowTable extends HttpServlet {
|
||||||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||||
|
|
||||||
String resultServiceRowID = "";
|
String resultServiceRowID = "";
|
||||||
PrintWriter out = resp.getWriter();
|
resp.setContentType(TEXT_HTML);
|
||||||
|
// PrintWriter out = resp.getWriter();
|
||||||
resp.setContentType(TEXT_HTML);
|
PrintWriter out = new PrintWriter(new OutputStreamWriter(resp.getOutputStream(), UTF_8), true);
|
||||||
resp.setCharacterEncoding(UTF_8);
|
|
||||||
|
|
||||||
|
// resp.setCharacterEncoding(UTF_8);
|
||||||
|
|
||||||
|
|
||||||
|
out.println(headWithTitle(""));
|
||||||
|
out.println(BODY);
|
||||||
try {
|
try {
|
||||||
// get parameters
|
// get parameters
|
||||||
resultServiceRowID = req.getParameter("oid");
|
resultServiceRowID = req.getParameter("oid");
|
||||||
|
@ -113,13 +133,15 @@ public class ResultRowTable extends HttpServlet {
|
||||||
logger.trace("table for ResultRowPersistence is empty "+table.isEmpty());
|
logger.trace("table for ResultRowPersistence is empty "+table.isEmpty());
|
||||||
out.println(table);
|
out.println(table);
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
logger.error("Error in ResultRowTable servlet ",e);
|
logger.error("Error in ResultRowTable servlet ",e);
|
||||||
throw new Exception("Error in ResultRowTable servlet ", e);
|
throw new Exception("Error in ResultRowTable servlet ", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
out.println(BODYCLOSE);
|
||||||
|
out.println(HTMLCLOSE);
|
||||||
out.close(); //CLOSE STREAM
|
out.close(); //CLOSE STREAM
|
||||||
|
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
|
@ -131,7 +153,8 @@ public class ResultRowTable extends HttpServlet {
|
||||||
// throw new ServletException(error);
|
// throw new ServletException(error);
|
||||||
|
|
||||||
// logger.error(error, e);
|
// logger.error(error, e);
|
||||||
|
out.println(BODYCLOSE);
|
||||||
|
out.println(HTMLCLOSE);
|
||||||
out.close(); //CLOSE STREAM
|
out.close(); //CLOSE STREAM
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.portlets.user.speciesdiscovery.server;
|
package org.gcube.portlets.user.speciesdiscovery.server;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStreamWriter;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -56,6 +57,22 @@ public class TaxonomyRowTable extends HttpServlet {
|
||||||
*/
|
*/
|
||||||
public static final String TEXT_HTML = "text/html; charset=UTF-8";
|
public static final String TEXT_HTML = "text/html; charset=UTF-8";
|
||||||
|
|
||||||
|
public static final String DOCTYPE = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">";
|
||||||
|
public static final String HTML = "<HTML>";
|
||||||
|
public static final String HTMLCLOSE = "</HTML>";
|
||||||
|
public static final String HEAD = "<HEAD>";
|
||||||
|
public static final String HEADCLOSE = "</HEAD>";
|
||||||
|
public static final String TITLE = "<TITLE>";
|
||||||
|
public static final String TITLECLOSE = "</TITLE>";
|
||||||
|
public static final String BODY = "<BODY>";
|
||||||
|
public static final String BODYCLOSE = "</BODY>";
|
||||||
|
|
||||||
|
public static String headWithTitle(String title) {
|
||||||
|
// return (DOCTYPE + "\n" + HTML+"\n<link type=\"text/css\" rel=\"stylesheet\" href=\"SpeciesDiscovery.css\">" + HEAD+TITLE + title + TITLECLOSE+HEADCLOSE+"\n");
|
||||||
|
return (DOCTYPE + "\n" + HTML+ "\n"+HEAD + "\n"+TITLE + title + TITLECLOSE+"\n"+HEADCLOSE+"\n");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected Logger logger = Logger.getLogger(TaxonomyRowTable.class);
|
protected Logger logger = Logger.getLogger(TaxonomyRowTable.class);
|
||||||
|
|
||||||
|
@ -88,14 +105,16 @@ public class TaxonomyRowTable extends HttpServlet {
|
||||||
private void retrieveTaxonomyRowAsHtmlTable(HttpServletRequest req, HttpServletResponse resp) {
|
private void retrieveTaxonomyRowAsHtmlTable(HttpServletRequest req, HttpServletResponse resp) {
|
||||||
|
|
||||||
String taxonomyServiceRowID = "";
|
String taxonomyServiceRowID = "";
|
||||||
|
// resp.setCharacterEncoding(UTF_8);
|
||||||
resp.setContentType(TEXT_HTML);
|
resp.setContentType(TEXT_HTML);
|
||||||
resp.setCharacterEncoding(UTF_8);
|
|
||||||
|
|
||||||
TaxonomyRow row = null;
|
TaxonomyRow row = null;
|
||||||
PrintWriter out = null;
|
PrintWriter out = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
out = resp.getWriter();
|
out = new PrintWriter(new OutputStreamWriter(resp.getOutputStream(), UTF_8), true);
|
||||||
|
out.println(headWithTitle(""));
|
||||||
|
out.println(BODY);
|
||||||
// get parameters
|
// get parameters
|
||||||
taxonomyServiceRowID = req.getParameter("oid");
|
taxonomyServiceRowID = req.getParameter("oid");
|
||||||
|
|
||||||
|
@ -191,7 +210,8 @@ public class TaxonomyRowTable extends HttpServlet {
|
||||||
throw new Exception("Error in ResultRowTable servlet ", e);
|
throw new Exception("Error in ResultRowTable servlet ", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
out.println(BODYCLOSE);
|
||||||
|
out.println(HTMLCLOSE);
|
||||||
out.close(); //CLOSE STREAM
|
out.close(); //CLOSE STREAM
|
||||||
|
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
|
@ -205,6 +225,8 @@ public class TaxonomyRowTable extends HttpServlet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out.println(error);
|
out.println(error);
|
||||||
|
out.println(BODYCLOSE);
|
||||||
|
out.println(HTMLCLOSE);
|
||||||
out.close(); //CLOSE STREAM
|
out.close(); //CLOSE STREAM
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
<set-property name="log_DivLogger" value="DISABLED" />
|
<set-property name="log_DivLogger" value="DISABLED" />
|
||||||
|
|
||||||
<inherits name='org.gcube.portlets.widgets.lighttree.WorkspacePortletLightTree' />
|
<inherits name='org.gcube.portlets.widgets.lighttree.WorkspacePortletLightTree' />
|
||||||
<!-- <inherits name='com.google.gwt.query.Query' /> -->
|
|
||||||
|
<!-- <inherits name='com.google.gwt.query.Query'/> -->
|
||||||
|
|
||||||
<!-- Specify the app entry point class. -->
|
<!-- Specify the app entry point class. -->
|
||||||
<entry-point
|
<entry-point class='org.gcube.portlets.user.speciesdiscovery.client.SpeciesDiscovery' />
|
||||||
class='org.gcube.portlets.user.speciesdiscovery.client.SpeciesDiscovery' />
|
|
||||||
|
|
||||||
<!-- Specify the paths for translatable code -->
|
<!-- Specify the paths for translatable code -->
|
||||||
<source path='client' />
|
<source path='client' />
|
||||||
|
|
Reference in New Issue