I want to convert the following VB code into Java to automate creation of users to a user class.
We are a java shop.
Description:
How do you add users to a user class in Access Manager with OLE automation?
Solution:
The following sample code demonstrates this functionality:
' script to add users to a user class
' this script script assumes that the users and user class already exist in the namespace
Sub Main()
Dim objAuthApp as Object
Dim objAuthDoc as Object
Dim objRootUserClass as Object
Dim objUserClass as Object
Set objAuthApp = CreateObject("Authenticator2.Application"
Set objAuthDoc = objAuthApp.Documents.OpenWithBasicSignon ("default", "administrator","", 0)
Set objRootUserClass = objAuthDoc.RootUserClass
'insert the user class into the next line
Set objUserClass= objRootUserClass.UserClasses.Item("UserClassName"
'insert the user to be added to the user class into the next line
Set objUser1 = objAuthDoc.UserFolder.Users.Item ("UserName1"
objUserClass.Users.Add (objUser1)
Msgbox "The following users are now members of " & objUserClass & " user class:" & chr$(10) & chr$(10) & objUser1
objAuthApp.Quit
Set objUserClass = Nothing
Set objRootUserClass = Nothing
Set objAuthDoc = Nothing
Set objAuthApp = Nothing
End Sub
We are a java shop.
Description:
How do you add users to a user class in Access Manager with OLE automation?
Solution:
The following sample code demonstrates this functionality:
' script to add users to a user class
' this script script assumes that the users and user class already exist in the namespace
Sub Main()
Dim objAuthApp as Object
Dim objAuthDoc as Object
Dim objRootUserClass as Object
Dim objUserClass as Object
Set objAuthApp = CreateObject("Authenticator2.Application"
Set objAuthDoc = objAuthApp.Documents.OpenWithBasicSignon ("default", "administrator","", 0)
Set objRootUserClass = objAuthDoc.RootUserClass
'insert the user class into the next line
Set objUserClass= objRootUserClass.UserClasses.Item("UserClassName"
'insert the user to be added to the user class into the next line
Set objUser1 = objAuthDoc.UserFolder.Users.Item ("UserName1"
objUserClass.Users.Add (objUser1)
Msgbox "The following users are now members of " & objUserClass & " user class:" & chr$(10) & chr$(10) & objUser1
objAuthApp.Quit
Set objUserClass = Nothing
Set objRootUserClass = Nothing
Set objAuthDoc = Nothing
Set objAuthApp = Nothing
End Sub