Commit 0e424ea8 authored by Marc Dutoo's avatar Marc Dutoo

studio : patched #106 Constants not supported in Java interface of BasicService template

still wider TODO  #107 Improve Template parameter escaping 
parent afdc12d1
......@@ -59,6 +59,10 @@ public class TemplateRestImpl implements TemplateRest {
return this.compositeTemplates.getForm(templateName);
}
// TODO #FRASCATI-107 bad escaping :
// manually encode / decode each param on both sides,
// or on server-side let FraSCAti do the escaping by rather passing a Map-like argument,
// or on client side find a more automated way (implementation.widget, see helloworld-widget example ?)
@Override
public String createApplication(String params) {
try {
......@@ -66,8 +70,8 @@ public class TemplateRestImpl implements TemplateRest {
String[] paramsArray = params.split("&");
Map<String, Object> map = new HashMap<String, Object>();
for (String param : paramsArray) {
String[] paramArray = param.split("=");
if(paramArray.length > 1){
int equalsIndex = param.indexOf('='); // patch for #FRASCATI-106
if(equalsIndex > 0){
// TODO : problem when working with WSDL form nuxeo, the nuxeo URL is used in the generated composite
// App is successfully created but cannot be deployed
// How to use the "soap:address"(eg:location="http://168.192.0.28/WS/ContactSvc.asmx) in the wsdl instead of the
......@@ -76,18 +80,20 @@ public class TemplateRestImpl implements TemplateRest {
// Many solutions, depends on the case
// - for proxyws : use the service endpoint registered in the wsdl
// - for mock : use the provided endpoint
map.put(paramArray[0], paramArray[1]);
String paramName = param.substring(0, equalsIndex);
String paramValue = param.substring(equalsIndex + 1);
map.put(paramName, paramValue);
}
}
// Replace the WSDL URL by the endpoint url
// TODO : Add a test to know when the url must be replaced by the endpoint URL or by user provided URL
// TODO : activate the generic webResourceDownloadService and test with online services
//if(){
if (map.get("url") != null) {
map.put("wsdlLocation", map.get("url"));
WsdlInformations wsdlInformations = codeGenerator.loadWsdl((String)map.get("url"));
map.put("url", wsdlInformations.getEndpointUrls().get(map.get("servicePort")) + "?wsdl");
//}
} // else no url : ex. BasicService template
User user = users.searchUser((String) map.get("user"));
return serviceManager.createApplication(user, (String) map.get("name"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment