Posts

Create waraper to process ofbiz soap service response

How to call soap service is describe in my previous post. http://tariqliferay.blogspot.com/2015/09/how-to-create-soap-client-for-ofbiz.html Here you get response as OMElement. Then you need to process this. Now i show how can you make pojo/dto class from response for further need. Think you get campaign list in response as key="campaignList" and  value list a list of campaign. First create dto/pojo class as your requirement. Here below a sample dto: import java.io.Serializable; /**  * @author tariq  *  */ public class Campaign implements Serializable{     public String campaignName = null;     public String campaignType = null;     public String contentId = null;     public String createdStamp = null;     public String createdTxStamp = null;     public String emailSubscription = null;     public String lastUpdatedStamp = null;  ...

How to configure/integrate ldap with liferay.

Image
Its very easy to integrate/configure ldap with liferay. To do this you need below: 1. LDAP server(to manage user, groups and authentication) Follow below link to install Ubuntu in linux .. http://www.unixmen.com/install-and-configure-openldap-in-ubuntu-15-04-and-debian-8/   2. Login liferay as admin and go to control panel> got portal settings > authintication and then configure as below: Export Mapping: Users DN = dc=example,dc=com User Default Object Classes = top,person,inetOrgPerson,organizationalPerson User Mapping: Screen Name =cn Email Address =mail Password =userPassword First Name =givenName Last Name =sn Connection: Base Provider URL=ldap://localhost:389 Base DN=dc=example,dc=com Principal =cn=admin,dc=example,dc=com Credentials = ldap admin pass Users: Authentication Search Filter=(mail=@email_address@) Import Search Filter=(objectClass=person) Finally change the below properties: ldap.auth.password.encrypt...

How to create soap client for ofbiz service or ofbiz service invocation from another application.

Sometimes ofbiz developer need to integrate ofbiz with 3rd party or another web application. This is very simple to create soap service in ofbiz.In ofbiz here soap engine to mail soap service. To create soap service or make service exportable follow the bellow steps: 1. Set export="true" in service definition for example   <service name="createColleague" engine="java" auth="true"         location="org.ofbiz.crm.colleague.ColleagueService" invoke="createColleague" export="true" > </service> You find all exportable service or soap service wsdl under webtools component. Open a your browser new tab and below url, http://localhost:8080/webtools/control/SOAPService?wsdl  Here you find all soap or exportable service. 2. Create java client to all this as below, /**  *  */ import java.util.Map; import java.util.logging.Logger; import org.apache.axiom.om.OMAbstractFactory; import org.apache.axio...

How to change Portrait/Profile photo in liferay programitically.

Sometime liferay developer need to change profile/portrait photo programmatically . Here i want to share my experience. Create portlet action url and method as below: In jsp file create action url: <script type="text/javascript" src="<%= request.getContextPath()%>/js/jasny-bootstrap.min.js"></script> <link rel="stylesheet" href="<%= request.getContextPath()%>/css/jasny-bootstrap.min.css"> <portlet:actionURL name="updateProfile" var="updateProfileURL" windowState="normal"/> <form action="<%=updateProfileURL %>" method="post" enctype="multipart/form-data" id='<portlet:namespace/>updateProfile'>                 <input name="<portlet:namespace/>userEmail" id='<portlet:namespace/>userEmail' type="hidden" value="" />                 <div class="col-xs-12 col...

Liferay enviorment set up step by step.

Image
1. Download liferay-portal, liferay-plugin from github Portal URL:https://github.com/liferay/liferay-portal Plugin URL:https://github.com/liferay/liferay-plugins You can download as zip or git clone from here. 2. Go to downloaded liferay-portal directory and run the command "ant all" Before this install java and ant. And install ecj. For this follow the below link: http://tariqliferay.blogspot.com/2015/02/liferay-builds-with-ecj-compilertricks.html After some times BUILD FAILED and show, If you already have Tomcat installed, make sure the property "${app.server.tomcat.dir}" points to your Tomcat installation. Please run the below command "ant -buildfile build-dist.xml unzip-tomcat" And then again run the command "ant all" 3. This will be created a folder named "bundle" in the same directory. 4. Go to bundle folder and there should be appear apache tomcat directory. 5. Go to bin folder and run the command ...

How to enable audio and video in liferay portal

Image
To enable audio and video in liferay portal, sign in as omadmin/admin and go to control panel--->Server Administraion--->External Services and scroll down bottom. Here you can see Xuggler. First install this. Then enable this by click on check box true. Then finally restart the server. Now you can add audio and video as web content. Here below the screen short:  

Service Script for LifeRay on Ubuntu

Liferay developer need write script to start and stop liferay as service. In my projects production and test server management i need this, and after spending few times  i got this. Here below i share my experience. The script code given below. #!/bin/bash # # tomcat     This shell script takes care of starting and stopping Tomcat # # chkconfig: - 80 20 # ### BEGIN INIT INFO # Provides: tomcat # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: # Default-Stop: # Short-Description: start and stop tomcat ### END INIT INFO #TOMCAT_HOME="/home/tariq/projects/projects/bundles/tomcat-7.0.42" TOMCAT_HOME="Home of your liferay tomcat" SHUTDOWN_WAIT=45 tomcat_pid() { #filter running process, here you can add extra filter criteria by adding | grep #criteria text     echo `ps aux | grep org.apache.catalina.startup.Bootstrap | grep -v grep | awk '{ print $2 }'` } start() {     pid=$(...