0 Replies Latest reply on Feb 26, 2008 9:56 AM by robin_panicker

    Accessing the CMS repository through a portlet

    robin_panicker Newbie

      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