cancel
Showing results for 
Search instead for 
Did you mean: 

Get simple Portal Content folder info

Former Member
0 Kudos

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>);

Accepted Solutions (1)

Accepted Solutions (1)

detlev_beutner
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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>);

detlev_beutner
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thanks for your help. This starts me in the right path. By calling the object: o.getClass().getName(). I got com.sapportals.portal.pcd.gl.PcdGlContext. I take it that it is going to follow the IPcdContext suggestion.

detlev_beutner
Active Contributor
0 Kudos

Hi Steve,

you're welcome. Please consider awarding points for helpful answers, just by pressing the yellow star button on the reply helping you and choosing the corresponding amount of points - the SDN way of saying "thanks"...

Thanks in advance & have a nice weekend

Detlev

venkatakalyan_karanam
Active Contributor
0 Kudos

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

Answers (0)