Will,
There seems to be two topics here. One is running UV programs from a DOS
batch file and the other is interfacing UV to IIS.
I have UniVerse PE installed on my laptop but run production on Linux. I
can open a DOS/Command prompt window and "cd \ibm\uv" then type
"bin\uvsh" and get a TCL prompt in my UV account without being prompted
for user ID or password. I can also create a directory and "uvsh" while
in the directory and setup a new UV account. In addition, I can run,
from the DOS prompt, "bin\uvsh COUNT VOC" and it works fine. For testing
purposes on your UV account or some other account you have, maybe you
should temporarily grant full control to "everyone" to eliminate Windows
security as an issue. In addition, in your UniVerse account where you
will be doing batch stuff from the command line, you will need to edit
your LOGIN VOC item and bypass all programs that require interaction
with a human. In my environment I run SB+ and so the first line of my
LOGIN VOC looks like this, "IF @LOGNAME = "uvcron" THEN GO SKIPALL". The
user "uvcron" is the account I have assigned to run all my batch jobs
(obviously through cron in Linux but the same would apply to the batch
scheduler in Windows).
I just recently interfaced IIS 6 with UniVerse 10.1.1 and the 10.1a
client using UniObjects. As someone else suggested, the Windows user
that is assigned to run the IIS services will need privileges to access
your UniVerse files and directories and you must bypass interactive
routines that exist in your LOGIN VOC as described above. I have a
single ASP page that continuously posts to itself with different
parameters. I have UniVerse generating ALL my XHTML. All my UniVerse
data is placed in XHTML tables. All processing happens in UniVerse on
the UniVerse server. Here are the processing steps:
1. The WEB client hits the WEB site and the default ASP page that
gets called loads the user login ID into a session variable using LDAP
then calls "uvpost.asp".
2. "uvpost.asp" is the only ASP page I have talking to UniVerse.
This page retrieves the HTTP values for these variables: "docid",
"trxtype", "imposter", "action", "key", "param", "line", "cnt",
"username" then calls my UniVerse subroutine UVWEB.SUBS passing the
appropriate variables
3. In my UniVerse subroutine, I check TRXTYPE and if it's NULL,
which it would be initially, I default it to "MENU". Because the
uvpost.asp page passed me the LDAP user login ID, I can open and read
user and group information from my SB+ files etc... and process
accordingly. In UVWEB.SUBS I use CASE statements on TRXTYPE and branch
accordingly. I populate a dynamic array called HTML which gets passed
back to uvpost.asp and the ASP page does a response.write(html) which
presents the WEB user with a menu or report or input screen. I also use
UVWEB.SUBS for non-human processes like moving Siebel opportunity data
into UniVerse. This is accomplished with VBScript and a TRXTYPE of
"OPTYIFACE" for example
4. The HTML that is generated by UniVerse and sent back to
uvpost.asp is imbedded with hyperlinks that call other routines in
UVWEB.SUBS by populating DOCID, TRXTYPE and the other variables as
needed.
As part of this initiative to extend UniVerse functionality to the WEB,
I have had to create utilities for keeping stuff in COMMON and managing
open files efficiently etc... With UniObjects, the UniVerse is yours.
Here is your "Hello World" written in VBScript.
-- START --
Option Explicit
' This is a VBS (visual basic script) file
' assuming you have UniObjects loaded on your machine and
' have tested connectivity, this script will call the
' UniVerse BASIC program "UVTEST" and require 2 parameters.
' in parameter one will return "HELLO" and parameter two
' will return "WORLD" and present this text in a Windows message box.
' - Same concept applies to ASP
'
' The UniVerse subroutine looks like this:
' SUBROUTINE TEST(P1,P2)
' P1='HELLO'
' P2='WORLD'
' RETURN
' END
public uvSession ' object
public uvStatus
public uvMsg
public uvBroker
public sub uvConnect()
uvMsg=""
uvStatus=0
set uvSession=CreateObject("Uniobjects.Unioaifctrl")
if (uvSession) is nothing then
uvStatus=1
uvMsg="unable to create object for uvSession"
exit sub
end if
uvSession.UserName="uvodbc"
uvSession.Password="uvodbc"
uvSession.HostName="however.datalink.com"
uvSession.AccountPath="/mp/uvodbc"
uvSession.DataBaseType="1" ' universe
uvStatus = uvSession.Connect()
if not False then
if (uvSession.Error) <> 0 then
uvStatus=1
uvMsg="Error connecting to Server (" & uvSession.Error &
")"
set uvSession=Nothing
exit sub
end if
else
uvStatus=1
uvMsg="Error connecting to Server (" & uvSession.Error & ")"
set uvSession=Nothing
exit sub
end if
if not (uvSession.IsActive) then
uvStatus=1
uvMsg="Session is not active"
set uvSession=Nothing
exit sub
end if
set uvBroker = uvSession.Subroutine("UVTEST",2)
if uvBroker is Nothing then
uvStatus=1
uvMsg="Unable to init the uvBroker service"
exit sub
else
end if
end sub
public sub uvDisconnect()
uvSession.Disconnect()
set uvBroker = Nothing
set uvSession = Nothing
end sub
call uvConnect()
dim myvalue1, myvalue2
uvBroker.SetArg 0, "" ' first variable
uvBroker.SetArg 1, "" ' second variable
uvBroker.Call ' call the sub
myvalue1 = uvBroker.GetArg (0) ' get value 1
myvalue2 = uvBroker.GetArg (1) ' get value 2
msgbox (myvalue1 & " " & myvalue2)
call uvDisconnect()
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, February 08, 2005 11:43 AM
To: [email protected]
Subject: Re: [U2] Universe to Web interface
In a message dated 2/8/2005 9:33:25 AM Pacific Standard Time,
[EMAIL PROTECTED] writes:
> It sounds like you want to visit a web page and see the output of a UV
> BASIC program, but I might be misunderstanding you.
Really it doesn't matter so much what I'm trying to do.
I'm just looking for an example of how ANYONE has done this UV on
Windows.
Examples for Unix or Linux aren't helping me :)
Thanks
Will
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/