12 Replies Latest reply on Jun 30, 2010 10:22 AM by yelan_gatein

    how to create new groovy for new skin

    yelan_gatein

      i add a new skin for gatein. but it just change the color and images, i want to change the structure of the page, so i add a new groovy for this skin.

       

      it doesn't work.

       

       

      so in a new skin, how to setup the skin for groovy........

       

      Thanks for anybody's help.

        • 1. Re: how to create new groovy for new skin
          mwringe

          A skin is only mean to change things like colours and images. The skinning service will only change things like the css.

           

          If you are trying to change something in groovy, this wont be handled by the skinning service. What are you trying to change in groovy?

          • 2. Re: how to create new groovy for new skin
            yelan_gatein

            in one page:  data(from database), structure, skin are independent of each other.

             

            only change skin is not enough, i want to change structure(in gatein is groovy).

             

            such as UIHomePagePortlet,  if i want to make it like index page of google.com, only css and images is not enough.

             

            how to do it.......

            • 3. Re: how to create new groovy for new skin
              mwringe

              The UIHomePagePortlet is a portlet, most of the components on the page are portlets. Since the components are portlets, you should just be able to modify the page to have it load your custom portlet instead. It's designed to be customized this way.

               

              Skins should only be used to change the appearance of the page, not the page behaviour or layout.

               

              Does your change have to depend on what skin is currently loaded?

              • 4. Re: how to create new groovy for new skin
                yelan_gatein

                first, much thanks for your answer.

                 

                 

                as your said, most of the components on the page are portlets.

                 

                such as there are two skins, default is red skin, have UIHomePagePortlet, include groovy and skin folder.

                     another is blue skin(new add), i create UIHomePagePortlet, also include groovy and skin folder. 

                note:  groovy folder include *.gtmpl;  skin folder include *.css and *.images.

                 

                 

                 

                run jbossAS,   when i loggedin and "change skin", only the blue "skin folder" works, why blue "groovy folder" doesn't work. still shown the red groovy.....

                • 5. Re: how to create new groovy for new skin
                  mwringe

                  As I have said, the skin service will only change the css files, it will not change groovy files or anything else.

                   

                  If you think making the skin service change things like groovy files, then please open a feature request in the GateIn jira.

                   

                  The other option is for you to make your groovy portlet aware of the currently loaded skin and change it output based on that.

                   

                  You mentioned that the red skin is loading the new groovy files, I don't know what you are doing here but its not being loaded because of the skin.

                  • 6. Re: how to create new groovy for new skin
                    yelan_gatein

                    As I have said, the skin service will only change the css files, it will not change groovy files or anything else.

                     

                    Much thanks, so it is.

                     

                    If you think making the skin service change things like groovy files, then please open a feature request in the GateIn jira.

                     

                    Is there any document or demo for this part?

                     

                    The other option is for you to make your groovy portlet aware of the currently loaded skin and change it output based on that.

                     

                    how to do it, could you give me more suggestion?

                     

                     

                    Thanks again.

                    • 7. Re: how to create new groovy for new skin
                      eliasbg

                      Hello, I have managed to change the aspect of the gatein modifying some template groove, here some references:

                       

                      1. To copy the folder MySkin, MySkin.css and MySkin-lt.css inside:

                       

                      gatein.ear/01eXoResources.war/skin

                       

                       

                      2. In gatein.ear/01eXoResources.war/WEB-INF/gatein-resources.xml,

                       

                      registry the Skin

                       

                       

                      <portal-skin>
                           <skin-name>TinkaSkin</skin-name>
                           <css-path>/skin/TinkaSkin.css</css-path>
                           <overwrite>false</overwrite>
                      </portal-skin>
                      
                      

                       

                       

                      3. To copy the directory MySkin inside gatein.ear/web.war/skin,

                       

                      which, it contains a subdirectory porleticons and an icon.

                       

                      4. to enter to gatein.ear/web.war/skin/portal/webui/component and

                       

                      to add the styles to the components <Ej. UIBannerPortlet>

                       

                      MySkin/background and his respective sheet of style MySkin.css.

                       

                      5. to modify the UIBannerPortlet.gtmpl and the UIFooterPortlet.gtmpl

                       

                      located in web.war/groovy/groovy/webui/component.

                       

                      6. To modify the UIPortalNavigation.gtmpl located in web.war/groovy/portal/webui/component.

                       

                      7. To register your resources of styles in web.war

                       

                      /WEB-INF/gatein-resources.xml, so much for the BannerPortlet as the FooterPortlet

                       

                      8. To predefine the style in the file portal.xml located in:

                       

                      Gatein.ear/02portal.war/WEB-INF/conf/portal/portal/classic/, it is necessary to place the label:

                       

                      <edit-permission>*:/platform/administrators</edit-permission>
                      <skin>MySkin</skin> 

                       


                      9.  When selecting a skin, an overview of the skin is possible.

                       

                      It has to be defined in the current skin used to display the form to change skins.

                       

                      Put the screeshot of the skin in:

                       

                      01eXoResources.war:/skin/DefaultSkin/portal/webui/component/customization/UIChangeSkinForm/background

                       

                      and add the following in 01eXoResources.war:/skin/DefaultSkin/portal/webui/component/customization/UIChangeSkinForm/Stylesheet.css:

                       

                      .UIChangeSkinForm .UIItemSelector .TemplateContainer .MySkinImage {
                        margin: auto; 
                        width: 329px; height:204px; 
                        background: url('background/MySkin.jpg') no-repeat top; 
                        cursor: pointer ; 
                      }
                      
                      

                       

                      Saludos,

                      • 8. Re: how to create new groovy for new skin
                        yelan_gatein

                        Elias Barrientos, thanks for you help, but you have not understand what's my real meaning.

                         

                        i want to change "theme" which include skin and groovy, not just skin....

                         

                        like you mobile phone theme, if you change theme, it will change color&images(skin) and icon position(groovy).

                         

                         

                        there is a section in gatein-resources.xml(in my maven skin project)

                         

                        <!-- Skin for HomePagePortlet -->
                            <portlet-skin>
                                <application-name>web</application-name>
                                <portlet-name>HomePagePortlet</portlet-name>
                                <skin-name>BlueSkin</skin-name>
                                <css-path>/templates/skin/webui/component/UIHomePagePortlet/BlueSkinStylesheet.css</css-path>
                                <overwrite>false</overwrite>
                            </portlet-skin>

                         

                         

                        if i can define groovy path here, it will easy to change skin with it's own groovy, maybe gatein porject manager will think about my suggestion.......

                         

                        <!-- Skin for HomePagePortlet -->
                             <portlet-skin>
                                 <application-name>web</application-name>
                                 <portlet-name>HomePagePortlet</portlet-name>
                                 <skin-name>BlueSkin</skin-name>
                                 <css-path>/templates/skin/webui/component/UIHomePagePortlet/BlueSkinStylesheet.css</css-path>

                                <groovy-path>/templates/skin/webui/component/UIHomePagePortlet/UIHomePagePortlet.gtmpl</groovy-path>
                                 <overwrite>false</overwrite>
                             </portlet-skin>

                         

                         

                        I'm here, wait for your help......

                        Thanks.

                        • 9. Re: how to create new groovy for new skin
                          eliasbg

                          In general the template is assigned when the portlet is defined inside the page.xml

                           

                          <page>
                              <name>homepage</name>
                              <title>Home Page</title>
                                <access-permissions>Everyone</access-permissions>
                                <edit-permission>*:/platform/administrators</edit-permission>
                              <portlet-application>
                                <portlet>
                                  <application-ref>web</application-ref>
                                  <portlet-ref>HomePagePortlet</portlet-ref>
                                  <preferences>
                                    <preference>
                                      <name>template</name>
                                      <value>system:/templates/groovy/webui/component/UIHomePagePortlet.gtmpl</value>
                                      <read-only>false</read-only>
                                    </preference>
                                  </preferences>
                                </portlet>
                                <title>Home Page portlet</title>
                                <access-permissions>Everyone</access-permissions>
                                <show-info-bar>false</show-info-bar>
                                <show-application-state>false</show-application-state>
                                <show-application-mode>false</show-application-mode>
                              </portlet-application>
                            </page>
                          • 10. Re: how to create new groovy for new skin
                            yelan_gatein

                            i try to new a pages.xml for this portlet in my skin project, it's no use.

                             

                            i research that HomePagePortlet's groovy path will be writen some place, when jbossAS works.
                            maybe in swap area or database.....


                            i add a new
                            HomePagePortlet(include new groovy) in my skin project,it doesn't work.
                            because new skin project can't change the groovy path in swap area or database.


                            .........
                            • 11. Re: how to create new groovy for new skin
                              jbossvenkat

                              yes i too created a new skin from UI  using GateIn portal and also created new groovy templates for home page portlet.

                              but when i start the server and launch the application gate in portal i dont find my new template inspite of doing portal configuration xml files and so on.

                               

                              could anyone please help me as how to get the  changes for a new portal in gatein portal.

                              • 12. Re: how to create new groovy for new skin
                                yelan_gatein

                                ....looks like you have the same thought with me.

                                 

                                read Matt Wringe's reply in this discussion.