[opencms-dev] Problem publishing a specific list of resources

Paul-Inge Flakstad flakstad at npolar.no
Fri Sep 4 14:05:18 CEST 2009


Hi Jasper

I've just finished some event listener code that publishes a custom-made list of resources. After checking some other approaches, I actually ended up with more or less the exact same code you posted here. My resources get published.

Looks like something's happening in your getPublishList call - from your screenshot it looks like the method returns an empty list?

>From what little I know, this could happen because of either:
1.) the user trying to perform the publish operation on the resource(s) does not have publish permissions, or
2.) the resource(s) are not lockable by the user trying to perform the publish operation.

There may be other possible reasons (of which I'm unaware), but I'd check these two at least: make sure your resources are lockable, and perform the publish operation using an Admin account.

HTH

Cheers,
Paul

________________________________
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Jasper Roel
Sent: 1. september 2009 20:03
To: opencms-dev at opencms.org
Subject: [opencms-dev] Problem publishing a specific list of resources

I've been trying to get OpenCms to publish only a specific subset of resources in OpenCms. This is a mix of new folders, new files, modified resources and deleted resources.

This code is run via the Administration panel through a newly created Module.

The code extract looks something like this;

 // This list gets populated before creating the CmsPublishList
 List<CmsResource> resourcesToPublish = new ArrayList<CmsResource>();

// Only publish what we actually touched
boolean publishSiblings = false;
boolean publishSubResources = false;

CmsPublishList publishList = OpenCms.getPublishManager().getPublishList(cms, resourcesToPublish, publishSiblings, publishSubResources);

OpenCms.getPublishManager().publishProject(cms, report, publishList);
OpenCms.getPublishManager().waitWhileRunning();

A short example of the result of this code is attached. All the resources with status N & U (New and Updated) are added to the resourcesToPublish List, but the publishProject publishes none of them (see ImportLog.htm for the result).

Any idea why OpenCms decides not to publish my resources, or is there a better way to publish these specific resources programmaticly?

Thanks,

Jasper Roel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20090904/fe10441e/attachment.htm>


More information about the opencms-dev mailing list