// Path: wizard/src/main/java/org/n52/sos/importer/model/table/Row.java
// public class Row extends TableElement {
// 
// 	private int number = -1;
// 
// 	public Row(int number) {
// 		this.number = number;
// 	}
// 	
// 	public void setNumber(int number) {
// 		this.number = number;
// 	}
// 
// 	public int getNumber() {
// 		return number;
// 	}
// 	
// 	public void mark() {
// 		TableController.getInstance().mark(this);
// 	}
// 	
// 	@Override
// 	public String getValueFor(Cell c) {
// 		return TableController.getInstance().getValueAt(this.getNumber(), c.getColumn());
// 	}
// 
// 	@Override
// 	public Cell getCellFor(Cell c) {
// 		return new Cell(this.getNumber(), c.getColumn());
// 	}
// 
// 	@Override
// 	public HashSet<String> getValues() {
// 		HashSet<String> values = new HashSet<String>();
// 		for (int i = 0; i < TableController.getInstance().getColumnCount(); i++) {
// 			String value = TableController.getInstance().getValueAt(this.getNumber(), i);
// 			values.add(value);
// 		}
// 		return values;
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return "row[" + number + "]";
// 	}
// 	
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + number;
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (!(obj instanceof Row))
// 			return false;
// 		Row other = (Row) obj;
// 		if (number != other.number)
// 			return false;
// 		return true;
// 	}
// }


import org.n52.sos.importer.model.table.TableElement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.x52North.sensorweb.sos.importer.x04.ColumnAssignmentsDocument.ColumnAssignments;
import org.x52North.sensorweb.sos.importer.x04.ColumnDocument.Column;
import org.x52North.sensorweb.sos.importer.x04.CsvMetadataDocument.CsvMetadata;
import org.x52North.sensorweb.sos.importer.x04.KeyDocument.Key.Enum;
import org.x52North.sensorweb.sos.importer.x04.MetadataDocument.Metadata;
import org.x52North.sensorweb.sos.importer.x04.RelatedSensorDocument.RelatedSensor;
import org.x52North.sensorweb.sos.importer.x04.SosImportConfigurationDocument.SosImportConfiguration;
import org.n52.sos.importer.model.table.Cell;
import org.n52.sos.importer.model.table.Row;
			meta = col.addNewMetadata();
			meta.setKey(key);
			addedOrUpdated = "Added";
		}
		meta.setValue(value);
		if (logger.isDebugEnabled()) {
			logger.debug(addedOrUpdated + " column metadata. Key: " + key + "; Value: " + 
					value + " in column " + col.getNumber());
		}
		return (meta.getValue().equalsIgnoreCase(value));
	}
	
	/**
	 * @param tabElem
	 * @return the id of the column of this TableElement or -1
	 */
	protected static int getColumnIdFromTableElement(final TableElement tabElem) {
		if (logger.isTraceEnabled()) {
			logger.trace("getColumnIdFromTableElement()");
		}
		if (tabElem == null) {
			return -1;
		}
		if (tabElem instanceof Cell) {
			final Cell c = (Cell) tabElem;
			return c.getColumn();
		} else if (tabElem instanceof org.n52.sos.importer.model.table.Column) {
			final org.n52.sos.importer.model.table.Column c = (org.n52.sos.importer.model.table.Column) tabElem;
			return c.getNumber();
			// TODO What is the reason for having it in rows?
// Path: wizard/src/main/java/org/n52/sos/importer/model/table/Row.java
// public class Row extends TableElement {
// 
// 	private int number = -1;
// 
// 	public Row(int number) {
// 		this.number = number;
// 	}
// 	
// 	public void setNumber(int number) {
// 		this.number = number;
// 	}
// 
// 	public int getNumber() {
// 		return number;
// 	}
// 	
// 	public void mark() {
// 		TableController.getInstance().mark(this);
// 	}
// 	
// 	@Override
// 	public String getValueFor(Cell c) {
// 		return TableController.getInstance().getValueAt(this.getNumber(), c.getColumn());
// 	}
// 
// 	@Override
// 	public Cell getCellFor(Cell c) {
// 		return new Cell(this.getNumber(), c.getColumn());
// 	}
// 
// 	@Override
// 	public HashSet<String> getValues() {
// 		HashSet<String> values = new HashSet<String>();
// 		for (int i = 0; i < TableController.getInstance().getColumnCount(); i++) {
// 			String value = TableController.getInstance().getValueAt(this.getNumber(), i);
// 			values.add(value);
// 		}
// 		return values;
// 	}
// 	
// 	@Override
// 	public String toString() {
// 		return "row[" + number + "]";
// 	}
// 	
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + number;
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (!(obj instanceof Row))
// 			return false;
// 		Row other = (Row) obj;
// 		if (number != other.number)
// 			return false;
// 		return true;
// 	}
// }


// Path: wizard/src/main/java/org/n52/sos/importer/model/xml/Helper.java
import org.n52.sos.importer.model.table.TableElement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.x52North.sensorweb.sos.importer.x04.ColumnAssignmentsDocument.ColumnAssignments;
import org.x52North.sensorweb.sos.importer.x04.ColumnDocument.Column;
import org.x52North.sensorweb.sos.importer.x04.CsvMetadataDocument.CsvMetadata;
import org.x52North.sensorweb.sos.importer.x04.KeyDocument.Key.Enum;
import org.x52North.sensorweb.sos.importer.x04.MetadataDocument.Metadata;
import org.x52North.sensorweb.sos.importer.x04.RelatedSensorDocument.RelatedSensor;
import org.x52North.sensorweb.sos.importer.x04.SosImportConfigurationDocument.SosImportConfiguration;
import org.n52.sos.importer.model.table.Cell;
import org.n52.sos.importer.model.table.Row;

			meta = col.addNewMetadata();
			meta.setKey(key);
			addedOrUpdated = "Added";
		}
		meta.setValue(value);
		if (logger.isDebugEnabled()) {
			logger.debug(addedOrUpdated + " column metadata. Key: " + key + "; Value: " + 
					value + " in column " + col.getNumber());
		}
		return (meta.getValue().equalsIgnoreCase(value));
	}
	
	/**
	 * @param tabElem
	 * @return the id of the column of this TableElement or -1
	 */
	protected static int getColumnIdFromTableElement(final TableElement tabElem) {
		if (logger.isTraceEnabled()) {
			logger.trace("getColumnIdFromTableElement()");
		}
		if (tabElem == null) {
			return -1;
		}
		if (tabElem instanceof Cell) {
			final Cell c = (Cell) tabElem;
			return c.getColumn();
		} else if (tabElem instanceof org.n52.sos.importer.model.table.Column) {
			final org.n52.sos.importer.model.table.Column c = (org.n52.sos.importer.model.table.Column) tabElem;
			return c.getNumber();
			// TODO What is the reason for having it in rows?
		} else if (tabElem instanceof Row) {