
package org.opencps.accountmgt.portlet;

import java.io.IOException;

import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;

import org.opencps.accountmgt.model.Business;
import org.opencps.accountmgt.model.Citizen;
import org.opencps.accountmgt.search.BusinessDisplayTerms;
import org.opencps.accountmgt.search.CitizenDisplayTerms;
import org.opencps.accountmgt.service.BusinessLocalServiceUtil;
import org.opencps.accountmgt.service.CitizenLocalServiceUtil;
import org.opencps.util.WebKeys;

import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;

public class AccountRegPortlet extends MVCPortlet {

	@Override
<<<<<<< HEAD
	public void render(RenderRequest renderRequest,
			RenderResponse renderResponse) throws PortletException, IOException {
		long citizenId = ParamUtil.getLong(
			renderRequest, CitizenDisplayTerms.CITIZEN_ID);
		
		long businessId = ParamUtil.getLong(renderRequest, 
			BusinessDisplayTerms.BUSINESS_BUSINESSID);
		
		try {
	        if(citizenId > 0) {
	        	Citizen citizen = CitizenLocalServiceUtil
	        					.fetchCitizen(citizenId);
	        	renderRequest.setAttribute(WebKeys.CITIZEN_ENTRY, citizen);
	        }
	        
	        if(businessId > 0) {
	        	Business business = BusinessLocalServiceUtil
	        					.fetchBusiness(businessId);
	        	renderRequest.setAttribute(WebKeys.BUSINESS_ENTRY, business);
	        }
        }
		
		
        catch (Exception e) {
	        _log.error(e);
        }
		
		super.render(renderRequest, renderResponse);
	}
	
	
	
=======
	public void render(
	    RenderRequest renderRequest, RenderResponse renderResponse)
	    throws PortletException, IOException {

		long citizenId = ParamUtil
		    .getLong(renderRequest, CitizenDisplayTerms.CITIZEN_ID);

		try {
			if (citizenId > 0) {
				Citizen citizen = CitizenLocalServiceUtil
				    .fetchCitizen(citizenId);
				renderRequest
				    .setAttribute(WebKeys.CITIZEN_ENTRY, citizen);
			}
		}
		catch (Exception e) {
			_log
			    .error(e);
		}

		super.render(renderRequest, renderResponse);
	}

>>>>>>> FETCH_HEAD
	private Log _log = LogFactoryUtil
	    .getLog(AccountRegPortlet.class
	        .getName());
}

@@ -807,915 +807,8 @@
 ide%0A
-%3C%3C%3C%3C%3C%3C%3C HEAD%0A%09public void render(RenderRequest renderRequest,%0A%09%09%09RenderResponse renderResponse) throws PortletException, IOException %7B%0A%09%09long citizenId = ParamUtil.getLong(%0A%09%09%09renderRequest, CitizenDisplayTerms.CITIZEN_ID);%0A%09%09%0A%09%09long businessId = ParamUtil.getLong(renderRequest, %0A%09%09%09BusinessDisplayTerms.BUSINESS_BUSINESSID);%0A%09%09%0A%09%09try %7B%0A%09        if(citizenId %3E 0) %7B%0A%09        %09Citizen citizen = CitizenLocalServiceUtil%0A%09        %09%09%09%09%09.fetchCitizen(citizenId);%0A%09        %09renderRequest.setAttribute(WebKeys.CITIZEN_ENTRY, citizen);%0A%09        %7D%0A%09        %0A%09        if(businessId %3E 0) %7B%0A%09        %09Business business = BusinessLocalServiceUtil%0A%09        %09%09%09%09%09.fetchBusiness(businessId);%0A%09        %09renderRequest.setAttribute(WebKeys.BUSINESS_ENTRY, business);%0A%09        %7D%0A        %7D%0A%09%09%0A%09%09%0A        catch (Exception e) %7B%0A%09        _log.error(e);%0A        %7D%0A%09%09%0A%09%09super.render(renderRequest, renderResponse);%0A%09%7D%0A%09%0A%09%0A%09%0A=======%0A
 %09pub
@@ -1027,16 +1027,120 @@
 N_ID);%0A%0A
+%09%09long businessId = ParamUtil%0A%09%09    .getLong(renderRequest, BusinessDisplayTerms.BUSINESS_BUSINESSID);%0A%0A
 %09%09try %7B%0A
@@ -1320,21 +1320,213 @@
 n);%0A%09%09%09%7D
+%0A%0A%09%09%09if (businessId %3E 0) %7B%0A%09%09%09%09Business business = BusinessLocalServiceUtil%0A%09%09%09%09    .fetchBusiness(businessId);%0A%09%09%09%09renderRequest%0A%09%09%09%09    .setAttribute(WebKeys.BUSINESS_ENTRY, business);%0A%09%09%09%7D
 %0A%09%09%7D%0A
+%0A
 %09%09catch 
@@ -1627,27 +1627,8 @@
 %09%7D%0A%0A
-%3E%3E%3E%3E%3E%3E%3E FETCH_HEAD%0A
 %09pri

Fix conflict