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

    jbp 2.0 has lots of pitfalls

      Hi

      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.

      regards

      Yang


        • 1. Re: jbp 2.0 has lots of pitfalls

          simpe pages are http://203.81.39.80/

          • 2. Re: jbp 2.0 has lots of pitfalls
            gruenewa

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

            • 3. Re: jbp 2.0 has lots of pitfalls
              andrejt

              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.

              Andrej
              (andrej.tibaut*AT*uni-mb.si)

              • 4. Re: jbp 2.0 has lots of pitfalls

                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.

                regards

                Yang

                • 5. Re: jbp 2.0 has lots of pitfalls

                  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 .

                  yang

                  • 6. Re: jbp 2.0 has lots of pitfalls

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

                    • 7. Re: jbp 2.0 has lots of pitfalls
                      andrejt

                      Hi!

                      Would you mind to send your code to my email?
                      andrej.tibaut*AT*uni-mb.si

                      I want to learn from your code.

                      Thanks,
                      Andrej

                      • 8. Re: jbp 2.0 has lots of pitfalls

                        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

                          ok.

                          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.

                          Regards

                          Yang

                          • 10. Re: jbp 2.0 has lots of pitfalls
                            andrejt

                            Hi Yang,

                            have you submited the patch already?

                            • 11. Re: jbp 2.0 has lots of pitfalls
                              vahcic

                              Hi,

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

                              Anton

                              • 12. Re: jbp 2.0 has lots of pitfalls

                                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.

                                regards
                                Yang

                                • 13. Re: jbp 2.0 has lots of pitfalls
                                  andrejusc

                                  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:

                                  http://www.jboss.org/jbossBlog/blog/acoliver?page=comments&permalink=0002.html

                                  • 14. Re: jbp 2.0 has lots of pitfalls

                                    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.

                                    yang