4 Replies Latest reply on Jan 22, 2008 8:48 AM by sjewett

    Access and display content stored in CMS

    sjewett

      Hi All,

      My environment info:

      JBoss App Server 4.2.2 GA
      JBoss Portal 2.6.3 GA (binary, not bundled)
      Windows XP
      Oracle 9i database

      My question: I've written a simple portlet (extends GenericPortlet). I also have an html page stored in the CMS. How do I display my html page as content in my portlet?

      Do I use a PortletRequestDispatcher? And if so, what's the path to the html stored in CMS?

      This seems really basic, but I've been looking at the Ref Guide, and I can't seem to achieve this.

      Thank you.

        • 1. Re: Access and display content stored in CMS
          sjewett

          My portlet class looks like this:

          public class RetailMarketingPortlet extends GenericPortlet {
          
           protected void doView(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException, UnavailableException
           {
           rResponse.setContentType("text/html");
           PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/content/Retail/1Marketing.html");
           prd.include(rRequest, rResponse);
           }
          
          }
          


          Thanks.

          When I run it and try to access the portlet, I get:


          The requested resource (/retailmarketing/content/Retail/1Marketing.html) is not available


          • 2. Re: Access and display content stored in CMS
            peterj

            I do not think you can do what you want. See the discussion at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=120865

            • 3. Re: Access and display content stored in CMS
              theute

              Few hints:
              You can always use the CMS ContentGetCommand to retrieve the HTML.
              You can also create a URLCommandMapper that does it.

              • 4. Re: Access and display content stored in CMS
                sjewett

                Thomas,

                "thomas.heute@jboss.com" wrote:
                Few hints:
                You can always use the CMS ContentGetCommand to retrieve the HTML.
                You can also create a URLCommandMapper that does it.


                Thank you. I'll try these. (I also found I could achieve my goal in the Admin Tool (I abandoned my portlet class) by creating a page and then going into Layout and adding CMS content in a new window.)

                But getting back to your suggestions: Forgive my ignorance, but is there documentation on objects and methods such as the ones you suggest above? Where do I go to read about these (and others)?

                Thanks for your help!

                -Steve