O'Reilly logo

GateIn Cookbook by Piergiorgio Lucidi, Luca Stancapiano, Ken Finnigan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a custom field in the user profile

We want to add a new field for the users and show it through the user profile console.

Getting ready

It is enough to access the groovy folder inside the portal configuration in the root application folder of Gatein. Here is the complete path for the groovy folder, if you are using JBoss:

JBOSS_CONF/deploy/gatein.ear/02portal.war/groovy

Otherwise, if you are using Tomcat, you will find it at:

webapps/portal/groovy

How to do it…

  1. Locate the OrganizationPortlet that adds the profiles fields to the users.
  2. Add the following code in the first rows of the script file /groovy/ webui/form/UIVTabInputSet.gtmpl:
    if (uicomponent.findComponentById("Nameofthenewprofileblock") == null) {
     org.exoplatform.webui.form.UIFormInputSet ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required