Wednesday, May 6, 2015

[Liferay] Writing Custom Sql for multiple tables in Liferay

Hi Friends,

There were a number of times you might have faced a situation when you need data from multiple tables. Sometimes you would have got the data from one service, extract some data and then call another service, extract some more data and do the processing by writing some logic. Well, this has a major impact on performance and that's not good.

That's not good choice because you can write your own custom SQL query and get the desired result. The query we are writing, we always have a chance to optimize it and boost/improve performance. Alright, enough of the lecture.. lets get to work.

Friday, May 1, 2015

[Liferay][iPad][iPhone] Safari turns numbers into links

There are many calling applications which install some kind of plugin to turn numbers to links on which if you click will offer you to call. Skype's click to call is one of such application.

Well Safari, by default does this. We did not like it. You also don't, probably that's why you're here.. Here is the solution.

Open the theme or template or html file and add this meta tag.

<meta name="format-detection" content="telephone=no">

This will leave all numbers as it is. Now, you may also want to show some phone numbers as link which were actually phone numbers. In this case use like this.

<p>My phone number: <a href="tel:1-203-203-2020">1-203-203-2020</a></p>

This will show the phone number as link.

In case of liferay, open your theme's portal_normal.vm file and add the meta tag as mentioned above.

Hope this helps.