/**
 * 
 */
package org.openforis.collect.csv;

import org.openforis.idm.model.Attribute;
import org.openforis.idm.model.Field;

/**
 * @author M. Togna
 * 
 * @deprecated replaced with idm-transform api
 */
@Deprecated
public class CoordinateColumnProvider extends CompositeAttributeColumnProvider {

	public CoordinateColumnProvider(String attributeName) {
		super(attributeName);
	}

	@Override
	protected String[] getFieldsHeadings() {
		return new String[] { getAttributeName() + "_srs_id", getAttributeName() + "_x", getAttributeName() + "_y" };
	}

	@Override
	protected Field<?>[] getFieldsToExtract(Attribute<?, ?> attr) {
		return new Field[] { attr.getField(2), attr.getField(0), attr.getField(1) };
	}

}

@@ -66,22 +66,140 @@
 ris.idm.
+meta
 model.
+CoordinateAttributeDefinition;%0Aimport org.openforis.idm.model.Attribute;%0Aimport org.openforis.idm.model.Coordinate
 Attribut
@@ -413,16 +413,69 @@
 ider %7B%0A%0A
+%09private static final String FIELD_SEPARATOR = %22_%22;%0A%0A
 %09public 
@@ -628,16 +628,21 @@
 ing%5B%5D %7B 
+%0A%09%09%09%09
 getAttri
@@ -658,71 +658,246 @@
 ) + 
-%22_srs_id%22, getAttributeName() + %22_x%22, getAttributeName() + %22_y%22
+FIELD_SEPARATOR + CoordinateAttributeDefinition.SRS_FIELD_NAME, %0A%09%09%09%09getAttributeName() + FIELD_SEPARATOR + CoordinateAttributeDefinition.X_FIELD_NAME, %0A%09%09%09%09getAttributeName() + FIELD_SEPARATOR + CoordinateAttributeDefinition.Y_FIELD_NAME
  %7D;%0A
@@ -972,24 +972,91 @@
  ?%3E attr) %7B%0A
+%09%09CoordinateAttribute coordinateAttr = (CoordinateAttribute) attr;%0A
 %09%09return new
@@ -1070,61 +1070,112 @@
 %5D %7B 
-a
+%0A%09%09%09%09coordinateA
 ttr.get
+SrsId
 Field(
-2
 ), 
-a
+%0A%09%09%09%09coordinateA
 ttr.get
+X
 Field(
-0
 ), 
-a
+%0A%09%09%09%09coordinateA
 ttr.get
+Y
 Field(
-1) 
+)%0A%09%09
 %7D;%0A%09

Use constant field names