Created
April 6, 2011 22:17
-
-
Save mhulse/906660 to your computer and use it in GitHub Desktop.
Get staff e-mails via DTI's Content Publisher CMS. Language keywords: CSP (Caché Server Page), COS (Caché Objectscript)
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="email" arguments='name:%String=""' returntype="%String" procedureblock="1"> | |
set return = "" | |
try { | |
set currentNS = $znspace | |
znspace ##class(dt.common.NamespaceProcs).GetLocationsName() | |
set sql = | |
"SELECT DISTINCT email " _ | |
"FROM dt_enewsroom_schema.NewsroomContact " _ | |
"WHERE fullName [ '" _ name _ "'" | |
set rs = ##class(%ResultSet).%New("%DynamicQuery:SQL") | |
set sc = rs.Prepare(sql) | |
if ($$$ISOK(sc)) { | |
set sc = rs.Execute() | |
if ($$$ISOK(sc)) { | |
if (rs.Next()) { | |
set return = rs.GetData(1) | |
} | |
} | |
} | |
znspace currentNS | |
} catch(e) { | |
; What to log and where? | |
} | |
quit return | |
</script> | |
<csp:comment> | |
<csp:object name="gStory" classname="dt.cms.schema.CMSStory" objid="26035312"> | |
#(..email("First M Last"))# | |
</csp:comment> | |
<csp:comment>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</csp:comment> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment