Pages

Wednesday, 24 April 2013

Embed a Portlet In Layout

This is gonna be a very small post, but trust me these two lines are amazing.
In some cases you may need to have a portlet show up on every single page every time. Instead of adding it manually everytime you create a new page, you can embed portlets in your custom layout.

Create a  layouttpl project.And then add the following code in your custom.tpl under source.
  • <div class="custom" id="main-content" role="main">
  • <div class="portlet-layout">
  • <div class="portlet-column portlet-column-only" id="column-1">
  • $processor.processPortlet("47")
  • $processor.processColumn("left")
  • </div></div></div>  
here "47" is portlet ID;

hope this might help full for you  in feature .
thank u
vinod

Tuesday, 23 April 2013

Get portlet preference

In many cases we need to find portlet preferences.
Below is the code which can help to find portlet preferences.


PortletPreferences preferences = renderRequest.getPreferences();
String portletResource = ParamUtil.getString(request, "portletResource");
if (Validator.isNotNull(portletResource)) {
preferences = PortletPreferencesFactoryUtil.getPortletSetup(request, portletResource);
}

String OAuthConsumerKey = preferences.getValue("OAuthConsumerKey", StringPool.BLANK);
String OAuthConsumerSecret = preferences.getValue("OAuthConsumerSecret", StringPool.BLANK);
String OAuthAccessToken = preferences.getValue("OAuthAccessToken", StringPool.BLANK);

Import the lar file for the guest community

Enable the below property in portal-ext.properties to import the lar file for the guest community.

#
# Specify a LAR file that can be used to create the guest public layouts.
# If this property is set, the previous layout properties will be ignored.
#
default.guest.public.layouts.lar=${liferay.home}/deploy/default_guest_public.lar

import LAR file into Liferay

public static void addDefaultLayoutsByLAR(
long userId, long groupId, boolean privateLayout, File larFile)
throws PortalException, SystemException {

Map parameterMap = new HashMap();

parameterMap.put(
PortletDataHandlerKeys.PERMISSIONS,
new String[] {Boolean.TRUE.toString()});
parameterMap.put(
PortletDataHandlerKeys.PORTLET_DATA,
new String[] {Boolean.TRUE.toString()});
parameterMap.put(
PortletDataHandlerKeys.PORTLET_DATA_CONTROL_DEFAULT,
new String[] {Boolean.TRUE.toString()});
parameterMap.put(
PortletDataHandlerKeys.PORTLET_SETUP,
new String[] {Boolean.TRUE.toString()});
parameterMap.put(
PortletDataHandlerKeys.USER_PERMISSIONS,
new String[] {Boolean.FALSE.toString()});

LayoutLocalServiceUtil.importLayouts(
userId, groupId, privateLayout, parameterMap, larFile);
}

Wednesday, 17 April 2013

Adding portlet to the portal Directly

here i am explaining How to add portlet to webpage  immediately after deploying the portlet
 its so simple
just past the below code in your action class
 public void init() throws PortletException {
       viewjsp=getInitParameter("view-jsp");
           try {              
               Company companyqq = CompanyLocalServiceUtil.getCompanyByWebId("vinod.com");
                Role adminRole = RoleLocalServiceUtil.getRole(companyqq.getCompanyId(),"Administrator");
                List<User> adminUsers = UserLocalServiceUtil.getRoleUsers(adminRole.getRoleId());                
                PrincipalThreadLocal.setName(adminUsers.get(0).getUserId());
                PermissionChecker permissionChecker =PermissionCheckerFactoryUtil.create(adminUsers.get(0), clearRequestParameters);
                PermissionThreadLocal.setPermissionChecker(permissionChecker);                            
                            long plid = 17817;
                           Layout layout = LayoutLocalServiceUtil.getLayout(plid);
                            LayoutTypePortlet layoutTypePortlet = (LayoutTypePortlet)layout.getLayoutType();
                           String portletId = "pagination_WAR_paginationportlet_INSTANCE_cVJ3";
                           String targetColumn = "column-1";
                           layoutTypePortlet.addPortletId(12770,portletId,targetColumn,-1);                          
                           layoutTypePortlet.resetStates();
                           LayoutServiceUtil.updateLayout(layout.getGroupId(), layout.isPrivateLayout(), layout.getLayoutId(), layout.getTypeSettings());
                       } catch (Exception e) {
                           e.printStackTrace();
               }
}

i hope this will be help full for you in feature.....
thank u

Monday, 15 April 2013

Embed search in theme and redirect


As we know that we can simply embed search in theme which is mentioned in http://vinodtips.blogspot.in/2013/04/embed-search-and-web-content-search.html

But If you want to embed search in theme and want to redirect on specific fix community page then you may need some modification and can use below code in you theme .vm file :
#set ($layoutService = $serviceLocator.findService('com.liferay.portal.service.LayoutLocalService') )
#set ($selectedPageGroup = $groupLocalService.getGroup($themeDisplay.getCompanyId(),"Guest") )
#set($pageLayout=$layoutService.getFriendlyURLLayout($selectedPageGroup.getGroupId(),false,"/search"))
#set($plid=$pageLayout.getPlid())
#set ($my_sites_portlet_url = $portletURLFactory.create($request, "3", $plid, "RENDER_PHASE"))               
<div id="search">
          <form onsubmit="ctem_3_search(); return false;" name="ctem_3_fm" method="get" action="$my_sites_portlet_url">
                    <input type="hidden" value="maximized" name="p_p_state">
                    <input type="hidden" value="view" name="p_p_mode">
                    <input type="hidden" value="/search/search" name="_3_struts_action">
                    <input type="hidden" value="$themeDisplay.getURLCurrent()" name="_3_redirect">
                    <input type="hidden" value="0" name="_3_groupId">
                    <input type="text" value="" placeholder="I'm Looking for..." size="30" name="_3_keywords" class="">                   
                    <input type="image" border="0" align="absmiddle" title="Search" src="/iu-health-theme/images/custom/ui/background/background-header-search-button.png">
      </form>
 </div>

Embed search and web content search portlet in theme


Hi everyone,

Simplest way to integration of search in theme.
If you want to integrate portal search and web content search in Liferay theme, Use below code in your vm file:
$theme.journalContentSearch() :  for web content search
$theme.search() :  for portal search

Solr integration with Liferay 6.1


If you want to setup solr with liferay and want to use solr as a search engine, 
Guys you can follow below steps:
Its very quick and simple, Just try ....
Setting up Solr Server on Tomcat :
•   Download apache-tomcat-7.0.34.zip and apache-solr-1.4.1.zip from Apache Mirrors.
•   Create one folder called solr-server under base directory.
•   Place and unzip above zip files in server directory.
•   Create data directory in solr-server directory. This data directory will contain all the index data. So make sure the free space available in this directory should be as per the estimated data size.
•    Now give full rights to all the folders under  solr-server directory.
•    Make changes in server.xml file if you want to change the default http port of tomcat server.
•    Copy SOLR_HOME/example/solr/apache-solr-1.4.1.war to SOLR_HOME/example/solr/solr.war
•    Copy SOLR_HOME/example/solr/solr.war file to TOMCAT_HOME/webapps directory.
      SOLR_HOME = /opt/jignesh/solr-server/apache-solr-1.4.1
      TOMCAT_HOME = /opt/jignesh/
solr-server/apache-tomcat-7.0.34
•    Edit TOMCAT_HOME/bin/catalina.sh file and add below line before shell script code starts.
      export JAVA_OPTS=-Dsolr.solr.home='/opt/jignesh/server/apache-solr-1.4.1/example/solr'

•    Edit SOLR_HOME/example/solr/conf/solrconfig.xml file for setting solr index data directory.
      Update <dataDir> tag for setting data directory.
       <dataDir>${solr.data.dir: /opt/jignesh/server/data}</dataDir>
•    Start tomcat server from TOMCAT_HOME/bin/ and access the below URL.
      http://[IP ADDRESS]:[PORT]/solr 

Configuration of solr-web plugin in Liferay :

•    Start the Tomcat server from Liferay Bundle.
•    Place .lpkg (i.e. 15187207_15857467_15857476.lpkg) file of solr-web plugin in tomcat’s deploy directory.
•    After solr-web plugin is deployed in Liferay, stop Liferay Tomcat server. Also stop the Solr Tomcat server which we have setup earlier on a separate tomcat instance.
•    Go to LIFERAY_HOME/tomcat-7.0.27/webapps/solr-web/WEB-INF/conf directory.
•    Copy/replace schema.xml file to SOLR_HOME/example/solr/conf directory on Solr Server.
•    Now go to LIFERAY_HOME/tomcat-7.0.27/webapps/solr-web/WEB-INF/classes/META-INF on Liferay Server.
•    Edit solr-spring.xml file and update value of Solr Server IP Address and Port number as mentioned in below example.
<bean id="com.liferay.portal.search.solr.server.BasicAuthSolrServer" class="com.liferay.portal.search.solr.server.BasicAuthSolrServer">
<constructor-arg type="java.lang.String" value="http://[SOLR SERVER IP]:[PORT]/solr" />
</bean>
•    After above changes are done, first start the Solr Tomcat Server.
•    After starting Solr Tomcat Server, Start Liferay Tomcat Server.
•    When Liferay Server starts successfully, follow below steps,
     o    Login with admin user
     o    Go to the Control Panel > Server > Server Administration.
     o    Click on Execute Button beside Reindex all search indexes.

