Please, when will docbasic ever be over ?
In an attempt to have a decent post/pre installation procedure for a set of content servers projects that I'm almost ready to install I tried to learn just enough docbasic to execute a java method to perform a variety of one time only operations on a new docbase. However, I can't figure out how to reference an existing session in a docbasic pre/post installation procedure.
This is what I have so far and though I've more or less verified that it works like this from the command line, it is far from optimal:
Sub Main()Dim docbase as StringDim user as StringDim password as StringDim sess As StringDim status as Integerdocbase="my_docbase"user="my_user"password="my_pass"sess = dmAPIGet("connect," & docbase & "," & user & "," & password)If sess = "" Then '1 print "No Connection"Else print "Connected"End ifjavaMethod$ = "apply," & sess & ",NULL,DO_METHOD,METHOD,S,<my_method_name_here>,RUN_AS_SERVER,B,T,SAVE_RESULTS,B,T, ARGUMENTS,S,'-p" & docbase & " " & user & " " & password & "'"colid$ = dmAPIGet(javaMethod$)print ("Collection Id: " & colid$) status = dmAPIExec("close," & sess & "," & colid$)If (status <> 1) Then print "Could not close collection for " & colid$Else print "Successfully executed method: " & javaMethod$End If End SubThe problem with this is that I'd need to edit it each time I installed into a different content server so that I can update the parameters needed to get the session. Docbasic is not my forte, and I hope to **** it never is, but if anyone can help me figure out how to get the session that composer will already have when installing and use that in my script I would be very grateful.
Thanks,
-Mark