Created
April 5, 2012 22:20
-
-
Save mhulse/2314638 to your computer and use it in GitHub Desktop.
Caché DTI ContentPublisher: Tested in 7.6: A Simple CSP method that gets the StartDate timestamp from the dt_cms_schema.CMSStoryPubTracking table.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<csp:comment>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</csp:comment> | |
<script language="cache" method="cmsPubTracking" arguments='cmsStory:dt.cms.schema.CMSStory=-1, latest:%Integer=0' returntype="%TimeStamp" procedureblock="1"> | |
set return = "" | |
; By default, get the oldest entry: | |
set order = $case(latest, 1:"DESC", :"ASC") | |
try { | |
; See Roberto's and Sungung's replies: | |
; https://groups.google.com/d/topic/intersystems-public-cache/yKft-NK826I/discussion | |
; https://groups.google.com/d/topic/intersystems-public-cache/DH1fQOzwPiM/discussion | |
set sql = "SELECT StartDate FROM dt_cms_schema.CMSStoryPubTracking WHERE CMSStory = ? ORDER BY StartDate " _ order | |
set (sc1, sc2, sc3) = -1 | |
set rs = ##class(%ResultSet).%New() | |
set sc1 = rs.Prepare(sql) | |
if ($$$ISOK(sc1)) { | |
set sc2 = rs.Execute(cmsStory.%Id()) | |
if ($$$ISOK(sc2)) { | |
do rs.%Next(.sc3) | |
set:($$$ISOK(sc3)) return = rs.GetData(1) | |
} | |
} | |
} catch(e) { | |
; What to log and where? | |
} | |
quit return | |
</script> | |
<csp:comment> | |
<csp:object name="gStory" classname="dt.cms.schema.CMSStory" objid="27846880"> | |
#(..cmsPubTracking(gStory))# | |
</csp:comment> | |
<csp:comment>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</csp:comment> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment