Hi We are running some post-script (using iwextattr to set the extended attribute) on Save/Update the DCR's but the teamsite shows the DCR has updated by "System" instead of logged-in user. Is there any why to set the modified by OR any alternate way ?
r external script in the folder "iw-home\httpd\iw-bin".What do you mean by use "iw_cgi_wrapper.cgi", in the path name?Here is the sample external code.[...]using system clt we are executing iwextattr cmd.Where should I need to add .cgi to fix the problem.Thank you in advance
IWDatacapture.callServer("/iw-bin/iw_cgi_wrapper.cgi/setMetadata.ipl");iw_cgi_wrapper.cgi will impersonate the user and set him as modified by for that file.
"IW_home/bin/iwextattrib.exe -s Owner=".currently_logged_user." ".DCR_PATH
Here is the datacapture.cfg code to call the javascript codescript language="JavaScript" location="webserver" src="/iw-mount/default/main/Development/Admin/WORKAREA/shared/DCT/Product/SaveProductAttributes.jsand SaveProductAttributes.js is IWEventRegistry.addFormHandler("onSaveDone", setProductAttributes); IWEventRegistry.addFormHandler("onSaveNameSpecified", enforceFileNameRules); function setProductAttributes(){ var incontextasset = IWDatacapture.getDCRPath(); var incontextDCR=incontextasset.substring(incontextasset.indexOf("/default"),incontextasset.length); params = new Object(); params.incontextasset = incontextDCR; server=window.location.hostname; IWDatacapture.callServer("/iw-bin/Pall/set_productattributes.ipl",params); return true; } here I am calling to set_productattributes.ipl which is doing post script task to add new extended attributes. however the system automatically modifying the "Modified By" column and setting it to the "System" (which is actually without owner of the file). I want to stop system to modify "Modified BY" Column OR reset back the current user.I also tried to save the owner of the file in to the variable using the codemy $fileOwner = `iwextattr -g Owner Y:.\"$incontextasset\"`;before the first line postscriptand tried to save back to original ownerusingsystem "iwextattr -s Owner=\"$fileOwner\" \"$incontextasset\" ";but it didn't work for me
Place your CGI code directly under "iw-home/httpd/iw-bin". Impersonation Wrapper will not find it under "Pall" subfolder.When done, modify the call:// IWDatacapture.callServer("/iw-bin/Pall/set_productattributes.ipl",params); Commented out. Instead:IWDatacapture.callServer("/iw-bin/iw_cgi_wrapper.cgi/set_productattributes.ipl", params);Beware! As Ghoti already noted, the user of this stuff *may* need local Windows logging priviliges, directly or throughADS for example.
Thank you ISCBorisBThe problem has been resolved.As you said.I placed my CGI code directly under "iw-home/httpd/iw-bin". and modified the call:// IWDatacapture.callServer("/iw-bin/Pall/set_productattributes.ipl",params); Commented out. Instead:IWDatacapture.callServer("/iw-bin/iw_cgi_wrapper.cgi/set_productattributes.ipl", params);Now it is working fine
I am using CreateNewDcr.ipl file for setting Extended Attributes. In saveDone() method i have written command likeIWDatacapture.callServer("http://" + server + "/iw-bin/iw_cgi_wrapper.cgi/CreateNewDcr.ipl",params);It modifies name from iwui to user_name, but it does not call .ipl file, hence EA are not getting set.Even i tried by separating both cgi and ipl call like this-->IWDatacapture.callServer("http://" + server + "/iw-bin/geam/CreateNewDcr.ipl",params);IWDatacapture.callServer("http://" + server + "/iw-bin/iw_cgi_wrapper.cgi/CreateNewDcr.ipl",params);In this case, either of the callServer is called. Not both.Kindly help me on this issue.