14 Replies Latest reply on Jul 19, 2005 12:04 AM by peter

    jbp 2.0 has lots of pitfalls

    peter Apprentice


      After a week's struggling, i make my project based on jbp2.0 possible.

      But my feedback is that jbp2.0 has lots of pitfalls.

      (1)Due to Menu navigation is needed, when i try to create a menu portlet, the first difficulty is due to inter-portlet communication. When clicking on the menu item, it is not straitforward to display corresponding contents in the center window. Although i use session attribute which make it work.
      (2)The default UserPortlet is not suitable becasue it hardcode a simple menu navigation with User management. Furthermore, it force the UserPortlet to be maximum to function. Definitely, it is hacking here.
      (3)When you try to invalidate a session from your own portlet, it doesn't work. After two days' struggling, i decided to try use UserPortlet's userLogout(), it works although it does the same thing (session.invalidate()) as my menuPortlet.
      (4)Due to lacking of inter-portlet communication, CMS becomes not so attractive. CMS content can only be displayed in CMS portlet window. But if you want to display different CMS content, the only way is click a URL WITHIN(embeded) in CMS portlet window. Don't forget that most of static pages (e.g. simple introduction page) has no RenderURLs and you only need to code them as JSPs.

      All above issue is due to two reason:
      Jbossportal lacks a workable menu navigation portlet. At least , hacking is not the best way.
      Jbossportal shouldn't put portlets in the core. All portlets shoule be package seperately so that they are not coupled with the core. Currently, UserPortlet and CMS portlet are very special portlets so that they are very difficult to reuse.

      I customize the UserPortlet by removing SHOWMENU and SHOWLOGIN and related codes becasue these codes shouldn't belong to UserPortlet. In addition, when registration success, no indication is displayed. If not reading the code, it is really confusion.

      So, in my own project, i customized the UserPortlet, i don't use CMS system, I use my own theme, layout etc.

      Hope any jboss team guys will read this and improve.



        • 1. Re: jbp 2.0 has lots of pitfalls
          peter Apprentice

          simpe pages are

          • 2. Re: jbp 2.0 has lots of pitfalls
            Alexander Grünewald Newbie

            Your login page needs improvement. It looks like the JBoss login ;-)

            • 3. Re: jbp 2.0 has lots of pitfalls
              Andrej Tibaut Newbie

              Hi yxyang!

              You've done a great job! Can you please share your changed source code, so we don't need to repeat the effort. This would be a very generous move.


              • 4. Re: jbp 2.0 has lots of pitfalls
                peter Apprentice

                I would like to contribute. But i just don't know how to submit my codes.

                I already sent email to julien and i think he is busy.



                • 5. Re: jbp 2.0 has lots of pitfalls
                  peter Apprentice

                  yes, i will improve login page. I just made forum work today. I hope i will make login page nice next week.

                  By the way, my work is based on jbp-2.0-branch. I hope these code can be accepted and will be part of jbp-2.0.1 .


                  • 6. Re: jbp 2.0 has lots of pitfalls
                    peter Apprentice

                    i just applied the domain name for my site. www.mobmeee.com.
                    Welcome comments! :)

                    • 7. Re: jbp 2.0 has lots of pitfalls
                      Andrej Tibaut Newbie


                      Would you mind to send your code to my email?

                      I want to learn from your code.


                      • 8. Re: jbp 2.0 has lots of pitfalls
                        Viet Master

                        I think I answered you.

                        Can you submit patch as jira patch and attach the patch file to the jira task ?

                        • 9. Re: jbp 2.0 has lots of pitfalls
                          peter Apprentice


                          I will try to create patch through jira.jboss.org.

                          Due to the change is not one or two lines modifications, i am thinking how to submit the patches properly. Someone maybe give me recommends.

                          What i did include:
                          (1)All pages definitions should be removed from jbp-core. Especially the "default" page. I remove all page definitions from jbp-core. So, core is just core and it is independent with the pages. Pages is designed by application developers to present their own business. Core portlets and portlet-instances are configured in jbp-core through portlet.xml portlet-instance.xml so that external applications can just reuse them through their own page definitions.

                          (2)Just like helloworld.war example, one external war is used to include page definitions(like default page) and jsps to present my own business.
                          This war can act as a typical example of how to use jbp-2.0.

                          (3)a MenuPortlet class is designed to process menu navigation actions and to pass IPC message to other portlets (espeically the portlet located at the center of the screen) in its processAction() method. Then IPC message is used in IPCed portlet's doView() method.

                          (4)Some code changes to UserPortlet and ForumsPortlet to remove the WindowState related & hardcoded logics.

                          (5)Which theme to use is not related to menu navigation. So theme is not needed to change.



                          • 10. Re: jbp 2.0 has lots of pitfalls
                            Andrej Tibaut Newbie

                            Hi Yang,

                            have you submited the patch already?

                            • 11. Re: jbp 2.0 has lots of pitfalls
                              Anton Vahčič Newbie


                              But i have not seen any other letters but ascii. Any luck with chinese characters - in other words any luck with unicode?


                              • 12. Re: jbp 2.0 has lots of pitfalls
                                peter Apprentice

                                Chinese character is not a problem. At least according to my experience. But i have no such requirement on my website yet.

                                If any problem with Chinese characters, there are a few reascons:

                                (1)DB configuration. This could be a reason two years ago. Now, i don't think this is a problem.

                                (2)Set the accept-charset="UTF-8" in action form if any input is required.

                                (3)When a HTTP Request reaches servlet container, before processing of application, you should call setCharacterEncoding("UTF-8") on the HTTP Request. I think this could be the reason that lots of people cannot process Chinese properly. The easy way to handle this is adding a filter to cal the setCharacterEncoding() within doFilter() method.

                                By the way, i think JBoss-portal team is implementing a IPC solution. I don't think it is necessary for me to submit my code anymore. My solution is just adding a menu/navigation controller to distribute IPC messages.


                                • 13. Re: jbp 2.0 has lots of pitfalls
                                  Andrejus Chaliapinas Newbie

                                  Does anybody know if IPC will become soon under some JSR? I was using Click2Action under WebSphere Portal 4.x (later 5.x) more than one year ago and just curious it's not a standard so far.

                                  By the way found similar comment in other place:


                                  • 14. Re: jbp 2.0 has lots of pitfalls
                                    peter Apprentice

                                    Personally, i don't like propriatory IPC used by portal vendors. I prefer to use some patterns to work around. That is to say, instead of hardcoding some propriatory machanism, it is better to document a workable theme/navigation patten to make IPC work so that most users will/like to follow this pattern. It is also easy to upgrade to future IPC specification.

                                    I am implementing a addressbook portlet for jbp2 now. Hope it will work next week.