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

    Accessing Metada in Groovy Templates

    kamesh_sampath

      Hi,

       

      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.

       

      Thanks,

      Kamesh

        • 1. Re: Accessing Metada in Groovy Templates
          vstorm83

          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 :

          org.exoplatform.webui.core.lifecycle.Lifecycle 

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

          • 2. Re: Accessing Metada in Groovy Templates
            kamesh_sampath

            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,