<div>Yves</div><div><br></div>Try using OpenCms.getPublishManager() to get the CmsPublishManager.<div><br></div><div>Steve<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Date: Wed, 19 Sep 2012 10:59:11 +0200<br>
From: Yves Glodt <<a href="mailto:yg@mind.lu">yg@mind.lu</a>><br>
To: The OpenCms mailing list <<a href="mailto:opencms-dev@opencms.org">opencms-dev@opencms.org</a>><br>
Subject: [opencms-dev] Use of CmsPublishManager in OpenCms 8<br>
Message-ID:<br>
        <<a href="mailto:CAAPhX7cbEkMn6YKHwKNXx_Jb-CMa6Da8JNWQQLQFubuhgTcJ6g@mail.gmail.com">CAAPhX7cbEkMn6YKHwKNXx_Jb-CMa6Da8JNWQQLQFubuhgTcJ6g@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello,<br>
<br>
In OpenCms 8 there is no longer CmsObject.publishResource(). So I tried to<br>
use the CmsPublishManager, but it does not work as expected.<br>
<br>
Here is my code:<br>
<br>
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>
<br>
What's wrong with it?<br>
<br>
Best regards,<br>
Yves<br></blockquote></div>
</div>