Project

General

Profile

« Previous | Next » 

Revision eba9ef31

Added by Anahit Babadshanjan over 15 years ago

Normal explicit excel import: Save the taxon name

View differences:

cdmlib-commons/src/main/java/eu/etaxonomy/cdm/common/ExcelUtils.java
42 42

  
43 43
    		int rows; // No of rows
44 44
    		rows = sheet.getPhysicalNumberOfRows();
45
			if(logger.isDebugEnabled()) { logger.debug("Number of rows: " + rows); }
45 46

  
46 47
    		int cols = 0; // No of columns
47 48
    		int tmp = 0;
......
59 60
    		row = sheet.getRow(0);
60 61
    		for (int c = 0; c < cols; c++){
61 62
    			cell = row.getCell(c);
62
    			columns.add(cell.toString());
63
				if(cell != null) {
64
					columns.add(cell.toString());
65
					if(logger.isDebugEnabled()) { logger.debug("Cell #" + c + ": " + cell.toString()); }
66
				} else {
67
					if(logger.isDebugEnabled()) { logger.debug("Cell #" + c + " is null"); }
68
				}
63 69
    		}
64 70
    		for(int r = 1; r < rows; r++) {
65 71
    			row = sheet.getRow(r);
......
69 75
    					cell = row.getCell((short)c);
70 76
    					if(cell != null) {
71 77
    						headers.put(columns.get(c), cell.toString());
78
    						if(logger.isDebugEnabled()) { logger.debug("Cell #" + c + ": " + cell.toString()); }
79
    					} else {
80
    						if(logger.isDebugEnabled()) { logger.debug("Cell #" + c + " is null"); }
72 81
    					}
73 82
    				}
74 83
    			}
......
76 85
    		}
77 86

  
78 87
    	} catch(Exception ioe) {
79
    		if (logger.isDebugEnabled()){logger.debug("Exception");}
88
    		logger.error("Error reading the Excel file.");
80 89
    		ioe.printStackTrace();
81 90
    	}
82 91
    	return recordList;

Also available in: Unified diff