Skip to Content
0
Former Member
Apr 02, 2014 at 08:45 PM

Issue while accessing properties of the PCD iview using PCD API

21 Views

Hi,

I am trying to access PCD iview properties using PCD API. I got the below exception:

com.sap.portal.pcm.iview.admin.AttributeSetiView incompatible with com.sap.portal.pcm.iview.IiView

Here is the code:

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);

env.put(Context.SECURITY_PRINCIPAL, request.getUser());

env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);

String id = "pcd:portal_content/google";

InitialContext iCtx = null;

try {

iCtx = new InitialContext(env);

IiView result=(IiView) iCtx.lookup(id); // getting Exception at this line

response.write(result.getAttribute("com.sap.portal.pcm.Title",request.getLocale()));

}

catch ( Exception e)

{

response.write(e.getMessage());

}

Can someone help me on this.

Regards,

Lakshmi