Skip to Content
0
Former Member
Oct 08, 2009 at 08:08 AM

issue with retriving the title of objects

24 Views

Hello Colleagues,

I am trying to develop an application which builds a tree structure with the objects assigned to a user in runtime.i.e if a user has a particular role lets say content administration,it list you the role and the objects inside that role.

I am able to build the tree structure ,but the structure shows the ID of all the objects ,i.e if its role is content Administration,then in my structure its shows com.sap.portal.content_administration.

But i want to show the title here as content Administration.

initially i tried using:

1.String title = searchResult.get("com.sap.portal.pcm.Title").get().toString()

but this gave me the title as Locale = ;content Administration.This full string instead of content administration.

2.then i tried using the locale

//get the locale

Locale locale = WDClientUser.getLoggedInClientUser().getLocale();

IAdminBase adminBaseRole = (IAdminBase)searchResult.getObject();

if(adminBaseRole!=null){

IAttributeSet attrSetRole = (IAttributeSet)adminBaseRole.getImplementation(IAdminBase.ATTRIBUTE_SET);

String objectName=attrSetRole.getAttribute("com.sap.portal.pcm.Title", locale);

but here i am getting the follwing error:

java.lang.ClassCastException: class com.sapportals.portal.pcd.gl.PcdGlContext:service:com.sap.tc.pcd.gl.srvcom.sap.engine.boot.loader.ResourceMultiParentClassLoader1325aefalive incompatible with interface com.sap.portal.pcm.admin.IAdminBase:library:tcepbcpcm~adminapicom.sap.engine.boot.loader.ResourceMultiParentClassLoadere26d2ealive

Has any one faced this error?

Or do you have any suggestions here?

Regards,

Suvarna

Edited by: Suvarna K A on Oct 8, 2009 10:08 AM