[opencms-dev] Problem publishing a specific list of resources
Jasper Roel
jroel at salesforce.com
Fri Sep 18 21:08:00 CEST 2009
Hi Paul,
Thanks for getting back to me on this one and my apologies for letting it linger so long.
My specific problem is that I want some resources deep inside the structure to be published, and some changed ones have to remain UNpublished. The current (OpenCms 7.0.5) functionality does not allow for this out of the box. It's either a) only the root folders or b) all changed resources contained within the root folders (including the root folders). This is essentially the 'Publish Directly' functionality.
And the way OpenCms handles it ends up having the Get* functions in PublishList 'ignore' a lot of my resources and returns the empty Lists you're referring to.
The function that does it 'right' (for my purpose) within OpenCms is the addAll() function in PublishList. Since this is protected we can't officially reach it from the outside (ie: my code).
I created a workaround by creating a new class in my project within the org.opencms.db package, and having a small function act as a proxy for my code.
This way I get exactly what I want, without any side-effects (so far anyway...)
The class consists of this one function:
public static CmsPublishList convert(CmsPublishList cmsPublishList, java.util.Collection<org.opencms.file.CmsResource> resources, boolean check) {
cmsPublishList.addAll(resources, check);
return cmsPublishList;
}
Thanks for the feedback, I appreciate it!
Regards,
Jasper
More information about the opencms-dev
mailing list