[opencms-dev] Use of CmsPublishManager in OpenCms 8

Yves Glodt yg at mind.lu
Wed Sep 19 14:37:19 CEST 2012


In fact when I say "it does not work as expected" I mean:

There is an exception without a message (null) happening on calling
cmsPublish.publishResource.



On 19 September 2012 10:59, Yves Glodt <yg at mind.lu> wrote:

> 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/85dcb3ad/attachment.htm>


More information about the opencms-dev mailing list