on 12-11-2014 2:04 PM
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.
Hi,
In 7.3x versions PCD and PCM are exposed as J2EE libraries.
Please use the following sharing references:
SAPJ2EE::library:tc~epbc~pcd~gl~api
SAPJ2EE::library:tc~epbc~pcm~adminapi
As you use IPage you also need reference to:
com.sap.portal.ivs.api_iview
You should write your code in the src.core part of the application and use PrivateSharingReference in the portalapp.xml if you do not intend to expose your own APis.
Regards,
Dror.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.