9 Replies Latest reply on Oct 30, 2005 12:19 PM by david.calvente

    Deploy a new portal instance on JBP2.2 alpha

    dunks80

      JBoss Portal 2.2 Alpha from cvs
      JBoss AS 4.0.3RC2
      Fedora Core 4
      MySQL 4.0

      ...lots of questions tonight. Ealier i was using JBP 2.0 and deploying a new portal instance (configured via *-portal.xml) no problem. I moved over to JBP 2.2 alpha and my app will deploy but I can't seem to naviagte to my portal instance. I take out the *-portal.xml and just try to get my portlets to deploy on the default portal instance using the *-pages.xml configuration file. Again my app deploys with no errors but the portlet page doesn't show up as a link in the pages portlet and I can't figure out how to navigate to it. Any tips for deploying a new portal instance on JBP 2.2?

        • 1. Re: Deploy a new portal instance on JBP2.2 alpha

          The -portal.xml descriptor has changed in one way. Look at the default-portal.xml as an example.

          Once like this:

          <instance-ref>portal.CMSPortlet.CMSPortletInstance</instance-ref>


          Now like this:
          <instance-ref>CMSPortletInstance</instance-ref>


          • 2. Re: Deploy a new portal instance on JBP2.2 alpha
            dunks80

            So I understand what you're saying and I changed my instance-ref's for my portlet in my portlet-instances.xml file but I still can't get to my portal instance. I'm trying every url i can think of /portal/myPortal, /portal/local/myPortal, etc. I think this has something to do with what Julien posted here
            http://www.jboss.com/index.html?module=bb&op=viewtopic&t=70350. I reread that post over and over but I'm still missing something. When deploying a new portal instance do i need a *-instances.xml file with all my portlet instances mapped like the ones in the default-instances.xml in addition to the portlet-instances.xml file? Should those mappings look like this?

            <instance>
             <instance-name>MyPortletInstance</instance-name>
             <component-ref>webapp:myNewPortal/MyPortlet</component-ref>
             </instance>
            


            I'm a little confused on how this new model Julien posted about works.

            • 3. Re: Deploy a new portal instance on JBP2.2 alpha

              when you have a deployment descriptor in the same webapp you don't need to use the full name, you just use the short name.

              so an instance use the portlet name and a window use the instance name, that's the deployer which resolves the name when it installs the descriptors.

              you use webapp:mywebapp/MyPortlet when you have an instance that is deployed in conf/data/default-instances.xml as the instance does not know in which webapp a portlet is.

              that's the same for window/instance

              you can use JMX and go on the mbean portal:service=ContainerRegistry and see if the object you are looking for exists or not using the getObject method, in that case you need to use the full name.

              • 4. Re: Deploy a new portal instance on JBP2.2 alpha
                david.calvente

                I'm at the same point: trying to deploy a custom portal in JBoss Portal 2.2 Alpha.
                My portal is a very simple HelloWorld Portal that works fine in JBoss Portal 2.01RC1.
                When I depoy the same *.war in 2.2Alpha JBoss does not complain but I can't reach my portal with any URL I can imagine.. (obviously I tryed the one used in 2.0.1 RC1 and doesn't work neither)

                I've tryed to use diferent instance paths but none worked!

                Please, could someone share a very simple Portal that works on JBoss Portal 2.2?

                • 5. Re: Deploy a new portal instance on JBP2.2 alpha

                  looks in the forums war files and copy it.

                  I am working on a better format for deployment of things such like that.

                  • 6. Re: Deploy a new portal instance on JBP2.2 alpha
                    david.calvente

                    Thanks Julien,
                    I built the forums portal and deployed it in my JBoss server.
                    To reach that portal I need to point my browser to:
                    http://localhost:8080/portal/local/forums
                    Is this the only one posible?. I tryied http://localhost:8080/portal/forums with no luck...

                    I also checked the internal files against the files in my helloworl portal and have a few questions:
                    1) The forums-pages.xml file: Is obsolete? It used the old structure for referencing instances and in the <portal-name> node its value is "default"
                    2) Do I need to build an EAR or it's enought with a WAR File
                    3)Is there any dependencies between War filename, jboss-app.xml app-name element value, and so on?

                    My HelloWorld Portal still fails to be reached..

                    And finally, Can I e-mail you my helloworld.war file (just 5 KB) to some address?

                    Thanks a lot

                    David

                    • 7. Re: Deploy a new portal instance on JBP2.2 alpha

                       

                      1) The forums-pages.xml file: Is obsolete? It used the old structure for referencing instances and in the <portal-name> node its value is "default"


                      yes it is, I am working on a better deployment format that should address more issues and allow deployment of portal / page / window

                      2) Do I need to build an EAR or it's enought with a WAR File


                      no

                      3)Is there any dependencies between War filename, jboss-app.xml app-name element value, and so on?


                      if jboss-app.xml / app-name is not defined then the application id is the context name, otherwise it is the app-name value that is taken. the reason of that is that we want to be able to provide an application id that is independant from the war file name. Because if you rename the war file then the application id would change and would break all internal references to that application.

                      • 8. Re: Deploy a new portal instance on JBP2.2 alpha
                        david.calvente

                        Thanks.

                        Could you please explain me why should I point my browser to:
                        http://localhost:8080/portal/local/forums instead of http://localhost:8080/portal/forums (doesn't work).

                        And please, Could you take a look at:

                        My helloworld portlet

                        package org.jboss.portlet.helloworld;
                        
                        import javax.portlet.GenericPortlet;
                        import javax.portlet.RenderRequest;
                        import javax.portlet.RenderResponse;
                        import java.io.PrintWriter;
                        import java.io.IOException;
                        
                        public class HelloWorld extends GenericPortlet {
                        
                         public void doView(RenderRequest request, RenderResponse response)
                         {
                         response.setContentType("text/html");
                         try {
                         PrintWriter writer = response.getWriter();
                         writer.write("Hello World !!!");
                         writer.close();
                         }
                         catch (IOException e)
                         {
                         e.printStackTrace();
                         }
                         }
                        }
                        
                        


                        My helloworld-portal.xml

                        <?xml version="1.0" encoding="UTF-8"?>
                        <portal>
                         <portal-name>helloworldPortal</portal-name>
                         <properties>
                         <property>
                         <name>org.jboss.portal.property.layout</name>
                         <value>phalanx</value>
                         </property>
                         <property>
                         <name>org.jboss.portal.property.renderSet</name>
                         <value>divRenderer</value>
                         </property>
                         <property>
                         <name>org.jboss.portal.property.strategy</name>
                         <value>default</value>
                         </property>
                         </properties>
                         <supported-modes>
                         <mode>view</mode>
                         <mode>edit</mode>
                         <mode>help</mode>
                         </supported-modes>
                         <supported-window-states>
                         <window-state>normal</window-state>
                         <window-state>minimized</window-state>
                         <window-state>maximized</window-state>
                         </supported-window-states>
                         <pages>
                         <default-page>helloworldPage01</default-page>
                         <page>
                         <page-name>helloworldPage01</page-name>
                         <window>
                         <window-name>helloworldWindow01</window-name>
                         <instance-ref>helloworldPortletInstance01</instance-ref>
                         <default>true</default>
                         <region>center</region>
                         <height>0</height>
                         </window>
                         </page>
                         </pages>
                        </portal>
                        


                        My jboss-app.xml

                        <jboss-app>
                         <app-name>helloworldPortal</app-name>
                        </jboss-app>
                        


                        My jboss-portlet.xml

                        <portlet-app>
                         <portlet>
                         <portlet-name>helloworldPortlet01</portlet-name>
                         <security></security>
                         </portlet>
                        </portlet-app>
                        


                        My portlet.xml

                        <?xml version="1.0" encoding="UTF-8"?>
                        <portlet-app
                         xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                         xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd /opt/SUNWps/dtd/portlet.xsd"
                         version="1.0">
                         <portlet>
                         <portlet-name>helloworldPortlet01</portlet-name>
                         <portlet-class>org.jboss.portlet.helloworld.HelloWorld</portlet-class>
                         <supported-locale>en</supported-locale>
                         <!-- <resource-bundle>Resource</resource-bundle> -->
                         <supports>
                         <mime-type>text/html</mime-type>
                         <portlet-mode>VIEW</portlet-mode>
                         </supports>
                         <portlet-info>
                         <title>My HelloWorld Portlet</title>
                         </portlet-info>
                         </portlet>
                        </portlet-app>
                        


                        My portlet-instances.xml
                        <?xml version="1.0" standalone="yes"?>
                        <instances>
                         <instance>
                         <instance-name>helloworldPortletInstance01</instance-name>
                         <component-ref>helloworldPortlet01</component-ref>
                         </instance>
                        </instances>
                        


                        I build a WAR file containing them in the WEB-INF dir except the .java, whose .class is in classes dir.


                        I've been working a lot on them, figuring out diferent combinations etc.. and as I said before, worked perfectly in 2.01 but in 2.2 ALPHA I can't find the right URL to access the portal

                        Please, could you spend a few minutes on this?.

                        Thanks a lot

                        David

                        • 9. Re: Deploy a new portal instance on JBP2.2 alpha
                          david.calvente

                          Finally I reached the portal at: http://localhost:8080/portal/local/helloworldPortal/helloworldPage01

                          It seems like the default-page node in *-portal.xml does not work

                          I also saw that using *-pages.xml does not work neither.

                          I hope this info could be useful for improving the code

                          Thanks

                          David