09 August, 2012

Velocity variables for layout template

$processor      com.liferay.portlet.layoutconfiguration.util.velocity.TemplateProcessor
$request      javax.servlet.http.HttpServletRequest    
$themeDisplay      com.liferay.portal.theme.ThemeDisplay    
$company      com.liferay.portal.model.Company    
$user          com.liferay.portal.model.User    
$realUser      com.liferay.portal.model.User    
$layout      com.liferay.portal.model.Layout
$layouts      java.util.List<com.liferay.portal.model.Layout>
$plid          java.lang.Long
$layoutTypePortlet      com.liferay.portal.model.LayoutTypePortlet
$portletGroupId      java.lang.Long
$locale      java.util.Locale
$timeZone      java.util.TimeZone
$theme          com.liferay.taglib.util.VelocityTaglib
$colorScheme      com.liferay.portal.model.ColorScheme
$portletDisplay  com.liferay.portal.theme.PortletDisplay

07 August, 2012

Image upload restrict from ckeditor

Stay tune here for more information !!!
I am preparing article for that.
Guys I can not share code here because some policy, But you can handle and restrict other community folders from ck editor by making changes in BaseCommandReceiver.java class

06 August, 2012

portlet.xml tag sequence

Hi Everyone,

This is very rarely used but its important to know the sequence of tags given in portlet.xml file:

Here is the tags sequence of portlet.xml file  :

             description
             portlet-name
             display-name
             portlet-class
             init-param
             expiration-cache
             cache-scope
             supports
             supported-locale
             resource-bundle
             portlet-info
             portlet-preferences
             security-role-ref
             supported-processing-event
             supported-publishing-event
             supported-public-render-parameter
             container-runtime-option

03 August, 2012

Change date format in calendar header

If you want to change date format in calendar or any liferay portlet you can simply use FastDateFormatFactoryUtil API which is very useful to change in fornat.

Please see below sample example to change calendar header.

you can override below jsp using hook.

In init.jsp :

Format df = FastDateFormatFactoryUtil.getSimpleDateFormat("dd-MMM-yyyy");


in summary.jspf :

<liferay-ui:calendar
month="<%= selMonth %>"
day="<%= selDay %>"
year="<%= selYear %>"
headerFormat="<%= df %>"
data="<%= data %>"
/>

27 July, 2012

Pagination in Liferay 6.1

Guys if you are thinking to put pagination in liferay,
use below code which is absolutely running properly and i would be putting more information regarding pagination with some more feature which supppoted by OOB liferay pagination.

25 July, 2012

Get Image From Image Gallery

You can re-use below code to get image from image gallery and can use in any of your portlet.


private IGImage getImage(IGFolder igFolder, String imageName, ThemeDisplay themeDisplay) {
        IGImage igImage = null;
        if (igFolder != null) {
            try {
                List imgList = IGImageLocalServiceUtil.getImages(themeDisplay.getScopeGroupId(), igFolder.getFolderId());

                for (IGImage igImg : imgList) {
                    if (imageName.equalsIgnoreCase(igImg.getName())) {
                        igImage = igImg;
                        break;
                    }
                }

            } catch (Exception e) {
             System.out.println(e.getMessage());
            }
        }
        return igImage;
    }

20 July, 2012

First LIUG Meetup in Ahmedabad

Hello Liferay Folks,

First time we are organizing LIUG (Liferay India User Group) meetup in Ahmedabad(Gujarat).
So stay tune here and be update with more information very soon.

Please visit this page regular for more update :
http://www.liferaysolution.com/p/liug.html

18 July, 2012

Custom LDAP attributes import

Hi Everyone,
If you want to import LDAP extra attributes in liferay , then you can achive this functionality two different ways :

06 July, 2012

LDAP import export


I know that this is very simple,
but when you configure your liferay first time with LDAP then this article will help you.

Follow below steps to configure LDAP with liferay :

26 June, 2012

Read repeatable data


Hi Everyone,

If you guys are thinking to read repeatable  data from structure and want to fatch in template, Just see and use below code :
In Structure :
<root>
  <dynamic-element index-type="text" name="name" repeatable="true" type="text">
    <dynamic-element index-type="" name="link" repeatable="false" type="text"></dynamic-element>
  </dynamic-element>
</root>

In Template :
<div class="community-names" style="background: none repeat scroll 0 0 #73B3DE; float: left; padding: 5px 0 5px 205px; width: 100%;">
#foreach ($communityname IN $name.getSiblings())
<a href="http://www.blogger.com/$communityname.link.getData%28%29">
    $communityname.getData()  
</a>   
 #end

</div>
</div>

19 June, 2012

Show all pages in theme

You can write below code in theme to list out all the pages(Hidden also) which we have created through GUI:

#set($layoutLocalService = $serviceLocator.findService("com.liferay.portal.service.LayoutLocalService"))
#set($topPublicLayouts = $layoutLocalService.getLayouts($layout.getGroupId(),false)) 
#foreach($layout_page in $topPublicLayouts)

Popular Posts

Featured Post

Liferay 7.3 compatibility matrix

Compatibility Matrix Liferay's general policy is to test Liferay Portal CE against newer major releases of operating systems, open s...