Bug 703206
Summary: | When uploading bundle recipes don't display the uploaded results | ||||||
---|---|---|---|---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | Charles Crouch <ccrouch> | ||||
Component: | Provisioning | Assignee: | Nobody <nobody> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | high | ||||||
Version: | 4.0.0 | CC: | hrupp, mazz | ||||
Target Milestone: | --- | Keywords: | FutureFeature, Improvement | ||||
Target Release: | --- | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Enhancement | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | Type: | --- | |||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Charles Crouch
2011-05-09 16:22:19 UTC
Setting this to high priority because when using the tool there is no indication of what the workaround is (i.e. copy and paste from the file to the text area, instead of uploading the file) you just get an exception complaining about invalid xml. We have a FAQ entry but I'm not sure people''s first reaction is to go look in there. "The answer here is just not to display the xml after a file upload" That's not fully the solution because we don't store the XML anywhere on the server - all we do it turn right around and stream it back over the response so the client can populate it in the text field (in other words, this is a way for a user to "load the content" of a file that is local to the browser and show it in the browser. We just use the server and HTTP protocol as a intermediary or proxy to do this. What we can do is on the server, parse the XML and remove the <tag/> type tags and replace them with <tag></tag> type tags, if that's possible. Or we fix the browser code to not screw this up (I'm not sure where the problem was, but I do remember debugging this and discovering it was a problem that wasn't obvious in our code) The problem is not server side - using a tcp-tracer, I captured the HTTP response coming back after the recipe is uploaded and you'll see the XML comes back OK - this is the last portion of the HTTP response: -----------------------------2498200481989377645876380938 Content-Disposition: form-data; name="textFile"; filename="deploy.xml" Content-Type: text/xml <?xml version="1.0"?> <project name="small-bundle" default="main" xmlns:rhq="antlib:org.rhq.bundle"> <rhq:bundle name="Small Bundle" version="1.0" description="a small bundle with a small.properties file"> <rhq:deployment-unit name="jar"> <rhq:file name="small-v1.properties" destinationFile="small.properties" replace="false" /> </rhq:deployment-unit> </rhq:bundle> <target name="main"/> </project> -----------------------------2498200481989377645876380938-- That XML is identical to the XML that was sent up in the HTTP request, and that XML is valid. It appears once the data gets here: org.rhq.enterprise.gui.coregui.client.bundle.create.BundleUploadDistroFileStep.createRecipeForm().new DynamicFormHandler() {...}.onSubmitComplete(DynamicFormSubmitCompleteEvent) the XML is corrupted. Created attachment 499618 [details]
test bundle recipe
Note: it appears this is a problem only on SOME browsers, but not all.
See the attached recipe to test with. using that, I see the error in FireFox but NOT Chrome. It appears there is a bug in FF's parsing of the XML. I think it has to do with its JavaScript implementation of innerHTML.
(In reply to comment #2) > "The answer here is just not to display the xml after a file upload" > > That's not fully the solution because we don't store the XML anywhere on the > server - all we do it turn right around and stream it back over the response so > the client can populate it in the text field This is exactly the problem. We should not be relying on the browser to store the contents of the recipe file that was uploaded. Instead when the user chooses to upload a recipe file it should be stored on the server and not displayed to the user. The fact that the user can, as an alternative, paste in a recipe into the wizard should be completely unrelated to the uploading of a recipe file. I understand that this is not how the wizard is architected right now, and that this problem only occurs on certain browsers. So given that, and according to comment1 we have this issue doc'd in the FAQ, I'm pushing this out of JON3 and marking it as a future improvement |