Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automation of COGNOS/JAVA

Status
Not open for further replies.

dasmathy

Programmer
Apr 2, 2003
1
US
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
 
Hi,
I don't think U can convert the VB code to Java but there is another way if u r using NDS.

U can directly create UserClasses & Users in NDS & it will get reflected in Access Manager.

NDS provides some Jar Files which can be used to do the same.

Check it out .

Prasad.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top