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)
IWDCRInfo.getStatus() Issues
dolly1
Hi,
I was trying to implement auto naming of the DCR and for that I had to check if a DCR with same name already exists. I did that using the IWDCRInfo.getStatus() and it is working fine.
Though I have discovered one issue later that if I have a DCR name "x.dcr" which was existing but now I have deleted it, submitted to STAGING area so the dcr is now deleted from STAGING area as well, still when I create a new DCR and the name happens to be "x.dcr" it does not get saved because IWDCRInfo.getStatus() still returns AVAILABLE.
I am not sure why is this. Is it that IWDCRInfo.getStatus() does not check the data folder but something else?
Here is the code..
function checkStatus()
{
var status = IWDCRInfo.getStatus();
if (status == IWDCRInfo.AVAILABLE) {
IWDCRInfo.setDCRName(null);
alert("DCR Already Exists !!!");
return true;
}
else if (status == IWDCRInfo.UNAVAILABLE) {
// Save the DCR and call the function to set the property //iw_form_valid = true
IWDatacapture.save();
setIW_Valid_True();
return true;
}
else if (status == IWDCRInfo.ERROR) {
alert("Can not set DCR Name");
}
else {
return true;
}
}
Please help.
TS 6.7.1 SP1, Solaris 10
Find more posts tagged with
Comments
BlueWhale
You can have some more troubleshooting of the issue you have like:
Use IWDCRInfo.getDCRName (), IWDCRInfo.getOwner (), IWDCRInfo.getModificationDate () etc., to get more information of the DCR that is deleted but the IWDCRInfo.getStatus() showing AVAILABLE. By the above, may be you can figure out whats going on.
[font=TheSansMono-Bold]
[/font]
Icebreaker
Hi There,
I do the following:
function checkFileExists()
{
dcrobj = new Array();
dcrobj['IW_DCT_PATH'] = parent.gWorkarea + "/templatedata/" + parent.gTDT;
var params = new Object();
var server = window.location.hostname;
var fileName= IWDCRInfo.getDCRName();
fileName = fileName.toLowerCase();
LTrim(RTrim(fileName));
params.vpath = dcrobj['IW_DCT_PATH'];
params.fileName = fileName;
IWDatacapture.callServer("/iw-bin/file_grep.cgi", params);
}
In my file_grep.cgi, I use TeamSite:
irwalk to browse through the files and see if the filename already exists.
Regards,