on 12-10-2004 6:23 PM
What class do I use to get simple Portal Content info, such as the name of the folder (title attribute) using a jndi lookup function? (I already have the pcd value of the folder.)
(CLASS???) portalFolder = (CLASS???) iCTX.lookup(<pcd location>);
Hi Steve,
I just checked your questions of 11-21, must have overlooked them... but it seems, that you are close on it...
IPcmObjectService pcdFactory = (IPcmObjectService) PortalRuntime.getRuntimeResources().getService(IPcmObjectService.KEY);
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
env.put(Context.SECURITY_PRINCIPAL, req.getUser());
IPcmObjectBuilder pcmSrv = pcdFactory.getInitialContext(env);
try {
Object o = pcmSrv.lookup(pcdURL);
return o;
} catch (NamingException e) {
// exception handling
}
Hope it helps
Detlev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, but I already have that code part implemented. Maybe, I didn't say exactly what I am looking for. What is the java class interface to use to retrieve the portal content folder information, such as the portal's folder name?
For example, if I wanted to iview information, I would use IPortalIview class.
then the code is ...
IPortalIview iview = (IPortalIview) pcmbuider.lookup(<pcd>);
Hi Steve,
ok, I got it.
The answer is - it depends. The easiest way you can find out by yourself would be to ask the returned object: o.getClass().getName().
Anyhow, the returned object by the code fragment given above will be of type IPcdContext or IPcmContext. For IPcmContext objects convenient methods like getTitle(), getDescription(), getObjectClassName() exist.
For IPcdObject on the other hand these do not exist. You have to investigate what you want to get, eg
Attributes atts = pcdContext.getAttributes("");
String title = ((ILocaleTextPair) atts.get("com.sap.portal.pcm.Title").get(0)).getText();
Hope it helps
Detlev
Hi Detlev
I am using a webdynpro application to create a Tree for PCD folders on button click.
I need to display the title.
Recently we are migrated to the 7.3.1.
On the enumeration of folders we are using IPropertyObject and IPropertyObjectProvider to retrive the title of the folder.
But these methods are not supporting in 7.3.1 version.
Please refer the thread
http://scn.sap.com/thread/3345610.
Can you please help me how we can retrive the folder title in new environment.
Regards
KALYAN
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.