[jboss-user] [JBoss Portal] - Accessing the CMS repository through a portlet

robin_panicker do-not-reply at jboss.com
Tue Feb 26 09:56:51 EST 2008


Hi,
   I need to access the list of files in the CMS storage. 

I am trying the following in my portlet code

....

MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
CMS CMSService = (CMS)MBeanProxy.get(CMS.class, new ObjectName 
                                  ("portal:service=CMS"), mbeanServer);


Command listCMD = CMSService.getCommandFactory
                                  ().createFolderGetListCommand(sPath);

Folder mainFolder = (Folder)CMSService.execute(listCMD);

List folders = mainFolder.getFolders();
List files = mainFolder.getFiles();

But i am getting a null pointer exception at CMSService.getCommandFactory().createFolderGetListCommand(sPath)

..... 

Can someone please verify if this is the correct way to get a list of files and folders in the CMS repository?

thanks
Robin


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4132204#4132204

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4132204



More information about the jboss-user mailing list