Bug in MagicDrawThe MagicDraw Web Publisher 2.0 ?

Uploaded report templates and discussions about reports.

Moderators: sarawut_w, Moderators

Bug in MagicDrawThe MagicDraw Web Publisher 2.0 ?

Postby John S » Tue Aug 28, 2018 3:44 pm

Hi,

When we generate the HTML files using the MD web publisher 2.0 all features work fine except 2 of them:

- The search
- Top button "Select in containment tree"

It seems to be a bug in MD adding 2 slashes between index_files and xml as seen below:

http://web_server_address/index_files//xml/data.xml

That's a security risk and in the latest Apache or Spring framework this is not allowed and is blocked:

https://stackoverflow.com/questions/484 ... se-the-url

Please see steps below in [1] to reproduce this issue and let us know if you can release a patch or updated \plugins\com.nomagic.magicdraw.reportwizard to fix this issue?

Thanks,
Jonh

[1] Steps to reproduce:

Run the plugin \plugins\com.nomagic.magicdraw.reportwizard to generate the html files

Files on the file system => working fine
Click on the index.html of generated files, everything looks fine. You can search in the model or click the top level button (see attached picture) to get to the section in the model in the left pane

Files on a web server => Not working
Now put these files behind a web server (Apache or Spring framework)
Access the index.html via the web server http://web_server_address/index.html
Now try to search for something or click on the top level button (see attached picture)
If you have the latest version of web servers it won't work.
You should get an error like " The request was rejected because the URL was not normalized."
It seems the code fails in this section in the web.js file:

