|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Displaying image from data type's property (Data Module)Hi,
How do I display an image that is stored under the data module for my defined data type? For example, I have a data type called "product" which has a property called "logo" (which is of data type binary). The content node created under the "product" data type was "test". I tried the following in my jsp: Content providerNode = null; providerNode = MgnlContext.getHierarchyManager("data").getContent("product/test"); String imageURL = providerNode.getNodeData("logo").getHandle() + "/" + providerNode.getNodeData("logo").getAttribute("fileName") + "." + providerNode.getNodeData("logo").getAttribute("extension"); However this imageURL doesn't retrieve the image in my jsp when I set it as the src in the image tag? I would appreciate it if anyone could help me on this. Thanks. Cheers, Rita. |
|
|
Re: Displaying image from data type's property (Data Module)hi.
try this...
java.io.InputStream is = getFileStream from the value you're reading BufferedImage input = javax.imageio.ImageIO.read(is); trying to get the inputstream and to handle it with java code... the rest should be easy.
that should work
Daniel
2009/10/22 Rita_ <mrita293@...>
|
|
|
Re: Displaying image from data type's property (Data Module)String imageURL = MgnlContext.getContextPath() +"/data" + providerNode.getNodeData("logo").getHandle(); should do the trick. Or even better: String imageURL = MagnoliaTemplatingUtilities.getInstance().createLink(providerNode.getNodeData("logo")); HTH, Jan On Thu, 2009-10-22 at 19:49 -0700, Rita_ wrote: > > Hi, > > How do I display an image that is stored under the data module for my > defined data type? > > For example, I have a data type called "product" which has a property called > "logo" (which is of data type binary). The content node created under the > "product" data type was "test". > > I tried the following in my jsp: > > Content providerNode = null; > > providerNode = > MgnlContext.getHierarchyManager("data").getContent("product/test"); > > String imageURL = providerNode.getNodeData("logo").getHandle() + "/" + > providerNode.getNodeData("logo").getAttribute("fileName") + "." + > providerNode.getNodeData("logo").getAttribute("extension"); > > However this imageURL doesn't retrieve the image in my jsp when I set it as > the src in the image tag? > > > I would appreciate it if anyone could help me on this. Thanks. > > Cheers, > Rita. > > > ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <user-list-unsubscribe@...> ---------------------------------------------------------------- |
|
|
Vacation replyHey,
how are you doing recently? I would like to introduce you a very good company and its website is www.mydosell.com It can offer you all kinds of electronic products that you may be in need,such as laptops ,gps ,TV LCD,cell phones,ps3,MP3/4,motorcycles and etc........ You can take some time to have a check ,there must be something interesting you 'd like to purchase . The contact Hope you can enjoy yourself in shopping from that company !
Regards ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <user-list-unsubscribe@...> ---------------------------------------------------------------- |
|
|
Vacation replyHey,
how are you doing recently? I would like to introduce you a very good company and its website is www.mydosell.com It can offer you all kinds of electronic products that you may be in need,such as laptops ,gps ,TV LCD,cell phones,ps3,MP3/4,motorcycles and etc........ You can take some time to have a check ,there must be something interesting you 'd like to purchase . The contact Hope you can enjoy yourself in shopping from that company !
Regards ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <user-list-unsubscribe@...> ---------------------------------------------------------------- |
|
|
Re: Displaying image from data type's property (Data Module)Thanks to Daniel and Jan for your replies.
Hi Jan, Both your solutions worked. It was exactly what I was looking for! Thanks alot. Cheers, Rita |
|
|
Vacation replyHey,
how are you doing recently? I would like to introduce you a very good company and its website is www.mydosell.com It can offer you all kinds of electronic products that you may be in need,such as laptops ,gps ,TV LCD,cell phones,ps3,MP3/4,motorcycles and etc........ You can take some time to have a check ,there must be something interesting you 'd like to purchase . The contact Hope you can enjoy yourself in shopping from that company !
Regards ---------------------------------------------------------------- For list details see http://www.magnolia-cms.com/home/community/mailing-lists.html To unsubscribe, E-mail to: <user-list-unsubscribe@...> ---------------------------------------------------------------- |
| Free embeddable forum powered by Nabble | Forum Help |