Home » Devtech review » LangsNTechs » Java » Liferay » 6 EE SP1 » Liferay (6) small hint – where are my portlets?

Liferay (6) small hint – where are my portlets?

Note: We’re running Liferay 6 on MySQL DB.

One day I just wanted to see on which pages my portlets are used. So I had to make a little query for this:
select portletId, layout.plid, group_.friendlyURL, layout.friendlyURL from portletpreferences left join layout on layout.plid = portletpreferences.plid left join group_ on layout.groupId = group_.groupId where portletId like '%_WAR_[YOUR WAR NAME GOES HERE]%';

If you want to see all of the portlets, you can remove the “where” clause (but be prepared to be overwhelmed with the output).

The results look like this:

+-----------+--------+--------------------+--------------------+
| portletId |  plid  | group_.friendlyURL | layout.friendlyURL |
+-----------+--------+--------------------+--------------------+
| 103       | 704033 | /guest             | /my-community      |
| 145       | 704033 | /guest             | /my-community      |
| 29        | 704033 | /guest             | /my-community      |
| 49        | 704033 | /guest             | /my-community      |
| 86        | 704033 | /guest             | /my-community      |
| 87        | 704033 | /guest             | /my-community      |
| 88        | 704033 | /guest             | /my-community      |
...

Maybe I should make a full-fledged control-panel portlet for this – who knows, it might come handy.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s