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)
Check out a document within a connector
MikeatBDB
Hi all
I am currently writing a connector to list work that transfers to an outsource company. The report work fine but now I have been asked that there should be a hyperlink to do an integrated checkout of a document if the person has a copy of filesite on their machine. The document will need to be written to the local machine not the server. I have seen something in the forms about using a HttpRequest to move it but I want to avoid any pop up dialogs and this will pop up a dialog.
Is it possible to use the applets on the Checkout screen to do this and has anyone got any documentation on how to do this?
Thanks
Mike
Bircham Dyson Bell
Find more posts tagged with
Comments
jny
One approach I could think of is to implement a COM Server Object that will invoke an instance of the CheckoutCmd Object (which is exposed by the IManExt.dll). This is an automated command object that is used to checkout the selected document file along with its PRF file to the portable directory. The IManExt.CheckoutCmd.NoCmdUI ContextItem is used to skip the UI so the checkout op will be silent.
In your code behind the hyper link, you will then need to create an instance of this Server Object to execute the CheckoutCmd. See iHelp folder in your SDK for iManage Extension Library Reference Manual.pdf and COM Reference Manual for WorkSite.pdf manuals for reference info on the IManExt.dll and iManage.dll objects respectively.
Here is some code snippet on how to use the CheckoutCmd Object:
[VB6]
On Error GoTo Oops
Dim sess As IManage.NRTSession
Dim db As IManage.NRTDatabase
Dim doc As IManage.NRTDocument
Dim strPath As String
' Assuming that sess is a valid handle to a connected session object
Set db = sess.Databases("<DatabaseName>")
Set doc = db.GetDocument(560, 1) ' Arbitrary example of a document number and version
If doc Is Nothing Then GoTo Cleanup
Dim pCheckoutCmd As IMANEXTLib.CheckoutCmd
Dim pCIs As IMANEXTLib.ContextItems
Dim dox(0) As IManage.NRTDocument
Set dox(0) = doc
Set pCheckoutCmd = New IMANEXTLib.CheckoutCmd
Set pCIs = New IMANEXTLib.ContextItems
' Add required contextitems
pCIs.Add "ParentWindow", Me.hWnd
pCIs.Add "SelectedNRTDocuments", dox
' Optional contextitems
pCIs.Add "IManExt.CheckoutCmd.NoVersionPrompts", True
pCIs.Add "IManExt.CheckoutCmd.NoCmdUI", True
pCIs.Add "IManExt.CheckoutCmd.NoCheckingBeforeCheckout", True
pCheckoutCmd.Initialize pCIs
pCheckoutCmd.Update
If pCheckoutCmd.Status = (pCheckoutCmd.Status And nrActiveCommand) Then
pCheckoutCmd.Execute
Dim blRefresh As Boolean
blRefresh = pCIs.Item("IManExt.Refresh")
If blRefresh = True Then
If doc.CheckedOut = True Then
strPath = doc.CheckoutPath
MsgBox strPath
End If
End If
pCIs.Remove "IManExt.Refresh"
End If
GoTo Cleanup
Oops:
MsgBox Err.Description
Err.Clear
dabird
Since you are within the context of a connector, an alternative approach would be to use the WebTransferCtrl that ships with WorkSite Web, which is an ActiveX control. The applet that ships with WSW does not support integrated checkout.
In order for this to work properly, you need to ensure that the following items are in place:
1. Since integrated checkout uses an ActiveX control, the client's browser must be able to accept signed ActiveX controls. This is handled in IE under Tools | Internet Options for the security zone in which the url to WSW is located. For most companies, WSW will probably be located in the Intranet Zone.
2. Make sure that WSW is configured to use ActiveX in Global Options. You can find this setting in the Document Settings panel.
3. A requirement of integrated checkout from WSW is that DeskSite/FileSite must be actively running on the client machine at the time the operation is invoked. If DS/FS is not running, WSW will perform the checkout, and once the file is opened on the client machine, DS/FS will not be aware of this new file.
Once these items are in order, your coding is minimal. Inside your connector’s Process() method, you need to build the hyperlink for checking out the document with an onclick event. For the onclick event, you should call downloadExPortable() and pass the document’s moniker as the argument, like so: <a href=’#’ onclick=’downloadExPortable(“document_moniker”)’>Document Description</a>
downloadExPortable() is the function that we use inside WSW to perform integrated checkout. You can find this function in includes/common.js. By using this function, you’re reusing the code that already has the necessary logic. You will not have to do anything else; the ActiveX control knows how to download the file to the nrportbl w/o having to prompt the user to save it, and providing that DS/FS is running, it will handle the checkout operation seamlessly.
jny
I think dabird's suggested approach would be more efficient to suit your purposes.
andrewdemmon
Thanks for all of your comments, we did start off trying the first way that Jny explained but this was taking a very long time and would need a lot of extra checking to make sure that the document was not already checked out, etc.
So we then tried using the donwloadExPortable javascript function that dabird recommended. This worked like a dream pretty much first time.
Many thanks for your help.
Andrew Demmon
Bircham Dyson Bell
andrewdemmon
Hi
This seems to be working perfectly, however when you come to close the document, you are faced with a prompt which is obvioulsy asking whether or not you would like to check the document back in.
The text says
'The file 3008713_1.DOC was checked out to [INTRANET]C:\NRPORTBL\BDB1\AXD\3008713_1.DOC. Proceed in [BDB03830]C:\NRPORTBL\BDB1\AXD\3008713_1.DOC?'
which we could see being confusing for our users. Is there anyway of maybe modifying some javascript to word this mesage better or remove it complete and simply check the doc back in. My guess is that it is in a compiled piece of code that we do not have access to. Any ideas?
Many thanks in advance
Andy
Bircham Dyson Bell
dabird
Andy,
You are receiving this message because DeskSite was not running when the document was checked out. Since DeskSite was not running, WorkSite Web checked out the document to the web server, not the client machine. The file is then opened, and DeskSite integration takes over inside Word. When closing the document, DS prompts as a precaution since the checkout path inside the PRF file is different from the path from which you are attempting to check in. I will have to defer to DeskSite developers on how to suppress the message in Word; I don't know how to do that.
When DeskSite is running (not just installed, but actually opened) on the client machine, WorkSite Web merely downloads the file to the client machine and hands it over to DeskSite for the actual checkout operation. As such, if you don't want to see this message, DeskSite should be running when the integrated checkout command is invoked inside WorkSite Web.
andrewdemmon
Ahhh
Makes sense, we are using Filesite rather than desksite but no doubt the same thing is happening.
Many thanks
Andy