Wednesday, 10 April 2013

example for edit mode

After creating the project you r suppose to configure the edit mode in portlet.xml
EX:-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<init-param>
<name>view-jsp</name>
<value>/html/editing/view.jsp</value>
</init-param>
<init-param>
<name>edit-jsp</name>
<value>/html/editing/edit.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<portlet-mode>edit</portlet-mode>
</supports>
add the following code in view jsp
1
2
3
4
<jsp:useBean id="userName" class="java.lang.String" scope="request"/> #1 
<p>Hello <%=userName %>!</p>
#1 Gets the bean out of the request
add the following code in edit jsp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
 <jsp:useBean class="java.lang.String" id="addNameUrl" scope="request" />
 <portlet:defineObjects />
 <form
  id = "<portlet:namespace />helloForm"
  action="<%=addNameUrl %>"
  method="post">
  <table>
   <tr>
   <td>Name:</td>
   <td><input type="text" name="username"></td>
   </tr>
  </table>
  <input type="submit" id="nameButton" title="Add Name" value="Add Name">
 </form>

the complete java code for the portlet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.liferayinaction.portlet;
 import java.io.IOException;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.GenericPortlet;
 import javax.portlet.PortletException;
 import javax.portlet.PortletMode;
 import javax.portlet.PortletPreferences;
 import javax.portlet.PortletRequestDispatcher;
 import javax.portlet.PortletURL;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 public class HelloYouPortlet extends GenericPortlet {
  public void init() throws PortletException {
   editJSP = getInitParameter("edit-jsp");
   viewJSP = getInitParameter("view-jsp");
  }
  public void doEdit(RenderRequest renderRequest,
   RenderResponse renderResponse)
   throws IOException, PortletException {
   renderResponse.setContentType("text/html");
   PortletURL addName = renderResponse.createActionURL();
   addName.setParameter("addName", "addName");
   renderRequest.setAttribute("addNameUrl", addName.toString());
   include(editJSP, renderRequest, renderResponse);
  }
  public void doView(RenderRequest renderRequest,
   RenderResponse renderResponse)
   throws IOException, PortletException {
   PortletPreferences prefs = renderRequest.getPreferences();
   String username = (String) prefs.getValue("name", "no");
   if (username.equalsIgnoreCase("no")) {
    username = "";
   }
   renderRequest.setAttribute("userName", username);
   include(viewJSP, renderRequest, renderResponse);
  }
  public void processAction(
   ActionRequest actionRequest,
   ActionResponse actionResponse)
   throws IOException, PortletException {
   String addName = actionRequest.getParameter("addName");
   if (addName != null) {
    PortletPreferences prefs =
     actionRequest.getPreferences();
    prefs.setValue(
     "name", actionRequest.getParameter("username"));
    prefs.store();
    actionResponse.setPortletMode(PortletMode.VIEW);
   }
  }
  protected void include(
   String path, RenderRequest renderRequest,
   RenderResponse renderResponse)
   throws IOException, PortletException {
   PortletRequestDispatcher portletRequestDispatcher =
    getPortletContext().getRequestDispatcher(path);
   if (portletRequestDispatcher == null) {
    _log.error(path + " is not a valid include");
   } else {
    portletRequestDispatcher.include(
    renderRequest, renderResponse);
   }
  }
  protected String editJSP;
  protected String viewJSP;
  private static Log _log = LogFactory.getLog(HelloYouPortlet.class);
 }




Tuesday, 9 April 2013

Embed or Integrate web content in theme- Liferay6.X.X

Hello Liferay folks,
I know that many time you will have this requirement that you need to integrate web content into Liferay theme.
So here is the code which can help you to integration :
Please follow the below steps :
1) Create theme in liferay
2) create liferay-look-and-feel.xml and put below code:
     <?xml version="1.0"?>
