on 12-07-2005 4:11 PM
Hi all,
I have done user mapping at group level in the portal and want to retrieve the same in my web dynpro application.
I used the following method for this :-
IUserMappingData mapdata =
UMFactory.getUserMapping().getUserMappingData(
"<system alias",
GroupObject,
null);
This actually works fine. But this is a deprecated API. So I found that the alternate is :-
UMFactory.getUserMapping().getUserMappingData(ISystemLandScapeObject object, IPrincipal p);
In this i can pass IGrrup in place of IPrincipal, but I <b>how do I create the object of "ISystemLandScapeObject"?</b>
I know the system alias name. Some one please help me in this.
Regards,
NArahari
Hello NArahari,
Use UMFactory.getSystemLandscapeWrappers. It returns ArrayList of ISystemLandScapeObject`s.
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maksim,
I have written the following code as you suggested :-
for (int i = 0;
i < UMFactory.getSystemLandscapeWrappers().size();
i++) {
ISystemLandscapeObject e =
(ISystemLandscapeObject) UMFactory
.getSystemLandscapeWrappers()
.get(
i);
if (e.getAlias().compareTo("CN") == 0) {
system = e;
}
}
Here "CN" is the system alias name.
But it throws a ClassCastException while casting the object to ISystemLandscapeObject.
Could you please give me a code snippet for what you have suggested?
Regards,
Narahari
Hello Narahari,
try this:
ISystemLandscapeObject system;
try {
final List wrappers = UMFactory.getSystemLandscapeWrappers();
for (int i = 0;i < wrappers.size(); i++) {
ISystemLandscapeWrapper e = (ISystemLandscapeWrapper) wrappers.get(i);
system = e.getSystemByUniqueKey("CN");
if(null==system) {
system = e.getSystemByAlias("CN");
if(null!=system) {
break;
}
} else {
break;
}
}
} catch (ExceptionInImplementationException e) {
//handle excpetion
}
Best regards, Maksim Rashchynski.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.