Home
TeamSite
Extract doc using .nrl file
amp834
How can I extract a document given the .nrl file for it? (to get, say, memo.doc on the hard disk without actually checking it out)
Nrl.exe /imanext.ExportCmd "%1" prompts the user, I want to do it programmatically. (%1 is the .nrl file).
A command line option would work (with some way of getting errors if it cannot extract the document), otherwise the simplest SDK calls that can be used.
Is the COM sdk available to all installations, or is it purchased separately? (I'm not sure if my client has purchased such an option if it exists, so a simpler solution would be better)
Any hints on where to find documentation and a roadmap of the non-sdk tools and the sdk documentation would be very useful.
Find more posts tagged with
Comments
jny
The NRL context has this format:
//SERVERNAME
//DOCUMENT OBJECTID
//Latest, current, or user-select version
DSS_WIN2003SERV
!nrtdms:0:!session
SS_WIN2003SERV:!database:WSDSS1:!document:452,1:
[Version]
Latest=N
If you want to download a copy of the document, you would first extract the objectid. Then, log onto a WorkSite dms object (via the SDK), then call GetCopy to download the file, like so:
[VB]
==================
Dim dms As New ManDMS
Dim sess As IManSession
Dim db As IManDatabase
'Logon
Set sess = dms.Sessions.Add("SERVERNAME") 'You can extract this from the nrl file content.
sess.Login "USERID", "PASSWORD"
' Or trusted logon
'sess.TrustedLogin
'Get database
Set db = sess.Databases.ItemByName("DATABASENAME") 'You can extract that by parsing the document object id, e.g., WSDSS1 is the database based on the objectid in the above sample nrl content.
Dim sDownloadpath As String
sDownloadpath = "C:\TEMP\copy_411_1.dox" 'Must be a full file path
'Get document
Dim doc As IManDocument
Set doc = db.GetDocument(411, 1).LatestVersion 'Version is determined by the value under [Version] in the nrl content.
'Download
doc.GetCopy sDownloadpath, imNativeFormat
==================
I don't know how the SDK is sold, whether it's a separate purchase or as a bundle. You would need to check with your client or their WorkSite rep.