google.com, pub-5747754088801811, DIRECT, f08c47fec0942fa0 Skip to main content

Posts

Showing posts from October, 2014

Liferay crud porrtlet with Jasper Reports.

I have used Meera Prince Crud operation demo for the Jasper reports which allow to export report in PDF , word, XLS format. It will look lie below image. Find Source code for the complete example on below location. LIFERAY JASPER REPORT INTEGRATION 1 I have available PhoneManger Crud Portlet which have pagination and crud functionality. 2 I create report-listing-mobile.jrxml  file with help of Ireport tool. <?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report-listing" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin=&q

Liferay portlet with alloy Ui form validator example.

 Alloy Ui  is built on YUI and we can use it in our liferay portlets.  Yui provides many component which are easy to use in our portlets  Here we see basic form validator.example with liferay portlet. Create portlet AlloyUi-portlet in eclipse. Add below content in view.jsp file Here we create two link for two JSP. <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> <script src="http://cdn.alloyui.com/2.5.0/aui/aui-min.js"></script> <link href="http://cdn.alloyui.com/2.5.0/aui-css/css/bootstrap.min.css" rel="stylesheet"></link> <portlet:defineObjects /> <portlet:renderURL var="basicform"> <portlet:param name="mvcPath" value="/BasicFormValidatorExample.jsp"/> </portlet:renderURL> <portlet:renderURL var="fullform"> <portlet:param name="mvcPath" value="/FullFormValidatorExample.jsp"/> </portlet:re

Model Listener Hook

                             Liferay Hook provide facility to create listener on particular model. We require to implement implements ModelListener on our custom class. Lets create one Hook which allow to do action on the various activity on particular model action. Create one hook.(e.g. UserListener-hook) Add portal properties inside liferay-hook.xml file under web inf.  <?xml version="1.0"?> <!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd"> <hook> <portal-properties>portal.properties</portal-properties> </hook>  It will create portal.properties inside src folder.  Add below property inside portlet.properties file             value.object.listener.com.liferay.portal.model.User=com.sa.CreateAccountHook In above property we have created listener for the User model and we will  implements ModelListener on our custom class in my case it is  com.sa.CreateA

One to Many Relationship liferay

In Real life Student can assign to multiple course. Here we see example of One to Many where student can assign to many courses. Create service in portlet. Add below content in your portlet service.   <entity name="Student" local-service="true" remote-service="true" cache-enabled="false">     <column name="studentId" type="long" primary="true" />     <column name="courses" type="Collection" entity="Course"/> </entity> <entity name="Course" local-service="true" remote-service="true" cache-enabled="false">   <column name="courseId" type="long" primary="true" />    <column name="studentId" type="long"/>     <finder name="courseId" return-type="Collection">         <finder-column name="courseId" />     </finder>