Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
spaces in the dcr name
Bhargav Coca
I am on TS6.5 on win2000. I am trying to execute CLT getting extended attributes, Since there are spces in my folder names i had to enclose them in quotes, but still it didn't solve my problem. Is this syntax right? Please some one can suggest me the right syntax pleasee to bypass spaces.
my $cmd_ea_dcr = "$ext_attr_cmd -g TeamSite/Templating/DCR/Type \"$entirepath\" ";
print LOG "Extended Attrib : $cmd_ea_dcr\n";
Out put ---
Extended Attrib : C:\Interwoven\TeamSite/bin/iwextattr -g TeamSite/Templating/DCR/Type \default\main\VSD\Content\WORKAREA\Work\templatedata\News and Media Center\Award\data\cocatest1
This will not work because the path to DCR is not in the quotes.
Thank you
Find more posts tagged with
Comments
jbonifaci
You must not be posting your exact code, as your quotes would be showing up if you were. That aside, I would recommend changing how you are creating your command slightly:
my $cmd_ea_dcr =
qq|
$ext_attr_cmd -g TeamSite/Templating/DCR/Type "$entirepath"
|
;
~Jeff
Bhargav Coca
Thank you for the reply, atlast some one is there to reply. But this didn't work. The command generated is not picking up the quotes. it still the path with no quotes.
Thank you
jbonifaci
Please post your entire code, as the code you and I both posted should have contain the quotes in your command variable. There must be something else in your code that is removing them.
~Jeff
Bhargav Coca
Here is the code, this is an ipl which my external task is calling to generate a xml file for the given dcr and attach it to the workflow. I am adding the only snippet i have.
Thank you
my
@file_list
= $task->GetFiles();
my $dcrs_attached = "";
foreach my $file (
@file_list){
print LOG "File list : $file\n";
if($file =~ /templatedata/){
my $entirepath = "$workarea\\$file";
my $cmd_ea_dcr = qq|$ext_attr_cmd -g TeamSite/Templating/DCR/Type "$entirepath"|;
print LOG "Extended Attrib : $cmd_ea_dcr\n";
my $ea_dcr = `$cmd_ea_dcr`;
@dcrsxml
= split(/\//,$ea_dcr);
print LOG "dcrXML
@dcrsxml\n"
;
foreach my $dcrspec1 (
@dcrsxml)
{
}
print LOG "*****
@dcrsxml[0]\\
@dcrsxml[1]\n"
;
$ea_dcr=~s/\//\\/g;
print LOG "This is file : $ea_dcr\n";
$dataType = $ea_dcr;
$dataType =~s/(.*)\\(.*)$/$2/;
print LOG "DatarTpe : $dataType\n";
$dcrs_attached .= "$file";
$dcrsfull = "$iwmount$workarea\\$dcrs_attached";
$dcrName = $file;
$dcrName =~s/[(.*)\\]+(.*)$/$2/;
print LOG "dcrName = $dcrname\n";
@dcrsfullArray
= split(/\\/,$dcrsfull);
$len = scalar
@dcrsfullArray
;
$len = $len - 1;
print LOG "length = $len\n ";
foreach my $dcrsfulle (
@dcrsfullArray)
{
}
#print LOG "*#*#*#*#*#*#*
@dcrsfull[10]
\n";
print LOG " Dcrs Attached : $dcrsfull\n";
$initialPath = $dcrsfull;
print LOG " inital Path 1: $initialPath\n";
$initialPath =~s/(.*)\\data\\(.*)/$1/;
print LOG "Initial path :$initialPath\n";
my $generate = "$generate_cmd -t \"$initialPath\\presentation\\$dataType.tpl\" -r \"$dcrsfull\" \"\\$workarea\\xml\\$ea_dcr\\$dcrsfullArray[$len].xml\"";
print LOG "Datatype : $dataType\n";
print LOG " Generate cmd : $generate";
my $img_path = "xml\\$ea_dcr\\$dcrsfullArray[$len].xml";
my $exe_gen_cmd = `$generate`;
my $cmd = "$attach_file_cmd $task_id $img_path '' ";
print LOG "cmd = $cmd \n";
print LOG "Length : $len\n";
print LOG "Dcrs Full array : $dcrsfullArray[$len]\n";
my $results = `$cmd`;
print LOG "\nAttaching File $img_path - Result: $results\n\n";
}
if($file =~ /xml/){
print LOG "
@#
@#
@#
@#
@#
@#
$file\n";
my $cmd_ea_dcr = "$ext_attr_cmd -g TeamSite/Templating/PrimaryDocumentType $workarea\\$file";
my $cmd_dcr = "$ext_attr_cmd -g TeamSite/Templating/PrimaryDCR $workarea\\$file";
# print LOG "Extended Command : $cmd_ea_dcr\n";
my $dcrname = `$cmd_dcr`;
my $dcrtype = `$cmd_ea_dcr`;
$dcrtype=~s/\//\\/g;
print LOG "DCR TYPE : $dcrtype\n";
print LOG "DCR Name: $dcrname\n";
my $dcrpath = "\\templatedata\\$dcrtype\\data\\$dcrname";
my $attachcmd = "$attach_file_cmd $task_id \"$dcrpath\" '' ";
print LOG "attachcmd = $attachcmd\n";
my $endresult = `$attachcmd`;
}
}
return $dcrs_attached;
}
jbonifaci
I don't know what to tell you. Looking at the code, I want to say that there is no way it is leaving out the quotes in the command. Are you sure the log file is being updated? Are you sure there is no where else in the code that is doing exactly what you are and you are looking at the wrong logging statement? Try changing the log statement label to something unique and make sure the log file is updated with this unique label, for example:
print LOG "Extended Attrib
(It is unlikely this will not be unique)
: $cmd_ea_dcr\n";
~Jeff
Bhargav Coca
Thank you so much, it works, I have the somemore quotes in bottom which were not generating the file which the whole snippet was meant for. Now i have changesd all the quotes to qq , and it works.
Thank you
Adam Stoller
I have to agree with jeff - I think you're chasing the wrong line of code.
Just create a simple script like:
use strict;
use warnings;
my $cmd = qq|some_command with "quoted arguments"|;
print "CMD: $cmd\n";
and run it via
iwperl
scriptname
from the command prompt - and you should see:
CMD: some_command with "quoted arguments"
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com