// Path: src/java/is/idega/idegaweb/egov/citizen/IWBundleStarter.java
// public class IWBundleStarter implements IWBundleStartable {
// 
// 	public final static String IW_BUNDLE_IDENTIFIER = "is.idega.idegaweb.egov.citizen";
// 	
// 	@Override
// 	public void start(IWBundle starterBundle) {
// 		addDefaultRemoteServices(starterBundle);
// 		try{
// 			addDefaultContactPurposes();
// 		}catch(Exception e){
// 			Logger.getLogger(IWBundleStarter.class.getName()).log(Level.WARNING, "failed adding default contact purposes for ehub", e);
// 		}
// 	}
// 
// 	@Override
// 	public void stop(IWBundle starterBundle) {
// 	}
// 	
// 	private void addDefaultContactPurposes() throws CreateException, IDOLookupException{
// 		ContactPurposeHome contactPurposeHome = (ContactPurposeHome) IDOLookup.getHome(ContactPurpose.class);
// 		Collection<ContactPurpose> contacts = contactPurposeHome.getContactPurposes(1);
// 		if(!ListUtil.isEmpty(contacts)){
// 			return;
// 		}
// 		ContactPurpose contactPurpose = contactPurposeHome.create();
// 		contactPurpose.setDisplayName("eHUB_messages");
// 		contactPurpose.store();
// 		contactPurpose = contactPurposeHome.create();
// 		contactPurpose.setDisplayName("eHUB_messages_SMS");
// 		contactPurpose.store();
// 	}
// 	
// 	
// 	private Collection<AdvancedProperty> getDefaultRemoteServices(){
// 		Collection <AdvancedProperty> defaultRemoteServices = new ArrayList<AdvancedProperty>();
// 		AdvancedProperty service = new AdvancedProperty("http://impratest.sidan.is","Innovation Center");
// 		defaultRemoteServices.add(service);
// 		service = new AdvancedProperty("http://biladev.sidan.is","Reykjavík City");
// 		defaultRemoteServices.add(service);
// 		service = new AdvancedProperty("http://felixtest.sidan.is","ÍSÍ");
// 		defaultRemoteServices.add(service);
// 		return defaultRemoteServices;
// 	}
// 	
// 	private void addDefaultRemoteServices(IWBundle starterBundle){
// 		CitizenRemoteServicesHome citizenRemoteServicesHome = null;
// 		try {
// 			citizenRemoteServicesHome = (CitizenRemoteServicesHome) IDOLookup.getHome(CitizenRemoteServices.class);
// 		} catch (IDOLookupException e) {
// 			Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "failed adding default remote services", e);
// 			return;
// 		}
// 		Collection<CitizenRemoteServices> services = citizenRemoteServicesHome.getRemoteServices(1);
// 		if(!ListUtil.isEmpty(services)){
// 			return;
// 		}
// 		
// 		Collection<AdvancedProperty> defaultServices = getDefaultRemoteServices();
// 		for(AdvancedProperty service : defaultServices){
// 			CitizenRemoteServices citizenRemoteServices =  null;
// 			try {
// 				citizenRemoteServices = (CitizenRemoteServices) citizenRemoteServicesHome.createIDO();
// 				citizenRemoteServices.setAddress(service.getId());
// 				citizenRemoteServices.setServerName(service.getValue());
// 				citizenRemoteServices.store();
// 			} catch (Exception e) {
// 				Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "failed adding default remote service" + service, e);
// 			}
// 		}
// 	}
// }
// 
// Path: src/java/is/idega/idegaweb/egov/citizen/data/AccountApplication.java
// public interface AccountApplication extends com.idega.block.process.data.Case
// {
//  public void setEmail(java.lang.String p0);
//  public java.lang.String getEmail();
//  public void setApplicantName(java.lang.String p0);
//  public java.lang.String getApplicantName();
// }


import is.idega.idegaweb.egov.accounting.business.CitizenBusiness;
import is.idega.idegaweb.egov.citizen.IWBundleStarter;
import is.idega.idegaweb.egov.citizen.data.AccountApplication;
import is.idega.idegaweb.egov.message.business.CommuneMessageBusiness;
import java.rmi.RemoteException;
import java.text.MessageFormat;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import javax.transaction.SystemException;
import javax.transaction.UserTransaction;
import com.idega.block.process.business.CaseBusinessBean;
import com.idega.core.accesscontrol.business.LoginCreateException;
import com.idega.core.accesscontrol.business.UserHasLoginException;
import com.idega.core.accesscontrol.data.LoginTable;
import com.idega.core.accesscontrol.data.PasswordNotKnown;
import com.idega.data.IDOCreateException;
import com.idega.idegaweb.IWResourceBundle;
import com.idega.user.data.Group;
import com.idega.user.data.User;
import com.idega.util.IWTimestamp;
/*
 * $Id$
 * 
 * Copyright (C) 2002 Idega hf. All Rights Reserved.
 * 
 * This software is the proprietary information of Idega hf. Use is subject to license terms.
 * 
 */
package is.idega.idegaweb.egov.citizen.business;





/**
 * @author <a href="mailto:tryggvi@idega.is">Tryggvi Larusson</a>
 * @version 1.0
 */
public abstract class AccountApplicationBusinessBean extends CaseBusinessBean implements AccountBusiness {

	protected abstract Class getCaseEntityClass();

