| Summary: | Changing the function name in an interface is not considered a structural change | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Zhi Zhu <zhuzhi> | ||||||
| Component: | EDT | Assignee: | Paul Harmon <pharmon> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | cdlwuxin, chenzhh, jqian, jvincens, smythew, svihovec | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 207460 [details]
PI
is this a deployment issue? I used the latest build 0.7.0.v201111240901-17D-7zHW3Jmz-AgOXOQAhuz-bajw
I opened the html page in firebug so I could see the url.
Here's what was sent for XML:
{"uri":"http:\/\/ws.geonames.org\/search?q=BeiJing&maxRows=20&username=demo","headers":{"content-type":"text\/html;
charset=UTF-8"},"body":null,"method":1}
Here's what is sent for JSON:
{"uri":"http:\/\/ws.geonames.org\/searchJSON?q=BeiJing&maxRows=10&username=demo","headers":{"content-type":"text\/html;
charset=UTF-8"},"body":null,"method":1}
both include maxRows=x0&username=demo
Also if I look at the deployed JS I see
egl.eglx.http.HttpMethod._GET, uri : "http://ws.geonames.org/search?q=" +
egl.eglx.http.HttpLib.convertToURLEncoded(egl.checkNull(this.queryStringField).getText())
+ "&maxRows=20&username=demo"
......
egl.eglx.http.HttpMethod._GET, uri : "http://ws.geonames.org/searchJSON?q=" +
egl.eglx.http.HttpLib.convertToURLEncoded(egl.checkNull(this.queryStringField).getText())
+ "&maxRows=10&username=demo"
.....
Which shows both URLs have the suffix.
I've seen cases where the browser caches the html and js files and I have to
close the browser to refresh it to the newly deployed application.
or is it possible you didn't redeploy after making the change or didn't restart
the server?
If you continue to see the problem please attach your war file so I can deploy
it and reproduce the problem.
As Joe mentioned this problem is likely related to some cache.
You can easily re-produce it, I will take the attached project as an example:
1. In IGeoName.egl, define function:
function search(query string in) returns(GeoNamesData)
{@GetRest {uriTemplate="http://ws.geonames.org/search?q={query}&maxRows=20&username=demo", responseFormat=XML}};
2. Generate target project GeoNamesTest, and deploy project GeoNames to GeoNamesTest, GeoNamesTest/WebContent/handlers/GeoName.js, check this file's
"invokeService" function, it contains the segment:
{ method : egl.eglx.http.HttpMethod._GET, uri : "http://ws.geonames.org/search?q=" + egl.eglx.http.HttpLib.convertToURLEncoded(egl.checkNull(this.queryStringField).getText()) + "&maxRows=20&username=demo"
And some information is generated based on IGeoName's function definition.
3.Change function definition in IGeoName.egl
function search(query string in) returns(GeoNamesData)
{@GetRest {uriTemplate="http://ws.geonames.org/search?q={query}&maxRows=20", responseFormat=XML}};
4. Re-deploy the project
5. Check "invokeService" from GeoNamesTest/WebContent/handlers/GeoName.js, one can see:
{ method : egl.eglx.http.HttpMethod._GET, uri : "http://ws.geonames.org/search?q=" + egl.eglx.http.HttpLib.convertToURLEncoded(egl.checkNull(this.queryStringField).getText()) + "&maxRows=20&username=demo"
is not changed:
should changed to:
{ method : egl.eglx.http.HttpMethod._GET, uri : "http://ws.geonames.org/search?q=" + egl.eglx.http.HttpLib.convertToURLEncoded(egl.checkNull(this.queryStringField).getText()) + "&maxRows=20"
and "&username=demo" is not needed here.
If you update GeoName.egl(handler) and IGeoName.egl(interface) simultaneously, and deploy the project, all generated files will be updated accordingly Regarding the changes in comment 4, if you restart the server, is the problem resolved? If restarting the server does not resolve the issue, can the issue be resolved by removing and then adding the project back to the server? The problem seemed to be: when uriTemplate in IGeoName was modified. The RUI Handler GeoName was not regenerated to get the new uriTemplate. Do a clean, or modify GeoName to make it re-generated will resolve the issue. In RBD, when interface changes, the RUI Handler gets regenerated. But this function is not in EDT. I think we should close this bug and open an enhancement. I changed the title to better reflect this issue, which is a defect and not an enhancement. I also changed the ownership to Paul Harmon and the component to Compiler. We can leave this as P1 for now and we will discuss this in the US on Monday. I encounter some similar problems. When you are developing a database app, and modified your Entity Record, the programs & services using that record do not regenerate and still uses the old annotation information. You'll have to 'touch' it to force a regen to pickup the changes in the record. Deferring until Future. The change is too risky to make at this point in time. The problem is that the code that "calculates" if a part is structurally changed does not take into account the annotations. Therefore, adding/changing/removing annotations is not considered a structural change. I am attaching a patch that fixes this problem Created attachment 207620 [details]
patch
I have committed the change to TypeUtils verify and close it |
1 Define an interface for calling third-part service which contains a function: function search(query string in) returns(GeoNamesData) {@GetRest {uriTemplate="http://ws.geonames.org/search?q={query}&maxRows=20&username=demo", responseFormat=XML}}; 2 When you deploy the app and the URL for calling third-party service like this: http://ws.geonames.org/search?q=London does not include the parameter "maxRows=20&username=demo" for reproducing it, please see attached project