<!DOCTYPE look-and-feel PUBLIC "-//Liferay//DTD Look and Feel 5.0.0//EN" "http://www.liferay.com/dtd/liferay-look-and-feel_5_0_0.dtd">
<look-and-feel>
    <compatibility>
        <version>6.0.0+</version>
    </compatibility>
   <company-limit>
        <company-includes /> 
        <company-excludes /> 
   </company-limit>
    <theme id="drupal-garland" name="drupal-garland">
        <template-extension>vm</template-extension> 
    <settings>
          <setting key="portlet-setup-show-borders-default" value="false" /> 
          <setting key="header-article-id" value="header-article-id" /> 
          <setting key="sidebar-article-id" value="sidebar-article-id" /> 
          <setting key="footer-article-id" value="footer-article-id" /> 
  </settings>
 </theme>
</look-and-feel>
3) Now put the below code in .vm file where you want to show that web content.
    #set ($portletSetupShowBordersDefault = $theme_settings.getProperty("portlet-setup-show-borders-default"))
#set ($journalArticleLocalService = $serviceLocator.findService("com.liferay.portlet.journal.service.JournalArticleLocalService"))
#set ($headerArticleId = $theme_settings.getProperty("header-article-id"))
#set ($journalArticleContentObject = $journalArticleLocalService.getArticleByUrlTitle( $theme_display.getCompanyGroupId(), $headerArticleId))
#set ($templateId = $journalArticleContentObject.getTemplateId())
#set ($headerContent = $journalContentUtil.getContent( $theme_display.getCompanyGroupId(), $journalArticleContentObject.getArticleId(), $templateId, "$locale", $theme_display))
<div id="header">$headerContent</div>
4) Don't wait for next steps guys !!!! you are done with the functionality.
This is the easiest way to integrate the web content in theme.




Access image from liferay theme


If you want to access any images in liferay from theme,

you can follow below very simple steps:

1) Define the taglib in your portlet jsp file
<%@taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %> 
2)Define the liferay tag like
<liferay-theme:defineObjects /> 
3)After doing this we would have themeDisplay object available in portlet jsp file 
so you can use
<img src="${themeDisplay.getPathThemeImages}/your_Image_folder/image.png" /> 
So that's it ... 

Saturday, 6 April 2013

Implement Captcha in Liferay Portlet


Sometimes it is required to add captcha functionality into portlet. Liferay already have everything required, and already used captcha in some internal portlets (login, message board), but, it is implemented using with CaptchaPortletAction - what is not available for plugins (in case you are developing in plugin environment).
So, here is small receipt how to enable liferay's captcha in your portlet developed in plugin environment.

Generate Captcha

In portlet, in my case inherited from JSPPortlet (renamted to MVCPortlet in post-5.2.3) class we need to add method serverResource - something like this:
public class CaptchaSamplePortlet extends JSPPortlet {
    /** Serve Resource used for getting captcha
     *
     */
    @Override
    public void serveResource(ResourceRequest resourceRequest,
                             ResourceResponse resourceResponse) throws IOException, PortletException {
        try {
            com.liferay.portal.kernel.captcha.CaptchaUtil.serveImage(resourceRequest, resourceResponse);
        } catch (Exception e) {
            log.error(e);
        }
    }
}
This method doing everything - generated captcha and returned it's content (with all required http-readers into response), as well as placed required data into session

Display Captcha

Now, to place captcha into jsp you need to place:
<portlet:resourceURL var="captchaURL"/>
<liferay-ui:captcha url="<%= captchaURL %>"/>
That will place captcha control and point it to our portlet resourceURL to generate image
Now, you will have captcha and field to enter captcha text on your form generated by these tags.

Validate Captcha

To check captcha add followed function in your action-handler in portlet-class:
private void checkCaptcha(PortletRequest request) throws Exception {
        String enteredCaptchaText = ParamUtil.getString(request, "captchaText");

        PortletSession session = request.getPortletSession();
        String captchaText = getCaptchaValueFromSession(session);
        if (Validator.isNull(captchaText)) {
            throw new Exception("Internal Error! Captcha text not found in session");
        }
        if (!StringUtils.equals(captchaText, enteredCaptchaText)) {
            throw new Exception("Invalid captcha text. Please reenter.");
        }
    }

    private String getCaptchaValueFromSession(PortletSession session) {
        Enumeration<String> atNames = session.getAttributeNames();
        while (atNames.hasMoreElements()) {
            String name = atNames.nextElement();
            if (name.contains("CAPTCHA_TEXT")) {
                return (String) session.getAttribute(name);
            }
        }
        return null;
    }
