Skip to Content
0
Former Member
Sep 02, 2010 at 03:46 PM

List iView properties of PCD content in WebDynpro

26 Views

Hi,

I'm having trouble listing the properties of iViews as I traverse the PCD in my WebDynpro application.

I get this error: java.lang.ClassCastException: com.sapportals.portal.pcd.gl.PcdGlDeltaLink incompatible with com.sapportals.portal.pcd.gl.IPcdContext

My code:

public javax.naming.InitialContext getEnvironment( )

{

//@@begin getEnvironment()

InitialContext initialContext = null;

try {

IUser principalObj = null;

// set the security principal

principalObj = this.getServiceUser("pcd_service");

Hashtable env = new Hashtable();

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

if (principalObj != null) {

env.put(Context.SECURITY_PRINCIPAL, principalObj);

}

env.put("com.sap.portal.jndi.requested_aspect",PcmConstants.ASPECT_ADMINISTRATION);

env.put("java.naming.factory.object", "__IPcdContext__");

initialContext = new InitialContext(env);

IPcdContext pcmObj = (IPcdContext) initialContext.lookupLink("portal_content/epiuse/com.epiuse.dj/com.dj.epiuse.iviews/com.epiuse.ooq4");

Object object = pcmObj.getAttributes("").get("com.sap.portal.navigation.MergeId");

if(object instanceof IPcdAttribute){

att = (IPcdAttribute)object;

folderContent.setMergeId(att.getAll().next().toString());

}

} catch (NamingException e) {

}

return initialContext;

//@@end

}

The application fails at:

IPcdContext pcmObj = (IPcdContext) initialContext.lookupLink("portal_content/epiuse/com.epiuse.dj/com.dj.epiuse.iviews/com.epiuse.ooq4");

Any help?