-
1. Re: SVG in portlet
roy.russo Jul 21, 2006 11:45 AM (in response to scollins311)Have you tried changing the supported mime-type for the portlet?
Is the path to your SVG correct? -
2. Re: SVG in portlet
scollins311 Jul 21, 2006 11:52 AM (in response to scollins311)These are the supported types I've added:
<supports> <mime-type>text/html</mime-type> <portlet-mode>VIEW</portlet-mode> </supports> <supports> <mime-type>text/xml</mime-type> <portlet-mode>VIEW</portlet-mode> </supports> <supports> <mime-type>application/xhtml+xml</mime-type> <portlet-mode>VIEW</portlet-mode> </supports>
I don't know what you mean with the path to my svg? Do you mean the namespace? The svg code is in the xhtml page. The namespaces I'm using arexmlns:xlink="http://www.w3.org/2000/xlink/namespace/" xmlns:svg="http://www.w3.org/2000/svg"
Thank you for answering so quickly,
Shaun -
3. Re: SVG in portlet
roy.russo Jul 21, 2006 12:11 PM (in response to scollins311)Maybe I don't understand SVG that well. Don't you have to link to an SVG file, much like you would with a flash file?
-
4. Re: SVG in portlet
scollins311 Jul 21, 2006 12:16 PM (in response to scollins311)You can but you can also do something like this person did.
http://jwatt.org/svg/demos/xhtml-with-inline-svg.xhtml
View the source to see what's going on.
Shaun -
5. Re: SVG in portlet
free1000 Jul 21, 2006 12:26 PM (in response to scollins311)Could it be possible that you also have to set content-type in your doView as well?
I think if you are serving xhtml to the browser. As xhtml is an instance of an xml document I expect that the content type should be application/xhtml+xml... however I haven't tried this myself yetprotected void doView(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException, UnavailableException { rResponse.setContentType("application/xhtml+xml"); PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("View.jsp"); prd.include(rRequest, rResponse); }
Thanks to this thread I discovered that firefox can natively display SVG inline. Cool. -
6. Re: SVG in portlet
scollins311 Jul 21, 2006 12:37 PM (in response to scollins311)I'm using Seam and JSF, so I don't think that I have a doView. I have tried setting the content type in the seam action that gets called on the page. I did it similar to how supernovasoftware.com did it in this thread: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=82396
Except instead of the request I got the response and set the content type that way. Maybe that isn't correct?
Shaun -
7. Re: SVG in portlet
roy.russo Jul 21, 2006 1:31 PM (in response to scollins311)I'm a bit stuck here. Even the link you sent, shows me a broken resource area. Do I need some SVG plugin in browsers?
-
8. Re: SVG in portlet
scollins311 Jul 21, 2006 1:35 PM (in response to scollins311)Yeah, you'll probably need the adobe svg viewer.
http://www.adobe.com/svg/viewer/install/main.html
Shaun -
9. Re: SVG in portlet
free1000 Jul 21, 2006 5:39 PM (in response to scollins311)Apparently SVG support is now available natively in firefox (no need for the Adobe viewer).
-
10. Re: SVG in portlet
free1000 Jul 22, 2006 4:52 AM (in response to scollins311)Ah... I have a theory that the problem is possibly that the content type of the *entire rendered portal page* is text/html
To embed svg in any single portlet window the *overall* content type of the portal page needs to be application/xhtml+xml because setting the content type of an individual portlet does not affect the total page.
Hence I think we need a way to set the content type for the portal as a whole. Can anyone direct me to where this might be configured/hacked? -
11. Re: SVG in portlet
free1000 Jul 22, 2006 4:52 AM (in response to scollins311)Ah... I have a theory that the problem is possibly that the content type of the *entire rendered portal page* is text/html
To embed svg in any single portlet window the *overall* content type of the portal page needs to be application/xhtml+xml because setting the content type of an individual portlet does not affect the total page.
Hence I think we need a way to set the content type for the portal as a whole. Can anyone direct me to where this might be configured/hacked? -
12. Re: SVG in portlet
scollins311 Jul 22, 2006 9:03 AM (in response to scollins311)free1000
I agree. That is one of the paths I was lurking down before I came here for help. Changing it was just over my head.
Shaun -
13. Re: SVG in portlet
free1000 Jul 22, 2006 10:15 AM (in response to scollins311)I guess that its safer for the entire portal to default to text/html in case there are portlets which are used which are not xhtml conformant. I'd expect to find the overall content type configurable at a high level, but maybe its something that can be set per page. This might be the most useful as it would mean that one could place non xhtml conformant portlets on other pages.
-
14. Re: SVG in portlet
free1000 Jul 24, 2006 2:09 AM (in response to scollins311)Content type for the whole portal can be altered by changing the content type for the index.jsp file which acts as the host for the whole portal layout.
The default file is at
jboss-portal.sar\portal-core.war\layouts\generic\index.jsp
Altering the meta tag in the HTML sends the correct content type to the browser. However this still does not make my inline svg display correctly so some more research is needed.