Hi -
I'm trying to populate my imp catalog user classes with access manager userclasses using the following macro. I get the message 'User Profiles have been successfully created', but when I look in my catalog - the user classes are not there. Thank you for your help.:
Copy User classes from a namespace to catalog User Profiles. ' '--------------------------------------------------------------'
OPTION EXPLICIT
Declare Sub User_classes(UsrClass as object, UsrProfile as object)
Sub Main ()
DIM ObjAuthApp as object
DIM ObjAuthDoc as object
DIM ObjUserClass as object
DIM ObjImpApp as object
DIM ObjCatalog as object
DIM ObjUserProfile as object
DIM ObjImpCat as object
On Error Goto Errhdlr1
'Open Namespace
Set ObjAuthApp = CreateObject("Authenticator2.Application"
Set ObjAuthDoc = ObjAuthApp.Documents.OpenWithBasicSignon ("default", "administrator","","Root User Class"
'Open catalog
Set ObjImpApp = CreateObject("CognosImpromptu.Application"
ObjImpApp.OpenCatalog "C:\dev.CAT", "Creator"
Set ObjImpCat = objImpApp.ActiveCatalog
Set ObjUserClass = ObjAuthDoc.rootuserclass
Set ObjUserProfile = ObjImpCat.ActiveUserClass
Call User_classes(ObjUserClass, ObjUserProfile)
MsgBox "User Profiles have been successfully created"
ObjImpApp.Quit
ObjAuthApp.quit
Set ObjImpApp = Nothing
Set ObjUserClass = Nothing
Set ObjAuthDoc = Nothing
Set ObjAuthApp = Nothing
exit sub
Errhdlr1:
Msgbox "Error - " & Err & ": " & Error$
End Sub
'--------------------------------------------------'
' User_classes function: '
' Navigates the Userclass hierarchy of Namespace '
' and create User Profiles in the catalog ' '--------------------------------------------------'
Sub User_classes(UsrClass as object, UsrProfile as object)
Dim ObjUsrClass as object
Dim ObjUsrProfile as object
Dim ObjMasterClass as object
Dim ObjMasterProfile as object
Dim UserClassCount as Integer
Set ObjUsrClass = UsrClass
Set ObjUsrProfile = UsrProfile
Set ObjMasterClass = UsrClass
Set ObjMasterProfile = UsrProfile
UserClassCount = ObjUsrClass.userclasses.count
If ObjUsrClass.userclasses.count <> 0 then
For UserClassCount = ObjUsrClass.userclasses.count to 1 step -1
Set ObjUsrClass = ObjMasterClass.userclasses.Item(UserClassCount)
Set ObjUsrProfile = ObjMasterProfile.userclasses.add
(ObjUsrClass.name)
Set objUsrprofile=Nothing
Next UserClassCount
End If
Set ObjUsrClass = Nothing
Set ObjMasterClass = Nothing
End Sub
----------------------
I'm trying to populate my imp catalog user classes with access manager userclasses using the following macro. I get the message 'User Profiles have been successfully created', but when I look in my catalog - the user classes are not there. Thank you for your help.:
Copy User classes from a namespace to catalog User Profiles. ' '--------------------------------------------------------------'
OPTION EXPLICIT
Declare Sub User_classes(UsrClass as object, UsrProfile as object)
Sub Main ()
DIM ObjAuthApp as object
DIM ObjAuthDoc as object
DIM ObjUserClass as object
DIM ObjImpApp as object
DIM ObjCatalog as object
DIM ObjUserProfile as object
DIM ObjImpCat as object
On Error Goto Errhdlr1
'Open Namespace
Set ObjAuthApp = CreateObject("Authenticator2.Application"
Set ObjAuthDoc = ObjAuthApp.Documents.OpenWithBasicSignon ("default", "administrator","","Root User Class"
'Open catalog
Set ObjImpApp = CreateObject("CognosImpromptu.Application"
ObjImpApp.OpenCatalog "C:\dev.CAT", "Creator"
Set ObjImpCat = objImpApp.ActiveCatalog
Set ObjUserClass = ObjAuthDoc.rootuserclass
Set ObjUserProfile = ObjImpCat.ActiveUserClass
Call User_classes(ObjUserClass, ObjUserProfile)
MsgBox "User Profiles have been successfully created"
ObjImpApp.Quit
ObjAuthApp.quit
Set ObjImpApp = Nothing
Set ObjUserClass = Nothing
Set ObjAuthDoc = Nothing
Set ObjAuthApp = Nothing
exit sub
Errhdlr1:
Msgbox "Error - " & Err & ": " & Error$
End Sub
'--------------------------------------------------'
' User_classes function: '
' Navigates the Userclass hierarchy of Namespace '
' and create User Profiles in the catalog ' '--------------------------------------------------'
Sub User_classes(UsrClass as object, UsrProfile as object)
Dim ObjUsrClass as object
Dim ObjUsrProfile as object
Dim ObjMasterClass as object
Dim ObjMasterProfile as object
Dim UserClassCount as Integer
Set ObjUsrClass = UsrClass
Set ObjUsrProfile = UsrProfile
Set ObjMasterClass = UsrClass
Set ObjMasterProfile = UsrProfile
UserClassCount = ObjUsrClass.userclasses.count
If ObjUsrClass.userclasses.count <> 0 then
For UserClassCount = ObjUsrClass.userclasses.count to 1 step -1
Set ObjUsrClass = ObjMasterClass.userclasses.Item(UserClassCount)
Set ObjUsrProfile = ObjMasterProfile.userclasses.add
(ObjUsrClass.name)
Set objUsrprofile=Nothing
Next UserClassCount
End If
Set ObjUsrClass = Nothing
Set ObjMasterClass = Nothing
End Sub
----------------------