3 Replies Latest reply on Feb 2, 2007 8:57 AM by antoine_h

    2 questions concerning CMS

    tbeuleke

      Hello,
      i'm trying to develop a web application that retrieves content from the PortalCMS (currently version 2.2.1).
      First of all, how can i acces the CMS-service in a web application (a servlet) running on the same JBoss server. I looked how the CMSAAdminportlet access the CMS but this seems to be a dead end since it gets the CMS object via the PortletContext (which apparently does not exists in my servlet).
      Do you have any ideas?

      Additionally i try to acces the repository directly via the jca-connector from jackrabbit. I have no problems accesing the cms but i have serious problems finding any information about stored folders. When the jbossportal is configured to use the local filesystem and i look at the stored files i can find a node for each folder i created in the CMSAdminportlet. But i cannot find any folder nodes when i use the PortalDS.

      Thanks for your help!
      Thomas

        • 1. Re: 2 questions concerning CMS
          theute

          The CMS Service is a MBean service, it is also registered in JNDI under the name "java:portal/CMS"

          You can access it like this:

          Context ctx = new InitialContext();
          CMS cmsService = (CMS)ctx.lookup("java:portal/CMS");
          


          This code should work for 2.6, the interface and JNDI name may be different in 2.2 though.


          • 2. Re: 2 questions concerning CMS
            tbeuleke

            Thanks for your fast answer.
            The interface name is correct for 2.2 but it looks like the JNDI name is not.

            javax.naming.NameNotFoundException: CMS not bound
            

            Well, i have no idea how to find out under what name it is registered, if it is at all...

            • 3. Re: 2 questions concerning CMS
              antoine_h

              Hello,

              the cms service, as an mbean, is named : name="portal:service=CMS"

              the descriptor of this service is in :
              deploy/jboss-portal.sar/portal-cms.sar/META-INF/jboss-service.xml

              with jbp 2.4, I can't see the jndi declaration.
              so I guess there was not for 2.2 either.

              may be you can add it to your CMS Service of 2.2 ?
              may be with the example of the code and descriptor of 2.6 ?
              (which is a good idea to have it...)

              or look at how to get a jmx service from your web app, without jndi.
              There's some wiki about this...
              with MBeanServer

              see :
              http://wiki.jboss.org/wiki/Wiki.jsp?page=MBeanServer
              and
              http://wiki.jboss.org/wiki/Wiki.jsp?page=FindMBeanServer