Want to manage custom fields (Service builder entity) from the Liferay Control Panel? Here you go.

Problem: Using custom fields for custom entities? However, the Liferay control panel does not provide a way to determine how many custom fields there are for custom entities.

 

Solution: Just add a single component, and it is done.

 

On this branch, I have created a sample component that can be deployed quickly into liferay. Once it is deployed, it will add visibility to custom fields for your custom entities.

 

Writing Custom Attributes Display class: Steps

  • Create one class that extends BaseCustomAttributesDisplay class of Liferay

public class ObjectDefinitionCustomAttributesDisplay extends BaseCustomAttributesDisplay

 

  • Add component declaration to it

@Component(

property = "javax.portlet.name=" + ObjectPortletKeys.OBJECT_DEFINITIONS,

service = CustomAttributesDisplay.class

)

  1. Here you can write your own module name as well.
  • Override the methods like getClassName and getIconCssClass

@Override

public String getClassName() {

return ObjectDefinition.class.getName();

}

 

@Override

public String getIconCssClass() {

return "relationship";

}

 

Now this component is ready to deploy. Once you deploy this into liferay, you can check the custom field page, it will display your custom entity in the list. And you can manage the custom field from liferay control panel page itself.

 

GitHub: https://github.com/BhargavVaghasiya-RV/liferay-component/