35 lines
947 B
Java
35 lines
947 B
Java
|
package org.gcube.portlets.widgets.ckan2zenodopublisher.server;
|
||
|
|
||
|
import org.gcube.portlets.widgets.ckan2zenodopublisher.client.CkanToZenodoPublisherService;
|
||
|
|
||
|
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||
|
|
||
|
/**
|
||
|
* The server side implementation of the RPC service.
|
||
|
*/
|
||
|
@SuppressWarnings("serial")
|
||
|
public class CkanToZenodoPublisherServiceImpl extends RemoteServiceServlet implements
|
||
|
CkanToZenodoPublisherService {
|
||
|
|
||
|
public String greetServer(String input) throws IllegalArgumentException {
|
||
|
|
||
|
|
||
|
return "Hello";
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Escape an html string. Escaping data received from the client helps to
|
||
|
* prevent cross-site script vulnerabilities.
|
||
|
*
|
||
|
* @param html the html string to escape
|
||
|
* @return the escaped string
|
||
|
*/
|
||
|
private String escapeHtml(String html) {
|
||
|
if (html == null) {
|
||
|
return null;
|
||
|
}
|
||
|
return html.replaceAll("&", "&").replaceAll("<", "<").replaceAll(
|
||
|
">", ">");
|
||
|
}
|
||
|
}
|