4 Replies Latest reply on Jun 1, 2009 1:10 PM by karypid

    Localized version of full pages

      Hello all,


      I am developing an application with Seam 2.0.2.SP1. I have been using localised messages as described in:


      Relevant Seam documentation


      My problem is that some pages contain large amounts of static text which is a pain to manage within a properties file. Can someone suggest an approach to handling this situation?

        • 1. Re: Localized version of full pages
          brandonsimpson

          I had the same sort of problem but haven't really come up with what I felt was an elegant solution. Right now I'm just taking a sort of brute-force approach...I typically just internationalize each page as pageName.content1, pageName.content2, pageName.content3, etc.


          It's sort of interesting...the built-in internationalization support seams to be geared towards internationalizing small strings in a page full of components. But it seems to me that sometimes you sort of need the opposite...whole pages internationalized with some components intermixed in the content. I thought about developing my own component that would hold each localized page in a cache but I wasn't sure what the best way to handle components (links,etc.) embedded in the content...probably would need to embed some sort of tag in the page and dynamically add in the components. Anyway, for now it sounded like too much work so I went with the brute-force approach I mentioned above.


          Another thing I wanted to have is a page (or document) versioning system. For example, I want to be able to have the user agree to a particular version of a User Agreement when they register and then later, if I make changes to the User Agreement, have the user again be prompted automatically to agree to the newer version of the agreement. I'd want to keep track of each version of the document and which ones the user actually agreed to.


          Seems like there are a lot of advanced features like this that aren't really addressed by any framework that I know of. I also haven't been able to find anything that handles all the details of paid subscriptions or something like that and have been trying to figure out the best way to implement it since I'd want the user to lose certain permissions when their subscription expired, maybe do automated mailings/renewals/etc. I can only hope that support for such things (which I think are pretty common to many websites) will be added in the future.

          • 2. Re: Localized version of full pages
            niox.nikospara.yahoo.com

            Hi Alexandre and Brandon,


            You can take advantage of the compositing features of Facelets to include large sections of internationalised text in your pages. In more detail:


            1) <ui:include src="..." />: The src attribute can take an EL expression. So you can separate internationalised content under folders like en/, el/, de/ etc.


            2) Even better, <ui:composition template="..."> can take EL expressions. So you can define internationalised templates!


            Versioning however goes beyond JSF. It is probably a Content Management System that you want. Or you can check out Hibernate Envers.


            I havent used it myself, but Alfresco is an open source CMS, implementing the Java Content Repositories JSR (and much more). Alfresco is based on JSF. There is an integration with SEAM here.

            • 3. Re: Localized version of full pages
              brandonsimpson

              Thanks for the ideas! Very good input!

              • 4. Re: Localized version of full pages

                Nikos,


                Thank you for the pointers, it was exactly what I was looking for.