	public CommuneMessageBusiness getMessageBusiness() throws RemoteException {
		return (CommuneMessageBusiness) this.getServiceInstance(CommuneMessageBusiness.class);
	}

// Path: src/java/is/idega/idegaweb/egov/citizen/IWBundleStarter.java
// public class IWBundleStarter implements IWBundleStartable {
// 
// 	public final static String IW_BUNDLE_IDENTIFIER = "is.idega.idegaweb.egov.citizen";
// 	
// 	@Override
// 	public void start(IWBundle starterBundle) {
// 		addDefaultRemoteServices(starterBundle);
// 		try{
// 			addDefaultContactPurposes();
// 		}catch(Exception e){
// 			Logger.getLogger(IWBundleStarter.class.getName()).log(Level.WARNING, "failed adding default contact purposes for ehub", e);
// 		}
// 	}
// 
// 	@Override
// 	public void stop(IWBundle starterBundle) {
// 	}
// 	
// 	private void addDefaultContactPurposes() throws CreateException, IDOLookupException{
// 		ContactPurposeHome contactPurposeHome = (ContactPurposeHome) IDOLookup.getHome(ContactPurpose.class);
// 		Collection<ContactPurpose> contacts = contactPurposeHome.getContactPurposes(1);
// 		if(!ListUtil.isEmpty(contacts)){
// 			return;
// 		}
// 		ContactPurpose contactPurpose = contactPurposeHome.create();
// 		contactPurpose.setDisplayName("eHUB_messages");
// 		contactPurpose.store();
// 		contactPurpose = contactPurposeHome.create();
// 		contactPurpose.setDisplayName("eHUB_messages_SMS");
// 		contactPurpose.store();
// 	}
// 	
// 	
// 	private Collection<AdvancedProperty> getDefaultRemoteServices(){
// 		Collection <AdvancedProperty> defaultRemoteServices = new ArrayList<AdvancedProperty>();
// 		AdvancedProperty service = new AdvancedProperty("http://impratest.sidan.is","Innovation Center");
// 		defaultRemoteServices.add(service);
// 		service = new AdvancedProperty("http://biladev.sidan.is","Reykjavík City");
// 		defaultRemoteServices.add(service);
// 		service = new AdvancedProperty("http://felixtest.sidan.is","ÍSÍ");
// 		defaultRemoteServices.add(service);
// 		return defaultRemoteServices;
// 	}
// 	
// 	private void addDefaultRemoteServices(IWBundle starterBundle){
// 		CitizenRemoteServicesHome citizenRemoteServicesHome = null;
// 		try {
// 			citizenRemoteServicesHome = (CitizenRemoteServicesHome) IDOLookup.getHome(CitizenRemoteServices.class);
// 		} catch (IDOLookupException e) {
// 			Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "failed adding default remote services", e);
// 			return;
// 		}
// 		Collection<CitizenRemoteServices> services = citizenRemoteServicesHome.getRemoteServices(1);
// 		if(!ListUtil.isEmpty(services)){
// 			return;
// 		}
// 		
// 		Collection<AdvancedProperty> defaultServices = getDefaultRemoteServices();
// 		for(AdvancedProperty service : defaultServices){
// 			CitizenRemoteServices citizenRemoteServices =  null;
// 			try {
// 				citizenRemoteServices = (CitizenRemoteServices) citizenRemoteServicesHome.createIDO();
// 				citizenRemoteServices.setAddress(service.getId());
// 				citizenRemoteServices.setServerName(service.getValue());
// 				citizenRemoteServices.store();
// 			} catch (Exception e) {
// 				Logger.getLogger(this.getClass().getName()).log(Level.WARNING, "failed adding default remote service" + service, e);
// 			}
// 		}
// 	}
// }
// 
// Path: src/java/is/idega/idegaweb/egov/citizen/data/AccountApplication.java
// public interface AccountApplication extends com.idega.block.process.data.Case
// {
//  public void setEmail(java.lang.String p0);
//  public java.lang.String getEmail();
//  public void setApplicantName(java.lang.String p0);
//  public java.lang.String getApplicantName();
// }


// Path: src/java/is/idega/idegaweb/egov/citizen/business/AccountApplicationBusinessBean.java
import is.idega.idegaweb.egov.accounting.business.CitizenBusiness;
import is.idega.idegaweb.egov.citizen.IWBundleStarter;
import is.idega.idegaweb.egov.citizen.data.AccountApplication;
import is.idega.idegaweb.egov.message.business.CommuneMessageBusiness;
import java.rmi.RemoteException;
import java.text.MessageFormat;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
import javax.transaction.SystemException;
import javax.transaction.UserTransaction;
import com.idega.block.process.business.CaseBusinessBean;
import com.idega.core.accesscontrol.business.LoginCreateException;
import com.idega.core.accesscontrol.business.UserHasLoginException;
import com.idega.core.accesscontrol.data.LoginTable;
import com.idega.core.accesscontrol.data.PasswordNotKnown;
import com.idega.data.IDOCreateException;
import com.idega.idegaweb.IWResourceBundle;
import com.idega.user.data.Group;
import com.idega.user.data.User;
import com.idega.util.IWTimestamp;

/*
 * $Id$
 * 
 * Copyright (C) 2002 Idega hf. All Rights Reserved.
 * 
 * This software is the proprietary information of Idega hf. Use is subject to license terms.
 * 
 */
package is.idega.idegaweb.egov.citizen.business;





/**
 * @author <a href="mailto:tryggvi@idega.is">Tryggvi Larusson</a>
 * @version 1.0
 */
public abstract class AccountApplicationBusinessBean extends CaseBusinessBean implements AccountBusiness {

	protected abstract Class getCaseEntityClass();

	public CommuneMessageBusiness getMessageBusiness() throws RemoteException {
		return (CommuneMessageBusiness) this.getServiceInstance(CommuneMessageBusiness.class);
	}

	protected AccountApplication getApplication(int applicationID) throws FinderException {