From 2e0dbaea5e750552545100ed728027defc678d23 Mon Sep 17 00:00:00 2001
From: ?? ? <ulysseskao@ximple.com.tw>
Date: Mon, 24 Mar 2008 19:57:27 +0800
Subject: [PATCH] EOFM-18

---
 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java            |    6 +
 xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/filter/ElementDispatcherTest.java              |    3 
 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java              |   75 +++++++++++++++++-
 xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml                           |   67 +++++++++++++++-
 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java              |    9 +
 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeIdDispatchableFilter.java           |    3 
 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractFLinkageDispatchableFilter.java |    5 
 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompLevelIdDispatchableFilter.java  |    3 
 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java           |    2 
 xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/ElementDispatcherRules.xml         |    3 
 xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml                                            |    4 +
 xdgnjobs/ximple-spatialjob/src/test/resources/com/ximple/eofms/filter/test-data/testElementFilter.xml    |    5 +
 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractDispatchableFilter.java         |   11 ++
 xdgnjobs/pom.xml                                                                                         |    1 
 xdgnjobs/ximple-spatialjob/src/test/resources/com/ximple/eofms/filter/test-data/testRules.xml            |    3 
 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompIdDispatchableFilter.java       |    2 
 16 files changed, 179 insertions(+), 23 deletions(-)

diff --git a/xdgnjobs/pom.xml b/xdgnjobs/pom.xml
index 9395e6c..0e8c505 100644
--- a/xdgnjobs/pom.xml
+++ b/xdgnjobs/pom.xml
@@ -20,6 +20,7 @@
     <java5>1.5</java5>
     <xdgnio.version>0.0.1</xdgnio.version>
     <gt.version>2.4.1</gt.version>
+    <failIfNoTests>false</failIfNoTests>
   </properties>
 
   <profiles>
diff --git a/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml b/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml
index 0e6d50e..1744b95 100644
--- a/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml
+++ b/xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml
@@ -52,6 +52,10 @@
           <key>TESTMODE</key>
           <value>true</value>
         </entry>
+        <entry>
+          <key>TESTCOUNT</key>
+          <value>2</value>
+        </entry>
       </job-data-map>
     </job-detail>
 
diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractDispatchableFilter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractDispatchableFilter.java
index 2269b69..5a493f8 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractDispatchableFilter.java
+++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractDispatchableFilter.java
@@ -7,6 +7,7 @@
 {
     private String name;
     private String description;
+    private int  elmtype;
 
     protected Log logger = LogFactory.getLog(AbstractFLinkageDispatchableFilter.class);
 
@@ -33,4 +34,14 @@
     {
         this.description = description;
     }
+
+    public int getElmtype()
+    {
+        return elmtype;
+    }
+
+    public void setElmtype(int elmtype)
+    {
+        this.elmtype = elmtype;
+    }
 }
diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractFLinkageDispatchableFilter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractFLinkageDispatchableFilter.java
index f12b07d..48be949 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractFLinkageDispatchableFilter.java
+++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/AbstractFLinkageDispatchableFilter.java
@@ -8,7 +8,7 @@
 
 public abstract class AbstractFLinkageDispatchableFilter extends AbstractDispatchableFilter
 {
-    protected FrammeAttributeData getFeatureLinkage(Element element)
+    public static FrammeAttributeData getFeatureLinkage(Element element)
     {
         if (!element.hasUserAttributeData())
             return null;
@@ -18,8 +18,7 @@
         {
             if (anUsrData instanceof FrammeAttributeData)
             {
-                FrammeAttributeData featureLinkage = (FrammeAttributeData) anUsrData;
-                return featureLinkage;
+                return (FrammeAttributeData) anUsrData;
             }
         }
         return null;
diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java
index bd0c8e7..4427809 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java
+++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java
@@ -47,7 +47,7 @@
     {
         if (typeBuilder == null)
         {
-            FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance(featureName);
+            typeBuilder = FeatureTypeBuilder.newInstance(featureName);
             typeBuilder.addType(AttributeTypeFactory.newAttributeType("GEOM", Geometry.class));
             typeBuilder.addType(AttributeTypeFactory.newAttributeType("TID", Integer.class));
             typeBuilder.addType(AttributeTypeFactory.newAttributeType("OID", Long.class));
diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompIdDispatchableFilter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompIdDispatchableFilter.java
index 4537e14..ccb351a 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompIdDispatchableFilter.java
+++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompIdDispatchableFilter.java
@@ -62,7 +62,7 @@
     {
         FrammeAttributeData featureLinkage = getFeatureLinkage(element);
         return featureLinkage != null && tid == featureLinkage.getFsc() &&
-                (cid == featureLinkage.getComponentID());
+                (cid == featureLinkage.getComponentID() && (getElmtype() == element.getElementType().id));
     }
 
     public Feature execute(Element element)
diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompLevelIdDispatchableFilter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompLevelIdDispatchableFilter.java
index 28c7211..3371f6b 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompLevelIdDispatchableFilter.java
+++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeCompLevelIdDispatchableFilter.java
@@ -75,7 +75,8 @@
         FrammeAttributeData featureLinkage = getFeatureLinkage(element);
         return featureLinkage != null && tid == featureLinkage.getFsc() &&
                 (cid == featureLinkage.getComponentID()) &&
-                (lid == element.getLevelIndex());
+                (lid == element.getLevelIndex()) &&
+                (getElmtype() == element.getElementType().id);
     }
 
     public Feature execute(Element element)
diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeIdDispatchableFilter.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeIdDispatchableFilter.java
index 54d70b0..0cf237e 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeIdDispatchableFilter.java
+++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/TypeIdDispatchableFilter.java
@@ -48,7 +48,8 @@
     public boolean isDispatchable(Element element)
     {
         FrammeAttributeData featureLinkage = getFeatureLinkage(element);
-        return featureLinkage != null && tid == featureLinkage.getFsc();
+        return featureLinkage != null && tid == featureLinkage.getFsc() &&
+                (getElmtype() == element.getElementType().id);
     }
 
     public Feature execute(Element element)
diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java
index cc6fd7a..00e66d6 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java
+++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java
@@ -20,6 +20,7 @@
 public abstract class AbstractOracleDatabaseJob implements Job
 {
     private static final String SHPDATA_DIR = "SHPDATA_DIR";
+    private static final String CONFSHPFILTER = "SHPFILTER_CONF";
     private static final String SPATAILSCHEMA = "ORGSCHEMA";
     private static final String ORAHOST = "ORAHOST";
     private static final String ORAINST = "ORAINST";
@@ -27,8 +28,10 @@
     private static final String ORAUSER = "ORAUSER";
     private static final String ORAPASS = "ORAPASS";
     private static final String TESTMODE = "TESTMODE";
+    private static final String TESTCOUNT = "TESTCOUNT";
 
     protected String _dataPath;
+    protected String _filterPath;
     protected String _oracleHost;
     protected String _oracleInstance;
     protected String _oraclePort;
@@ -36,6 +39,7 @@
     protected String _password;
     protected String _orgSchema;
     protected boolean _testMode = false;
+    protected int    _testCount = -1;
 
     public abstract void execute(JobExecutionContext context) throws JobExecutionException;
 
@@ -46,6 +50,7 @@
         // The directory to scan is stored in the job map
         JobDataMap dataMap = jobDetail.getJobDataMap();
         _dataPath = dataMap.getString(SHPDATA_DIR);
+        _filterPath = dataMap.getString(CONFSHPFILTER);
         _oracleHost = dataMap.getString(ORAHOST);
         _oracleInstance = dataMap.getString(ORAINST);
         _oraclePort = dataMap.getString(ORAPORT);
@@ -53,6 +58,7 @@
         _password = dataMap.getString(ORAPASS);
         _orgSchema = dataMap.getString(SPATAILSCHEMA);
         _testMode = dataMap.getBooleanFromString(TESTMODE);
+        _testCount = dataMap.getIntFromString(TESTCOUNT);
 
         // Validate the required input
         if (_dataPath == null)
diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java
index cc38243..b360e1d 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java
+++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java
@@ -99,12 +99,12 @@
         OrderedMap map = getBlobStorageList(jobContext.getOracleConnection(), querySchema, "SD$SPACENODES"
                 , null);
 
+        logger.info("begin convert job:[" + map.size() + "]:testmode=" + _testMode);
         for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();)
         {
             it.next();
 
             Pair pair = (Pair) it.getValue();
-
             String tableSrc = (String) pair.first;
 
             logger.info("begin convert:[" + order + "]-" + tableSrc);
@@ -112,7 +112,11 @@
 
             order++;
 
-            if (_testMode) break;
+            if (_testMode)
+            {
+                if ((_testCount < 0) || (order >= _testCount))
+                    break;
+            }
 
             if ((order % COMMITSIZE) == 0)
             {
@@ -123,6 +127,7 @@
             }
         }
 
+        jobContext.commitTransaction();
         logger.info("end convert job:[" + order + "]");
         System.gc();
     }
diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java
index 7bddaa9..0a78e96 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java
+++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java
@@ -2,7 +2,11 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.io.FileNotFoundException;
+import java.io.UnsupportedEncodingException;
 import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLDecoder;
 import java.sql.DriverManager;
 import java.sql.SQLException;
 import java.util.ArrayList;
@@ -15,6 +19,8 @@
 import org.apache.commons.transaction.memory.PessimisticMapWrapper;
 import org.apache.commons.transaction.util.CommonsLoggingLogger;
 import org.apache.commons.transaction.util.LoggerFacade;
+import org.apache.commons.digester.Digester;
+import org.apache.commons.digester.xmlrules.DigesterLoader;
 import org.geotools.data.FeatureWriter;
 import org.geotools.data.Transaction;
 import org.geotools.data.shapefile.ShapefileDataStore;
@@ -22,6 +28,8 @@
 import org.geotools.feature.FeatureType;
 import org.geotools.feature.IllegalAttributeException;
 import org.geotools.feature.SimpleFeature;
+import org.geotools.TestData;
+import org.xml.sax.SAXException;
 
 import com.vividsolutions.jts.util.Assert;
 
@@ -30,7 +38,9 @@
 import com.ximple.eofms.filter.CreateLineStringStrategy;
 import com.ximple.eofms.filter.ElementDispatcher;
 import com.ximple.eofms.filter.TypeCompIdDispatchableFilter;
+import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter;
 import com.ximple.io.dgn7.Element;
+import com.ximple.io.dgn7.FrammeAttributeData;
 
 public class OracleConvertJobContext
 {
@@ -226,6 +236,11 @@
 
     protected static final long TIMEOUT = Long.MAX_VALUE;
 
+    /**
+     * Encoding of URL path.
+     */
+    private static final String ENCODING = "UTF-8";
+
     static
     {
         try
@@ -252,6 +267,7 @@
     }
 
     private String _oracleHost;
+    private String _filterConfig;
     private String _oracleInstance;
     private String _oraclePort;
     private String _dataPath;
@@ -264,9 +280,10 @@
     private HashMap featuresContext = new HashMap();
     private PessimisticMapWrapper txFeaturesContext;
 
-    public OracleConvertJobContext()
+    public OracleConvertJobContext(String filterConfig)
     {
         properties = new Properties();
+        _filterConfig = filterConfig;
         elementDispatcher = createElementDispatcher();
         txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger);
 
@@ -274,9 +291,40 @@
 
     private ElementDispatcher createElementDispatcher()
     {
-        ElementDispatcher dispatcher = new ElementDispatcher();
-        dispatcher.addRule(new TypeCompIdDispatchableFilter("Conductor", new CreateLineStringStrategy(), 106, 0));
-        return dispatcher;
+        URL rulesURL = getClass().getResource("ElementDispatcherRules.xml");
+
+        File rulesFile = null;
+        try
+        {
+            rulesFile = new File(URLDecoder.decode(rulesURL.getPath(), ENCODING));
+            if (!rulesFile.exists()) {
+                throw new FileNotFoundException("Could not locate test-data: " + rulesFile);
+            }
+            Digester digester = DigesterLoader.createDigester(rulesFile.toURI().toURL());
+            File config = new File(_filterConfig);
+            if (!config.exists())
+            {
+                config = new File("conf\\DefaultConvertShpFilter.xml");
+            }
+            ElementDispatcher dispatcher = (ElementDispatcher) digester.parse(config);
+            return dispatcher;
+        } catch (UnsupportedEncodingException e)
+        {
+            logger.info(e.getMessage(), e);
+            throw new RuntimeException(e.getMessage(), e);
+        } catch (MalformedURLException e)
+        {
+            logger.info(e.getMessage(), e);
+            throw new RuntimeException(e.getMessage(), e);
+        } catch (IOException e)
+        {
+            logger.info(e.getMessage(), e);
+            throw new RuntimeException(e.getMessage(), e);
+        } catch (SAXException e)
+        {
+            logger.info(e.getMessage(), e);
+            throw new RuntimeException(e.getMessage(), e);
+        }
     }
 
     public void setLogin(String userName, String password)
@@ -338,7 +386,15 @@
     {
         Feature feature = elementDispatcher.execute(element);
         if (feature == null)
+        {
+            FrammeAttributeData linkage =
+                    AbstractFLinkageDispatchableFilter.getFeatureLinkage(element);
+            logger.debug("Unknown Element:" + element.getElementType().toString() +
+                ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" +
+            (linkage == null ? "NULL" : (linkage.getFsc() + "|" +linkage.getComponentID())));
+
             return;
+        }
 
         if (!txFeaturesContext.containsKey(feature.getFeatureType()))
         {
@@ -355,7 +411,13 @@
 
     public void commitTransaction()
     {
-        txFeaturesContext.commitTransaction();
+        if (!txFeaturesContext.isEmpty())
+        {
+            logger.debug("Transaction size = " + txFeaturesContext.size());
+            txFeaturesContext.commitTransaction();
+        } else
+            logger.debug("Transaction is empty.");
+        
         if (!featuresContext.isEmpty())
         {
             updateDataStore();
@@ -382,6 +444,8 @@
             {
                 FeatureType featureType = (FeatureType) it.next();
                 File sfile = new File(_dataPath + "\\" + featureType.getTypeName());
+                logger.debug("Begin Save shapefile:" + sfile.toURI());
+
                 ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURL());
                 shapefileDataStore.createSchema(featureType);
                 FeatureWriter writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT);
@@ -393,6 +457,7 @@
                     ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null));
                 }
                 writer.close();
+                logger.debug("End Save shapefile:" + sfile.toURI());
             }
             featuresContext.clear();
         } catch (MalformedURLException e)
diff --git a/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/ElementDispatcherRules.xml b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/ElementDispatcherRules.xml
index e48cfc6..707a720 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/ElementDispatcherRules.xml
+++ b/xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/filter/ElementDispatcherRules.xml
@@ -10,6 +10,7 @@
       <set-properties-rule/>
       <bean-property-setter-rule pattern="name"/>
       <bean-property-setter-rule pattern="description"/>
+      <bean-property-setter-rule pattern="elmtype"/>
       <bean-property-setter-rule pattern="tid"/>
         <pattern value="LineCreateStrategy">
             <object-create-rule classname="com.ximple.eofms.filter.CreateLineStringStrategy"/>
@@ -28,6 +29,7 @@
       <set-properties-rule/>
       <bean-property-setter-rule pattern="name"/>
       <bean-property-setter-rule pattern="description"/>
+      <bean-property-setter-rule pattern="elmtype"/>
       <bean-property-setter-rule pattern="tid"/>
       <bean-property-setter-rule pattern="cid"/>
         <pattern value="LineCreateStrategy">
@@ -47,6 +49,7 @@
       <set-properties-rule/>
       <bean-property-setter-rule pattern="name"/>
       <bean-property-setter-rule pattern="description"/>
+      <bean-property-setter-rule pattern="elmtype"/>
       <bean-property-setter-rule pattern="tid"/>
       <bean-property-setter-rule pattern="cid"/>
       <bean-property-setter-rule pattern="lid"/>
diff --git a/xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml b/xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml
index 64514a1..45ed790 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml
+++ b/xdgnjobs/ximple-spatialjob/src/main/resources/conf/DefaultConvertShpFilter.xml
@@ -5,222 +5,259 @@
     <tid>106</tid>
     <cid>0</cid>
     <description>�D�����u</description>
+    <elmtype>12</elmtype>
     <LineCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-402.C-0">
     <tid>402</tid>
     <cid>0</cid>
     <description>�ܹq��</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-402.C-1">
     <tid>402</tid>
     <cid>1</cid>
     <description>�ܹq�ҵ��O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-402.C-2">
     <tid>402</tid>
     <cid>2</cid>
     <description>�ܹq�Ҥ�����O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-411.C-0">
     <tid>411</tid>
     <cid>0</cid>
     <description>�t�q��</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-411.C-1">
     <tid>411</tid>
     <cid>1</cid>
     <description>�t�q�����O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-411.C-2">
     <tid>411</tid>
     <cid>2</cid>
     <description>�t�q��-1/600</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-411.C-3">
     <tid>411</tid>
     <cid>3</cid>
     <description>�t�q�����O-1/600</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-407.C-0">
     <tid>407</tid>
     <cid>0</cid>
     <description>�q��</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-407.C-1">
     <tid>407</tid>
     <cid>1</cid>
     <description>�q����O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-407.C-2">
     <tid>407</tid>
     <cid>2</cid>
     <description>�q��-1/600</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-407.C-3">
     <tid>407</tid>
     <cid>3</cid>
-    <description>�q��-1/600</description>
+    <description>�q��-1/600���O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-114.C-0">
     <tid>114</tid>
     <cid>0</cid>
     <description>�}��</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-114.C-1">
     <tid>114</tid>
     <cid>1</cid>
     <description>�}�����O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-122.C-0">
     <tid>122</tid>
     <cid>0</cid>
     <description>�����s��</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-122.C-1">
     <tid>122</tid>
     <cid>1</cid>
-    <description>�����s��</description>
+    <description>�����s�����O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-107.C-0">
     <tid>107</tid>
     <cid>0</cid>
     <description>������</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-107.C-2">
     <tid>107</tid>
     <cid>2</cid>
     <description>�����Τᤤ����O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-117.C-0">
     <tid>117</tid>
     <cid>0</cid>
     <description>Tie������</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-105.C-0">
     <tid>105</tid>
     <cid>0</cid>
     <description>�������Y</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-105.C-1">
     <tid>105</tid>
     <cid>1</cid>
-    <description>�������Y</description>
+    <description>�������Y���O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-101.C-0">
     <tid>101</tid>
     <cid>0</cid>
     <description>�׬y��</description>
+    <elmtype>3</elmtype>
     <LineCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-120.C-0">
     <tid>120</tid>
     <cid>0</cid>
     <description>�`�I</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-150.C-0">
     <tid>150</tid>
     <cid>0</cid>
     <description>����}��</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-130.C-0">
     <tid>130</tid>
     <cid>0</cid>
     <description>�ɽu��e</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-131.C-0">
     <tid>131</tid>
     <cid>0</cid>
     <description>�ɽu�ܧ�</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-109.C-0">
     <tid>109</tid>
     <cid>0</cid>
     <description>���u�s��</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-116.C-0">
     <tid>116</tid>
     <cid>0</cid>
     <description>�����׺�</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-108.C-0">
     <tid>108</tid>
     <cid>0</cid>
     <description>�_����</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-108.C-1">
     <tid>108</tid>
     <cid>1</cid>
     <description>�_�������O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-119.C-0">
     <tid>119</tid>
     <cid>0</cid>
     <description>�q��</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-115.C-0">
     <tid>115</tid>
     <cid>0</cid>
     <description>������</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-115.C-1">
     <tid>115</tid>
     <cid>1</cid>
     <description>���������O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-102.C-0">
     <tid>102</tid>
     <cid>0</cid>
     <description>�q�e��</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-100.C-0">
     <tid>100</tid>
     <cid>0</cid>
     <description>�׹p��</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-140.C-0">
     <tid>140</tid>
     <cid>0</cid>
     <description>�����u��</description>
+    <elmtype>12</elmtype>
     <LineCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-151.C-0">
     <tid>150</tid>
     <cid>0</cid>
     <description>�`���}��</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <!-- Low Voltage Features -->
