[opencms-dev] Use of CmsPublishManager in OpenCms 8

Yves Glodt yg at mind.lu
Thu Sep 20 10:08:19 CEST 2012


Thanks for all the replies.

Ass suggested, we used *OpenCms.getPublishManager().publishResource(cms,
"/path/to/resource")* and this works fine !

best regards,
Yves

On 20 September 2012 01:25, Steve Bryan <steve.bryan at shinetech.com> wrote:

> 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
>>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20120920/3aa680b6/attachment.htm>


More information about the opencms-dev mailing list