What is all - now, you can do everything - display captcha, enter value - and check it


Contributed by : www.emforge.net

Alloy Tag Examples

AUI HYPERLINK EXAMPLE
=======================


Attributes 
    cssClass: custom classes for additional styling (the attribute class will be ignored)
    href: the url of the link
    label: the content of the <a> element (automatically translated).

 Example :
-----------

 <aui:a cssClass="test" href="http://www.cignex.com" id="googleId" label="CIGNEX" ></aui:a>

    
AUI INPUT TAG EXAMPLE
=======================

Attributes 


    cssClass: custom classes for additional styling (the attribute class will be ignored)
    disabled. Set this to true to disable the input field.
    first: set this to true if this is the first element in the form (for css styling)
    last: set this to true if this is the last element in the form (for css styling)
    helpMessage: message to display when the user hovers a question mark icon next to the field label
    name: name of the field
    id: id of the field. (If empty, it will be the same as the name)
    label: Label to display (automatically translated). If this attribute is used and the value is an empty String, then no label will be shown. If the attribute is not used, the label is obtained from the name (automaticalle formatted from ThisIsAName to this-is-a-name).
    inlineField: set this to true if you want this field to be inline with the next element
    inlineLabel: set this to left if you want this field to be inline with the label and the label at the left of the input or right if you want the field to be inline with the label but at the right of the input.
    checked: Set this to true if your element must be checked by default (only enabled when type=radio)
    type: the type of input element. These are some of the values that type could have: texthidden When the type is hidden, the value is automatically escaped

Example :
---------

    <aui:input inlineLabel="left" inlineField="true" label="Edu. Details : "  name="education" type="textarea"></aui:input>


 

 AUI BUTTON & BUTTON ROW EXAMPLE
 ================================
 Attributes 


    cssClass: custom classes for additional styling (the attribute class will be ignored)

Example :
---------

 <aui:button-row> 
    <aui:button name="saveButton" type="submit" value="save" onClick="javascript:alert('Save?')" /> 
    <aui:button name="cancelButton" type="button" value="cancel" onClick="javascript:alert('Cancel?')" /> 
</aui:button-row>

    
    
AUI SELECT EXAPLE
=================

Attributes 


    bean: An object that will be accessed. (Only valid when using listType)
    listType: The name of the ListType (can be obtained from ListTypeImpl.java). Using this attribute will automatically generate all the options and mark the option from the bean as selected (the bean can be obtained from the model context)
    showEmptyOption. Displays an empty option as the first option of the select.
    disabled. Set this to true to disable the selector.
    cssClass: custom classes for additional styling (the attribute class will be ignored)
    first: set this to true if this is the first element in the form (for css styling)
    last: set this to true if this is the last element in the form (for css styling)
    helpMessage: message to display when the user hovers a question mark icon next to the field label
    name: name of the field
    idid of the field. (If empty, it will be the same as the name)
    label: Label to display (automatically translated). If this attribute is used and the value is an empty String, then no label will be shown. If the attribute is not used, the label is obtained from the name (automaticalle formatted from ThisIsAName to this-is-a-name).
    inlineField: set this to true if you want this field to be inline with the next element
    inlineLabel: set this to left if you want this field to be inline with the label and the label at the left of the selector or right if you want the field to be inline with the label but at the right of the selector.
    suffix: Message to display at the right of the selector.

Example :
---------
---
    <aui:select label="Country" name="selectionStyle">
            <aui:option selected="india" value="india">India</aui:option>
            <aui:option selected="us" value="us">US</aui:option>
            <aui:option selected="uk" value="uk">UK</aui:option> 
    </aui:select>


    
AUI FIELDWRAPPER EXAMPLE
==========================

Used to wrap any other element in a form (radio elements, custom elements...)
Attributes  

    cssClass: custom classes for additional styling (the attribute class will be ignored)
    first: set this to true if this is the first element in the form (for css styling)
    last: set this to true if this is the last element in the form (for css styling)
    helpMessage: message to display when the user hovers a question mark icon next to the field label
    name: name of the field
    label: Label to display (automatically translated). If this attribute is used and the value is an empty String, then no label will be shown. If the attribute is not used, the label is obtained from the name (automaticalle formatted from ThisIsAName to this-is-a-name).
    inlineField: set this to true if you want this field to be inline with the next element
    inlineLabel: set this to left if you want this field to be inline with the label and the label at the left of the field or right if you want the field to be inline with the label but at the right of the field.
    
