Home
TeamSite
Get Last Modified from DCT
fred_sanford
I've got a TPL that generates two files, one for content, one for navigation. Inside the DCT I want to check and see if the navigation file has been modified outside of templating by comparing the last modified dates. I can easily get the DCR last mod by IWDCRInfo.getModificationDate() however it is proving tricky to find out the last mod for the nav file. I know the full path of the file and all sorts of perl commands (perl -e stat etc...) to find out the last mod date but how in the world can I call a command line from a DCT? Inline and callserver call an external file, which is an ok solution, but I'd rather not maintain an additional file for a one-line task.
Find more posts tagged with
Comments
Adam Stoller
You'll either have to use inline, a cgi-callout, or a server-side CGI with CallServer() since FormAPI is run on the client side and thus won't have access to the file on the server in order to perform the stat operation you're looking for - if you need to do this at the DCT/DCR level.
If you can delay and perform the operation at the PT level - it's a lot easier...
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Dwayne
Well, I'm afraid I don't know any alternative to either
callServer
or
inline
.
Of the two, I'd
definitely
choose
inline
for your situation - much simpler to test, maintain, and understand. As long as you don't need to refresh the timestamp after the DCT has been loaded into memory.
--
Current project: TS 5.5.2/6.1 W2K
fred_sanford
I figured that was the answer. So much for compactness and efficiency. Thanks for the reply.
fred_sanford
Yeah, wish I could wait until TPL but I need to prompt the user in the DCT if they want to overwrite the nav file or specify a new location.