Posts

Showing posts from December, 2016

Getting the modal hints for the column in class

We will update the maxlength for the column in portlet-modal-hints.xml. Just like as below <field name="comments" type="String"> <hint name="max-length">500</hint> </field> If we want to get these max length in the class,  we can use the below code. ModelHintsUtil.getMaxLength(model, field) model : Class name field : columnName ex: ModelHintsUtil.getMaxLength(KBUser.class.getName(), "comments");

Debug the Mail in liferay

To turn on logging of Liferay mail and JavaMail, add the following to your Log4j configuration in  webapps/ROOT/WEB-INF/class/ META-INF/portal-log4j-ext.xml  after the last  <appender>  entry: <logger name="com.liferay.util.mail"> <level value="DEBUG"/> </logger>

Analyzing the Portlet Performance in liferay

Set the following log in the  tomcat/lib/META-INF/portal-log4j-ext.xml <category name="com.liferay.portlet.InvokerPortletImpl">        <priority value="DEBUG" />     </category> This will cause the performance of each portlet render to be logged, for example:  render for welcomeportlet_WAR_welcomeportlet takes 1 ms render for employmentportlet_WAR_linksportlet takes 80 ms