Thursday 25 May 2017

Add Custom Organization Types in Liferay

Purpose:
Liferay 7 GA3 Does not provides field to create organization with different types. On creating  new organization it automatically set 'Organization' as it's type. Purpose of this document is to create Organization with your own defined types as given in document below.

Add the following properties in your portal-ext.properties file.


# Define types  of organizations separated by comma(,)
organizations.types=Organization,Client,Customer


# set as root organization
organizations.rootable[Organization]=true


# Define types of child organizations separated by comma(,)
organizations.children.types[Organization]=Organization,Client,Customer


# set country field enabled and required.
organizations.country.enabled[Organization]=false
organizations.country.required[Organization]=false


# set as root organization
organizations.rootable[Client]=true
# set country field enabled and required.
organizations.country.enabled[Client]=true
organizations.country.required[Client]=false


# set as root organization
organizations.rootable[Customer]=false
# set country field enabled and required.
organizations.country.enabled[Customer]=true
organizations.country.required[Customer]=false

Add Organization:
Find Add Organization option under Control Panel > Users > Users and Organizations. find (+) icon at right bottom on the screen to Add Organization.

Before Adding properties:

As you can see that before adding properties in portal-ext.properties file no such options available to set type of organizations.
After Adding properties:
Type field is available to select type of organization with the following values in select dropdown.
  • Organization,
  • Client
  • Customer

After Adding Organization:
As you can see the multiple organizations with different types.


2 comments: