[opencms-dev] Use of CmsPublishManager in OpenCms 8

Steve Bryan steve.bryan at shinetech.com
Thu Sep 20 01:25:25 CEST 2012


Yves

Try using OpenCms.getPublishManager() to get the CmsPublishManager.

Steve


> Date: Wed, 19 Sep 2012 10:59:11 +0200
> From: Yves Glodt <yg at mind.lu>
> To: The OpenCms mailing list <opencms-dev at opencms.org>
> Subject: [opencms-dev] Use of CmsPublishManager in OpenCms 8
> Message-ID:
>         <
> CAAPhX7cbEkMn6YKHwKNXx_Jb-CMa6Da8JNWQQLQFubuhgTcJ6g at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> 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/20120920/e67a97e3/attachment.htm>


More information about the opencms-dev mailing list