.gitattributes
@@ -71,12 +71,20 @@ xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleElementLogger.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleUpgradeBlob2UDTJob.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnFileJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnFileJobContext.java -text xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnToOraSDOJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnToPostGISJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractOracleJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/DummyFeatureConvertJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/FeatureDgnConvertJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/GeneralDgnConvertJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/IndexDgnConvertJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractOracleToOraSDOJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractOracleToPostGISJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/DummyFeatureConvertPostGISJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/DummyFeatureConvertShpJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/FeatureDgnConvertPostGISJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/FeatureDgnConvertShpJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/GeneralDgnConvertPostGISJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/GeneralDgnConvertShpJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/IndexDgnConvertPostGISJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/IndexDgnConvertShpJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/OracleConvertOraSDOJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/OracleConvertPostGISJobContext.java svneol=native#text/plain xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/OracleConvertShapefilesJobContext.java svneol=native#text/plain xdgnjobs/pom.xml
@@ -255,6 +255,17 @@ <version>11.1.0</version> </dependency> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>8.3-603.jdbc3</version> </dependency> <dependency> <groupId>org.postgis</groupId> <artifactId>postgis-driver</artifactId> <version>1.3.2</version> </dependency> <!-- opensymphony --> <dependency> <groupId>opensymphony</groupId> @@ -273,7 +284,7 @@ <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>5.8</version> <version>5.7</version> <scope>test</scope> </dependency> </dependencies> @@ -345,6 +356,10 @@ <artifactId>gt2-data</artifactId> <groupId>org.geotools</groupId> </dependency> <dependency> <groupId>org.geotools</groupId> <artifactId>gt2-postgis</artifactId> </dependency> <!-- because main and sample-data depend on referencing we need a tie breaker --> <dependency> @@ -367,12 +382,6 @@ <artifactId>gt2-epsg-hsql</artifactId> <groupId>org.geotools</groupId> <scope>test</scope> </dependency> <!-- ORACLE --> <dependency> <artifactId>ojdbc5</artifactId> <groupId>com.oracle</groupId> </dependency> <dependency> xdgnjobs/ximple-jobcarrier/pom.xml
@@ -69,6 +69,21 @@ <version>1.0.1B</version> </dependency> <!-- ORACLE --> <dependency> <artifactId>ojdbc5</artifactId> <groupId>com.oracle</groupId> </dependency> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> </dependency> <dependency> <groupId>org.postgis</groupId> <artifactId>postgis-driver</artifactId> </dependency> <!-- Ximple Library --> <dependency> <artifactId>ximple-dgnio</artifactId> xdgnjobs/ximple-spatialjob/pom.xml
@@ -56,6 +56,21 @@ <groupId>opensymphony</groupId> </dependency> <!-- ORACLE --> <dependency> <artifactId>ojdbc5</artifactId> <groupId>com.oracle</groupId> </dependency> <dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> </dependency> <dependency> <groupId>org.postgis</groupId> <artifactId>postgis-driver</artifactId> </dependency> <!-- Ximple Library --> <dependency> <groupId>com.ximple.eofms</groupId> xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DummyFeatureConvertJobContext.java
@@ -37,6 +37,7 @@ import com.ximple.eofms.filter.TypeCompIdDispatchableFilter; import com.ximple.eofms.filter.TypeCompLevelIdDispatchableFilter; import com.ximple.eofms.filter.TypeIdDispatchableFilter; import com.ximple.eofms.jobs.context.AbstractDgnFileJobContext; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; import com.ximple.io.dgn7.ComplexElement; xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2OraSDOJob.java
@@ -46,9 +46,9 @@ import com.ximple.eofms.util.ByteArrayCompressor; import com.ximple.eofms.util.StringUtils; import com.ximple.eofms.jobs.context.AbstractOracleJobContext; import com.ximple.eofms.jobs.context.FeatureDgnConvertJobContext; import com.ximple.eofms.jobs.context.GeneralDgnConvertJobContext; import com.ximple.eofms.jobs.context.IndexDgnConvertJobContext; import com.ximple.eofms.jobs.context.FeatureDgnConvertShpJobContext; import com.ximple.eofms.jobs.context.GeneralDgnConvertShpJobContext; import com.ximple.eofms.jobs.context.IndexDgnConvertShpJobContext; import com.ximple.eofms.jobs.context.OracleConvertShapefilesJobContext; public class OracleConvertDgn2OraSDOJob extends AbstractOracleDatabaseJob @@ -562,7 +562,7 @@ for (File dgnFile : dgnFiles) { IndexDgnConvertJobContext convertContext = new IndexDgnConvertJobContext(getDataPath()); IndexDgnConvertShpJobContext convertContext = new IndexDgnConvertShpJobContext(getDataPath()); logger.debug("--- start dgnfile-" + dgnFile.toString() + " ---"); try { @@ -609,7 +609,7 @@ } } protected void scanIndexDgnElement(IndexDgnConvertJobContext convertContext) protected void scanIndexDgnElement(IndexDgnConvertShpJobContext convertContext) throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); @@ -652,7 +652,7 @@ logger.debug("ElementRecord Count=" + count); } private void processIndexElement(Element element, IndexDgnConvertJobContext convertContext) throws IllegalAttributeException, SchemaException private void processIndexElement(Element element, IndexDgnConvertShpJobContext convertContext) throws IllegalAttributeException, SchemaException { if (element instanceof TextElement) { @@ -691,7 +691,7 @@ for (File dgnFile : dgnFiles) { GeneralDgnConvertJobContext convertContext = new GeneralDgnConvertJobContext(getDataPath()); GeneralDgnConvertShpJobContext convertContext = new GeneralDgnConvertShpJobContext(getDataPath()); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); try { @@ -738,7 +738,7 @@ } } public void scanOtherDgnElement(GeneralDgnConvertJobContext convertContext) public void scanOtherDgnElement(GeneralDgnConvertShpJobContext convertContext) throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); @@ -781,7 +781,7 @@ logger.debug("ElementRecord Count=" + count); } private void processOtherElement(Element element, GeneralDgnConvertJobContext convertContext) private void processOtherElement(Element element, GeneralDgnConvertShpJobContext convertContext) throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); @@ -794,12 +794,12 @@ { deleteFilesInPath(outDataPath); } outDataPath = new File(getDataPath(), IndexDgnConvertJobContext.SHPOUTPATH); outDataPath = new File(getDataPath(), IndexDgnConvertShpJobContext.SHPOUTPATH); if (outDataPath.exists() && outDataPath.isDirectory()) { deleteFilesInPath(outDataPath); } outDataPath = new File(getDataPath(), GeneralDgnConvertJobContext.SHPOUTPATH); outDataPath = new File(getDataPath(), GeneralDgnConvertShpJobContext.SHPOUTPATH); if (outDataPath.exists() && outDataPath.isDirectory()) { deleteFilesInPath(outDataPath); @@ -864,7 +864,7 @@ for (File dgnFile : dgnFiles) { FeatureDgnConvertJobContext convertContext = new FeatureDgnConvertJobContext(getDataPath(), _filterPath); FeatureDgnConvertShpJobContext convertContext = new FeatureDgnConvertShpJobContext(getDataPath(), _filterPath); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); try { @@ -911,7 +911,7 @@ } } public void scanFeatureDgnElement(FeatureDgnConvertJobContext convertContext) public void scanFeatureDgnElement(FeatureDgnConvertShpJobContext convertContext) throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); @@ -954,7 +954,7 @@ logger.debug("ElementRecord Count=" + count); } private void processFeatureElement(Element element, FeatureDgnConvertJobContext convertContext) private void processFeatureElement(Element element, FeatureDgnConvertShpJobContext convertContext) throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); @@ -963,7 +963,7 @@ private void createDummyFeatureFile(JobExecutionContext context) throws JobExecutionException { /* DummyFeatureConvertJobContext convertContext = new DummyFeatureConvertJobContext(getDataPath(), _filterPath); DummyFeatureConvertShpJobContext convertContext = new DummyFeatureConvertShpJobContext(getDataPath(), _filterPath); try { convertContext.startTransaction(); convertContext.commitTransaction(); xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2PostGISJob.java
@@ -47,9 +47,9 @@ import com.ximple.eofms.util.ByteArrayCompressor; import com.ximple.eofms.util.StringUtils; import com.ximple.eofms.jobs.context.AbstractOracleJobContext; import com.ximple.eofms.jobs.context.FeatureDgnConvertJobContext; import com.ximple.eofms.jobs.context.GeneralDgnConvertJobContext; import com.ximple.eofms.jobs.context.IndexDgnConvertJobContext; import com.ximple.eofms.jobs.context.FeatureDgnConvertShpJobContext; import com.ximple.eofms.jobs.context.GeneralDgnConvertShpJobContext; import com.ximple.eofms.jobs.context.IndexDgnConvertShpJobContext; import com.ximple.eofms.jobs.context.OracleConvertShapefilesJobContext; public class OracleConvertDgn2PostGISJob extends AbstractOracleDatabaseJob @@ -609,7 +609,7 @@ for (File dgnFile : dgnFiles) { IndexDgnConvertJobContext convertContext = new IndexDgnConvertJobContext(getDataPath()); IndexDgnConvertShpJobContext convertContext = new IndexDgnConvertShpJobContext(getDataPath()); logger.debug("--- start dgnfile-" + dgnFile.toString() + " ---"); try { @@ -656,7 +656,7 @@ } } protected void scanIndexDgnElement(IndexDgnConvertJobContext convertContext) protected void scanIndexDgnElement(IndexDgnConvertShpJobContext convertContext) throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); @@ -699,7 +699,7 @@ logger.debug("ElementRecord Count=" + count); } private void processIndexElement(Element element, IndexDgnConvertJobContext convertContext) throws IllegalAttributeException, SchemaException private void processIndexElement(Element element, IndexDgnConvertShpJobContext convertContext) throws IllegalAttributeException, SchemaException { if (element instanceof TextElement) { @@ -738,7 +738,7 @@ for (File dgnFile : dgnFiles) { GeneralDgnConvertJobContext convertContext = new GeneralDgnConvertJobContext(getDataPath()); GeneralDgnConvertShpJobContext convertContext = new GeneralDgnConvertShpJobContext(getDataPath()); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); try { @@ -785,7 +785,7 @@ } } public void scanOtherDgnElement(GeneralDgnConvertJobContext convertContext) public void scanOtherDgnElement(GeneralDgnConvertShpJobContext convertContext) throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); @@ -828,7 +828,7 @@ logger.debug("ElementRecord Count=" + count); } private void processOtherElement(Element element, GeneralDgnConvertJobContext convertContext) private void processOtherElement(Element element, GeneralDgnConvertShpJobContext convertContext) throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); @@ -841,12 +841,12 @@ { deleteFilesInPath(outDataPath); } outDataPath = new File(getDataPath(), IndexDgnConvertJobContext.SHPOUTPATH); outDataPath = new File(getDataPath(), IndexDgnConvertShpJobContext.SHPOUTPATH); if (outDataPath.exists() && outDataPath.isDirectory()) { deleteFilesInPath(outDataPath); } outDataPath = new File(getDataPath(), GeneralDgnConvertJobContext.SHPOUTPATH); outDataPath = new File(getDataPath(), GeneralDgnConvertShpJobContext.SHPOUTPATH); if (outDataPath.exists() && outDataPath.isDirectory()) { deleteFilesInPath(outDataPath); @@ -911,7 +911,7 @@ for (File dgnFile : dgnFiles) { FeatureDgnConvertJobContext convertContext = new FeatureDgnConvertJobContext(getDataPath(), _filterPath); FeatureDgnConvertShpJobContext convertContext = new FeatureDgnConvertShpJobContext(getDataPath(), _filterPath); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); try { @@ -958,7 +958,7 @@ } } public void scanFeatureDgnElement(FeatureDgnConvertJobContext convertContext) public void scanFeatureDgnElement(FeatureDgnConvertShpJobContext convertContext) throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); @@ -1001,7 +1001,7 @@ logger.debug("ElementRecord Count=" + count); } private void processFeatureElement(Element element, FeatureDgnConvertJobContext convertContext) private void processFeatureElement(Element element, FeatureDgnConvertShpJobContext convertContext) throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); @@ -1010,7 +1010,7 @@ private void createDummyFeatureFile(JobExecutionContext context) throws JobExecutionException { /* DummyFeatureConvertJobContext convertContext = new DummyFeatureConvertJobContext(getDataPath(), _filterPath); DummyFeatureConvertShpJobContext convertContext = new DummyFeatureConvertShpJobContext(getDataPath(), _filterPath); try { convertContext.startTransaction(); convertContext.commitTransaction(); xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2ShpJob.java
@@ -37,9 +37,9 @@ import com.ximple.eofms.util.ByteArrayCompressor; import com.ximple.eofms.util.StringUtils; import com.ximple.eofms.jobs.context.AbstractOracleJobContext; import com.ximple.eofms.jobs.context.FeatureDgnConvertJobContext; import com.ximple.eofms.jobs.context.GeneralDgnConvertJobContext; import com.ximple.eofms.jobs.context.IndexDgnConvertJobContext; import com.ximple.eofms.jobs.context.FeatureDgnConvertShpJobContext; import com.ximple.eofms.jobs.context.GeneralDgnConvertShpJobContext; import com.ximple.eofms.jobs.context.IndexDgnConvertShpJobContext; import com.ximple.eofms.jobs.context.OracleConvertShapefilesJobContext; import com.ximple.io.dgn7.ComplexElement; import com.ximple.io.dgn7.Dgn7fileException; @@ -511,7 +511,7 @@ for (File dgnFile : dgnFiles) { IndexDgnConvertJobContext convertContext = new IndexDgnConvertJobContext(getDataPath()); IndexDgnConvertShpJobContext convertContext = new IndexDgnConvertShpJobContext(getDataPath()); logger.debug("--- start dgnfile-" + dgnFile.toString() + " ---"); try { @@ -558,7 +558,7 @@ } } protected void scanIndexDgnElement(IndexDgnConvertJobContext convertContext) protected void scanIndexDgnElement(IndexDgnConvertShpJobContext convertContext) throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); @@ -601,7 +601,7 @@ logger.debug("ElementRecord Count=" + count); } private void processIndexElement(Element element, IndexDgnConvertJobContext convertContext) throws IllegalAttributeException, SchemaException private void processIndexElement(Element element, IndexDgnConvertShpJobContext convertContext) throws IllegalAttributeException, SchemaException { if (element instanceof TextElement) { @@ -640,7 +640,7 @@ for (File dgnFile : dgnFiles) { GeneralDgnConvertJobContext convertContext = new GeneralDgnConvertJobContext(getDataPath()); GeneralDgnConvertShpJobContext convertContext = new GeneralDgnConvertShpJobContext(getDataPath()); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); try { @@ -687,7 +687,7 @@ } } public void scanOtherDgnElement(GeneralDgnConvertJobContext convertContext) public void scanOtherDgnElement(GeneralDgnConvertShpJobContext convertContext) throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); @@ -730,7 +730,7 @@ logger.debug("ElementRecord Count=" + count); } private void processOtherElement(Element element, GeneralDgnConvertJobContext convertContext) private void processOtherElement(Element element, GeneralDgnConvertShpJobContext convertContext) throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); @@ -743,12 +743,12 @@ { deleteFilesInPath(outDataPath); } outDataPath = new File(getDataPath(), IndexDgnConvertJobContext.SHPOUTPATH); outDataPath = new File(getDataPath(), IndexDgnConvertShpJobContext.SHPOUTPATH); if (outDataPath.exists() && outDataPath.isDirectory()) { deleteFilesInPath(outDataPath); } outDataPath = new File(getDataPath(), GeneralDgnConvertJobContext.SHPOUTPATH); outDataPath = new File(getDataPath(), GeneralDgnConvertShpJobContext.SHPOUTPATH); if (outDataPath.exists() && outDataPath.isDirectory()) { deleteFilesInPath(outDataPath); @@ -813,7 +813,7 @@ for (File dgnFile : dgnFiles) { FeatureDgnConvertJobContext convertContext = new FeatureDgnConvertJobContext(getDataPath(), _filterPath); FeatureDgnConvertShpJobContext convertContext = new FeatureDgnConvertShpJobContext(getDataPath(), _filterPath); logger.info("--- start dgnfile-" + dgnFile.toString() + " ---"); try { @@ -860,7 +860,7 @@ } } public void scanFeatureDgnElement(FeatureDgnConvertJobContext convertContext) public void scanFeatureDgnElement(FeatureDgnConvertShpJobContext convertContext) throws Dgn7fileException, IOException, IllegalAttributeException, SchemaException { Dgn7fileReader reader = convertContext.getReader(); @@ -903,7 +903,7 @@ logger.debug("ElementRecord Count=" + count); } private void processFeatureElement(Element element, FeatureDgnConvertJobContext convertContext) private void processFeatureElement(Element element, FeatureDgnConvertShpJobContext convertContext) throws IllegalAttributeException, SchemaException { convertContext.putFeatureCollection(element); @@ -912,7 +912,7 @@ private void createDummyFeatureFile(JobExecutionContext context) throws JobExecutionException { /* DummyFeatureConvertJobContext convertContext = new DummyFeatureConvertJobContext(getDataPath(), _filterPath); DummyFeatureConvertShpJobContext convertContext = new DummyFeatureConvertShpJobContext(getDataPath(), _filterPath); try { convertContext.startTransaction(); convertContext.commitTransaction(); xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnFileJobContext.java
@@ -1,6 +1,6 @@ package com.ximple.eofms.jobs.context; import java.util.Properties; import java.util.Map; import org.quartz.JobExecutionContext; @@ -16,7 +16,7 @@ private JobExecutionContext executionContext = null; protected String _dataPath = null; protected Properties properties = null; protected Map properties = null; private Dgn7fileReader reader = null; private String filename = null; xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnToOraSDOJobContext.java
New file @@ -0,0 +1,12 @@ package com.ximple.eofms.jobs.context; import java.util.Properties; public abstract class AbstractDgnToOraSDOJobContext extends AbstractDgnFileJobContext { public AbstractDgnToOraSDOJobContext(String dataPath, Properties properties) { super(dataPath); this.properties = properties; } } xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnToPostGISJobContext.java
New file @@ -0,0 +1,12 @@ package com.ximple.eofms.jobs.context; import java.util.Properties; public abstract class AbstractDgnToPostGISJobContext extends AbstractDgnFileJobContext { public AbstractDgnToPostGISJobContext(String dataPath, Properties properties) { super(dataPath); this.properties = properties; } } xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractOracleToOraSDOJobContext.java
New file @@ -0,0 +1,10 @@ package com.ximple.eofms.jobs.context; import java.util.Properties; public abstract class AbstractOracleToOraSDOJobContext extends AbstractOracleJobContext { public AbstractOracleToOraSDOJobContext(String dataPath, Properties properties) { } } xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractOracleToPostGISJobContext.java
New file @@ -0,0 +1,10 @@ package com.ximple.eofms.jobs.context; import java.util.Properties; public abstract class AbstractOracleToPostGISJobContext extends AbstractOracleJobContext { public AbstractOracleToPostGISJobContext(String dataPath, Properties properties) { } } xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/DummyFeatureConvertPostGISJobContext.java
New file @@ -0,0 +1,31 @@ package com.ximple.eofms.jobs.context; import java.util.Properties; public class DummyFeatureConvertPostGISJobContext extends AbstractDgnToPostGISJobContext { public DummyFeatureConvertPostGISJobContext(String dataPath, Properties properties) { super(dataPath, properties); } public void startTransaction() { //To change body of implemented methods use File | Settings | File Templates. } public void commitTransaction() { //To change body of implemented methods use File | Settings | File Templates. } public void rollbackTransaction() { //To change body of implemented methods use File | Settings | File Templates. } public String getDataOutPath() { return null; //To change body of implemented methods use File | Settings | File Templates. } } xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/DummyFeatureConvertShpJobContext.java
File was renamed from xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/DummyFeatureConvertJobContext.java @@ -42,9 +42,9 @@ import com.ximple.io.dgn7.ComplexElement; import com.ximple.io.dgn7.UserAttributeData; public class DummyFeatureConvertJobContext extends AbstractDgnFileJobContext public class DummyFeatureConvertShpJobContext extends AbstractDgnFileJobContext { static final Log logger = LogFactory.getLog(DummyFeatureConvertJobContext.class); static final Log logger = LogFactory.getLog(DummyFeatureConvertShpJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); static final GeometryFactory geometryFactory = new GeometryFactory(); static final String SHPOUTPATH = "shpout"; @@ -60,7 +60,7 @@ private String _filterConfig; private boolean withIndex = false; public DummyFeatureConvertJobContext(String dataPath, String filterConfig) public DummyFeatureConvertShpJobContext(String dataPath, String filterConfig) { super(dataPath); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/FeatureDgnConvertPostGISJobContext.java
New file @@ -0,0 +1,28 @@ package com.ximple.eofms.jobs.context; import java.util.Properties; public class FeatureDgnConvertPostGISJobContext extends AbstractDgnToPostGISJobContext { public FeatureDgnConvertPostGISJobContext(String dataPath, Properties properties) { super(dataPath, properties); } public void startTransaction() { } public void commitTransaction() { } public void rollbackTransaction() { } public String getDataOutPath() { return null; } } xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/FeatureDgnConvertShpJobContext.java
File was renamed from xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/FeatureDgnConvertJobContext.java @@ -39,9 +39,9 @@ import com.ximple.io.dgn7.UserAttributeData; import com.ximple.io.dgn7.ComplexElement; public class FeatureDgnConvertJobContext extends AbstractDgnFileJobContext public class FeatureDgnConvertShpJobContext extends AbstractDgnFileJobContext { static final Log logger = LogFactory.getLog(FeatureDgnConvertJobContext.class); static final Log logger = LogFactory.getLog(FeatureDgnConvertShpJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); static final GeometryFactory geometryFactory = new GeometryFactory(); static final String SHPOUTPATH = "shpout"; @@ -57,7 +57,7 @@ private String _filterConfig; private boolean withIndex = false; public FeatureDgnConvertJobContext(String dataPath, String filterConfig) public FeatureDgnConvertShpJobContext(String dataPath, String filterConfig) { super(dataPath); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/GeneralDgnConvertPostGISJobContext.java
New file @@ -0,0 +1,28 @@ package com.ximple.eofms.jobs.context; import java.util.Properties; public class GeneralDgnConvertPostGISJobContext extends AbstractDgnToPostGISJobContext { public GeneralDgnConvertPostGISJobContext(String dataPath, Properties properties) { super(dataPath, properties); } public void startTransaction() { } public void commitTransaction() { } public void rollbackTransaction() { } public String getDataOutPath() { return null; } } xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/GeneralDgnConvertShpJobContext.java
File was renamed from xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/GeneralDgnConvertJobContext.java @@ -47,9 +47,9 @@ import com.ximple.io.dgn7.TextNodeElement; import com.ximple.io.dgn7.UserAttributeData; public class GeneralDgnConvertJobContext extends AbstractDgnFileJobContext public class GeneralDgnConvertShpJobContext extends AbstractDgnFileJobContext { static final Log logger = LogFactory.getLog(GeneralDgnConvertJobContext.class); static final Log logger = LogFactory.getLog(GeneralDgnConvertShpJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); static final GeometryFactory geometryFactory = new GeometryFactory(); public static final String SHPOUTPATH = "shpout"; @@ -67,7 +67,7 @@ private String featureBaseName = null; private boolean withIndex = false; public GeneralDgnConvertJobContext(String dataPath) public GeneralDgnConvertShpJobContext(String dataPath) { super(dataPath); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/IndexDgnConvertPostGISJobContext.java
New file @@ -0,0 +1,28 @@ package com.ximple.eofms.jobs.context; import java.util.Properties; public class IndexDgnConvertPostGISJobContext extends AbstractDgnToPostGISJobContext { public IndexDgnConvertPostGISJobContext(String dataPath, Properties properties) { super(dataPath, properties); } public void startTransaction() { } public void commitTransaction() { } public void rollbackTransaction() { } public String getDataOutPath() { return null; } } xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/IndexDgnConvertShpJobContext.java
File was renamed from xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/IndexDgnConvertJobContext.java @@ -43,9 +43,9 @@ import com.ximple.io.dgn7.TextElement; import com.ximple.io.dgn7.UserAttributeData; public class IndexDgnConvertJobContext extends AbstractDgnFileJobContext public class IndexDgnConvertShpJobContext extends AbstractDgnFileJobContext { static final Log logger = LogFactory.getLog(IndexDgnConvertJobContext.class); static final Log logger = LogFactory.getLog(IndexDgnConvertShpJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); static final GeometryFactory geometryFactory = new GeometryFactory(); TWD97GeometryConverterDecorator convertDecorator = new TWD97GeometryConverterDecorator(); @@ -62,7 +62,7 @@ private FeatureType featureType = null; private FeatureType featureType2 = null; public IndexDgnConvertJobContext(String dataPath) public IndexDgnConvertShpJobContext(String dataPath) { super(dataPath); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/OracleConvertOraSDOJobContext.java
@@ -1,5 +1,16 @@ package com.ximple.eofms.jobs.context; public class OracleConvertOraSDOJobContext public class OracleConvertOraSDOJobContext extends AbstractOracleJobContext { public void startTransaction() { } public void commitTransaction() { } public void rollbackTransaction() { } } xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/OracleConvertPostGISJobContext.java
@@ -1,5 +1,327 @@ package com.ximple.eofms.jobs.context; public class OracleConvertPostGISJobContext import java.util.Properties; import java.util.HashMap; import java.util.ArrayList; import java.util.Iterator; import java.sql.DriverManager; import java.sql.SQLException; import java.net.URL; import java.net.MalformedURLException; import java.io.File; import java.io.UnsupportedEncodingException; import java.io.IOException; import java.nio.charset.Charset; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.transaction.util.LoggerFacade; import org.apache.commons.transaction.util.CommonsLoggingLogger; import org.apache.commons.transaction.memory.PessimisticMapWrapper; 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.DataStore; import org.geotools.data.postgis.PostgisDataStoreFactory; import org.geotools.data.shapefile.ShapefileDataStore; import org.geotools.data.shapefile.indexed.IndexedShapefileDataStore; import org.geotools.feature.Feature; import org.geotools.feature.FeatureType; import org.geotools.feature.SimpleFeature; import org.geotools.feature.IllegalAttributeException; import org.quartz.JobExecutionContext; import org.xml.sax.SAXException; import com.vividsolutions.jts.util.Assert; import com.ximple.eofms.jobs.OracleElementLogger; import com.ximple.eofms.filter.ElementDispatcher; import com.ximple.eofms.filter.AbstractFLinkageDispatchableFilter; import com.ximple.io.dgn7.Element; import com.ximple.io.dgn7.FrammeAttributeData; import com.ximple.io.dgn7.ComplexElement; public class OracleConvertPostGISJobContext extends AbstractOracleToPostGISJobContext { static Log logger = LogFactory.getLog(OracleConvertShapefilesJobContext.class); static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); static PostgisDataStoreFactory dataStoreFactory = new PostgisDataStoreFactory(); private OracleElementLogger elmLogger = null; static { try { DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); } catch (SQLException e) { Assert.shouldNeverReachHere(e.getMessage()); } } private String _filterConfig; private ElementDispatcher elementDispatcher; private HashMap featuresContext = new HashMap(); private HashMap<String, FeatureWriter> featuresWriterContext = new HashMap<String, FeatureWriter>(); private PessimisticMapWrapper txFeaturesContext; private JobExecutionContext executionContext; private String dataOut = null; private String _convertDB = null; private String _convertFile = null; private String currentSchema = null; private String pgCurrentSchema = null; private boolean schemaChanged = false; private String _convertElementIn = null; public OracleConvertPostGISJobContext(String dataPath, Properties properties, String filterConfig) { super(dataPath, properties); _filterConfig = filterConfig; elementDispatcher = createElementDispatcher(); txFeaturesContext = new PessimisticMapWrapper(featuresContext, sLogger); } private ElementDispatcher createElementDispatcher() { try { URL rulesURL = ElementDispatcher.class.getResource("ElementDispatcherRules.xml"); assert rulesURL != null; Digester digester = DigesterLoader.createDigester(rulesURL); URL filterURL = null; if (_filterConfig != null) { File config = new File(_filterConfig); if (config.exists()) { filterURL = config.toURI().toURL(); } } if (filterURL == null) { // config = new File("conf/DefaultConvertShpFilter.xml"); filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); } assert filterURL != null; return (ElementDispatcher) digester.parse(filterURL); } 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 putFeatureCollection(Element element) { assert elementDispatcher != null; // §PÂ_¬O§_²Å©M±ø¥ó Feature feature = elementDispatcher.execute(element); if (feature == null) { boolean isEmptySize = false; FrammeAttributeData linkage = AbstractFLinkageDispatchableFilter.getFeatureLinkage(element); logger.warn("Unknown Element:" + element.getElementType().toString() + ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); if (element instanceof ComplexElement) { ComplexElement complex = (ComplexElement) element; logger.warn("----Complex Element size=" + complex.size() + ":" + (linkage == null ? "NULL" : (linkage.getUfid()))); isEmptySize = true; } if (getElementLogging() && (!isEmptySize)) { getElementLogger().logElement(element, getCurrentSchema()); } return; } if (!txFeaturesContext.containsKey(feature.getFeatureType())) { txFeaturesContext.put(feature.getFeatureType(), new ArrayList()); } ArrayList arrayList = (ArrayList) txFeaturesContext.get(feature.getFeatureType()); arrayList.add(feature); } public void startTransaction() { //txFeaturesContext.startTransaction(); } public void commitTransaction() { if (!txFeaturesContext.isEmpty()) { logger.debug("Transaction size = " + txFeaturesContext.size()); //txFeaturesContext.commitTransaction(); } else { logger.debug("Transaction is empty."); } if (!featuresContext.isEmpty()) { updateDataStore(); } if (this.getElementLogger() != null) this.getElementLogger().flashLogging(); } public void rollbackTransaction() { //txFeaturesContext.rollbackTransaction(); if (!featuresContext.isEmpty()) { updateDataStore(); } } private void updateDataStore() { Iterator it = featuresContext.keySet().iterator(); try { while (it.hasNext()) { FeatureType featureType = (FeatureType) it.next(); FeatureWriter writer = null; if (featuresWriterContext.containsKey(featureType.getTypeName())) { writer = featuresWriterContext.get(featureType.getTypeName()); } else { DataStore postGisDataStore = null; postGisDataStore = dataStoreFactory.createDataStore(properties); boolean existTable = isExistFeature(featureType); if (!existTable) { postGisDataStore.createSchema(featureType); writer = postGisDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); } else { writer = postGisDataStore.getFeatureWriterAppend(featureType.getTypeName(), Transaction.AUTO_COMMIT); } featuresWriterContext.put(featureType.getTypeName(), writer); } ArrayList features = (ArrayList) featuresContext.get(featureType); Iterator itFeature = features.iterator(); while (itFeature.hasNext()) { Feature feature = (Feature) itFeature.next(); ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null)); } //writer.close(); logger.debug("End Save posgis:"); } featuresContext.clear(); } catch (MalformedURLException e) { logger.error(e.getMessage(), e); } catch (IllegalAttributeException e) { logger.error(e.getMessage(), e); } catch (IOException e) { logger.error(e.getMessage(), e); } } private boolean isExistFeature(FeatureType featureType) { return false; } public JobExecutionContext getExecutionContext() { return executionContext; } public void setExecutionContext(JobExecutionContext context) { executionContext = context; } /** * Ãö³¬³]³Æ¼g¤J¾¹ * * @throws IOException IOµo¥Í¿ù»~ */ public void closeFeatureWriter() throws IOException { for (FeatureWriter featureWriter : this.featuresWriterContext.values()) { featureWriter.close(); } this.featuresWriterContext.clear(); } public void setConvertDB(String convertDB) { _convertDB = convertDB; } public void setConvertFile(String convertFile) { _convertFile = convertFile; } protected OracleElementLogger getElementLogger() { if (elmLogger == null) { elmLogger = new OracleElementLogger(getOracleConnection()); elmLogger.setDataPath(this.getDataPath()); } return elmLogger; } public String getCurrentSchema() { return currentSchema; } public void setCurrentSchema(String querySchema) { this.currentSchema = querySchema; this.schemaChanged = true; } public void setConvertElementIn(String convertElementIn) { _convertElementIn = convertElementIn; } }