[opencms-dev] Get Content's Last Modified Date

karl adenener adenener at hotmail.com
Wed Jan 9 07:29:35 CET 2008



Hi Nick, 

you know this?

CmsTemplateModules cms     = new CmsTemplateModules(pageContext, request, response);
CmsObject cmso        = cms.getCmsObject();
CmsResource cmsr    = cmso.readResource( uri );
CmsFile file               = new CmsFile( cmsr ); // or Ressource or Folder
file.getDateContent() // Returns the date of the last modification of the content of this resource.

For me it is working fine.

Aden

Date: Tue, 8 Jan 2008 12:05:31 -0600
From: ndesteffen at tlcontact.com
To: opencms-dev at opencms.org
Subject: [opencms-dev] Get Content's Last Modified Date


















Hi,

I’m trying to get the date that a page was last modified.  When I use the
following code in a .jsp the date that is returned is the modified date of the
template.  Any ideas on how to get at the content’s date?  It has to be
available as its listed in the workspace.

 

org.opencms.flex.CmsFlexController
controller = org.opencms.flex.CmsFlexController.getController(request);

java.util.Date expired = new
java.util.Date(controller.getDateLastModified());

 

Thanks!

 

Nick DeSteffen

Web Developer - CarePages Inc.

http://www.carepages.com

ndesteffen at tlcontact.com

 

 



----

Harness the compassion to help when someone needs
you. We're excited to announce 'We Carry Each
Other,' a collection of inspiring stories and
practical tips on how to cope and care from Eric
and Sharon Langshur, the founders of CarePages.
Look at your local major bookseller or visit
http://www.carepages.com/we_carry.jsp




_________________________________________________________________
Testen Sie Live.com - die schnelle, personalisierte Homepage, über die Sie auf alle für Sie relevanten Inhalte zentral zugreifen können.
http://www.live.com/getstarted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20080109/5005eda6/attachment.htm>


More information about the opencms-dev mailing list