From bb3e35238db4783a1e81043918dd5bd0a3791057 Mon Sep 17 00:00:00 2001
From: Dennis Kao <ulysseskao@gmail.com>
Date: Tue, 07 Jan 2014 18:44:36 +0800
Subject: [PATCH] update for flow mark

---
 xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleIncrementPostGISJobContext.java |   37 +++++++++++++++++++++++++++++++++++--
 1 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleIncrementPostGISJobContext.java b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleIncrementPostGISJobContext.java
index 0a54b0b..524976b 100644
--- a/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleIncrementPostGISJobContext.java
+++ b/xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleIncrementPostGISJobContext.java
@@ -44,7 +44,7 @@
 public class OracleIncrementPostGISJobContext extends AbstractOracleToPostGISJobContext
     implements CreateFeatureTypeEventListener {
 
-    static Log logger = LogFactory.getLog(OracleConvertPostGISJobContext.class);
+    static Log logger = LogFactory.getLog(OracleIncrementPostGISJobContext.class);
     static final LoggerFacade sLogger = new CommonsLoggingLogger(logger);
 
     // static PostgisNGDataStoreFactory dataStoreFactory = new PostgisNGDataStoreFactory();
@@ -71,6 +71,17 @@
     private boolean schemaChanged = false;
     private boolean dropTableMode = true;
     private int accumulate = 0;
+
+    public static class ElementTransactionContext {
+        public int transcationType;
+        public short cid;
+        public int oid;
+        public short compid;
+        public short occid;
+        public int taskid;
+        public Element element;
+        public int result;
+    };
 
     public OracleIncrementPostGISJobContext(String dataPath, DataStore pgDS, String targetSchema, String filterConfig,
                                           boolean profileMode, boolean useTransform) {
@@ -113,7 +124,29 @@
         }
     }
 
-    public void putFeatureCollection(Element element) {
+    /**
+     * STATUS 欄位 :0:新增  2:編輯  3:刪除設備   4:刪除元件
+     * @param context
+     */
+    public void putFeatureCollection(ElementTransactionContext context) {
+        assert elementDispatcher != null;
+        if (context == null) {
+            logger.warn("putFeatureCollection context is null");
+            return;
+        }
+        if (context.transcationType == 0) {
+            // insert Element
+            putFeatureCollection(context.element);
+        } else if (context.transcationType == 2) {
+            // Update Element
+        } else if (context.transcationType == 3) {
+            // Remove Whole Feature
+        } else if (context.transcationType == 4) {
+            // Remove Feature Part
+        }
+    }
+
+    protected void putFeatureCollection(Element element) {
         assert elementDispatcher != null;
         // 判斷是否符和條件
         SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed());

--
Gitblit v0.0.0-SNAPSHOT