In fact when I say "it does not work as expected" I mean:<br><br>There is an exception without a message (null) happening on calling <span style="font-family:courier new,monospace">cmsPublish.publishResource.<br>
<br><br></span><br><div class="gmail_quote">On 19 September 2012 10:59, Yves Glodt <span dir="ltr"><<a href="mailto:yg@mind.lu" target="_blank">yg@mind.lu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br><br>In OpenCms 8 there is no longer CmsObject.publishResource(). So I tried to use the CmsPublishManager, but it does not work as expected.<br><br>Here is my code:<br><br><span style="font-family:courier new,monospace">CmsObject cms = OpenCms.initCmsObject("Guest");<br>
cms.loginUser("user", "password");<br>CmsProject project = cms.readProject("Offline");<br>cms.getRequestContext().setCurrentProject(project);<br>cms.getRequestContext().setSiteRoot("/sites/<a href="http://mysite.lu/" target="_blank">mysite.lu/</a>");<br>
<br>CmsPublishManager cmsPublish = new CmsPublishManager();<br>cmsPublish.initialize(cms);<br>cmsPublish.publishResource(cms,"/images/articles/"+no_article);<br></span><br>What's wrong with it?<br><br>Best regards,<br>
Yves<br><br>
</blockquote></div><br>