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)
IManExt.NewProfile.ProfileNoUI
maselunas
I am trying to import a new document using the IManage 8.2 Type Library and IManExt 1.0 Type Library. I have successfully executed this code in the .NET environment, but I am now trying to get it to work using a scripting language similar to JavaScript.
The scripts behave exactly the same way, except for some reason when I run it in the scripting language, it ignores my call to import silently and not display the New Profile dialog.
context.Add("IManExt.NewProfile.ProfileNoUI", true);
It will display every time the script is executed.
Does anyone have any ideas or suggestions?
Thanks
CODE
===========
function interwoven(){
var dms = COMCreateObject("IManage.ManDMS.1");
var ses;
ses = dms.Sessions.Add("LIBRARY_NAME");
ses.TrustedLogin();
var db;
db = ses.Databases.ItemByName("DB_NAME");
var fparms;
fparms = dms.CreateFolderSearchParameters();
fparms.Add(0, "12345"); // 0 = imFolderAttributeID.imFolderID
var dblist = COMCreateObject("IManage.ManStrings");
dblist.Add("" + db.Name);
var results;;
results = ses.WorkArea.SearchFolders(dblist, fparms);
if (results.Empty){
ses.Logout();
return;
}
var fldr;
fldr = results.ItemByIndex(1);
if (fldr){
var sPath = "c:\\Documents and Settings\\All Users\\Desktop\\Test doc.doc";
var context = COMCreateObject("IManExt.ContextItems");
var impCmd = COMCreateObject("IManExt.ImportCmd");
context.Add("IManDestinationObject", fldr);
context.Add("IManExt.Import.FileName", ("" + sPath));
context.Add("IManExt.Import.DocAuthor", ("" + ses.UserID));
context.Add("IManExt.Import.DocClass", "MISC");
context.Add("IManExt.Import.DocDescription", ("" + sPath));
context.Add("IManExt.NewProfile.ProfileNoUI", true);
context.Add("IManExt.Import.InheritSecurity", true);
impCmd.Initialize(context);
impCmd.Update();
if (impCmd.Status === 0){
impCmd.Execute();
var brefresh = context.Item("IManExt.Refresh");
if (brefresh){
var doc;
doc = context.Item("ImportedDocument");
}
}
}
ses.Logout();
}
Find more posts tagged with
Comments
There are no comments yet