-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GEOS-11390] Replace TestWfsPost with Javascript Demo Page #7672
Conversation
@davidblasby I really like the consistent action button names + workflow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor feedback (missing header). When folks are happy with button names we can update the docs and get this moving.
I would appreciate squash and merge (or interactive rebase) to collapse this to a single commit for backport.
Excellent work David.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy with the consistent button naming, thank you.
Additional non blocking feedback from me:
- Clicking Show Result, the Response Body spills over the right edge of the bolded Response Body panel, instead of wrapping.
-
The (red) Busy spinner icon is not the expected green/black busy standard icon of other GeoServer pages, nor is it in the top right corner, where I expected it to be.
-
DemoRequests > Show Result in New Page does not open in a new tab, as expected, but rather in the current tab. Control/Shift clicking does not change this.
// ====================================================== | ||
// https://www.npmjs.com/package/prettify-xml | ||
// | ||
// The MIT License (MIT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an MIT License right in the middle of the javascript, is that intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - there's MIT code in the JS. Thats the "xml pretty print" code.
I can move it to its own file??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could move it to the top of the file, we have an example for GeoTools here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strong recommendation to remove the black boxes around the headers and responses, they are alien to the GeoServer UI, can make the output harder to read.
Instead, use horizontal line separators like in the rest of the GUI (same appearance),
they would fit better and not interfere with the output.
In addition, just thinking out loud, is the XML pretty printer able to wrap text at a certain amount of columns? Geometries may otherwise be represented as a very very very long line.
The two other builders look good, but one button label is misleading in both the WCS and WPS pages:
There is no such thing as a "Demo Request Builder", had it been a "builder" we would have had no need for the WCS/WPS one. Just say "Get Coverage in Demo requests" and "Execute in Demo requests" instead.
Finally, as @jodygarnett always reminds me, documentation should be updated any time we touch the GUI.
These pages have been affected by the change, screenshots should be re-made, and descriptive text updated accordingly:
</div> | ||
<div style="display:flex; flex-direction: row"> | ||
<div class="button-group selfclear"> | ||
<a onclick="document.getElementById('openNewWindow').checked = false; submitRequest()" ><wicket:message key="submit">Submit</wicket:message></a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe @sikeoka won't be happy about more inline javascript, he's been doing a number of PRs to avoid having it, so that CSP headers can be enabled (which will in turn lead to better protection against XSS attacks).
Just one example for reference:
#7560
See open and closed PRs in this search for more context:
https://github.com/geoserver/geoserver/pulls?q=is%3Apr+author%3Asikeoka+is%3Aclosed+inline+javascript
<div wicket:id="requestBuilder"></div> | ||
<ul> | ||
<li class="button-group selfclear"> | ||
<button wicket:id="execute" type="submit"><wicket:message key="execute">execute</wicket:message></button> | ||
<button wicket:id="executeXML" type="submit"><wicket:message key="showXML">show xml</wicket:message></button> | ||
<!-- <button onclick="getCoverage()" type="submit"><wicket:message key="execute">execute</wicket:message></button>--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't leave commented out sections.
String js = ""; | ||
js += "function getCoverage() {\n"; | ||
js += " var url ='" + url + "';\n"; | ||
js += " var xml = document.getElementById(\"xml\").value;\n"; | ||
js += " var user ='';\n"; | ||
js += " var pass= '';\n"; | ||
js += " openInNewWindow(url,xml,user,pass);\n"; | ||
js += "}\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably going to be a problem, CSP wise, too.
Sorry I accidentally closed, was trying to take it out of draft and add a checklist |
workflow feedback addressed, but docs remain pending. I will review when docs are ready
I actually went back to the old Demo Requests - and the new one is very much an improvement. |
@@ -1 +1,68 @@ | |||
.. _wps_request_builder:WPS Request Builder===================The GeoServer WPS extension includes a request builder for testing out WPS processes through the :ref:`web_admin`. This tool can also be used to demonstrate processes, and construct your own examples.Accessing the request builder---------------------------------To access the WPS Request Builder:#. Navigate to the main :ref:`web_admin`.#. Click on the :guilabel:`Demos` link on the left side.#. Select :guilabel:`WPS Request Builder` from the list of demos... figure:: images/demospage.png :align: center *WPS request builder in the list of demos*Using the request builder-------------------------The WPS Request Builder primarily consists of a selection box listing all of the available processes, and two buttons, one to submit the WPS request, and another to display what the POST request looks like... figure:: images/requestbuilderblank.png :align: center *Blank WPS request builder form*The display changes depending on the process and input selected. JTS processes have available as inputs any of a GML/WKT-based feature collection, URL reference, or subprocess. GeoServer-specific processes have all these as options and also includes the ability to choose a GeoServer layer as input.For each process, a form will display based on the required and optional parameters associated with that process, if any... figure:: images/requestbuildertoppstates.png :align: center *WPS request builder form to determine the bounds of topp:states*To see the process as a POST request, click the :guilabel:`Generate XML from process inputs/outputs` button... figure:: images/requestbuilderrequest.png :align: center *Raw WPS POST request for the above process*To execute the process, click the :guilabel:`Execute Process` button. The response will be displayed in a window or.. figure:: images/requestbuilderresponse.png :align: center *WPS server response* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did this really have windows line formatting before? Wow ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding documentation and addressing feedback.
With documentation included I have marked this as "ready for review". I believe Andrea's changes have been addressed and this can now go ahead. |
@aaime if I understand correctly David is at the limits of what he can do with respect to inline javascript and forthcoming CSP restrictions in Wicket 9. Reading wicket 9 guidance the result is to restrict, but a setting can be defined per page to allow pages like this to function. Reference: |
I know @aaime I was just hunting down the link to #7154 to share with David who is not aware of that work. I was looking in that PR for examples and I mostly see him picking up inline styles. Since David is at the limits of his wicket ability we need an example. Update:
|
I actually don't care about inline JavaScript in Wicket pages. Wicket 9 has its own complex and strict way of handling Content-Security-Policy and my work just assumes that it will cover everything else in GeoServer while letting Wicket do its own thing. |
I see @sikeoka has now commented. Here was my research:
I do not know how to search just on the https://github.com/bradh/geoserver/tree/wicket8 branch. |
@sikeoka perhaps you could look at this PR; it would make us feel a lot better if someone with your wicket experience is comfortable with the change. |
Yes yes, my comment was meant to catch Steve's attention, not to raise a blocker. |
I will manually backport given the squash and merge approach for clean history. |
…#7672) * Remove Demo Request proxy server - TestWFSPost * update WCS request page to piggy back on top of DemoRequests page * handle WPS request builder * Remove demo request, fix test cases, add new test cases * Feeback from peter and andrea * fix QA warning * Add header * feedback from andrea * update documentation with new screenshots and functionality --------- Authored-by: david.blasby <david.blasby@geocat.net> # Conflicts: # src/wfs/src/main/java/org/vfny/geoserver/wfs/servlets/TestWfsPost.java # src/wfs/src/test/java/org/vfny/geoserver/wfs/servlets/TestWfsPostTest.java
…#7672) * Remove Demo Request proxy server - TestWFSPost * update WCS request page to piggy back on top of DemoRequests page * handle WPS request builder * Remove demo request, fix test cases, add new test cases * Feeback from peter and andrea * fix QA warning * Add header * feedback from andrea * update documentation with new screenshots and functionality --------- Authored-by: david.blasby <david.blasby@geocat.net> # Conflicts: # src/wfs/src/main/java/org/vfny/geoserver/wfs/servlets/TestWfsPost.java # src/wfs/src/test/java/org/vfny/geoserver/wfs/servlets/TestWfsPostTest.java
…#7672) * Remove Demo Request proxy server - TestWFSPost * update WCS request page to piggy back on top of DemoRequests page * handle WPS request builder * Remove demo request, fix test cases, add new test cases * Feeback from peter and andrea * fix QA warning * Add header * feedback from andrea * update documentation with new screenshots and functionality --------- Authored-by: david.blasby <david.blasby@geocat.net> # Conflicts: # src/wfs/src/main/java/org/vfny/geoserver/wfs/servlets/TestWfsPost.java # src/wfs/src/test/java/org/vfny/geoserver/wfs/servlets/TestWfsPostTest.java
* Remove Demo Request proxy server - TestWFSPost * update WCS request page to piggy back on top of DemoRequests page * handle WPS request builder * Remove demo request, fix test cases, add new test cases * Feeback from peter and andrea * fix QA warning * Add header * feedback from andrea * update documentation with new screenshots and functionality --------- Authored-by: david.blasby <david.blasby@geocat.net> # Conflicts: # src/wfs/src/main/java/org/vfny/geoserver/wfs/servlets/TestWfsPost.java # src/wfs/src/test/java/org/vfny/geoserver/wfs/servlets/TestWfsPostTest.java
* Remove Demo Request proxy server - TestWFSPost * update WCS request page to piggy back on top of DemoRequests page * handle WPS request builder * Remove demo request, fix test cases, add new test cases * Feeback from peter and andrea * fix QA warning * Add header * feedback from andrea * update documentation with new screenshots and functionality --------- Authored-by: david.blasby <david.blasby@geocat.net> # Conflicts: # src/wfs/src/main/java/org/vfny/geoserver/wfs/servlets/TestWfsPost.java # src/wfs/src/test/java/org/vfny/geoserver/wfs/servlets/TestWfsPostTest.java
} | ||
|
||
@Override | ||
public void renderHead(IHeaderResponse response) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-opening https://osgeo-org.atlassian.net/browse/GEOS-11390 due to missing call to super.render(response) here, required to ensure header contributions are included.
This PR removes the TestWfsPost servlet and replaces it with 100% javascript functionality (running on the browser).
SEE: demo-requests.js Line 211 to 277
Trying to incorporate andrea's and peter's feedback.
Demo Page:
WPS:
WCS:
Demo Requests:
Checklist
main
branch (backports managed later; ignore for branch specific issues).For core and extension modules:
[GEOS-XYZWV] Title of the Jira ticket
.