[opencms-dev] Use of CmsPublishManager in OpenCms 8

Yves Glodt yg at mind.lu
Wed Sep 19 10:59:11 CEST 2012


Hello,

In OpenCms 8 there is no longer CmsObject.publishResource(). So I tried to
use the CmsPublishManager, but it does not work as expected.

Here is my code:

CmsObject cms = OpenCms.initCmsObject("Guest");
cms.loginUser("user", "password");
CmsProject project = cms.readProject("Offline");
cms.getRequestContext().setCurrentProject(project);
cms.getRequestContext().setSiteRoot("/sites/mysite.lu/");

CmsPublishManager cmsPublish = new CmsPublishManager();
cmsPublish.initialize(cms);
cmsPublish.publishResource(cms,"/images/articles/"+no_article);

What's wrong with it?

Best regards,
Yves
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20120919/b9e8be67/attachment.htm>


More information about the opencms-dev mailing list