From f26cdb4382420cb98e96237914cf21ae351ceecb Mon Sep 17 00:00:00 2001 From: ?? ? <ulysseskao@ximple.com.tw> Date: Mon, 17 Mar 2008 17:31:01 +0800 Subject: [PATCH] update for EOFM-17 --- ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 52 insertions(+), 5 deletions(-) diff --git a/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java b/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java index fee578a..1b0a17a 100644 --- a/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java +++ b/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertJobContext.java @@ -6,10 +6,16 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.geotools.feature.AttributeTypeFactory; +import org.geotools.feature.FeatureCollection; +import org.geotools.feature.FeatureTypeBuilder; +import org.opengis.geometry.Geometry; import com.vividsolutions.jts.util.Assert; import oracle.jdbc.OracleConnection; + +import com.ximple.io.dgn7.Element; public class OracleConvertJobContext { @@ -173,7 +179,7 @@ + " END;"; protected static final String TRG_ELMINDEX = - "CREATE OR REPLACE TRIGGER \"%s\".\"%s\"\n" + "CREATE OR REPLACE TRIGGER \"%s\".\"%s\"\n" + " AFTER INSERT OR UPDATE OR DELETE ON \"%s\".\"%s\"\n" + " REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW\n" + " BEGIN\n" @@ -202,10 +208,6 @@ protected static final String SMTM_GRANTOBJECTTYPE = "GRANT EXECUTE ANY TYPE TO \"" + UDT_SCHEMA + "\""; - private String _oracleHost; - private String _oracleInstance; - private String _oraclePort; - static { try @@ -231,12 +233,26 @@ return builder.toString(); } + private String _oracleHost; + private String _oracleInstance; + private String _oraclePort; + private OracleConnection oracleConnection = null; private Properties properties; + + private ElementDispatcher elementDispatcher; public OracleConvertJobContext() { properties = new Properties(); + elementDispatcher = createElementDispatcher(); + } + + private ElementDispatcher createElementDispatcher() + { + ElementDispatcher dispatcher = new ElementDispatcher(); + dispatcher.addRule(new TypeCompIdHandlerStrategy(106, 0)); + return dispatcher; } public void setLogin(String userName, String password) @@ -288,4 +304,35 @@ _oracleInstance = oracleInstance; _oraclePort = oraclePort; } + + public FeatureCollection putFeatureCollection(Element element) + { + return null; + } + + public FeatureCollection createFeatureCollection(Element element) + { + FeatureTypeBuilder typeBuilder = FeatureTypeBuilder.newInstance("Line"); + + typeBuilder.addType(AttributeTypeFactory.newAttributeType("GEOM", Geometry.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("TID", Integer.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("OID", Long.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("CID", Integer.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("LID", Integer.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("LEVEL", Integer.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMCOLOR", Integer.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMWEIGHT", Integer.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("SYMSTYLE", Integer.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("FONT", String.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("JUST", Integer.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("HEIGHT", Double.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("WIDTH", Double.class)); + typeBuilder.addType(AttributeTypeFactory.newAttributeType("ANGLE", Double.class)); + return null; + } + + public void commit() + { + + } } -- Gitblit v0.0.0-SNAPSHOT