I am struggling almost 2 days to accomplish this simple scenario:
* Save image in content repository using Java API
* Generate link to it in template
My current status:
* Java client:
[code]InputStream stream = ContentUtil.getArticleImage(object.getItemid(),
getContentPath());
Binary binary = getSession().getValueFactory().createBinary(stream);
Node file = article.addNode("image", "nt:file");
Node content = file.addNode("jcr:content", "nt:resource");
content.setProperty("jcr:data", binary);
content.setProperty("jcr:mimeType", "image/gif");[/code]
* Template:
<img src='${cmsfn.link(articleNode.image}' width='400' />
I am able to see "image" node in JCR browser but when going through generated
link I end up with empty content. What am I doing wrong? Please help - I am
using Magnoloa 5.2.
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=73590311-e91d-43ee-b110-05b644e34e5d
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------