// Path: src/java/com/idega/company/CompanyConstants.java
// public class CompanyConstants {
// 
// 	public static final String IW_BUNDLE_IDENTIFIER = "com.idega.company";
// 	
// 	public static final String GROUP_TYPE_COMPANY = "iw_company";
// 
// }


import java.io.FileInputStream;
import java.io.InputStream;
import java.rmi.RemoteException;
import java.util.Collection;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.FinderException;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import com.idega.company.CompanyConstants;
import com.idega.data.GenericEntity;
import com.idega.data.IDOLookup;
import com.idega.data.IDOQuery;
	    	Iterator it = sheet.rowIterator();
	    	if(it.hasNext()) {
	    		it.next();
	    	}
	    	while(it.hasNext()) {
	    		HSSFRow row = (HSSFRow) it.next();
	    		if(row != null) {
	    			HSSFCell codeCell = row.getCell((short) 0);
	    			if(codeCell != null) {
	    				UnregisterType unregisterType = getUnregisterTypeHome().create();
	    				unregisterType.setCode(codeCell.getStringCellValue());
	    				
	    				HSSFCell descriptionCell = row.getCell((short) 1);
	    				if(descriptionCell != null) {
	    					unregisterType.setDescription(descriptionCell.getStringCellValue());
	    				}
	    				unregisterType.store();
	    			}
	    		}
	    	}
	    }
	}
	
	private InputStream getCodesInputStream() {
		
		try {
			return new FileInputStream(getIWMainApplication().getBundlesRealPath()+"/"+CompanyConstants.IW_BUNDLE_IDENTIFIER+".bundle/resources/startdata/Codes.xls");
			
		} catch (Exception e) {
			
// Path: src/java/com/idega/company/CompanyConstants.java
// public class CompanyConstants {
// 
// 	public static final String IW_BUNDLE_IDENTIFIER = "com.idega.company";
// 	
// 	public static final String GROUP_TYPE_COMPANY = "iw_company";
// 
// }


// Path: src/java/com/idega/company/data/UnregisterTypeBMPBean.java
import java.io.FileInputStream;
import java.io.InputStream;
import java.rmi.RemoteException;
import java.util.Collection;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.FinderException;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import com.idega.company.CompanyConstants;
import com.idega.data.GenericEntity;
import com.idega.data.IDOLookup;
import com.idega.data.IDOQuery;

	    	Iterator it = sheet.rowIterator();
	    	if(it.hasNext()) {
	    		it.next();
	    	}
	    	while(it.hasNext()) {
	    		HSSFRow row = (HSSFRow) it.next();
	    		if(row != null) {
	    			HSSFCell codeCell = row.getCell((short) 0);
	    			if(codeCell != null) {
	    				UnregisterType unregisterType = getUnregisterTypeHome().create();
	    				unregisterType.setCode(codeCell.getStringCellValue());
	    				
	    				HSSFCell descriptionCell = row.getCell((short) 1);
	    				if(descriptionCell != null) {
	    					unregisterType.setDescription(descriptionCell.getStringCellValue());
	    				}
	    				unregisterType.store();
	    			}
	    		}
	    	}
	    }
	}
	
	private InputStream getCodesInputStream() {
		
		try {
			return new FileInputStream(getIWMainApplication().getBundlesRealPath()+"/"+CompanyConstants.IW_BUNDLE_IDENTIFIER+".bundle/resources/startdata/Codes.xls");
			
		} catch (Exception e) {
			
			logger.log(Level.SEVERE, "Exception while retrieving codes.xls resource from: "+getIWMainApplication().getBundle(CompanyConstants.IW_BUNDLE_IDENTIFIER).getResourcesRealPath(), e);