@@ -228,97 +265,113 @@
     <tid>200</tid>
     <cid>0</cid>
     <description>�C���`�I</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-201.C-0">
     <tid>201</tid>
     <cid>0</cid>
     <description>����u</description>
+    <elmtype>12</elmtype>
     <LineCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-201.C-1">
     <tid>201</tid>
     <cid>1</cid>
     <description>����u���O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-201.C-2">
     <tid>201</tid>
     <cid>2</cid>
     <description>����u���׵��O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-202.C-0">
     <tid>202</tid>
     <cid>0</cid>
     <description>�����I</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-202.C-1">
     <tid>202</tid>
     <cid>1</cid>
     <description>�����I���P���O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-203.C-0">
     <tid>203</tid>
     <cid>0</cid>
     <description>���O�d�������I</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-203.C-1">
     <tid>203</tid>
     <cid>1</cid>
     <description>���O�d�������I���O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-204.C-0">
     <tid>204</tid>
     <cid>0</cid>
     <description>�C�����u</description>
+    <elmtype>17</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-205.C-0">
     <tid>205</tid>
     <cid>0</cid>
     <description>�C���ɽu</description>
+    <elmtype>12</elmtype>
     <LineCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-205.C-1">
     <tid>205</tid>
     <cid>1</cid>
     <description>�C���ɽu���O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-205.C-2">
     <tid>205</tid>
     <cid>2</cid>
     <description>�C���ɽu���׵��O</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-206.C-0">
     <tid>206</tid>
     <cid>0</cid>
     <description>�C�������c</description>
-    <LineCreateStrategy/>
+    <elmtype>17</elmtype>
+    <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-207.C-0">
     <tid>207</tid>
     <cid>0</cid>
     <description>�C��ĵ����</description>
-    <LineCreateStrategy/>
+    <elmtype>17</elmtype>
+    <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-208.C-0">
     <tid>208</tid>
     <cid>0</cid>
     <description>�C���׺�</description>
-    <LineCreateStrategy/>
+    <elmtype>17</elmtype>
+    <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompFilter name="FSC-209.C-0">
     <tid>209</tid>
     <cid>0</cid>
     <description>�C����q���x</description>
-    <LineCreateStrategy/>
+    <elmtype>17</elmtype>
+    <TextCreateStrategy/>
   </TypeCompFilter>
 
   <!-- Dummy
diff --git a/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/filter/ElementDispatcherTest.java b/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/filter/ElementDispatcherTest.java
index e2caf2a..a8ef208 100644
--- a/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/filter/ElementDispatcherTest.java
+++ b/xdgnjobs/ximple-spatialjob/src/test/java/com/ximple/eofms/filter/ElementDispatcherTest.java
@@ -40,6 +40,7 @@
         TypeIdDispatchableFilter tFilter = (TypeIdDispatchableFilter) filter;
         Assert.assertEquals(tFilter.getName(), "DemoFeature1");
         Assert.assertEquals(tFilter.getTid(), 106);
+        Assert.assertEquals(tFilter.getElmtype(), 7);
         Assert.assertNotNull(tFilter.getCreateStrategy());
         Assert.assertTrue(tFilter.getCreateStrategy() instanceof CreateLineStringStrategy);
 
@@ -48,7 +49,7 @@
         TypeCompIdDispatchableFilter tcFilter = (TypeCompIdDispatchableFilter) filter;
         Assert.assertEquals(tcFilter.getName(), "DemoFeature2");
         Assert.assertEquals(tcFilter.getTid(), 107);
-        Assert.assertEquals(tcFilter.getCid(), 1);
+        Assert.assertEquals(tcFilter.getCid(), 11);
         Assert.assertNotNull(tcFilter.getCreateStrategy());
         Assert.assertTrue(tcFilter.getCreateStrategy() instanceof CreateTextStrategy);
 
diff --git a/xdgnjobs/ximple-spatialjob/src/test/resources/com/ximple/eofms/filter/test-data/testElementFilter.xml b/xdgnjobs/ximple-spatialjob/src/test/resources/com/ximple/eofms/filter/test-data/testElementFilter.xml
index 169feeb..d6cd66f 100644
--- a/xdgnjobs/ximple-spatialjob/src/test/resources/com/ximple/eofms/filter/test-data/testElementFilter.xml
+++ b/xdgnjobs/ximple-spatialjob/src/test/resources/com/ximple/eofms/filter/test-data/testElementFilter.xml
@@ -3,18 +3,21 @@
   <TypeFilter name="DemoFeature1">
     <tid>106</tid>
     <description>DemoFilter for DemoFeature</description>
+    <elmtype>7</elmtype>
     <LineCreateStrategy/>
   </TypeFilter>
   <TypeCompFilter name="DemoFeature2">
     <tid>107</tid>
-    <cid>1</cid>
+    <cid>11</cid>
     <description>DemoFilter for DemoFeature</description>
+    <elmtype>7</elmtype>
     <TextCreateStrategy/>
   </TypeCompFilter>
   <TypeCompLevelFilter name="DemoFeature3">
     <tid>108</tid>
     <cid>2</cid>
     <lid>34</lid>
+    <elmtype>17</elmtype>
     <description>DemoFilter for DemoFeature</description>
     <TextCreateStrategy-None/>
   </TypeCompLevelFilter>
diff --git a/xdgnjobs/ximple-spatialjob/src/test/resources/com/ximple/eofms/filter/test-data/testRules.xml b/xdgnjobs/ximple-spatialjob/src/test/resources/com/ximple/eofms/filter/test-data/testRules.xml
index e48cfc6..707a720 100644
--- a/xdgnjobs/ximple-spatialjob/src/test/resources/com/ximple/eofms/filter/test-data/testRules.xml
+++ b/xdgnjobs/ximple-spatialjob/src/test/resources/com/ximple/eofms/filter/test-data/testRules.xml
@@ -10,6 +10,7 @@
       <set-properties-rule/>
       <bean-property-setter-rule pattern="name"/>
       <bean-property-setter-rule pattern="description"/>
+      <bean-property-setter-rule pattern="elmtype"/>
       <bean-property-setter-rule pattern="tid"/>
         <pattern value="LineCreateStrategy">
             <object-create-rule classname="com.ximple.eofms.filter.CreateLineStringStrategy"/>
@@ -28,6 +29,7 @@
       <set-properties-rule/>
       <bean-property-setter-rule pattern="name"/>
       <bean-property-setter-rule pattern="description"/>
+      <bean-property-setter-rule pattern="elmtype"/>
       <bean-property-setter-rule pattern="tid"/>
       <bean-property-setter-rule pattern="cid"/>
         <pattern value="LineCreateStrategy">
@@ -47,6 +49,7 @@
       <set-properties-rule/>
       <bean-property-setter-rule pattern="name"/>
       <bean-property-setter-rule pattern="description"/>
+      <bean-property-setter-rule pattern="elmtype"/>
       <bean-property-setter-rule pattern="tid"/>
       <bean-property-setter-rule pattern="cid"/>
       <bean-property-setter-rule pattern="lid"/>

--
Gitblit v0.0.0-SNAPSHOT