Good evening,
TS/TST 552, Window 2000
Let me explain the process to how we're attempting to generate files within TS. User completes a DCR, selects Save/Close on the DCT, prompted 'Do you want to submit for Approval' (YES) and wft is instantiated. In the wft file, I have an externaltask which calls a custom script. The custom script uses the iwgen cmd to generate the output file. When I attempt to execute the iwgen cmd for the script, the following error display:
Error creating file to be generated
Here's the remaining output of the script:
E:\Apps\Interwoven\iw-home\custom>corporateGenerateFileScript.ipl 35331 35332
area_path is Y:/default/main/Intranet/TSDev/WORKAREA/ysTestEnv
file path is /templatedata/department/CorporateNewsPage/data/ysTest
Y:\default\main\Intranet\TSDev\WORKAREA\ysTestEnv\LeadershipCorner\corporatenews\corpnews.asp: Error creating file to be generated
Corporate News method
e:/apps/INTERW~1/iw-home\bin\iwgen -t Y:/default/main/Intranet/TSDev/WORKAREA/ysTestEnv/templatedata/department/CorporateNewsPage/presentation/StandardWebPage.tpl -r Y:/default/main/Intranet/TSDev/WORKAREA/ysTestEnv/templatedata/department/CorporateNewsPage/data/ysTest Y:/default/main/Intranet/TSDev/WORKAREA/ysTestEnv/LeadershipCorner/corporatenews/corpnews.asp
Here's the tpl file:
<?xml version="1.0" encoding="UTF-8"?>
<iw_pt name="3-Column Dual Nav">
<iw_perl>
<![CDATA[
# determines the width of the content section based on
# the inclusion of a right and/or left nav panel
$LEFT_NAV_WIDTH = 150;
$RIGHT_NAV_WIDTH = 150;
my $left_nav = iwpt_dcr_value('dcr.Left Nav Panel');
my $right_nav = iwpt_dcr_value('dcr.Right Nav Panel');
my $content_width = 463;
if ($left_nav eq "")
{
$content_width += $LEFT_NAV_WIDTH;
$left_nav = 0;
}
else
{
$left_nav = $LEFT_NAV_WIDTH;
}
if ($right_nav eq "")
{
$content_width += $RIGHT_NAV_WIDTH;
$right_nav = 0;
}
else
{
$right_nav = $RIGHT_NAV_WIDTH;
}
]]>
</iw_perl>
<![CDATA[
<!-- #include virtual="_includes/intraMenuHome.inc" -->
<!-- #include virtual="_includes/intraMenuVar.inc" -->
]]>
<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="/Common/_Styles/mystyle.css" />
<title>
<iw_value name='dcr.Header'/>
</title>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" onLoad="writeMenus()">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="4">
<iw_include pt='/templatedata/components/intraHeaderNew.tpl'>
<![CDATA[
$iw_param{Theme} = iwpt_dcr_value('dcr.Theme');
$iw_param{Header} = iwpt_dcr_value('dcr.Header');
$iw_param{ColorScheme} = iwpt_dcr_value('dcr.ColorScheme');
]]>
</iw_include>
</td>
</tr>
<tr>
<td colspan="4" height="20"></td>
</tr>
<tr>
<td width="5" style="vertical-align: top">
<img src="images/spacer.gif" width="5" height="400" />
</td>
<td class="navpanel" width="{iw_value name='$left_nav'/}" style="vertical-align: top">
<iw_if expn="{iw_value name='dcr.Left Nav Panel'/} ne ''">
<iw_then>
<iw_include pt='/templatedata/components/navPanel.tpl'>
<![CDATA[
$iw_param{Location} = 'left';
$iw_param{navDCR} = iwpt_dcr_value('dcr.Left Nav Panel');
$iw_param{ColorScheme} = iwpt_dcr_value('dcr.ColorScheme');
$iw_param{Theme} = iwpt_dcr_value('dcr.Theme');
]]>
</iw_include>
</iw_then>
</iw_if>
</td>
<td width="100%" class="content">
<iw_value name='dcr.Paragraph' />
</td>
<td class="navpanel" width="{iw_value name='$right_nav'/}" style="vertical-align: top">
<iw_if expn="{iw_value name='dcr.Right Nav Panel'/} ne ''">
<iw_then>
<iw_include pt='/templatedata/components/navPanel.tpl'>
<![CDATA[
$iw_param{Location} = 'right';
$iw_param{navDCR} = iwpt_dcr_value('dcr.Right Nav Panel');
$iw_param{ColorScheme} = iwpt_dcr_value('dcr.ColorScheme');
$iw_param{Theme} = iwpt_dcr_value('dcr.Theme');
]]>
</iw_include>
</iw_then>
</iw_if>
</td>
</tr>
<tr>
<td colspan="4" height="10">
</td>
</tr>
<tr>
<td colspan="4">
<iw_include pt='/templatedata/components/intraFooter.tpl'/>
</td>
</tr>
</table>
</body>
</html>
</iw_pt>
Here's the custom script:
#!e:\apps\INTERW~1\iw-home/iw-perl/bin/iwperl
=head1 NAME
=head1 DESCRIPTION
=cut
##use strict;
use TeamSite::Config;
use TeamSite::WFtask;
use TeamSite::WFworkflow;
(my $iwhome = TeamSite::Config::iwgethome()) =~ tr|\\|/|;
(my $iwmount = TeamSite::Config::iwgetmount()) =~ tr|\\|/|;
my $IWGENHOME = $iwhome . "\\bin";
my $IWGENEXEC = $IWGENHOME . "\\iwgen";
my ($wfid, $taskid, $workarea,
@files) =
@ARGV;
my $task = new TeamSite::WFtask($taskid);
my $area_vpath = $task->GetArea();
(my $area_path = $iwmount . $area_vpath) =~ tr|\\|/|;
my
@files = $task->GetFiles();
print "area_path is $area_path\n\n\n";
foreach (
@files){ (my $file = "/" . $_) =~ tr|\\|/|;
if($file =~ m|data| && ($file =~ m|message| || $file =~ m|Message|)){
print "file path is $file\n\n\n";
&generateGarysMessage($file);
}
elsif($file =~ m|data| && ($file =~ m|news| || $file =~ m|News|)){
print "file path is $file\n\n\n";
&generateCorpNews($file);
}
}
sub generateGarysMessage{
local $dcrPath;
local $tplPath;
local $pathToOutputFile;
local $iwGenCmd;
local $runGenCmd;
(local $file = "/" . $_) =~ tr|\\|/|;
$dcrPath = "$area_path" . "$file";
$tplPath = "$area_path" . "\/templatedata\/department\/GarysMessagePage\/presentation\/LeadershipPage.tpl";
$pathToOutputFile = "$area_path" . "\/LeadershipCorner\/ceo\/message.asp";
$iwGenCmd = "$IWGENEXEC -t $tplPath -r $dcrPath $pathToOutputFile";
$runGenCmd = `$iwGenCmd`;
print "Garys Message method\n";
print "$IWGENEXEC " . "-t $tplPath " . "-r $dcrPath " . "$pathToOutputFile\n\n\n\n";
print "runGenCmd is $runGenCmd\n\n\n\n\n";
#return $runGenCmd;
}
sub generateCorpNews{
local $dcrPath;
local $tplPath;
local $pathToOutputFile;
local $iwGenCmd;
local $runGenCmd;
(local $file = "/" . $_) =~ tr|\\|/|;
$dcrPath = "$area_path" . "$file";
$tplPath = "$area_path" . "\/templatedata\/department\/CorporateNewsPage\/presentation\/StandardWebPage.tpl";
$pathToOutputFile = "$area_path" . "\/LeadershipCorner\/corporatenews\/corpnews.asp";
$iwGenCmd = "$IWGENEXEC -t $tplPath -r $dcrPath $pathToOutputFile";
$runGenCmd = `$iwGenCmd`;
print "Corporate News method\n";
print "$IWGENEXEC " . "-t $tplPath " . "-r $dcrPath " . "$pathToOutputFile\n\n\n\n";
print "runGenCmd is $runGenCmd\n";
#return $runGenCmd;
}
#if($runGenCmd = 0){
# $task->CallBack(0, "Generated File.");
#}
#elsif($runGenCmd = 1){
#$task->CallBack(1, "Generated File.");
#}
Edited by talktome_ys on 09/10/03 07:55 PM (server time).