/**
 * Copyright (c) 2009 Penril Datability (SEA) Sdn Bhd All rights reserved.
 *
 * This software is copyrighted. Under the copyright laws, this software
 * may not be copied, in whole or in part, without prior written consent
 * of Penril Datability (SEA) Sdn Bhd or its assignees. This software is
 * provided under the terms of a license between Penril Datability (SEA)
 * Sdn Bhd and the recipient, and its use is subject to the terms of that
 * license.
 */
package my.com.kfh.enterprise.services.ib111_epf;

import my.com.kfh.enterprise.services.IBEnterpriseServicesWorkspace;
import my.com.kfh.enterprise.services.common.CommonConstants;
import my.com.kfh.error.exception.IBGenericException;
import my.com.kfh.web.utils.DataValidator;
import my.com.kfh.web.utils.IBDynaBean;
import my.com.kfh.web.utils.IBSessionObjects;
import my.com.kfh.web.utils.constant.ServiceInfo;

/**
 * <pre>
 * PROGRAMMER: Chang Giat Yeng
 * CHANGE-NO:
 * TASK-NO:
 * DATE CREATED: Dec 14, 2009
 * TAG AS:
 * REASON(S):
 * MODIFICATION:
 * </pre>
 */

/**
 * <Class description>
 */
public class IBEpfMaintEditConfirmServices extends IBEnterpriseServicesWorkspace
{
	private static Class c_oClass = IBEpfMaintEditConfirmServices.class;

	/**
	 * @ Class constructor specifying session object.
	 *
	 * @param p_oIBSessionObjects Session object contains all information stored in HTTP session
	 */
	public IBEpfMaintEditConfirmServices (IBSessionObjects m_oIBSessionObjects)
	{
		super (m_oIBSessionObjects);
	}

	public void verifyInput () throws IBGenericException
	{
		IBDynaBean m_oViewBean = (IBDynaBean) getIBDynaBean().get(EPFConstants.EPF_MAINTENANCE_VIEW);
		IBDynaBean m_oServiceInfoBean = (IBDynaBean) m_oViewBean.get (ServiceInfo.SERVICE_INFO_BEAN);
		if (((Boolean) m_oServiceInfoBean.get (ServiceInfo.BEAN_ATT_TAC_REQUIRED)).booleanValue ())
		{
			IBDynaBean m_oSMSViewBean = (IBDynaBean) getIBSessionObjects().getHttpSessionAttrObject(CommonConstants.SMS_VIEW_BEAN);
			String beneName = (String)getIBDynaBean ().get (EPFConstants.EPF_BENE_NAME);
			if(!DataValidator.isEmptyString(beneName)){
				m_oSMSViewBean.set(CommonConstants.BENE_NAME, beneName.length()>25?beneName.substring(0, 25):beneName);
			}
			getIBSessionObjects().setHttpSessionAttrObject(CommonConstants.SMS_VIEW_BEAN, m_oSMSViewBean);
		}
		
	}
}
