Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Adding a document usinf OScript--urgent
Support_Lloyds_Register
I want to copy a file from the file system to livelink interface.Could anyoone help me how to add document through custom module using OScript
Find more posts tagged with
Comments
eLink User
Message from Nair, Krishnankutty N. via eLinkWhat you are trying to accomplish can be easily done.If you have builderlook in WFMAIN->GeneralCallbackScripts and the script SaveToOrig.Also some of the stuff in the script might be superflous but it explains how we create a workflow report.Edit suitablyWe pass in workid and wfreportstorageid which we get from the workflow and workflow attributesrespectively.You may not need that.Our Script startsfunction Assoc SaveToLivelink( Integer workId, \ Integer wfReportStorageDataid, \ String fileName, \ Object prgCtx ) String wfReportName Assoc retVal Dynamic wfStorageDocument Assoc fileData DAPISESSION dSession DAPINODE wfStorageFolder Object LLNode Dynamic nodeStatus // Set up the DAPI session and get the parent node (the folder you are going to store the report in) dSession = prgCtx.Dsession().fSession wfStorageFolder = DAPI.GetNodeByID( dSession, 0, wfReportStorageDataid ) // Set up the LLNode subsystem for Documents LLNode = $LLIAPI.LLNodeSubsystem.GetItem ( $TypeDocument ) // Check to see if a workflow report already exists. wfReportName = str.ValueToString( workid ) + "_Workflow_Report" retVal = $LLIAPI.NodeUtil.IsNameUnique( wfReportName, wfStorageFolder ) // if the workflow report doesn't already exist then add it. if ( retVal.OK ) // Allocate a new node. Pass the parent node and the name of the new node. wfStorageDocument = LLNode.NodeAlloc( wfStorageFolder, wfReportName ) if ( wfStorageDocument.OK ) wfStorageDocument = wfStorageDocument.node else retVal.OK = False end // Set up the data about the version...versionFile is the path to the document fileData.comment = "A report of the workflow --- contains attributes, step and comments information." fileData.versionFile = fileName fileData.fileName = $WebDocUtils.GetName( fileName ) fileData.fileType = "html" fileData.platform = DAPI.PLATFORM_WINDOWS fileData.mimeType = "text/html" fileData.provider = "EXTSHARED" // Create the node. Pass the parent node, the dapi node of the object, and the data just set up. nodeStatus = LLnode.NodeCreate( wfStorageDocument,wfStorageFolder,fileData ) if ( !nodeStatus.OK ) retVal.OK = False end else // if the workflow report already exists then add a new version. wfStorageDocument = DAPI.GetNode( wfReportName, wfStorageFolder ) fileData.versionFile = fileName fileData.fileName = $WebDocUtils.GetName( fileName ) fileData.fileType = "html" fileData.platform = DAPI.PLATFORM_WINDOWS fileData.mimeType = "text/html" fileData.provider = "EXTSHARED" retVal = LLNode.NodeAddVersion( wfStorageDocument, fileData ) end end return retValendKrishnankutty N Nair 918-661-5824Livelink-EDMS -----Original Message-----From: eLink Discussion: Development Discussion[mailto:development@elinkkc.opentext.com]Sent: Tuesday, May 25, 2004 7:19 AMTo: eLink RecipientSubject: Adding a document usinf OScript--urgentAdding a document usinf OScript--urgentPosted by Campbell, Philip on 05/25/2004 08:17 AMI want to copy a file from the file system to livelink interface.Could anyoone help me how to add document through custom module using OScript[To reply to this thread, use your normal E-mail reply function.]============================================================Discussion: Development Discussion
https://knowledge.opentext.com/knowledge/livelink.exe?func=ll&objId=786303&objAction=viewLivelink
Server:
https://knowledge.opentext.com/knowledge/livelink.exe
Romain-Pierre_Bourque
I've got a strange message using this sort of script (LLIAPI_LLNodeErr.CoulNotFindTheDapiSessionObjectOf1) whith LLNode.NodeAlloc call ( -> LLIAPI.NodeUtil.FindapiCtx(node) -> Capi.ContextData wich is undefined). The message shows me my module name which is not a llnode because i just want to create a Document node. The parent node seems to be the good one, a folder, and the name of the new node is unique. I can't explain this unusual error, could you help me please ?