forked from geodmms/xdgnjobs

?? ?
2008-06-06 5f10bce7d517a2131efd37938f60a75c82623a75
update for EOFM-115
11 files modified
1 files added
111 ■■■■ changed files
.gitattributes 1 ●●●● patch | view | raw | blame | history
xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml 4 ●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java 10 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2PostGISJob.java 17 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnFileJobContext.java 2 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/GeneralDgnConvertPostGISJobContext.java 44 ●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/IndexDgnConvertPostGISJobContext.java 12 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/AbstractDgnToShapefileJobContext.java 13 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/DummyFeatureConvertShpJobContext.java 2 ●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/FeatureDgnConvertShpJobContext.java 2 ●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/GeneralDgnConvertShpJobContext.java 2 ●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/IndexDgnConvertShpJobContext.java 2 ●●● patch | view | raw | blame | history
.gitattributes
@@ -84,6 +84,7 @@
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/GeneralDgnConvertPostGISJobContext.java svneol=native#text/plain
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/IndexDgnConvertPostGISJobContext.java svneol=native#text/plain
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/OracleConvertPostGISJobContext.java svneol=native#text/plain
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/AbstractDgnToShapefileJobContext.java svneol=native#text/plain
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/DummyFeatureConvertShpJobContext.java svneol=native#text/plain
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/FeatureDgnConvertShpJobContext.java svneol=native#text/plain
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/GeneralDgnConvertShpJobContext.java svneol=native#text/plain
xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml
@@ -88,7 +88,7 @@
        </entry>
        <entry>
          <key>CREATEDUMMY</key>
          <value>true</value>
          <value>false</value>
        </entry>
        <entry>
          <key>ELEMLOG</key>
@@ -100,7 +100,7 @@
        </entry>
        <entry>
          <key>TESTMODE</key>
          <value>false</value>
          <value>true</value>
        </entry>
        <entry>
          <key>TESTCOUNT</key>
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java
@@ -15,6 +15,7 @@
import org.apache.commons.logging.Log;
import org.geotools.data.DataStore;
import org.geotools.data.postgis.PostgisDataStoreFactory;
import org.geotools.data.jdbc.ConnectionPoolManager;
import org.geotools.data.oracle.OracleDataStore;
import org.geotools.data.oracle.OracleDataStoreFactory;
@@ -369,6 +370,15 @@
        map.put("dbtype", "oracle");
        map.put("alias", _oracleInstance);
        map.put("namespace", null);
        if (!map.containsKey(OracleDataStoreFactory.MAXCONN.key))
        {
            map.put(OracleDataStoreFactory.MAXCONN.key, "2");
        }
        if (!map.containsKey(OracleDataStoreFactory.MINCONN.key))
        {
            map.put(OracleDataStoreFactory.MINCONN.key, "1");
        }
        if (!dataStoreFactory.canProcess(map))
        {
            getLogger().warn("cannot process properties-");
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2PostGISJob.java
@@ -97,7 +97,7 @@
    protected String _pgPassword;
    protected String _pgUseWKB;
    protected Map pgProperties;
    protected Map<String, String> pgProperties;
    protected PostgisDataStore targetDataStore;
    /*
@@ -1087,6 +1087,21 @@
        }
        */
        if (!pgProperties.containsKey(PostgisDataStoreFactory.MAXCONN.key))
        {
            pgProperties.put(PostgisDataStoreFactory.MAXCONN.key, "2");
        }
        if (!pgProperties.containsKey(PostgisDataStoreFactory.MINCONN.key))
        {
            pgProperties.put(PostgisDataStoreFactory.MINCONN.key, "1");
        }
        if (!pgProperties.containsKey(PostgisDataStoreFactory.WKBENABLED.key))
        {
            pgProperties.put(PostgisDataStoreFactory.WKBENABLED.key, "true");
        }
        if (!dataStoreFactory.canProcess(pgProperties))
        {
            getLogger().warn("cannot process properties-");
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/AbstractDgnFileJobContext.java
@@ -49,8 +49,6 @@
    public abstract void rollbackTransaction();
    public abstract String getDataOutPath();
    public Dgn7fileReader getReader()
    {
        return this.reader;
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/GeneralDgnConvertPostGISJobContext.java
@@ -53,7 +53,6 @@
    static final Log logger = LogFactory.getLog(GeneralDgnConvertPostGISJobContext.class);
    static final LoggerFacade sLogger = new CommonsLoggingLogger(logger);
    static final GeometryFactory geometryFactory = new GeometryFactory();
    public static final String SHPOUTPATH = "shpout";
    private String dataOut = null;
@@ -153,8 +152,7 @@
            while (it.hasNext())
            {
                FeatureType featureType = (FeatureType) it.next();
                File sfile = new File(getDataOutPath() + File.separator + featureType.getTypeName());
                logger.debug("Begin Save shapefile:" + sfile.toURI());
                logger.debug("Begin Save into PostGIS:" + featureType.getTypeName());
                FeatureWriter writer;
                if (featuresWriterContext.containsKey(featureType.getTypeName()))
@@ -162,27 +160,14 @@
                    writer = featuresWriterContext.get(featureType.getTypeName());
                } else
                {
                    ShapefileDataStore shapefileDataStore = null;
                    boolean existFile = sfile.exists();
                    if (!withIndex)
                    if (targetDataStore.getSchema(featureType.getTypeName()) != null)
                    {
                        shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL(),
                                true, Charset.forName("UTF-8"));
                    } else
                    {
                        shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(),
                                null, true, true, IndexedShapefileDataStore.TREE_QIX, Charset.forName("UTF-8"));
                    }
                    if (!existFile)
                    {
                        shapefileDataStore.createSchema(featureType);
                        writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(),
                        targetDataStore.createSchema(featureType);
                        writer = targetDataStore.getFeatureWriter(featureType.getTypeName(),
                                Transaction.AUTO_COMMIT);
                    } else
                    {
                        writer = shapefileDataStore.getFeatureWriterAppend(featureType.getTypeName(),
                        writer = targetDataStore.getFeatureWriterAppend(featureType.getTypeName(),
                                Transaction.AUTO_COMMIT);
                    }
                    featuresWriterContext.put(featureType.getTypeName(), writer);
@@ -196,7 +181,7 @@
                    ((SimpleFeature) writer.next()).setAttributes(feature.getAttributes(null));
                }
                //writer.close();
                logger.debug("End Save shapefile:" + sfile.toURI());
                logger.debug("End Save into PostGIS:" + featureType.getTypeName());
            }
            featuresContext.clear();
        } catch (MalformedURLException e)
