9 Replies Latest reply on Feb 7, 2007 10:24 AM by peterj

    How do I edit User Portlet?

    dleerob

      In the User Portlet, is says "Don't have an account yet? You can
      create one". I wan't to get rid of that text/link as I don't want anyone to be able to create users or signup as they want. Only an administrator must be able to create users and grant access.

      Where can I edit this User Portlet page to remove that link? I have taken a look in "server\default\deploy\jboss-portal.sar\portal-core.war\WEB-INF\jsp" but can't find any jsp with that text/link.

      Also, instead of just having "Standard Login" there, which links of to a seperate login.jsp, I would like to just have the username and password fields right there, with a login button. Anyone know how I would go about doing that?

      Any help would be appreciated and hopefully others will benefit from this post as well.

        • 1. Re: How do I edit User Portlet?
          peterj

          Like all good JSP code, the Portal uses properties to define the text strings so that the UI is easily translatable. Look for the property REGISTER_REGISTER in the file portal-core.war/WEB-INF/jsp/user/login/jsp.

          • 2. Re: How do I edit User Portlet?
            jimisola

             

            "PeterJ" wrote:
            Like all good JSP code, the Portal uses properties to define the text strings so that the UI is easily translatable. Look for the property REGISTER_REGISTER in the file portal-core.war/WEB-INF/jsp/user/login/jsp.


            Hmmm... He said that he did not want the link at all - not that he wanted to change the text. I'm having a look a JBoss Portal myself; if I have to hack jsp code to turn of such functionality then I am starting to get worried about upgrading from one version to another. Such things should be in the database to provide easy/easier upgrades.

            I might have misunderstood something, please correct me if so.

            Regards,
            Jimisola

            • 3. Re: How do I edit User Portlet?
              peterj

              My understanding was that dleerob wanted to know which JSP contained the text so that it could be removed. I provided the JSP file name, and a key piece of text to look for to find where that message is presented so that it could be removed.

              My reference to the properties file was not to say 'change the text here', though one possibility would be to set REGISTER_REGISTER, and it's sibling properties, to blank. Rather, it was to point out why the plain text was not found via a text search of the JSPs.

              • 4. Re: How do I edit User Portlet?
                ravindrareddy

                can i get the "userid" from databse to use in my portlet.
                in one of my requirements i want to use "role".
                for example incase if i want to display welcome "username" in one of my portlet, how to get the "username" from user profile in database depends upon the user who logged in.

                • 5. Re: How do I edit User Portlet?
                  dleerob

                  Thanks PeterJ for the responses. Nice to see you so actively participating in the forums. You've responded to a few of my posts already, much appreciated.

                  I did find the REGISTER_REGISTER propery in the login.jsp file thanks. And yes I can simply remove that and it will disappear.

                  Jimisola, it seems that removing that from the login.jsp will solve my dilemma. If I want to change the text, I'm guessing I would simply make changes to the relevant .properties files found in "jboss-portal.sar\portal-core.war\WEB-INF\classes".

                  I haven't done any of this just yet, but I imagine it should all work fine.

                  Thanks.

                  • 6. Re: How do I edit User Portlet?
                    theute

                    Removing the link, will not remove the feature on the back-end.

                    So if a user wants, he can still type the correct URL to register himself.

                    • 7. Re: How do I edit User Portlet?
                      peterj

                      Aw shucks, you mean that security by obscurity is not sufficient? Well, in that case I guess one would also have to edit core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java, removing the 'elseif' clause containing OP_SHOWREGISTER.

                      • 8. Re: How do I edit User Portlet?
                        dleerob

                        Yes it seems you can.

                        PeterJ, I take it you build your portal from source? Currenty im using the binary distribution, but im considering building from source, that way I can't at least make these sort of changes when need be. Would you recommend binary ditro or building from source? And what IDE do you use for the portal project? Eclipse?

                        • 9. Re: How do I edit User Portlet?
                          peterj

                          Yes, I usually build from source (for a while, some fixes I needed were only available that way). I extract the sources from Subversion and run the build script in the build directory. After a few minutes, the binary is in core/output/resources. I also download the binary because I find that easier to use to set up the database stuff.

                          I use Eclipse, but mainly for editing my portlets. If I need to dig through the portal source or make minor changes, I usually just load that source in UltraEdit. Though I imagine if I was to make more significant changes I would load it into Eclipse.