Code: Select all
XMLRequest.send(resourcesLocation + '/xml/' + 'data.xml', function(responseXML) {


Checking the URL it shows 2 slashes:

Code: Select all
http://web_server_address/index_files//xml/data.xml
You do not have the required permissions to view the files attached to this post.
John S
Forum Beginner
Forum Beginner
 
Posts: 67
Posts Rating:0
Joined: Mon Jul 02, 2018 7:52 pm
Full name: John S

Re: Bug in MagicDrawThe MagicDraw Web Publisher 2.0 ?

Postby John S » Tue Aug 28, 2018 5:31 pm

We noticed today that this happens also in other places like the double slash before images:

Code: Select all
http://web-site/index_files//images/navigator/undock.gif


Which seems to be in a lot of places and also in the navigator.js file:

Code: Select all
'url("'+a+'/images/navigator/dock.gif")';this.dockOverImg='url("'+a+'/images/navigator/dock_over.gif")';this.undockImg='url("'+a+'/images/navigator/undock.gif")';


Maybe in the patch/update you can create a function to do the cleanup (normalize) a URL, removing double slash and make all these URL creation parts to go through that function to make sure all of them are clean and no security risk and blocking by the new servers.
John S
Forum Beginner
Forum Beginner
 
Posts: 67
Posts Rating:0
Joined: Mon Jul 02, 2018 7:52 pm
Full name: John S

Re: Bug in MagicDrawThe MagicDraw Web Publisher 2.0 ?

Postby sarawut_w » Tue Aug 28, 2018 10:20 pm

Hello,

We are sorry for your inconvenience.
We can provide you a patch file, what is your MagicDraw version?

Best regards,
Sarawut W.
Support Engineer
sarawut_w
No Magic
No Magic
 
Posts: 336
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am

Re: Bug in MagicDrawThe MagicDraw Web Publisher 2.0 ?

Postby John S » Wed Aug 29, 2018 8:47 am

Cameo Enterprise 18.5 SP3
Build: 20171208_0259_29f3ad39
John S
Forum Beginner
Forum Beginner
 
Posts: 67
Posts Rating:0
Joined: Mon Jul 02, 2018 7:52 pm
Full name: John S

Re: Bug in MagicDrawThe MagicDraw Web Publisher 2.0 ?

Postby sarawut_w » Wed Aug 29, 2018 8:02 pm

Hello,

Please extract this attachment to "C:\Users\<username>\AppData\Local\.cameoea\18.5\data\reports".
Web Publisher 2.0.zip


Best regards,
Sarawut
You do not have the required permissions to view the files attached to this post.
sarawut_w
No Magic
No Magic
 
Posts: 336
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am

Re: Bug in MagicDrawThe MagicDraw Web Publisher 2.0 ?

Postby John S » Thu Aug 30, 2018 10:38 am

Hello,

1. Thank you for the patch. We applied it to the user directory, generated new html files and verified that they have the new files format that you sent.
But it still doesn't work and has double slash. Checking the web.js searching for "xml" it seems it still has some with /xml. Even changing those didn't help.

Please see below in [1] how to reproduce it and how to test your changes.

2. Will the fix go into next SP of Cameo 18.5 or next product version of Cameo 19.x ? As we have to install it on multiple machines in our company and the location is under C:\Users not the Cameo installation location we wonder if we should do this patch installation manually or will the next SP release do this type of installations under C:\Users ?

Thanks,
Jonh

[1] How to reproduce the issue

- Extract this attachment to "C:\Users\<username>\AppData\Local\.cameoea\18.5\data\reports".
- Run the plugins\com.nomagic.magicdraw.reportwizard on a Model
- Put the generated files behind a web server (Apache)
- Click on the index.html (via the web server, not the file system as file system is fine the web servers have the new security restriction)
- Click on a Diagram in the left pane
- Click on the top button called "Select in the Containment tree" (same error if you try to search for something via top right corner search field)
- To see the result which is sent to the network see attached picture DoubleSlash_1.PNG in IE browser. Choose "Inspect the Element" to launch the debugger
- Once the IE debugger is launched click on the NETWORK tab to see the message sent to the web server
- Now click on the "Select in the Containment tree"
- See the picture DoubleSlash_2.PNG attached
- As you see there is a double slash before "xml" and that's blocked by the modern web servers
- Note: Please after your changes before sending a new patch run above test steps both on the "Select in the Containment tree" button, on top right corner search field and images (in navigator.js) to make sure no other part of the code create this issue.
DoubleSlash_1.PNG
DoubleSlash_2.PNG
You do not have the required permissions to view the files attached to this post.
John S
Forum Beginner
Forum Beginner
 
Posts: 67
Posts Rating:0
Joined: Mon Jul 02, 2018 7:52 pm
Full name: John S

Re: Bug in MagicDrawThe MagicDraw Web Publisher 2.0 ?

Postby John S » Thu Aug 30, 2018 12:18 pm

Please check the navigator.js and all the image cases. For example see the error below when initially the home page is launched:

images.PNG
You do not have the required permissions to view the files attached to this post.
John S
Forum Beginner
Forum Beginner
 
Posts: 67
Posts Rating:0
Joined: Mon Jul 02, 2018 7:52 pm
Full name: John S

Re: Bug in MagicDrawThe MagicDraw Web Publisher 2.0 ?

Postby sarawut_w » Thu Aug 30, 2018 7:59 pm

Hello,

- Do you generate the report via command line or UI?
- Please show us your Environment tab in the About dialog. Go to Help > About. Then, click Enviroment tab.
- Please send us the "web.js" and "navigation.js" of your generated report.

By the way, it seems 18.5 does not have any more SP, because 19.0 LTR has been released already.

Best regards,
Sarawut
sarawut_w
No Magic
No Magic
 
Posts: 336
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am

Re: Bug in MagicDrawThe MagicDraw Web Publisher 2.0 ?

Postby John S » Tue Sep 04, 2018 9:25 am

Hello,

- Do you generate the report via command line or UI?
[JS] Please see the steps to reproduce above. We generate the report via command line using the plugin \plugins\com.nomagic.magicdraw.reportwizard

- Please show us your Environment tab in the About dialog. Go to Help > About. Then, click Enviroment tab.
- Please send us the "web.js" and "navigation.js" of your generated report.
[JS] Attached picture and files

By the way, it seems 18.5 does not have any more SP, because 19.0 LTR has been released already.
[JS] In which version and SP will this fix be released ?

Thanks,
Jonh
You do not have the required permissions to view the files attached to this post.
John S
Forum Beginner
Forum Beginner
 
Posts: 67
Posts Rating:0
Joined: Mon Jul 02, 2018 7:52 pm
Full name: John S

Re: Bug in MagicDrawThe MagicDraw Web Publisher 2.0 ?

Postby sarawut_w » Tue Sep 04, 2018 9:15 pm

Hello,

Thank you for your answers.
We have just found your report directory is at "xxx\Cameo_EA\".
So, you would rather need to update the Web Publisher 2.0 template at that directory.
Please click the link at "Configuration Files:" in your Environment tab of the About dialog.
Then, go to "xxx\Cameo_EA\data\reports".
Now, you would rather need to remove the existing Web Publisher 2.0 template and place the fixed template to that directory.

Best regards,
Sarawut
sarawut_w
No Magic
No Magic
 
Posts: 336
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am

Next

Return to Report Engine

Who is online

Users browsing this forum: No registered users and 0 guests

cron