@@ -209,23 +194,6 @@
        {
            logger.error(e.getMessage(), e);
        }
    }
    public String getDataOutPath()
    {
        if (dataOut == null)
        {
            File outPath = new File(getDataPath(), SHPOUTPATH);
            if (!outPath.exists())
            {
                outPath.mkdir();
            } else if (!outPath.isDirectory())
            {
                outPath.mkdir();
            }
            dataOut = outPath.toString();
        }
        return dataOut;
    }
    public void closeFeatureWriter() throws IOException
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/postgis/IndexDgnConvertPostGISJobContext.java
@@ -20,6 +20,7 @@
import org.geotools.data.FeatureWriter;
import org.geotools.data.Transaction;
import org.geotools.data.DataStore;
import org.geotools.data.postgis.PostgisDataStore;
import org.geotools.data.shapefile.ShapefileDataStore;
import org.geotools.data.shapefile.indexed.IndexedShapefileDataStore;
import org.geotools.feature.AttributeTypeFactory;
@@ -159,11 +160,14 @@
                    /*
                    ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL(),
                            true, Charset.forName("UTF-8"));
                    */
                    ShapefileDataStore shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(),
                    PostgisDataStore shapefileDataStore = new IndexedShapefileDataStore(sfile.toURI().toURL(),
                            null, true, true, IndexedShapefileDataStore.TREE_QIX, Charset.forName("UTF-8"));
                    shapefileDataStore.createSchema(featureType);
                    writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT);
                    */
                    if (targetDataStore.getSchema(featureType.getTypeName()) != null)
                    {
                        targetDataStore.createSchema(featureType);
                    }
                    writer = targetDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT);
                    featuresWriterContext.put(featureType.getTypeName(), writer);
                }
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/AbstractDgnToShapefileJobContext.java
New file
@@ -0,0 +1,13 @@
package com.ximple.eofms.jobs.context.shapefile;
import com.ximple.eofms.jobs.context.AbstractDgnFileJobContext;
public abstract class AbstractDgnToShapefileJobContext extends AbstractDgnFileJobContext
{
    public AbstractDgnToShapefileJobContext(String dataPath)
    {
        super(dataPath);
    }
    public abstract String getDataOutPath();
}
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/DummyFeatureConvertShpJobContext.java
@@ -43,7 +43,7 @@
import com.ximple.io.dgn7.FrammeAttributeData;
import com.ximple.io.dgn7.UserAttributeData;
public class DummyFeatureConvertShpJobContext extends AbstractDgnFileJobContext
public class DummyFeatureConvertShpJobContext extends AbstractDgnToShapefileJobContext
{
    static final Log logger = LogFactory.getLog(DummyFeatureConvertShpJobContext.class);
    static final LoggerFacade sLogger = new CommonsLoggingLogger(logger);
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/FeatureDgnConvertShpJobContext.java
@@ -39,7 +39,7 @@
import com.ximple.io.dgn7.FrammeAttributeData;
import com.ximple.io.dgn7.UserAttributeData;
public class FeatureDgnConvertShpJobContext extends AbstractDgnFileJobContext
public class FeatureDgnConvertShpJobContext extends AbstractDgnToShapefileJobContext
{
    static final Log logger = LogFactory.getLog(FeatureDgnConvertShpJobContext.class);
    static final LoggerFacade sLogger = new CommonsLoggingLogger(logger);
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/GeneralDgnConvertShpJobContext.java
@@ -47,7 +47,7 @@
import com.ximple.io.dgn7.TextNodeElement;
import com.ximple.io.dgn7.UserAttributeData;
public class GeneralDgnConvertShpJobContext extends AbstractDgnFileJobContext
public class GeneralDgnConvertShpJobContext extends AbstractDgnToShapefileJobContext
{
    static final Log logger = LogFactory.getLog(GeneralDgnConvertShpJobContext.class);
    static final LoggerFacade sLogger = new CommonsLoggingLogger(logger);
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/context/shapefile/IndexDgnConvertShpJobContext.java
@@ -44,7 +44,7 @@
import com.ximple.io.dgn7.TextElement;
import com.ximple.io.dgn7.UserAttributeData;
public class IndexDgnConvertShpJobContext extends AbstractDgnFileJobContext
public class IndexDgnConvertShpJobContext extends AbstractDgnToShapefileJobContext
{
    static final Log logger = LogFactory.getLog(IndexDgnConvertShpJobContext.class);
    static final LoggerFacade sLogger = new CommonsLoggingLogger(logger);