callServer() framework written by some genius iwov expert working only for first replicant
Hi Expert,
I am using the callServer() framework written by some genius iwov expert. Well, I am following it properly(as per the definition) but somehow its failing to process all the replicants. Its processing only first replicants.
I am calling the callServerDone() method inside my perl code( the script used inside callServerQueue() method).
I tried to have an alert call in all the methods of the callServer() farmework and every time alert is getting triggered but callServerQueue() is processing only first record.
Please below see the java script I am calling from my DCT. CallServer.js is the file which has all the callServer() framework method.
<script language="javascript" src="https://www.tdameritrade.com/retail-en_us/resources/javascript/custom_libs/libs/jquery-1.10.1.min.js"/>
<script language="javascript" src="https://www.tdameritrade.com/retail-en_us/resources/javascript/release/jquery/jquery-ui/js/jquery-ui-1.10.4.custom.min.js"/>
<script language="javascript" src="/iw/js/personalization/CallServer.js"></script>
<script language="javascript" location="template-type" src="/guiupdate/guiupdate.js"/>
<script language="javascript" src="/iw/js/personalization/personalization.js"/>
<script language="javascript" src="/iw/js/personalization/repdelete.js"/>
<script language="javascript" src="/iw/js/personalization/logictemplate.js"/>
<script language="javascript" src="/iw-cc/base/widget/calendar/calendar_init.js" type="text/javascript"/>
The perl script where I am calling the callServerDone() method.
#!C:\Interwoven\TeamSite/iw-perl/bin/iwperl -w
use strict;
use warnings;
use File::Copy;
use TeamSite::Config;
use CGI;
use TeamSite::CGI_lite;
my $timestamp = localtime(time);
my $logFile = "C:/Interwoven/TeamSite/local/logs/FileCopy.log";
open(LOG, ">>$logFile") or die "Unable to open logfile:$!\n";
print LOG "Entering FileCopy - TEMP.ipl \n";
#This file requires source and destination parameters.
my $in = new CGI;
my $source_file =$in->param('source');
print LOG "source file is : $source_file \n";
my $target_file = $in->param('target');
print LOG "Target file is : $target_file \n";
copy($source_file,$target_file) or die "File cannot be copied: $!";
close LOG;
print <<"END";
<!DOCTYPE html>
<html>
<head>
<title>TD Ameritrade - Teamsite</title>
<body>
//<script language="javascript" src="http://devctwvcmsapp01.pte-am.ameritrade.com/iw/js/personalization/personalization.js"></script>
<script language="javascript" src="http://devctwvcmsapp01.pte-am.ameritrade.com/iw/js/personalization/CallServer.js"></script>
<script>
callServerDone();
//alert("done");
</script>
END
exit 0;
The below method I am calling from my js file.
callServerQueue("http://devctwvcmsapp01.pte-am.ameritrade.com/iw-bin/FileCopy.ipl", param,true);
Regards,
Ajay Tyagi
Comments
-
OK, you are missing the code that actually calls the callserver.
More importantly you need to say what you want to happen. Are you planning to pass all items in the replicant to the callserver or are you expecting to call it for each replicant ? Looking at the IPL you posted, I assume it is the latter, though that is a horrid way of doing it.
0 -
Thanks again for your reply!
Well, i tryed like a below but it works fine till i have 29 files attached in my DCR. When i checked the size of the object and found that its getting failed when object size goes beyond 8080 bytes.
var ruleCount = IWDatacapture.getItem("/personalization_root_container/personalization_container").getChildren().length;
// showLoadingIndicator(true,ruleCount);
//alert("rulecount="+ruleCount);
var fileList = [];
for(var count=1;count<=ruleCount;count++)
{
var src=IWDatacapture.getItem("/personalization_root_container/personalization_container["+count+"]/src").getValue();
var dest=IWDatacapture.getItem("/personalization_root_container/personalization_container["+count+"]/dest").getValue();
fileList.push(src + ',' + dest);
//fileList.push(src);
}
fileList = fileList.join("|");
//alert("Ajay" + fileList);
alert("Ajay" + fileList.length);
IWDatacapture.callServer("/iw-bin/Filecopy.ipl ", { source: fileList }, true);
return true;0 -
Well you can either write an IPL that allows mulitple instances of itself, though I am not certain of what it does so that may not be possible, or you can wait for the callserver to return (they are async by default) within the callback routine and kick off the second one.
Lastly, you can adjust how you send the data to your current IPL. Instead of full paths, send WA relative paths and then the WA itself. That may allow you to send more than 29 in hte 8080 characters.
0
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 103 General Questions
- 123 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 123 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax
- Docker Automation
- LiveSite Content Services (LSCS) REST API
- Single Page Application (SPA) Modules
- TeamSite Add-ons
If you are interested in gaining full access to the content, you can register for a My Support account here.