4 Replies Latest reply on Feb 12, 2007 5:44 PM by Peter Johnson

    Deploy new portal using existing portlets

    Michael Lipp Newbie

      Hi,

      I want to deploy my own portal "on top" of the default portal. I have seen the sample HelloWorldPortal.zip and started to build my own portal-object.xml.

      The main difference is that helloworld-object.xml uses and references only the portlet that comes with it. But I want to use other, already deployed portlets as well, e.g. the CMSPortlet.

      Is this possible? How can I create the instances that I need in my portal-object.xml (I need new instances of CMSPortlet that display special content)? From what I have found so far, it is not possible to reference portlets outside the WAR that contains the portal-object.xml, is it? Or can it be done after all?

      Any help appreciated.

      Regards,

      Michael

        • 1. Re: Deploy new portal using existing portlets
          Peter Johnson Master

          In the portlet-instances.xml file, you should be able to reference existing portlets using the full portlet name, which is typically local.appname.portletname. For example, for the CMS portlet, the name is local.portal.CMSPortlet. You can easily find full portlet names in the Management Portlet, click on the Portlets link at the top.

          But beware, the Portal will not read the portlet-instances.xml file unless you define a portlet in your war file. Also, there is a possible issue if the Portal loads your war file before the war file containing the portlet you are referencing. See the discussion at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=100332

          • 2. Re: Deploy new portal using existing portlets
            Michael Lipp Newbie

            Thanks Peter. You write "you should be able to reference existing portlets ...", well, I tried this already, but all I get is

            Failed to create instance WfDemoPortalIntroInstance of portlet /de.danet.an.jbportal.war.local.portal.CMSPortlet because portlet /de.danet.an.jbportal.war.local.portal.CMSPortlet is not available

            so the portal effectively prepends the name of the WAR with the portal definition (de.danet.an.jbportal.war) to the full portlet name. It does not recognize this as a "fully qualified" (not-to-be-modified) portlet name.

            Maybe I'll head for the programmatic approach described in the referenced thread.

            • 3. Re: Deploy new portal using existing portlets
              David Roberts Apprentice

              I created a new instance of CMSPortlet through the actual portal by going to the Management Portlet, clicking on "portlets", selecting "local.portal.CMSAdminPortlet", then on the right entering in a new name, and clicking "Create instance". If you now click on "Instances" under the Management Portlet, your new instance should be there. You can edit the indexpage value from there to point to the new contents index page that you should create under the CMS Admin. I basically created a [mycompanyname] folder at the same level as the default folder, stuck an index.html file in there and created whatever contents I wanted, and then pointed my new instance indexpage value to that directory/file. Now you can add your new instance to whatever pages you want and give the required securities via the Management Portal "Portal" link.

              Hope this help you a bit.

              • 4. Re: Deploy new portal using existing portlets
                Peter Johnson Master

                I went back and looked at what I did earlier, and it turns out I gave you bad information because I remembered it wrong. Do this instead.

                First, in portlet.xml, create a new portlet using the CSM portlet class, like this:

                <portlet>
                 <portlet-name>NewCmsPortlet</portlet-name>
                 <portlet-class>org.jboss.portal.core.portlet.cms.CMSPortlet</portlet-class>
                 . . .
                <portlet>


                Then in the portlet-instances.xml file, refer use NewCmsPortlet as the portlet name.

                Not quit the same as creating new instances of an existing protlet, but close enough.