Hi,
I am trying to get the attribute values of a perticular pcd objects in the DC, using the PCD API. Though my DC is deployed successfully, I get an exception from my NWDI logs, which says
'Application can not be started. Reason: it has Hard reference to the following resources, which are currently not available on the system: hard to SAPPORTAL/com.sap.portal.pcm.admin (public) (f=true, cl=true);'
In my portalapp.xml, i have added the following sharing reference:
<property name="SharingReference" value=
"urlgenerator,com.sap.portal.htmlb,
com.sap.portal.navigation.service,
com.sap.portal.navigation.helperservice,
com.sap.portal.pcd.glservice,
com.sap.portal.pcm.admin"/>
Here is my code:
Hashtable ht_env = new Hashtable();
//Setting environment variables
ht_env.put(Context.INITIAL_CONTEXT_FACTORY,IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
ht_env.put(Context.SECURITY_PRINCIPAL, request.getUserPrincipal());
ht_env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);
InitialContext iCtx = null;
IiView iView = null;
IPage ipage = null;
try {
iCtx = new InitialContext(ht_env);
Object currentObject = iCtx.lookup("portal_content/somepath/somepath");
if (currentObject instanceof IiView) {
iView = (IiView) currentObject;
Enumeration enum1 = iView.getAttributeIds();
if(enum1!=null){
while(enum1.hasMoreElements()){
String str = (String)enum1.nextElement();
//Displaying all the attributes of the iview
response.write("Attribute : " + str + " : " +iView.getAttribute(str).toString() + "<BR>");
}
}
}else if (currentObject instanceof IPage) {
ipage = (IPage) currentObject;
Enumeration enum1 = iView.getAttributeIds();
pt ="";
if(enum1!=null){
while(enum1.hasMoreElements()){
String str = (String)enum1.nextElement();
pt = pt+">>"+ipage.getAttribute(str);
//Displaying all the attributes of the iview
response.write("Attribute : " + str + " : " +ipage.getAttribute(str).toString() + "<BR>");
}
}
}
I am following the following thread as reference:
Some pointers would be extremely helpful. thanks in advance.