[opencms-dev] Module Action class updateModule method

Claus Priisholm cpr at codedroids.com
Tue Nov 8 12:35:33 CET 2005


The project publish event does include the relevant information - I've 
done something like this:
---
CmsUUID publishHistoryId = new 
CmsUUID((String)event.getData().get(I_CmsEventListener.KEY_PUBLISHID));

CmsDbContext dbContext = 
(CmsDbContext)event.getData().get(I_CmsEventListener.KEY_DBCONTEXT);

CmsObject cms = 
OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserGuest());

List publishedResources = cms.readPublishedResources(publishHistoryId);

Iterator it = publishedResources.iterator();
while(it.hasNext()) {
	CmsPublishedResource pr = (CmsPublishedResource)it.next();
	...
}
---
Note that the list does not hold CmsResource objects but rather some 
other variant:

http://www.codedroids.com/javadocs/opencms/build_6_0_0/docs/api/org/opencms/db/CmsPublishedResource.html

which does hold the resource path, so you're good to read the resource 
by the usual means.



Pere Torrodellas wrote:
> Thanks to all for your hints.
> 
> Unfortunatelly, what I need is to do something when specific files are
> published, and it doesn't seem to exist an event for this, does it?
> 
> EVENT_RESOURCE_MODIFIED is fired when the file is edited or unlocked, but
> not when it's published.
> 
> EVENT_PUBLISH_PROJECT is fired when a resource is published, but the event
> data doesn't include information to find out what was published, just a
> project id and some control data, so I would have to act for all and every
> resource publication.
> 
> Am I overlooking something?
> 
> Thanks,
> 
> Pere
> 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
> 

-- 
Claus Priisholm, CodeDroids ApS
Phone: +45 48 22 46 46
cpr (you know what) codedroids.com - http://www.codedroids.com
cpr (you know what) interlet.dk - http://www.interlet.dk
--
Javadocs and other OpenCms stuff: 
http://www.codedroids.com/community/opencms



More information about the opencms-dev mailing list