2 Replies Latest reply on May 27, 2011 4:42 AM by Kamesh Sampath

    Accessing Metada in Groovy Templates

    Kamesh Sampath Newbie



      Can anyone tell me how to access the Portal metadata information inside the Groovy template, when I mean meta data I mean the things like Portal or site name, the current user groups etc.,


      Also where do we find the information on what are all the implicit objects that are available for Groovy templates.




        • 1. Re: Accessing Metada in Groovy Templates
          Vu Viet Phuong Novice

          There are some useful implicit objects you can use, the most importance one is :

          _ctx : org.exoplatform.webui.core.lifecycle.WebuiBindingContext;


          --> this is context object that hold the implicit objects. You can call _ctx.getRequestContext() to get the request context, and from this object, you have access to other imformation you want


          There are some other objects, you can find out at :


          ---> processRender method binds some useful objects for the template

          • 2. Re: Accessing Metada in Groovy Templates
            Kamesh Sampath Newbie

            thanks, but then I am using that object already but was hunting for some samples which will help me to pull out informaiton like the Portal Name e.g if I have portalA, portalB + classic (default) i want to know which portal  the user is currently in and ofcourse information like user groups, permissions etc,