Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
Jukka, thanks to the still existing test account on your private wms server, which i used to verify against ;) ..ede On 08.06.2015 19:09, Rahkonen Jukka (MML) wrote: Hi, GetLegendGraphics works now fine with our servers through https and basic authentication. Thanks -Jukka Rahkonen- Giuseppe Aruta wrote: Hi Ede, thanks for your help. Let us wait Jukka opinion/test to check the new reuse of WMSRequest with protected WMS servers. I implemented the dialog as a detachable internal frame, as you suggested. It looks also more elegant. I preferred the option to have it always on the top of the main view as I think that a legend should be always visible, it can be minimized by users anyhow. Regarding that dialogs accumulate and you suggestion to update/reuse existing legends per layer, I still didn't find a solution and I ask you a little help. best regards Peppe 2015-06-05 12:49 GMT+02:00 edgar.sol...@web.de mailto:edgar.sol...@web.de: hey Peppe, while playing around with the plugin i stumbled over two issues 1. the plugin was enabled even if multiple wms layers were selected. this is fixed now in trunk. 2. the dialogs accumulate. every time a new one gets created. you should update/reuse existing legends per layer. additionally i suggest you implement the dialogs as detachable internal frames. this way they will be listed in the 'Windows' main menu and the user can decide where to place them. nice addition ..ede On 04.06.2015 15 tel:04.06.2015%2015:24, Giuseppe Aruta wrote: Dear Jumpers, I added on OpenJUMP a new plugin that displays WMS layer(s) legend (if available) on a Dialog. This plugin is located on WMS Layer tree context menu, as Show WMS Layer Legend. The code originally came from Kosmo SAIG and it was completely rewritten in order to adapt WMS GetLegendGraphic and GetStyle operators without modifing OJ WMS classes. Best Regards Peppe -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net mailto:Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net mailto:Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
Hi Michael, this is a good page where to take some WMS urls wiith legends: http://nsidc.org/data/atlas/ogc_services.html *WMS:* - Northern Hemisphere: http://nsidc.org/cgi-bin/atlas_north?service=WMSrequest=GetCapabilitiesversion=1.1.1 - Southern Hemisphere: http://nsidc.org/cgi-bin/atlas_south?service=WMSrequest=GetCapabilitiesversion=1.1.1 Some of the Urls embedded into OJ have legends: http://ows.terrestris.de/osm/service? for instance Peppe 2015-06-08 22:16 GMT+02:00 Michaël Michaud m.michael.mich...@orange.fr: Thanks all, Do you know any public url with GetLegendGraphics capability so that I can easily test it ? Michaël Le 08/06/2015 19:09, Rahkonen Jukka (MML) a écrit : Hi, GetLegendGraphics works now fine with our servers through https and basic authentication. Thanks -Jukka Rahkonen- Giuseppe Aruta wrote: Hi Ede, thanks for your help. Let us wait Jukka opinion/test to check the new reuse of WMSRequest with protected WMS servers. I implemented the dialog as a detachable internal frame, as you suggested. It looks also more elegant. I preferred the option to have it always on the top of the main view as I think that a legend should be always visible, it can be minimized by users anyhow. Regarding that dialogs accumulate and you suggestion to update/reuse existing legends per layer, I still didn't find a solution and I ask you a little help. best regards Peppe 2015-06-05 12:49 GMT+02:00 edgar.sol...@web.de: hey Peppe, while playing around with the plugin i stumbled over two issues 1. the plugin was enabled even if multiple wms layers were selected. this is fixed now in trunk. 2. the dialogs accumulate. every time a new one gets created. you should update/reuse existing legends per layer. additionally i suggest you implement the dialogs as detachable internal frames. this way they will be listed in the 'Windows' main menu and the user can decide where to place them. nice addition ..ede On 04.06.2015 15:24, Giuseppe Aruta wrote: Dear Jumpers, I added on OpenJUMP a new plugin that displays WMS layer(s) legend (if available) on a Dialog. This plugin is located on WMS Layer tree context menu, as Show WMS Layer Legend. The code originally came from Kosmo SAIG and it was completely rewritten in order to adapt WMS GetLegendGraphic and GetStyle operators without modifing OJ WMS classes. Best Regards Peppe -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing listJump-pilot-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
Hi Peppe, Fine, thanks. Works fine. On some layers of the first url you sent (Northern Hemisphere : layer=cities), the WMSLegend plugin throws a NPE java.lang.NullPointerException at javax.swing.ImageIcon.init(ImageIcon.java:240) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.getLegendPanel(WMSLegendPlugIn.java:157) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.execute(WMSLegendPlugIn.java:63) Michaël Le 09/06/2015 10:05, Giuseppe Aruta a écrit : Hi Michael, this is a good page where to take some WMS urls wiith legends: http://nsidc.org/data/atlas/ogc_services.html *WMS:* * Northern Hemisphere: http://nsidc.org/cgi-bin/atlas_north?service=WMSrequest=GetCapabilitiesversion=1.1.1 * Southern Hemisphere: http://nsidc.org/cgi-bin/atlas_south?service=WMSrequest=GetCapabilitiesversion=1.1.1 Some of the Urls embedded into OJ have legends: http://ows.terrestris.de/osm/service? for instance Peppe 2015-06-08 22:16 GMT+02:00 Michaël Michaud m.michael.mich...@orange.fr mailto:m.michael.mich...@orange.fr: Thanks all, Do you know any public url with GetLegendGraphics capability so that I can easily test it ? Michaël Le 08/06/2015 19:09, Rahkonen Jukka (MML) a écrit : Hi, GetLegendGraphics works now fine with our servers through https and basic authentication. Thanks -Jukka Rahkonen- Giuseppe Aruta wrote: Hi Ede, thanks for your help. Let us wait Jukka opinion/test to check the new reuse of WMSRequest with protected WMS servers. I implemented the dialog as a detachable internal frame, as you suggested. It looks also more elegant. I preferred the option to have it always on the top of the main view as I think that a legend should be always visible, it can be minimized by users anyhow. Regarding that dialogs accumulate and you suggestion to update/reuse existing legends per layer, I still didn't find a solution and I ask you a little help. best regards Peppe 2015-06-05 12:49 GMT+02:00 edgar.sol...@web.de mailto:edgar.sol...@web.de: hey Peppe, while playing around with the plugin i stumbled over two issues 1. the plugin was enabled even if multiple wms layers were selected. this is fixed now in trunk. 2. the dialogs accumulate. every time a new one gets created. you should update/reuse existing legends per layer. additionally i suggest you implement the dialogs as detachable internal frames. this way they will be listed in the 'Windows' main menu and the user can decide where to place them. nice addition ..ede On 04.06.2015 15 tel:04.06.2015%2015:24, Giuseppe Aruta wrote: Dear Jumpers, I added on OpenJUMP a new plugin that displays WMS layer(s) legend (if available) on a Dialog. This plugin is located on WMS Layer tree context menu, as Show WMS Layer Legend. The code originally came from Kosmo SAIG and it was completely rewritten in order to adapt WMS GetLegendGraphic and GetStyle operators without modifing OJ WMS classes. Best Regards Peppe -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net mailto:Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net mailto:Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net mailto:Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net mailto:Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
Hi Michael, sorry but I can't reproduce it. This is the screenshot with layer:cities and Layer:Greenland surface elevayion loaded Can you send me more details? Thanks Peppe 2015-06-09 13:32 GMT+02:00 Michaël Michaud m.michael.mich...@orange.fr: Hi Peppe, Fine, thanks. Works fine. On some layers of the first url you sent (Northern Hemisphere : layer=cities), the WMSLegend plugin throws a NPE java.lang.NullPointerException at javax.swing.ImageIcon.init(ImageIcon.java:240) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.getLegendPanel(WMSLegendPlugIn.java:157) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.execute(WMSLegendPlugIn.java:63) Michaël Le 09/06/2015 10:05, Giuseppe Aruta a écrit : Hi Michael, this is a good page where to take some WMS urls wiith legends: http://nsidc.org/data/atlas/ogc_services.html *WMS:* - Northern Hemisphere: http://nsidc.org/cgi-bin/atlas_north?service=WMSrequest=GetCapabilitiesversion=1.1.1 - Southern Hemisphere: http://nsidc.org/cgi-bin/atlas_south?service=WMSrequest=GetCapabilitiesversion=1.1.1 Some of the Urls embedded into OJ have legends: http://ows.terrestris.de/osm/service? for instance Peppe 2015-06-08 22:16 GMT+02:00 Michaël Michaud m.michael.mich...@orange.fr: Thanks all, Do you know any public url with GetLegendGraphics capability so that I can easily test it ? Michaël Le 08/06/2015 19:09, Rahkonen Jukka (MML) a écrit : Hi, GetLegendGraphics works now fine with our servers through https and basic authentication. Thanks -Jukka Rahkonen- Giuseppe Aruta wrote: Hi Ede, thanks for your help. Let us wait Jukka opinion/test to check the new reuse of WMSRequest with protected WMS servers. I implemented the dialog as a detachable internal frame, as you suggested. It looks also more elegant. I preferred the option to have it always on the top of the main view as I think that a legend should be always visible, it can be minimized by users anyhow. Regarding that dialogs accumulate and you suggestion to update/reuse existing legends per layer, I still didn't find a solution and I ask you a little help. best regards Peppe 2015-06-05 12:49 GMT+02:00 edgar.sol...@web.de: hey Peppe, while playing around with the plugin i stumbled over two issues 1. the plugin was enabled even if multiple wms layers were selected. this is fixed now in trunk. 2. the dialogs accumulate. every time a new one gets created. you should update/reuse existing legends per layer. additionally i suggest you implement the dialogs as detachable internal frames. this way they will be listed in the 'Windows' main menu and the user can decide where to place them. nice addition ..ede On 04.06.2015 15:24, Giuseppe Aruta wrote: Dear Jumpers, I added on OpenJUMP a new plugin that displays WMS layer(s) legend (if available) on a Dialog. This plugin is located on WMS Layer tree context menu, as Show WMS Layer Legend. The code originally came from Kosmo SAIG and it was completely rewritten in order to adapt WMS GetLegendGraphic and GetStyle operators without modifing OJ WMS classes. Best Regards Peppe -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing listJump-pilot-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing listJump-pilot-devel@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
Thanks all, Do you know any public url with GetLegendGraphics capability so that I can easily test it ? Michaël Le 08/06/2015 19:09, Rahkonen Jukka (MML) a écrit : Hi, GetLegendGraphics works now fine with our servers through https and basic authentication. Thanks -Jukka Rahkonen- Giuseppe Aruta wrote: Hi Ede, thanks for your help. Let us wait Jukka opinion/test to check the new reuse of WMSRequest with protected WMS servers. I implemented the dialog as a detachable internal frame, as you suggested. It looks also more elegant. I preferred the option to have it always on the top of the main view as I think that a legend should be always visible, it can be minimized by users anyhow. Regarding that dialogs accumulate and you suggestion to update/reuse existing legends per layer, I still didn't find a solution and I ask you a little help. best regards Peppe 2015-06-05 12:49 GMT+02:00 edgar.sol...@web.de mailto:edgar.sol...@web.de: hey Peppe, while playing around with the plugin i stumbled over two issues 1. the plugin was enabled even if multiple wms layers were selected. this is fixed now in trunk. 2. the dialogs accumulate. every time a new one gets created. you should update/reuse existing legends per layer. additionally i suggest you implement the dialogs as detachable internal frames. this way they will be listed in the 'Windows' main menu and the user can decide where to place them. nice addition ..ede On 04.06.2015 15 tel:04.06.2015%2015:24, Giuseppe Aruta wrote: Dear Jumpers, I added on OpenJUMP a new plugin that displays WMS layer(s) legend (if available) on a Dialog. This plugin is located on WMS Layer tree context menu, as Show WMS Layer Legend. The code originally came from Kosmo SAIG and it was completely rewritten in order to adapt WMS GetLegendGraphic and GetStyle operators without modifing OJ WMS classes. Best Regards Peppe -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net mailto:Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net mailto:Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
Hi, GetLegendGraphics works now fine with our servers through https and basic authentication. Thanks -Jukka Rahkonen- Giuseppe Aruta wrote: Hi Ede, thanks for your help. Let us wait Jukka opinion/test to check the new reuse of WMSRequest with protected WMS servers. I implemented the dialog as a detachable internal frame, as you suggested. It looks also more elegant. I preferred the option to have it always on the top of the main view as I think that a legend should be always visible, it can be minimized by users anyhow. Regarding that dialogs accumulate and you suggestion to update/reuse existing legends per layer, I still didn't find a solution and I ask you a little help. best regards Peppe 2015-06-05 12:49 GMT+02:00 edgar.sol...@web.demailto:edgar.sol...@web.de: hey Peppe, while playing around with the plugin i stumbled over two issues 1. the plugin was enabled even if multiple wms layers were selected. this is fixed now in trunk. 2. the dialogs accumulate. every time a new one gets created. you should update/reuse existing legends per layer. additionally i suggest you implement the dialogs as detachable internal frames. this way they will be listed in the 'Windows' main menu and the user can decide where to place them. nice addition ..ede On 04.06.2015 15tel:04.06.2015%2015:24, Giuseppe Aruta wrote: Dear Jumpers, I added on OpenJUMP a new plugin that displays WMS layer(s) legend (if available) on a Dialog. This plugin is located on WMS Layer tree context menu, as Show WMS Layer Legend. The code originally came from Kosmo SAIG and it was completely rewritten in order to adapt WMS GetLegendGraphic and GetStyle operators without modifing OJ WMS classes. Best Regards Peppe -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.netmailto:Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.netmailto:Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
On 08.06.2015 08:36, Giuseppe Aruta wrote: Hi Ede, thanks for your help. Let us wait Jukka opinion/test to check the new reuse of WMSRequest with protected WMS servers. I implemented the dialog as a detachable internal frame, as you suggested. It looks also more elegant. I preferred the option to have it always on the top of the main view as I think that a legend should be always visible, it can be minimized by users anyhow. btw. i noticed that the dialog always came up on the upper left screen corner. GUIUtil has some methods that help you place it on the screen, maybe on the right/middle with some offset from the screen border? Regarding that dialogs accumulate and you suggestion to update/reuse existing legends per layer, I still didn't find a solution and I ask you a little help. this would have to be done in your plugin. keep a hashmap of layer/dialog entries and check if one already exists on plugin execution. ..ede -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
Hi Ede, thanks for your help. Let us wait Jukka opinion/test to check the new reuse of WMSRequest with protected WMS servers. I implemented the dialog as a detachable internal frame, as you suggested. It looks also more elegant. I preferred the option to have it always on the top of the main view as I think that a legend should be always visible, it can be minimized by users anyhow. Regarding that dialogs accumulate and you suggestion to update/reuse existing legends per layer, I still didn't find a solution and I ask you a little help. best regards Peppe 2015-06-05 12:49 GMT+02:00 edgar.sol...@web.de: hey Peppe, while playing around with the plugin i stumbled over two issues 1. the plugin was enabled even if multiple wms layers were selected. this is fixed now in trunk. 2. the dialogs accumulate. every time a new one gets created. you should update/reuse existing legends per layer. additionally i suggest you implement the dialogs as detachable internal frames. this way they will be listed in the 'Windows' main menu and the user can decide where to place them. nice addition ..ede On 04.06.2015 15:24, Giuseppe Aruta wrote: Dear Jumpers, I added on OpenJUMP a new plugin that displays WMS layer(s) legend (if available) on a Dialog. This plugin is located on WMS Layer tree context menu, as Show WMS Layer Legend. The code originally came from Kosmo SAIG and it was completely rewritten in order to adapt WMS GetLegendGraphic and GetStyle operators without modifing OJ WMS classes. Best Regards Peppe -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
I think also that Kosmo request to WMS Styles and Legends starts probably together with a WMS layer request. Since I didn't want to modify any original WMS OJ classes, OJ WMS legend plugin calls after a WMS is loaded. Infact there is a small delay on OJ whenever a user ask for a legend, comparing to the same process on Kosmo 2015-06-05 9:54 GMT+02:00 Giuseppe Aruta giuseppe.ar...@gmail.com: Hi Jukka, thanks for the quick answer. Regarding user/password of WMS, I can see that the code comes from SelectUrlWithAuthPanel.class but I don't see where these datas are stored on WMS classes ( or maybe not, they are only asked at the beginning of the WMS request process). This plugin is relatively simple. If you have time you can see the code on class org.openjump.core.ui.plugin.wms.WMSLegendPlugIn. The core of legend request is Line 71, the String getLegendUrl(PlugInContext context, String names). The String is divided into 3 parts: a) PlugInContext refers to WMS layer where to extract the URL calling layer.getService().getServerUrl(). b) while String names is the name of the WMS layer. c) the rest of the code calls GetLegendGraphic, Version, etc, including some graphical components for the legend. I don't have experience with WMS. I understood from your code ( https://username:pas...@site.fi/cgi-bin/service1?) that that user/password should before the the server URL string (part a of String getLegendUrl) . If so, and if OJ memorize somewhere those datas, it should be easy to modify this String to get Legends from WMS withcredentials. Otherwhise I should build ad hoc another panel where users have to enter those info again. Regarding ChangeWMSStyleDialogPlugIn, I gave a look to it thinking to port to OpenJUMP. While GetLegend is relatively easy as it is shown a new image on a separate panel, for the Style it should redraw the workbench. Which I still don't know how to do. I really appreciate any comment or help on the code from you. Best Regards Peppe 2015-06-04 17:56 GMT+02:00 Rahkonen Jukka (MML) jukka.rahko...@maanmittauslaitos.fi: Hi Peppe, Seems to work with Geoserver and it generates also a correct URL for Mapserver so it should work. However, there is some little issue with sites using basic authentication. I think that the plugin is sending the request without credentials or something like that. Note that the error log shows URL as URL: https://username:pas...@site.fi/cgi-bin/service1? and if I copy the whole URL into browser I get the legend graphics. However, OpenJUMP gets an http 401 “not authorized” response. javax.imageio.IIOException: Can't get input stream from URL! at javax.imageio.ImageIO.read(Unknown Source) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.getLegendPanel(WMSLegendPlugIn.java:150) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.execute(WMSLegendPlugIn.java:48) at com.vividsolutions.jump.workbench.plugin.AbstractPlugIn$1.actionPerformed(AbstractPlugIn.java:342) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source)
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
Hi Jukka, can you send me a WMS url with relative User/Password? I want to check a possibility to set them on asking GetLegendGraphic URL Peppe 2015-06-05 9:59 GMT+02:00 Giuseppe Aruta giuseppe.ar...@gmail.com: I think also that Kosmo request to WMS Styles and Legends starts probably together with a WMS layer request. Since I didn't want to modify any original WMS OJ classes, OJ WMS legend plugin calls after a WMS is loaded. Infact there is a small delay on OJ whenever a user ask for a legend, comparing to the same process on Kosmo 2015-06-05 9:54 GMT+02:00 Giuseppe Aruta giuseppe.ar...@gmail.com: Hi Jukka, thanks for the quick answer. Regarding user/password of WMS, I can see that the code comes from SelectUrlWithAuthPanel.class but I don't see where these datas are stored on WMS classes ( or maybe not, they are only asked at the beginning of the WMS request process). This plugin is relatively simple. If you have time you can see the code on class org.openjump.core.ui.plugin.wms.WMSLegendPlugIn. The core of legend request is Line 71, the String getLegendUrl(PlugInContext context, String names). The String is divided into 3 parts: a) PlugInContext refers to WMS layer where to extract the URL calling layer.getService().getServerUrl(). b) while String names is the name of the WMS layer. c) the rest of the code calls GetLegendGraphic, Version, etc, including some graphical components for the legend. I don't have experience with WMS. I understood from your code ( https://username:pas...@site.fi/cgi-bin/service1?) that that user/password should before the the server URL string (part a of String getLegendUrl) . If so, and if OJ memorize somewhere those datas, it should be easy to modify this String to get Legends from WMS withcredentials. Otherwhise I should build ad hoc another panel where users have to enter those info again. Regarding ChangeWMSStyleDialogPlugIn, I gave a look to it thinking to port to OpenJUMP. While GetLegend is relatively easy as it is shown a new image on a separate panel, for the Style it should redraw the workbench. Which I still don't know how to do. I really appreciate any comment or help on the code from you. Best Regards Peppe 2015-06-04 17:56 GMT+02:00 Rahkonen Jukka (MML) jukka.rahko...@maanmittauslaitos.fi: Hi Peppe, Seems to work with Geoserver and it generates also a correct URL for Mapserver so it should work. However, there is some little issue with sites using basic authentication. I think that the plugin is sending the request without credentials or something like that. Note that the error log shows URL as URL: https://username:pas...@site.fi/cgi-bin/service1? and if I copy the whole URL into browser I get the legend graphics. However, OpenJUMP gets an http 401 “not authorized” response. javax.imageio.IIOException: Can't get input stream from URL! at javax.imageio.ImageIO.read(Unknown Source) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.getLegendPanel(WMSLegendPlugIn.java:150) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.execute(WMSLegendPlugIn.java:48) at com.vividsolutions.jump.workbench.plugin.AbstractPlugIn$1.actionPerformed(AbstractPlugIn.java:342) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
Hi Jukka, thanks for the quick answer. Regarding user/password of WMS, I can see that the code comes from SelectUrlWithAuthPanel.class but I don't see where these datas are stored on WMS classes ( or maybe not, they are only asked at the beginning of the WMS request process). This plugin is relatively simple. If you have time you can see the code on class org.openjump.core.ui.plugin.wms.WMSLegendPlugIn. The core of legend request is Line 71, the String getLegendUrl(PlugInContext context, String names). The String is divided into 3 parts: a) PlugInContext refers to WMS layer where to extract the URL calling layer.getService().getServerUrl(). b) while String names is the name of the WMS layer. c) the rest of the code calls GetLegendGraphic, Version, etc, including some graphical components for the legend. I don't have experience with WMS. I understood from your code ( https://username:pas...@site.fi/cgi-bin/service1?) that that user/password should before the the server URL string (part a of String getLegendUrl) . If so, and if OJ memorize somewhere those datas, it should be easy to modify this String to get Legends from WMS withcredentials. Otherwhise I should build ad hoc another panel where users have to enter those info again. Regarding ChangeWMSStyleDialogPlugIn, I gave a look to it thinking to port to OpenJUMP. While GetLegend is relatively easy as it is shown a new image on a separate panel, for the Style it should redraw the workbench. Which I still don't know how to do. I really appreciate any comment or help on the code from you. Best Regards Peppe 2015-06-04 17:56 GMT+02:00 Rahkonen Jukka (MML) jukka.rahko...@maanmittauslaitos.fi: Hi Peppe, Seems to work with Geoserver and it generates also a correct URL for Mapserver so it should work. However, there is some little issue with sites using basic authentication. I think that the plugin is sending the request without credentials or something like that. Note that the error log shows URL as URL: https://username:pas...@site.fi/cgi-bin/service1? and if I copy the whole URL into browser I get the legend graphics. However, OpenJUMP gets an http 401 “not authorized” response. javax.imageio.IIOException: Can't get input stream from URL! at javax.imageio.ImageIO.read(Unknown Source) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.getLegendPanel(WMSLegendPlugIn.java:150) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.execute(WMSLegendPlugIn.java:48) at com.vividsolutions.jump.workbench.plugin.AbstractPlugIn$1.actionPerformed(AbstractPlugIn.java:342) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method)
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
hey Peppe, while playing around with the plugin i stumbled over two issues 1. the plugin was enabled even if multiple wms layers were selected. this is fixed now in trunk. 2. the dialogs accumulate. every time a new one gets created. you should update/reuse existing legends per layer. additionally i suggest you implement the dialogs as detachable internal frames. this way they will be listed in the 'Windows' main menu and the user can decide where to place them. nice addition ..ede On 04.06.2015 15:24, Giuseppe Aruta wrote: Dear Jumpers, I added on OpenJUMP a new plugin that displays WMS layer(s) legend (if available) on a Dialog. This plugin is located on WMS Layer tree context menu, as Show WMS Layer Legend. The code originally came from Kosmo SAIG and it was completely rewritten in order to adapt WMS GetLegendGraphic and GetStyle operators without modifing OJ WMS classes. Best Regards Peppe -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
hey Peppe, check r4476. i made it reuse the existing WMSRequest classes to avoid implementing additional http auth code. ..ede On 05.06.2015 11:01, Giuseppe Aruta wrote: Hi Jukka, can you send me a WMS url with relative User/Password? I want to check a possibility to set them on asking GetLegendGraphic URL Peppe 2015-06-05 9:59 GMT+02:00 Giuseppe Aruta giuseppe.ar...@gmail.com mailto:giuseppe.ar...@gmail.com: I think also that Kosmo request to WMS Styles and Legends starts probably together with a WMS layer request. Since I didn't want to modify any original WMS OJ classes, OJ WMS legend plugin calls after a WMS is loaded. Infact there is a small delay on OJ whenever a user ask for a legend, comparing to the same process on Kosmo 2015-06-05 9:54 GMT+02:00 Giuseppe Aruta giuseppe.ar...@gmail.com mailto:giuseppe.ar...@gmail.com: Hi Jukka, thanks for the quick answer. Regarding user/password of WMS, I can see that the code comes from SelectUrlWithAuthPanel.class but I don't see where these datas are stored on WMS classes ( or maybe not, they are only asked at the beginning of the WMS request process). This plugin is relatively simple. If you have time you can see the code on class org.openjump.core.ui.plugin.wms.WMSLegendPlugIn. The core of legend request is Line 71, the String getLegendUrl(PlugInContext context, String names). The String is divided into 3 parts: a) PlugInContext refers to WMS layer where to extract the URL calling layer.getService().getServerUrl(). b) while String names is the name of the WMS layer. c) the rest of the code calls GetLegendGraphic, Version, etc, including some graphical components for the legend. I don't have experience with WMS. I understood from your code (https://username:pas...@site.fi/cgi-bin/service1?) that that user/password should before the the server URL string (part a of String getLegendUrl) . If so, and if OJ memorize somewhere those datas, it should be easy to modify this String to get Legends from WMS withcredentials. Otherwhise I should build ad hoc another panel where users have to enter those info again. Regarding ChangeWMSStyleDialogPlugIn, I gave a look to it thinking to port to OpenJUMP. While GetLegend is relatively easy as it is shown a new image on a separate panel, for the Style it should redraw the workbench. Which I still don't know how to do. I really appreciate any comment or help on the code from you. Best Regards Peppe 2015-06-04 17:56 GMT+02:00 Rahkonen Jukka (MML) jukka.rahko...@maanmittauslaitos.fi mailto:jukka.rahko...@maanmittauslaitos.fi: Hi Peppe, __ __ Seems to work with Geoserver and it generates also a correct URL for Mapserver so it should work. However, there is some little issue with sites using basic authentication. I think that the plugin is sending the request without credentials or something like that. Note that the error log shows URL as URL: https://username:pas...@site.fi/cgi-bin/service1? and if I copy the whole URL into browser I get the legend graphics. However, OpenJUMP gets an http 401 “not authorized” response. __ __ __ __ javax.imageio.IIOException: Can't get input stream from URL! at javax.imageio.ImageIO.read(Unknown Source) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.getLegendPanel(WMSLegendPlugIn.java:150) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.execute(WMSLegendPlugIn.java:48) at com.vividsolutions.jump.workbench.plugin.AbstractPlugIn$1.actionPerformed(AbstractPlugIn.java:342) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source)
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
Hi, If you adapted GetStyle code are you going to add also this on into OpenJUMP: org.saig.jump.plugin.wms.ChangeWMSStyleDialogPlugIn.name=Change WMS style? -Jukka Rahkonen- Giuseppe Aruta wrote: Dear Jumpers, I added on OpenJUMP a new plugin that displays WMS layer(s) legend (if available) on a Dialog. This plugin is located on WMS Layer tree context menu, as Show WMS Layer Legend. The code originally came from Kosmo SAIG and it was completely rewritten in order to adapt WMS GetLegendGraphic and GetStyle operators without modifing OJ WMS classes. Best Regards Peppe -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
Hi Peppe, Seems to work with Geoserver and it generates also a correct URL for Mapserver so it should work. However, there is some little issue with sites using basic authentication. I think that the plugin is sending the request without credentials or something like that. Note that the error log shows URL as URL: https://username:pas...@site.fi/cgi-bin/service1? and if I copy the whole URL into browser I get the legend graphics. However, OpenJUMP gets an http 401 “not authorized” response. javax.imageio.IIOException: Can't get input stream from URL! at javax.imageio.ImageIO.read(Unknown Source) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.getLegendPanel(WMSLegendPlugIn.java:150) at org.openjump.core.ui.plugin.wms.WMSLegendPlugIn.execute(WMSLegendPlugIn.java:48) at com.vividsolutions.jump.workbench.plugin.AbstractPlugIn$1.actionPerformed(AbstractPlugIn.java:342) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: https://username:pas...@site.fi/cgi-bin/service1?SERVICE=WMSREQUEST=GetLegendGraphicVERSION=1.1.1FORMAT=image/pngWIDTH=16HEIGHT=16legend_options=bgColor:0xEE;dpi:100;fontAntiAliasing:true;forceLabels:onLAYER=tukialueet at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source) at
[JPP-Devel] New WMS Layer legend plugin on OpenJUMP
Dear Jumpers, I added on OpenJUMP a new plugin that displays WMS layer(s) legend (if available) on a Dialog. This plugin is located on WMS Layer tree context menu, as Show WMS Layer Legend. The code originally came from Kosmo SAIG and it was completely rewritten in order to adapt WMS GetLegendGraphic and GetStyle operators without modifing OJ WMS classes. Best Regards Peppe -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
Re: [JPP-Devel] New WMS Layer legend plugin on OpenJUMP
The plugin will be available on OJ 4474 Night Snapshot 2015-06-04 15:24 GMT+02:00 Giuseppe Aruta giuseppe.ar...@gmail.com: Dear Jumpers, I added on OpenJUMP a new plugin that displays WMS layer(s) legend (if available) on a Dialog. This plugin is located on WMS Layer tree context menu, as Show WMS Layer Legend. The code originally came from Kosmo SAIG and it was completely rewritten in order to adapt WMS GetLegendGraphic and GetStyle operators without modifing OJ WMS classes. Best Regards Peppe -- ___ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel