The below .ipl file is what I am using to Tag the URI field when setting the metadata for a file .This is not working when I am trying to Tag multiple files ,it is putting the same value on all of them.Do you have any suggestions for this or any work arounds.Bascially I need set the name of the file(including vpath) to the Uri field of the metadata. This is my datacapture.cfg <item name="uri" pathid="uri">
<label>URI</label>
<description>This is the URI for the content </description>
<text size="75" required="f">
<cgi-callout url="/iw-bin/iw_cgi_wrapper.cgi/SetPath.ipl" label="SETPath" window-features="width=500,height=130,resizable=yes,toolbar=no,scrollbars=yes,titlebar=no"/>
</text>
</item>
I would prefer it if I could make it inline command.
My setpath.ipl
#!c:\x-apps\iw-home/iw-perl/bin/iwperl
#
# Copyright 2002 Interwoven, Inc.
# All Rights Reserved
# modified, enhanced, integrated with TeamSite
# August 2001
#
use TeamSite::CGI_lite;
use CGI qw(:standard);
# begin the cgitask
$|=1;
$cgi = TeamSite::CGI_lite->new();
$cgi->parse_data();
my $form_name = 'opener.'. $cgi->{'form'}{'iw_form_name'};
my $element_name = $cgi->{'form'}{'iw_callback_var'};
my $user_name = $cgi->{'form'}{'user_name'};
my $item_name = $cgi->{'form'}{'iw_item_name'};
my $item_description = $cgi->{'form'}{'iw_item_description'};
my $dcr_name = $cgi->{'form'}{'iw_object_name'};
my
@dcr_paths = $cgi->{'form'}{'path_0'};
$numofnums =
@dcr_paths ;
#foreach my $navType (
@dcr_paths){print "navType length: $#$navType\n";}
my $dcr_path=$dcr_paths[0];
$len = length $dcr_path;
$word="site";
$first = index($dcr_path, $word);
$dcr_path =substr( $dcr_path , $first-1, $len);
print "Content-type: text/html \n\n";
print <<EOF;
<HTML>
<HEAD>
<TITLE>ID</TITLE>
<script language="JavaScript">
function set_datacapture_item_value( selectedValue )
{
if ((window.opener == null) ||
(window.opener.closed))
{
return false;
}
var calloutForm = eval($form_name);
if (!calloutForm)
{
return false;
}
var calloutElementFound = false;
for ( i = 0 ; i < calloutForm.elements.length ; i++ )
{
if (calloutForm.elements
.name == '$element_name' && calloutForm.elements.value=="")
{
calloutForm.elements.value = selectedValue;
calloutElementFound = true;
}else{self.close();}
}
if (!calloutElementFound)
{
return false;
}
self.close();
return true;
}
//Form button calendar
//author unknown
</script>
</HEAD>
<body onload="set_datacapture_item_value('$dcr_path');">
</BODY>
</HTML>
EOF