Example :
---------
---
    <aui:field-wrapper name="gender">
            <aui:input checked="true" inlineLabel="right" name="gender" type="radio" value="1" label="male" />
            <aui:input inlineLabel="right" name="gender" type="radio" value="2" label="female" />
    </aui:field-wrapper>
        
AUI FIELD SET EXAMPLE
======================

You should have all your fields grouped at least under one fieldset. It is a good practice to separate different areas with different fieldsets. 
        
Attributes 

    cssClass: custom classes for additional styling (the attribute class will be ignored)
    column: set this attribute to true if you want this fieldset to be displayed as a column instead of as a row. (this allows you to have a form with several columns)
    title: text which describes the group of elements inside the fieldset. (It creates the legend for the fieldset)

Example : 
        
        <aui:fieldset>
             
             <aui:input type="checkbox" name="liferay" label="Liferay" value="" > </aui:input>
             <aui:input type="checkbox" name="alfresco" label="Alfresco" value="" > </aui:input>
             <aui:input type="checkbox" name="drupal" label="Drupal" value="" > </aui:input>           
        </aui:fieldset>

AUI Panel Example
=================

<aui:column columnWidth="50" last="true">
        <aui:panel collapsible="true" id="educationdetails" label="Education Details">
            <aui:input inlineLabel="left" inlineField="true" label="Edu. Details : "  name="education" type="textarea"></aui:input>
            <aui:a cssClass="test" href="http://www.cignex.com" id="googleId" label="CIGNEX" ></aui:a>
        </aui:panel>
        <aui:panel collapsible="true" id="experiencedetails" label="Experience Details">
            <aui:input   inlineField="true" label="Exp. Details : "  name="experience" type="textarea"></aui:input>
            <aui:a cssClass="test" href="http://liferaycms.blogspot.com" id="liferayId" label="Liferay Experience" target="_blank"></aui:a>
        </aui:panel>
    </aui:column>

        

        
AUI LAYOUT EXAMPLE
===================


Used to wrap columns (avoiding tables) 

Attributes  

    cssClass: custom classes for additional styling (the attribute class will be ignored)
Example :
---------

<aui:layout>

Used to create columns without using tables
    <aui:column columnWidth="50" first="true" >
        <aui:input  inlineField="true" label="First Name : " name="firstName"></aui:input>
        <aui:input  inlineField="true" label="Last Name : " name="lastName"></aui:input>
        <aui:input  inlineField="true" label="Date of Birth: "  name="birthDate"></aui:input>
        <aui:field-wrapper name="gender">
            <aui:input checked="true" inlineLabel="right" name="gender" type="radio" value="1" label="male" />
            <aui:input inlineLabel="right" name="gender" type="radio" value="2" label="female" />
        </aui:field-wrapper>
         
        <aui:select label="Country" name="selectionStyle">
            <aui:option selected="india" value="india">
                India
            </aui:option>
            <aui:option selected="us" value="us">
                US
            </aui:option>
            <aui:option selected="uk" value="uk">
                UK
            </aui:option> 
        </aui:select>
         


        <aui:fieldset>
             
             <aui:input type="checkbox" name="liferay" label="Liferay" value="" > </aui:input>
             <aui:input type="checkbox" name="alfresco" label="Alfresco" value="" > </aui:input>
             <aui:input type="checkbox" name="drupal" label="Drupal" value="" > </aui:input>           
        </aui:fieldset>
    </aui:column>
     
    <aui:column columnWidth="50" last="true">
        <aui:panel collapsible="true" id="educationdetails" label="Education Details" >
            <aui:input inlineLabel="left" inlineField="true" label="Edu. Details : "  name="education" type="textarea"></aui:input>
            <aui:a cssClass="test" href="http://www.cignex.com" id="googleId" label="CIGNEX" ></aui:a>
        </aui:panel>
        <aui:panel collapsible="true" id="experiencedetails" label="Experience Details">
            <aui:input   inlineField="true" label="Exp. Details : "  name="experience" type="textarea"></aui:input>
            <aui:a cssClass="test" href="http://liferaycms.blogspot.com" id="liferayId" label="Liferay Experience" target="_blank"></aui:a>
        </aui:panel>
    </aui:column>
</aui:layout>


Contributed by Liferay.com