Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
How to specify 'path' of data folder
rohitspathak123
Hi ,
Using TS 6.1 on Win 2000 SP4 box.
I have following templatedata structure
MyBranch/WORKAREA/MyWorkArea/templatedata/MyCategory/MyDataType/data
Now I want to write a javascript function to retrive list of all DCR present in data folder .
Want to know how do we specify path for 'data' folder in javascript .
function FindFile(dcrSourceName)
{
# Getting the FSO
var fso = new ActiveXObject('Scripting.FileSystemObject');
#how do we mention the path of 'data' folder
var dcr_path= ?
var fold = fso.GetFolder(dcr_path);
}
How should i refer to path of 'data' folder in javascript 'dcr_path' variable .
Can someone explain the basics of using the path in DCTs .
Regards
Rohit Pathak
Find more posts tagged with
Comments
Migrateduser
I'm not sure if there's a cleaner way to do this but IWDatacapture.getFormType() will get for you the type of DCT you're currently viewing. So, one could piece this together with:
var dcr_type = IWDatacapture.getFormType();
var dcr_path = "templatedata/" + dcr_type + "/data";
Is this the missing link you were looking for?
rohitspathak123
Hi ,
Thanks for response .
But even if I am hardcoding the 'dcr_path' value ...it is throwing HTTP 500 ERROR .
function FindFile(dcrSourceName)
{
alert ("DCR Name in find file: " + dcrSourceName);
var fso = new ActiveXObject('Scripting.FileSystemObject');
alert ("hello");
var path="templatedata/common_module/test/data";
var fold = fso.GetFolder(path);
}
Could u pls tell me what's the reason .
Regards
Rohit Pathak
Migrateduser
Well, what's the deal with var fso = new ActiveXObject('Scripting.FileSystemObject'), anyway? We're talking Javascript, not VBScript, right? I don't think that's allowed but what happens when you comment that line?
p1.rptdesign
Adam Stoller
Javascript is running on the client-side.
The TeamSite DCR data directory structure is on the server side.
If you want to use FormAPI - you would need to do CallServer() and call a CGI script on the server side - which could use Perl or some other language to actually generate the list you want and then use javascript and FormAPI (through the getScriptFrame() function) to push the retrieved data into the DCT form.
Alternatively - if this list is not dependent upon something having been selected in the DCT - but rather being a general list that will be accessed regardless of other fields - use an inline script (again, probably in Perl or java or some other language like that) to generate the list in a DCT-compatible format.