Skip to main content

Posts

Showing posts from February, 2013

Getting access to menu from portlet in liferay

The below code describes the way of accessing menu items from the portlet. Here i have called it from jsp. The best thing about this is you can use the beautiful permission management of menu items of liferay as well without bothering about that. Writing services for fetching menu names from the layout tables will need more codes for permission managements......

Hope this helps.........


<%--
/**
* Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%@ page import="com.li…

Inter-portlet communication in liferay

In this article we will discuss about the Client-side Inter-Portlet Communication......


The JSR-286 (Portlet 2.0) specification gives a mechanism for inter-portlet communication (IPC).
it is mainly started and supported in Liferay since version 5.1.Though there is no perticular solution that fits all the requirments, so Liferay gives an additional method based on JavaScript to perform client side communication.

The client-side mechanism communicates portlets on events.

An event-based model allows one portlet to provide a notification that something of significance has happened, without establishing any kind of hard dependency. Other portlets on the same page that are interested/configured in that event and have registered listeners are then able to act accordingly.

The API is very simple and is mainly based on two methods....

 Liferay.trigger(eventName, data)
 Liferay.bind(eventName, function, [scope])

The above methods have been deprecated in Liferay 6 and replaced with...

 Liferay.fir…

How To Enable Remote Access To MySQL Server?

Mysql server by default disables the remote access of the server... To access it from a remote host follow the below steps.....
Step # 1: Login to your mysql server with SSH.
Step # 2: Enable the networking in the server.
Now open the my.cnf file using your favourite editor. I used vi.
# vi /etc/my.cnf
Step # 3:Then locate line follows
[mysqld]
Make sure line skip-networking is commented (or remove line) and add following line
bind-address=YOUR-SERVER-IP
For example, if your MySQL server IP is 23.23.23.23 then entire block should be look like as follows: [mysqld] user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp language = /usr/share/mysql/English bind-address = 23.23.23.23 # skip-networking

Here bind-address : IP address to bind to.
Dont forget to comment the line skip-networking to enable communication over tcp/ip.