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

Posts

Showing posts from September, 2014

Liferay service finder methods

Liferay provides finder methods facility with help of service. Lets say we have employee entity and we want to create the finder method base on city. It allow to create finder method in it. In below example we create finder method which return List of Employee. <entity name="Employee" local-service="true" remote-service="true" cache-enabled="false"> <column name="employeeId" type="long" primary="true" /> <column name="employeeCity" type="String" /> <column name="employeeCell" type="String" /> <finder name="EmployeeCity" return-type="Collection"> <finder-column name="employeeCity" /> </finder> </entity> Run service. Our half work is done (finder method is available in persistence class). EmployeeUtil in my case it is package com.sa.service.persistence inside WEB-INF. There are many

Interproccess communication liferay

We have requirement to communicate between two portal one solution is interproccess communication with help of the event.  Today we will develop inter proccess communication portlets example. You can find source code for sender portlet and receiver portlet below link. Sender portlet Receiver portlet 1 Create portlet Sender. 2 Create jsp inside Folder docroot -> html -> sender -> view.jsp    put below content inside it. <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> <portlet:defineObjects /> <%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %> <%@page import="javax.portlet.PortletURL"%> <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> <%@page import="javax.portlet.PortletSession"%> <portlet:actionURL name="addform" var="updateURL"> </portlet:actionURL > <aui:form action="<%=up

Integrating Alfresco Repository to Liferay Documents and Media Portlet

Install alfresco in your system Install liferay in your system. Edit your liferay-home\tomcat-7.0.42\conf\server.xml file  <Server port="5005" shutdown="SHUTDOWN"> <Connector port="5050" protocol="HTTP/1.1">         connectionTimeout="20000"          redirectPort="5443" URIEncoding="UTF-8" /> <Connector port="5009" protocol="AJP/1.3" redirectPort="5443" URIEncoding="UTF-8" /> Add in portal-ext.properties file below property. session.store.password=true company.security.auth.type=screenName Note:- Above line is useful for similarity in credential for both alfresco and liferay. ReStart liferay server  Start alfresco server Login with admin user in liferay. This time it will ask screen name and password due to above properties file. Create new user with Screen Name :-  admin Password      :-   admin Email    

Embedded Language portlet in Theme.

I want to embedded liferay inbuilt portlet language in custom theme.We require to add just few line of codes in themes vm file in my case it is normal.vm file. Copy below content in the file where you want to embedded language portal. <div > $velocityPortletPreferences.setValue("portletSetupShowBorders", "false") $velocityPortletPreferences.setValue("languageIds", "pt_BR,en_US") $velocityPortletPreferences.setValue("displayStyle", "1") $theme.runtime("82", "", $velocityPortletPreferences.toString()) $velocityPortletPreferences.reset() </div>

Add custom field in user expando api liferay 6.2

Custom Field Liferay 1) The easiest way to add customfield is  add customfield with control panel. Admin -> Control panel -> Configuraton -> custom fields -> Click user -> Add custom field -> Add key and Type (e.g key - nickname type - Text field index) Click on save Now you done. Create One Hook Liferay ->  https://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/customize-and-extend-functionality-hooks-liferay-portal-6-2-dev-guide-en Override html\portlet\users_admin\user\details.jsp Add below code in jsp for the custom field nickname.     <div class="exp-ctrl-holder">            <liferay-ui:custom-attribute              className="<%= User.class.getName() %>"              classPK="<%= (selUser != null) ? selUser.getUserId() : 0 %>"               editable="<%= true %>"               label="<%= true %>"               name="nickname"  /> </div>   

Liferay 6.2 multileval workflow kaleo

This example shows how to apply multilevel workflow in liferay. Please copy paste below content in legal-marketing-definition.xml file. Then upload it in configuration -> workflow -> defination -> upload defination Create two user approver1 and approver2.  Apply workflow from  configuration -> workflow -> defination -> default configuration. <?xml version="1.0"?> <workflow-definition     xmlns="urn:liferay.com:liferay-workflow_6.2.0"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:schemaLocation="urn:liferay.com:liferay-workflow_6.2.0 http://www.liferay.com/dtd/liferay-workflow-definition_6_2_0.xsd" >     <name>Legal and Marketing Approval</name>     <description>Workflow assets must be approved first by Marketing and then by Legal.</description>     <version>1</version>     <state>         <name>created</name>         <metadata>