Hello All-
I have a DCR that when I click generate, it prompts me to enter the file name, then it opens a window with the following in the address bar and then never returns or generates the file:
http://localhost/iw-bin/iw_cgi_wrapper.cgi/iwtmplhtmlwizard.cgiBeing a newbie to templating, I don't know where to start looking in the logs for possible error or how to debug this exactly. Can anyone give me a hint on this? We are running TS 6.1 SP1 on Windows 2000. This DCT and PT was initially created by an IW consultant on TS 5.2.2 and this is the first time that we have attempted to get this working since the upgrade to 6.1. Any advice, help, flames much appreciated.
-Nathan
Washington State DIS
BTW, Here is the text of our .tpl.
*snip
<?xml version="1.0" encoding="UTF-8"?>
<iw_pt name="Media Release">
<![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.1 Transitional//EN">
<HTML>
<head>
<title><iw_value name='dcr.Headline'/></title>
<META NAME="title" CONTENT="<iw_value name='dcr.Headline'/>">
<META NAME="description" CONTENT="Department of Social and Health Services Media release.">
<META NAME="keywords" CONTENT="media release DSHS">
<META NAME="originatorJurisdiction" CONTENT="Washington State">
<META NAME="originatorDepartment" CONTENT="Department of Social and Health Services">
<META NAME="originatorDivision" CONTENT="Community Relations">
<META NAME="createDate" CONTENT="102803">
<META NAME="dateofLastModification" CONTENT="2005/03/09">
<STYLE TYPE="text/css">
BODY
{
margin-top: 0;
margin-left: 0;
}
H4
{
color:#333366; font: Verdana, Helvetica, Arial, Futura, Trebuchet;
}
H5
{
color:#000000; font: Verdana, Helvetica, Arial, Futura, Trebuchet;
}
</STYLE>
<script language="JavaScript" src="/js/date.js"></script>
</head>
<body background="/graphics/bggradient.gif" bgcolor="#ffffff" link="#336699" vlink="#990000" alink="#FF0000">
<script language="JavaScript" src="/js/calldatesub.js"></script>
<br>
<!--#include virtual="/ssi/3banner.ssi"-->
<a name="top"></a>
<h4>
]]>
<iw_iterate var='contact' list='dcr.Contact Info' >
<![CDATA[
Contact: ]]><iw_value name='contact.Contact Name' />
<iw_if expn='{iw_value name="contact.Contact Email"/} ne "" ' >
<iw_then>
<![CDATA[, <a href="mailto:]]><iw_value name='contact.Contact Email' /><![CDATA[">]]><iw_value name='contact.Contact Email' /><![CDATA[</a><br/>]]>
</iw_then>
<iw_else>
<![CDATA[<br/>]]>
</iw_else>
</iw_if>
</iw_iterate>
<![CDATA[
</h4>
<!--Begin:contents media release-->
<h3>
]]>
<iw_if expn=' {iw_value name="dcr.Press Release Number"/} ne "" ' >
<iw_then>
<![CDATA[NO. ]]><iw_value name='dcr.Press Release Number'/><br/>
</iw_then>
</iw_if>
<iw_if expn=' {iw_value name="dcr.Publish_Date.publish_date"/} ne "" ' >
<iw_then>
<iw_value name='dcr.Publish_Date.publish_date'/><br/>
</iw_then>
</iw_if>
<iw_if expn=' {iw_value name="dcr.Headline"/} ne "" ' >
<iw_then>
<iw_value name='dcr.Headline'/><br/>
</iw_then>
</iw_if>
<iw_if expn=' {iw_value name="dcr.SubHeadline"/} ne "" ' >
<iw_then>
<iw_value name='dcr.SubHeadline'/><br/>
</iw_then>
</iw_if>
<![CDATA[
</h3>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2">
]]>
<iw_iterate var='paragraph' list='dcr.Story'>
<iw_value name='paragraph.Paragraph'/>
</iw_iterate>
<
ress release content -->
<HR>
<div align="left"><font size="-1" face="Verdana">Modification Date:
]]>
<iw_perl>
<![CDATA[
use TeamSite::Config;
use Mail::Mailer;
(my $iwhome = TeamSite::Config::iwgethome()) =~ tr|\\|/|;
(my $iwmount = TeamSite::Config::iwgetmount()) =~ tr|\\|/|;
$DEBUG = 0;
$debugfile = "$iwhome/tmp/debug.txt";
debug("-----------------------");
debug("In news.tpl");
# Output current date to output page
my $fulltime = scalar(localtime(time()));
$fulltime =~ m!^([^\s]*)\s*([^\s]*)\s*([^\s]*)\s*([^\s]*)\s*([^\s]*)$!;
my $month = $2;
my $date = $3;
my $year = $5;
iwpt_output("$month $date, $year");
(my $output_filename = iwpt_get_ofile_name()) =~ tr|\\|/|;
$output_filename =~ s|^[^/]+||;
# If generating then set extended attributes on output file, send email, and regenerate the index file
if (!($output_filename =~ m|zz_tst_|)) {
# Set extended attributes
my $publish_date = iwpt_dcr_value('dcr.Publish_Date.publish_date');
my $headline = iwpt_dcr_value('dcr.Headline');
my $tmp_cmd = "$iwhome/bin/iwextattr -s PublishDate=$publish_date $output_filename";
`$tmp_cmd`;
$tmp_cmd = "$iwhome/bin/iwextattr -s \"Headline=$headline\" $output_filename";
`$tmp_cmd`;
# Send email
my $maildomain = get_config('iwsend_mail', 'maildomain');
my $mailserver = get_config('iwsend_mail', 'mailserver');
my $recipient_email = "ExecMediaCM\
@dshs.wa.gov";
my $sender_email = "webpublisher\
@dshs.wa.gov";
my $mailer = new Mail::Mailer('smtp', Server => $mailserver);
my %headers = (
'To' => $recipient_email,
'From' => $sender_email,
'Subject' => "DSHS Press Release Notice",
);
$mailer->open(\%headers);
my $tmp_press_release_num = iwpt_dcr_value("dcr.Press Release Number");
my $tmp_publish_date = iwpt_dcr_value("dcr.Publish_Date.publish_date");
my $tmp_headline = iwpt_dcr_value("dcr.Headline");
my $tmp_subheadline = iwpt_dcr_value("dcr.SubHeadline");
print $mailer <<EOS;
<html>
<body>
<FONT FACE="Arial, Helvetica, Sans Serif" size="2">
No. $tmp_press_release_num<br>
$tmp_publish_date<br>
$tmp_headline<br>
$tmp_subheadline<br>
EOS
foreach my $node (iwpt_dcr_list('dcr.Story')) {
my $value = iwpt_dcr_value('node.Paragraph');
print $mailer "$value";
}
print $mailer "</body></html>";
$mailer->close;
# Generate index page
(my $dcr_path = iwpt_get_dcr_name()) =~ tr|\\|/|;
$dcr_path =~ s|^[^/]+||;
my $tpl_path = $dcr_path;
$tpl_path =~ s|^(.*)/data/.*|$1/presentation/news_index\.tpl|;
my $index_path = $output_filename;
$index_path =~ s|^(.*)/mediareleases/.*|$1/mediareleases/index\.shtml|;
$tmp_cmd = "$iwhome/bin/iwgen -t $tpl_path -r $dcr_path $index_path";
debug ("in news: tmp_cmd is $tmp_cmd");
`$tmp_cmd`;
# Generate archive page
$tpl_path = $dcr_path;
$tpl_path =~ s|^(.*)/data/.*|$1/presentation/news_archive\.tpl|;
my $archive_path = $output_filename;
$archive_path =~ s|^(.*)/mediareleases/.*|$1/mediareleases/archive\.shtml|;
$tmp_cmd = "$iwhome/bin/iwgen -t $tpl_path -r $dcr_path $archive_path";
debug ("in news: tmp_cmd is $tmp_cmd");
`$tmp_cmd`;
}
# Function to read a value from iw.cfg
sub get_config {
my ($section, $entry, $default) =
@_;
my $value = `$iwhome/bin/iwconfig $section $entry`;
if (!defined $value) {
return $default;
} else {
chomp $value;
return ($value eq '') ? $default : $value;
}
}
sub debug
{
return unless $DEBUG;
my ($message,
@rest) =
@_;
open(DEBUG,">>$debugfile") or die "Can't open $debugfile: $!\n";
print DEBUG "$message\n";
close(DEBUG);
}
]]>
</iw_perl>
<![CDATA[
</font>
<!--#include virtual="/ssi/dshs_footer.ssi"-->
</div>
</body>
</html>
]]>
</iw_pt>