dongze5043 2012-06-05 09:44
浏览 53
已采纳

通过perl脚本在Lotus Domino数据库中创建文档

I've seen blocks of code like this

use Win32::OLE; 
my $Notes = Win32::OLE->new('Notes.NotesSession') 
    or die "Cannot start Lotus Notes Session object.
"; 
my $database = $Notes->GetDatabase("",'mail\VIMM.nsf'); 

but my script is running on a virtual webfusion apache service so how do you establish a connection to database on my domino server, I have control of its acl and its a website so can pass in a username & password. The script & 'POST' data is sent by a third party gateway with results of the transaction (Success/ Fail + name value pairs etc) which I need to capture. I can't do it directly on the domino server because although Domino supports PERL scripts, they will only work if PERL is also installed on the server which isn't an option.

  • 写回答

5条回答 默认 最新

  • duan19740319 2012-06-26 21:01
    关注

    The underlying problem is that a url such as http://www.mysite.com/thankyou?orderno=123 won't work in a Lotus Domino website because the ? is a special character (eg ?openagent, ?opendatabase) to the Domino web engine. You also can't use http://www.mysite.com/(thankyou)?openagent?orderno=456 (I tried), in both cases all you get is 404 page not found error and a domino log error "don't understand the url". The question was originally asking for help with Perl to solve the problem but I couldn't Perl scripts to run on my webfusion community server but fortunately quickly had success with this simple php script:

    <?php
        $params = "";
        $url = "http://www.mywebsite.co.uk/";
        $path = "wpx/website.nsf/httpagent?openagent";
          if($_GET) {
        $kv = array();
              foreach ($_GET as $key => $value) {
                  $kv[] = "$key=$value";
              }
              $params = join("&", $kv);
    }
    print "<script>window.location.href=\"" . $url . $path . "&" . $params . "\"</script>";
    ?>
    

    The script is placed on my webfusion server under a subdomain which effectively translates the url into a format that Domino can handle, the format ?openagent&orderno=456 is easily handled by either a java or Lotusscript agent, the parameter is extracted from the CGI Request_Content field.

    The redirect means I don't for now need to manipulate data in the domino database directly, it also means that with the exception of the url translation script all the website code is in the domino database.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?