6 Replies Latest reply on Mar 14, 2007 12:21 PM by fredf

    adding themes to portal core?

    fredf

      Hello.

      Is there any hook in the portal core api which I can call to create a new
      theme in the portal core? I am referring to the portal-themes.xml file. I have a function that allows users in the portal to create their own theme (mainly background image and portlet-frame images) and i want to automatize this as far as possible. My idea is to have a new folder in

      \jboss-portal.sar\portal-core.war\themes


      created and then have a new element in the portal-themes.xml created. Does creating new themes require any additional steps to add a theme by hand?

      So, my question is: Is there some sort of api-call to acomplish all this or do I have to manually create all files and folders and entries in the portlet-themes.xml?

      thanks.

        • 1. Re: adding themes to portal core?
          theute

          You could use the ThemeService.
          org.jboos.portal.theme.ThemService

          It has the following method:
          addTheme(RuntimeContext runtimeContext, PortalThemeMetaData metaData) throws ThemeException;

          You should be able to achieve this goal.

          • 2. Re: adding themes to portal core?
            fredf

             

            "thomas.heute@jboss.com" wrote:
            You could use the ThemeService.
            org.jboos.portal.theme.ThemService

            It has the following method:
            addTheme(RuntimeContext runtimeContext, PortalThemeMetaData metaData) throws ThemeException;

            You should be able to achieve this goal.


            Thank you for a quick answer. When the user has created a new theme, is it possible to edit the themes programmatically? I.e. can I call some setThemeMetaData() on an existing theme? I did not find any. The idea is to let the user upload her/his own portlet-frame-images to our server and modify an existing theme. (her dedicated theme folder in the core)

            I have also found out that adding a new theme requires me to restart the server in order to find the theme in the portlet manager. Need I restart the server in order to call the org.jboos.portal.theme.ThemService.addTheme ?



            • 3. Re: adding themes to portal core?
              theute

              You cannot modify the files of the core.

              You have to provide a way to upload content, images, HTML and so on.

              Actually i guess that in your scenario you don't even need to use the theme Layout. You just need to create a smart theme, where it will construct the URL based on the logged-in user. (including the username in the path for example)

              But first you need to give them a way to uplad files on the server.

              • 4. Re: adding themes to portal core?
                fredf

                What URL do you mean? The url of the layout or the url of the portal page?

                • 5. Re: adding themes to portal core?
                  theute

                  URL to background image for example.

                  You don't need to create a new Theme per user if you just want to let them change a background image.

                  • 6. Re: adding themes to portal core?
                    fredf

                    Ok. The thing here is that our use case is page centered and not user centered. All users should experience the same theme when they see page A. The fact that I mention users is that we want to restrict users to only set the theme for the page they own.

                    Maybe you recognize this from an earlier question I had on this forum.

                    http://jboss.org/index.html?module=bb&op=viewtopic&t=98817

                    Is it still realizable?