Help needed with the basics: Connecting to FileSite and opening a file

I'm just starting as an analyst/developer with a company that uses FileSite. They need (and I'm nearly finished with) some code to automatically save files before a system reboot and then open those files after the reboot is complete.

I'm trying to get answers about whether or not we have support documentation or a customer service account, but for right now, I'm flying blind. The company's going through a pretty big transition, and the senior developers here are also new. Everyone has a lot on their plate.

Oh, and I'm also temporarily limited to VBScript. The details aren't interesting, so there it is.

Basically, I don't understand anything about how to connect to FileSite or how to point it to a specific file. I've been reading through sample code in the forums, and I'm putting pieces together here and there, getting familiar with some of the objects. But when I try to test that code on my end, it inevitably fails.

If anyone could point me to the most basic of beginner resources on developing for FileSite, I'd really appreciated it. And if you have sample code in VBScript for connecting to the DMS and opening a file and could help me understand some of the diction, man, would I love you forever.

Thanks!

Comments

  • Get the SDK, you can buy it from your reseller and there are vb, c++ and c# examples

    Each document in the system has a unique reference (objectID), made up of the document number, it's version, it's database and the server connection.
    eg
    "!nrtdms:0:!sessionSmiley FrustratedERVER1:!database:Live:!document:3742,1:"

    You start with a high level DMS object. You add Session objects (server connections) to it's list of sessions, and then login to the server session (trusted login is simplest). If you have a objectID, you can read this to get the server name.

    Each session has a list of database objects, and you can get document objects from there.

    if you have the document objectID, you can get a document object by using the DMS object using the "getobjectbyID" command.

    Worksite also has a protocol handler, so you can do shell execute to launch a file without having to use the API if you know it's details.

    for change management, when you are working on a document it is "checked out" to your machine (typically to a "portable" directory), and closing it "checks" it back in (this list of checked out documents is available in the api for each Database object)

    Dim iDMS As Imanage.ManDMS
    Dim iSession As Imanage.IManSession
    Dim iDoc as Imanage.IManDocument
    Set iDMS = new Imanage.NRTDMS
    Set iSession = iDMS.Sessions.Add("DEMO")
    iSession.TrustedLogon
    set iDoc = iDMS.GetObjectByID("!nrtdms:0:!sessionSmiley FrustratedERVER1:!database:Live:!document:3742,1:")
    ....
    iSession.logout
  • Thanks so much, RKnott2! This is really helpful. I'm trying to get some buy in on the need for the SDK, but I appreciate you giving me a head start on this.

    You mentioned that "Worksite also has a protocol handler, so you can do shell execute to launch a file without having to use the API if you know it's details." What details of the file do I need to know for this? And what would the shell execute look like?

    The code I'm working on just needs to open files that were open before. So I'm already collecting information on open files before the computer shuts down in order to be able to restore them when the reboot is complete. If I know, for example, that the file is 300256899_2.docx, is that enough info? The first digit tells FileSite what server the file is on, after all. I started out with the assumption that I should just be able to feed FileSite a document number, but wasn't able to find any examples that worked that way. Can I cherish any hope that it actually is that simple?

    Thanks again!
  • the format on the iwl protocol handler is
    iwl:dms(Servername)&lib=(Databasename)&num=(docnumber)&ver=(version)&command=opencmd
    for example
    iwl:dms=Server1&lib=Live&num=12345&ver=2&command=opencmd

    Server name you can pull from the client registry "Software\Interwoven\WorkSite\8.0\Common\Login\RegisteredServers"
    I'm reluctant to suggest interpreting the docnumber, version and database from the path as the user or administrator can choose to edit it. For example, that file name is just DocumentNumber_Version.docx, you may have business rules that say certain document number ranges match certain servers, but the worksite API won't be aware of this, so you still need to workout the database. (as well as the DMS object having getobjectbyID(string objectid), a database has GetDocument(int Number, int vers) method)

    However, a checked out document does have a checkedoutpath property, so you can loop though the list of checked out documents and match the path with your list of opened documents.

    For shell execute, this can be an application or a file, it's the same method worksite uses when a application launch method is not specified

    function fnShellExecuteVB()
    dim objShell

    set objShell = CreateObject("shell.application")

    objShell.ShellExecute "notepad.exe", "", "", "open", 1

    set objShell = nothing
    end function

    so you should be able to launch the iwl url using
    objShell.ShellExecuteShellExecute 0, "", iwlurl, "", "", 1

    Hope this helps
  • Thanks again. I'm still having trouble. I tracked down the person who used to be responsible for this and he told me we don't pay for the SDK anymore. Trying to get customer support from Autonomy, but, of course, the holidays slowed everything down. I'm sure if I could just get my hands on the first section of the developer support, it would be really clear what I'm doing wrong.

    I took what you gave me, went over Server and DB names (we have several) with our DMS administrator, and still no luck.

    Function fnOpenCmdVB()

    Dim objShell
    Set objShell = CreateObject("Shell.Application")

    Dim iwlurl
    iwlurl = "iwl:dms=[SERVERNAME]&lib=[dbName]&num=[DocNum]&ver=1&command=opencmd"

    objShell.ShellExecute "",iwlurl,"","",1

    Set objShell = Nothing

    End Function

    When I don't specify an application for ShellExecute, the command just opens up my file browser to the directory I'm runing the script from. The test file I'm trying to open is a .docx, so I tried opening with Word, and Word tells me it can't open "iwl:dms......" It doesn't say why. Just that it can't open it.

    So, one more ignorant question. What should I do before I call this function? Is it because I'm not including the iManExt libraries?

    Thanks for your patience with my noob-ness and the generosity with your time.
  • Hi,
    tested this myself, the url apparently should be the first argument, not the second (sorry, my mistake)
    for example in my environment:
    Dim objShell
    objShell = CreateObject("Shell.Application")

    Dim iwlurl
    iwlurl = "iwl:dms=Server1&lib=live&num=4549&ver=1&command=opencmd"

    objShell.ShellExecute(iwlurl, "", "", "", 1)

    objShell = Nothing

    hope this helps
  • **I'm leaving the following question up in case others encounter the same issue.

    ***The script was failing because I was not connecting to the correct server/database. Apparently, I have to use the alias for the server and the database, not the actual server and database names. I don't know if that's specific to our setup, or if that's a universal feature of the iwlurl protocol handler.***

    Thank you so, so much! Again!

    I ran the script with the iwlurl first, got a prompt to login, used my trusted login, and then got the following error:

    "Unable to retrieve document 0.0 from its archived location because database [Database] could not be accessed."

    I'm going to spend some time experimenting with the server/database names, but I'm concerened about the "document 0.0" part of the message. If the document is, as in your example, 4549 v1, shouldn't the error say "document 4549.1"? Or is it failing to process the command past the point of accessing the database?
  • Actually that rather helpful message means it couldn't find the file:
    In 8.5 the DocArtifact and Project Artifact tables were added, to tell the system when a file or folder had been moved to.
    SO when Worksite can't find a file, it checks this table to see if the file did exist and has been moved.
    Unfortunately if it can't find it in the artefact table, it tells you that it couldn't find it in the artefact table, not that it couldn't find the document. (kinda of like if you asked it to look for the milk in the fridge. It checks the fridge, then checks the worktop next to the fridge, and come back and says "the milk's not on the worktop"...)

    Hope this helps
TeamSite Developer Resources

  • Docker Automation

  • LiveSite Content Services (LSCS) REST API

  • Single Page Application (SPA) Modules

  • TeamSite Add-ons

If you are interested in gaining full access to the content, you can register for a My Support account here.
image
OpenText CE Products
TeamSite
APIs