Good evening,
I have the following section of code in my workflow script:
foreach $compareAttachedFile (
@files){ if($compareAttachedFile =~ m/data/i && ($compareAttachedFile =~ m/CorporateNews\// || $compareAttachedFile =~ m/CorporateNews\\/)){
$iwPTCompileCmd = "$iwPTCompileCLT -pt " . "Y:" . "$area_path/$templateFiles{RedirectPage} -iw_pt-dcr " . "Y:" . "$dcrPath -ofile " . "Y:" . "$area_path$generatedOutputFiles{CCN} -iw_pt-arg articleType=CN";
$iwPTCompileCmd =~ tr|\\|/|;
$iwPTCompileRun = `$iwPTCompileCmd`;
$task->AddFile("$generatedOutputFiles{CCN}", "Generated Output File");
print "FileAdd is $generatedOutputFiles{CCN}\n";
}
elsif($compareAttachedFile =~ m/data/i && ($compareAttachedFile =~ m/CeoMessage\//i || $compareAttachedFile =~ m/CeoMessage\\/i)){
$iwPTCompileCmd = "$iwPTCompileCLT -pt " . "Y:" . "$area_path/$templateFiles{RedirectPage} -iw_pt-dcr " . "Y:" . "$dcrPath -ofile " . "Y:" . "$area_path$generatedOutputFiles{GM} -iw_pt-arg articleType=Ceo";
$iwPTCompileCmd =~ tr|\\|/|;
$iwPTCompileRun = `$iwPTCompileCmd`;
$task->AddFile("$generatedOutputFiles{GM}", "Generated Output File");
print "FileAdd is $generatedOutputFiles{GM}\n";
}
##CHECK POINT
print "iwPTCompileCmd is: $iwPTCompileCmd\n";
One works (CeoMessage) and the other doesn't (CorporateNews). Here are the cmd output to the logs:
WORKS:
START OF SCRIPT
iwPTCompileCmd is: e:/apps/INTERW~1/iw-home/bin/iwpt_compile.ipl -pt Y:/default/main/Intranet/TSDev/WORKAREA/TSDevWA/templatedata/department/linkList/presentation/Redirect.tpl -iw_pt-dcr Y:/default/main/Intranet/TSDev/WORKAREA/TSDevWA/templatedata/department/linkList/data/newHome1 -ofile Y:/default/main/Intranet/TSDev/WORKAREA/TSDevWA/CorporateNewsLetter/ceo/CurrentMessage.asp -iw_pt-arg articleType=Ceo
END OF SCRIPT
DOSESN'T:
START OF SCRIPT
iwPTCompileCmd is: e:/apps/INTERW~1/iw-home/bin/iwpt_compile.ipl -pt Y:/default/main/Intranet/TSDev/WORKAREA/TSDevWA/templatedata/department/linkList/presentation/Redirect.tpl -iw_pt-dcr Y:/default/main/Intranet/TSDev/WORKAREA/TSDevWA/templatedata/department/linkList/data/newHome1 -ofile Y:/default/main/Intranet/TSDev/WORKAREA/TSDevWA/CorporateNewsLetter/CurrentNews.asp -iw_pt-arg articleType=CN
END OF SCRIPT
When I run both cmds from the dos prompted, no errors but only one generates. Permissons are consistant in both target locations. Here's the tpl code:
<?xml version="1.0" encoding="UTF-8"?>
<iw_pt name="Link List">
<iw_perl><![CDATA[
##my $sortType = iwpt_dcr_value('dcr.how_to_sort');
##iwpt_output("<b>Sorted by: ".$sortType."<\/b>\n\n");
my $articleType = $iw_arg{articleType};
iwpt_output("ARGUMENT is $articleType\n");
#my $articleType = "CorporateNews";
my $iterateNumber = "0";
my
@sorted_replicants = reverse sort byReplicant iwpt_dcr_list('dcr.Hyperlinks');
foreach my $rep (
@sorted_replicants){ my $linkText = iwpt_dcr_value('rep.LinkText');
my $linkCaption = iwpt_dcr_value('rep.LinkCaption');
my $linkDate = iwpt_dcr_value('rep.LinkDate');
my $linkUrl = iwpt_dcr_value('rep.LinkURL');
my $linkPage = iwpt_dcr_value('rep.LinkPage');
# do what you want with replicant info
if($iterateNumber eq "0" && $articleType eq "CN" && $linkPage eq "CorporateNews"){
iwpt_output(qq~
HELLO WORLD
<!-- <%
if ("$linkUrl")<>"" then
Response.Redirect("$linkUrl")
end if
%> -->
~);
$iterateNumber = $iterateNumber + 1;
exit;
}
elsif($iterateNumber eq "0" && $articleType eq "Ceo" && $linkPage eq "Ceo"){
iwpt_output(qq~
<%
if ("$linkUrl")<>"" then
Response.Redirect("$linkUrl")
end if
%>
~);
$iterateNumber = $iterateNumber + 1;
exit;
}
}
sub byReplicant{
#sort criteria here
#by LinkText
#return(iwpt_dcr_value('a.LinkText') cmp iwpt_dcr_value('b.LinkText'));
#by LinkText (ignore case)
#return(lc(iwpt_dcr_value('a.LinkText')) cmp lc(iwpt_dcr_value('b.LinkText')));
#by LinkCaption
#return(iwpt_dcr_value('a.LinkCaption') cmp iwpt_dcr_value('b.LinkCaption'));
#by LinkCaption (ignore case)
#return(lc(iwpt_dcr_value('a.LinkCaption')) cmp lc(iwpt_dcr_value('b.LinkCaption')));
#by LinkDate (without modules, can also use a date comparision module if you have access)
my ($aM,$aD,$aY) = split('/',(iwpt_dcr_value('a.LinkDate')));
my ($bM,$bD,$bY) = split('/',(iwpt_dcr_value('b.LinkDate')));
my $aDate = sprintf("%4.4d%2.2d%2.2d",$aY,$aM,$aD);
my $bDate = sprintf("%4.4d%2.2d%2.2d",$bY,$bM,$bD);
return($aDate <=> $bDate);
#by LinkPage
#return(iwpt_dcr_value('a.LinkPage') cmp iwpt_dcr_value('b.LinkPage'));
#by LinkPage (ignore case)
#return(lc(iwpt_dcr_value('a.LinkPage')) cmp lc(iwpt_dcr_value('b.LinkPage')));
}
]]></iw_perl>
</iw_pt>
Any assistance would be greatly appreciated!
Regards,