Dennis Kao
2013-12-04 98fc790f9ec053d5367d7ce5851ef66d5a7ced5b
add copyapi for theme
20 files modified
10986 ■■■■ changed files
xdgnjobs/pom.xml 24 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-build/maven/jar-collector/src/main/java/com/ximple/eofms/maven/JarCollector.java 2 ●●● patch | view | raw | blame | history
xdgnjobs/ximple-build/maven/pom.xml 2 ●●● patch | view | raw | blame | history
xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml 18 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateArcLineStringStrategy.java 4 ●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateComplexChainStrategy.java 16 ●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateEllipseShapeStrategy.java 4 ●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java 16 ●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineTextStrategy.java 16 ●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateMultiSymbolStrategy.java 8 ●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateShapeStrategy.java 8 ●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateSymbolStrategy.java 2 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateTextStrategy.java 8 ●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java 8 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DataReposVersionManager.java 5 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/GeoserverIntegrateConfigJob.java 54 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2PostGISJob.java 504 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleTransformColorOwnerJob.java 4 ●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FeatureTypeBuilderUtil.java 43 ●●●●● patch | view | raw | blame | history
xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/xgeosdataconfig.xml 10240 ●●●● patch | view | raw | blame | history
xdgnjobs/pom.xml
@@ -53,6 +53,30 @@
        </site>
      </distributionManagement>
    </profile>
    <!-- =========================================================== -->
    <!--     Build Configuration                                     -->
    <!--         copies all JARs in a single directory.              -->
    <!-- =========================================================== -->
    <profile>
      <id>collect</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.ximple.eofms.maven</groupId>
            <artifactId>ximple-jar-collector</artifactId>
            <version>${project.version}</version>
            <executions>
              <execution>
                <goals>
                  <goal>collect</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <scm>
xdgnjobs/ximple-build/maven/jar-collector/src/main/java/com/ximple/eofms/maven/JarCollector.java
@@ -136,7 +136,7 @@
                    scope.equalsIgnoreCase(Artifact.SCOPE_RUNTIME)))
                {
                    final File file = artifact.getFile();
                    if (!artifact.getGroupId().startsWith("org.geotools")) {
                    if (!artifact.getGroupId().startsWith("com.ximple.eofms")) {
                        final File copy = new File(collect, file.getName());
                        if (copy.exists()) {
                            /*
xdgnjobs/ximple-build/maven/pom.xml
@@ -56,7 +56,7 @@
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>2.0.1</version>
      <version>2.1</version>
    </dependency>
  </dependencies>
xdgnjobs/ximple-jobcarrier/src/main/resources/quartz_jobs.xml
@@ -25,9 +25,9 @@
      <group>DEFAULT</group>
      <description>A job that convert dgn to postgis</description>
      <!--job-class>com.ximple.eofms.jobs.OracleConvertDgn2PostGISJob</job-class-->
      <!--job-class>com.ximple.eofms.jobs.GeoserverIntegrateConfigJob</job-class-->
      <job-class>com.ximple.eofms.jobs.GeoserverIntegrateConfigJob</job-class>
      <!--job-class>com.ximple.eofms.jobs.OracleTransformColorOwnerJob</job-class-->
      <job-class>com.ximple.eofms.jobs.OracleTransformColorOwner2CSVJob</job-class>
      <!--job-class>com.ximple.eofms.jobs.OracleTransformColorOwner2CSVJob</job-class-->
      <!--volatility>false</volatility-->
      <durability>false</durability>
      <recover>false</recover>
@@ -35,15 +35,15 @@
      <job-data-map>
        <entry>
          <key>JOBDATA_DIR</key>
          <value>/Users/Shared/Public/Projects/XGeoDMMS/xjobrun/nstpcjobs/jobdata</value>
          <value>/Users/Shared/Public/Projects/XGeoDMMS/xjobrun/tctpcjobs/jobdata</value>
        </entry>
        <entry>
          <key>PGHOST</key>
          <value>10.10.1.9</value>
          <value>10.10.1.17</value>
        </entry>
        <entry>
          <key>PGDATBASE</key>
          <value>pgDMMS2</value>
          <value>pgDMMS</value>
        </entry>
        <entry>
          <key>PGPORT</key>
@@ -63,7 +63,7 @@
        </entry>
        <entry>
          <key>ORAHOST</key>
          <value>10.10.1.9</value>
          <value>10.10.1.17</value>
        </entry>
        <entry>
          <key>ORAINST</key>
@@ -99,6 +99,10 @@
          <value>false</value>
        </entry>
        <entry>
          <key>CONVERTPWTHEMES</key>
          <value>true</value>
        </entry>
        <entry>
          <key>CREATEDUMMY</key>
          <value>false</value>
        </entry>
@@ -132,7 +136,7 @@
        </entry>
        <entry>
          <key>GEOSERVER_URL</key>
          <value>http://10.10.1.9:8080/geoserver</value>
          <value>http://10.10.1.17:8080/geoserver</value>
        </entry>
        <entry>
          <key>GEOSERVER_USER</key>
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateArcLineStringStrategy.java
@@ -82,10 +82,8 @@
                    fLinkage.getOccID(),
                    (short) lineStringElement.getLevelIndex(),
                    colorTable.getColorCode(lineStringElement.getColorIndex()),
                    colorTable.getColorCode(lineStringElement.getColorIndex()),
                    (short) lineStringElement.getWeight(),
                    (short) lineStringElement.getLineStyle(),
                    -1
                    (short) lineStringElement.getLineStyle()
                }, null);
        }
        return feature;
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateComplexChainStrategy.java
@@ -82,10 +82,8 @@
                    fLinkage.getOccID(),
                    (short) lineStringElement.getLevelIndex(),
                    colorTable.getColorCode(lineStringElement.getColorIndex()),
                    colorTable.getColorCode(lineStringElement.getColorIndex()),
                    (short) lineStringElement.getWeight(),
                    (short) lineStringElement.getLineStyle(),
                    -1
                    (short) lineStringElement.getLineStyle()
                }, null);
        } else if (element instanceof ComplexChainElement) {
            ComplexChainElement complexChain = (ComplexChainElement) element;
@@ -109,10 +107,8 @@
                    fLinkage.getOccID(),
                    (short) complexChain.getLevelIndex(),
                    colorTable.getColorCode(complexChain.getColorIndex()),
                    colorTable.getColorCode(complexChain.getColorIndex()),
                    (short) complexChain.getWeight(),
                    (short) complexChain.getLineStyle(),
                    -1
                    (short) complexChain.getLineStyle()
                }, null);
        } else if (element instanceof LineElement) {
            LineElement lineElement = (LineElement) element;
@@ -137,10 +133,8 @@
                    fLinkage.getOccID(),
                    (short) lineElement.getLevelIndex(),
                    colorTable.getColorCode(lineElement.getColorIndex()),
                    colorTable.getColorCode(lineElement.getColorIndex()),
                    (short) lineElement.getWeight(),
                    (short) lineElement.getLineStyle(),
                    -1
                    (short) lineElement.getLineStyle()
                }, null);
            return feature;
        } else if (element instanceof ArcElement) {
@@ -166,10 +160,8 @@
                    fLinkage.getOccID(),
                    (short) arcElement.getLevelIndex(),
                    colorTable.getColorCode(arcElement.getColorIndex()),
                    colorTable.getColorCode(arcElement.getColorIndex()),
                    (short) arcElement.getWeight(),
                    (short) arcElement.getLineStyle(),
                    -1
                    (short) arcElement.getLineStyle()
                }, null);
        }
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateEllipseShapeStrategy.java
@@ -80,10 +80,8 @@
                    fLinkage.getOccID(),
                    (short) ellipseElement.getLevelIndex(),
                    colorTable.getColorCode(ellipseElement.getColorIndex()),
                    colorTable.getColorCode(ellipseElement.getColorIndex()),
                    (short) ellipseElement.getWeight(),
                    (short) ellipseElement.getLineStyle(),
                    -1
                    (short) ellipseElement.getLineStyle()
                }, null);
        }
        return feature;
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineStringStrategy.java
@@ -80,10 +80,8 @@
                    fLinkage.getOccID(),
                    (short) lineStringElement.getLevelIndex(),
                    colorTable.getColorCode(lineStringElement.getColorIndex()),
                    colorTable.getColorCode(lineStringElement.getColorIndex()),
                    (short) lineStringElement.getWeight(),
                    (short) lineStringElement.getLineStyle(),
                    -1
                    (short) lineStringElement.getLineStyle()
                }, null);
        } else if (element instanceof ComplexChainElement) {
            ComplexChainElement complexChain = (ComplexChainElement) element;
@@ -114,10 +112,8 @@
                    fLinkage.getOccID(),
                    (short) complexChain.getLevelIndex(),
                    colorTable.getColorCode(complexChain.getColorIndex()),
                    colorTable.getColorCode(complexChain.getColorIndex()),
                    (short) complexChain.getWeight(),
                    (short) complexChain.getLineStyle(),
                    -1
                    (short) complexChain.getLineStyle()
                }, null);
        } else if (element instanceof LineElement) {
            LineElement lineElement = (LineElement) element;
@@ -139,10 +135,8 @@
                    fLinkage.getOccID(),
                    (short) lineElement.getLevelIndex(),
                    colorTable.getColorCode(lineElement.getColorIndex()),
                    colorTable.getColorCode(lineElement.getColorIndex()),
                    (short) lineElement.getWeight(),
                    (short) lineElement.getLineStyle(),
                    -1
                    (short) lineElement.getLineStyle()
                }, null);
            return feature;
        } else if (element instanceof ArcElement) {
@@ -165,10 +159,8 @@
                    fLinkage.getOccID(),
                    (short) arcElement.getLevelIndex(),
                    colorTable.getColorCode(arcElement.getColorIndex()),
                    colorTable.getColorCode(arcElement.getColorIndex()),
                    (short) arcElement.getWeight(),
                    (short) arcElement.getLineStyle(),
                    -1
                    (short) arcElement.getLineStyle()
                }, null);
        }
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateLineTextStrategy.java
@@ -77,10 +77,8 @@
                    fLinkage.getOccID(),
                    (short) lineStringElement.getLevelIndex(),
                    colorTable.getColorCode(lineStringElement.getColorIndex()),
                    colorTable.getColorCode(lineStringElement.getColorIndex()),
                    (short) lineStringElement.getWeight(),
                    (short) lineStringElement.getLineStyle(),
                    -1
                    (short) lineStringElement.getLineStyle()
                }, null);
        } else if (element instanceof TextElement) {
            TextElement txtElement = (TextElement) element;
@@ -116,10 +114,8 @@
                fLinkage.getOccID(),
                (short) txtElement.getLevelIndex(),
                colorTable.getColorCode(txtElement.getColorIndex()),
                colorTable.getColorCode(txtElement.getColorIndex()),
                (short) txtElement.getWeight(),
                (short) txtElement.getLineStyle(),
                -1
                (short) txtElement.getLineStyle()
            }, null);
        } else if (element instanceof ComplexChainElement) {
            ComplexChainElement complexChain = (ComplexChainElement) element;
@@ -152,10 +148,8 @@
                    fLinkage.getOccID(),
                    (short) complexChain.getLevelIndex(),
                    colorTable.getColorCode(complexChain.getColorIndex()),
                    colorTable.getColorCode(complexChain.getColorIndex()),
                    (short) complexChain.getWeight(),
                    (short) complexChain.getLineStyle(),
                    -1
                    (short) complexChain.getLineStyle()
                }, null);
        } else if (element instanceof LineElement) {
            LineElement lineElement = (LineElement) element;
@@ -176,10 +170,8 @@
                fLinkage.getOccID(),
                (short) lineElement.getLevelIndex(),
                colorTable.getColorCode(lineElement.getColorIndex()),
                colorTable.getColorCode(lineElement.getColorIndex()),
                (short) lineElement.getWeight(),
                (short) lineElement.getLineStyle(),
                -1
                (short) lineElement.getLineStyle()
            }, null);
        }
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateMultiSymbolStrategy.java
@@ -99,15 +99,13 @@
                    fLinkage.getOccID(),
                    (short) txtElement.getLevelIndex(),
                    colorTable.getColorCode(txtElement.getColorIndex()),
                    colorTable.getColorCode(txtElement.getColorIndex()),
                    (short) txtElement.getWeight(),
                    (short) txtElement.getLineStyle(),
                    (short) txtElement.getJustification(),
                    (float) txtElement.getTextHeight(),
                    (float) txtElement.getTextWidth(),
                    (float) angle,
                    sb.toString(),
                    -1
                    sb.toString()
                }, null);
        } else if (element instanceof TextNodeElement) {
            TextNodeElement nodeElement = (TextNodeElement) element;
@@ -163,15 +161,13 @@
                                fLinkage.getOccID(),
                                (short) txtChildElement.getLevelIndex(),
                                colorTable.getColorCode(nodeElement.getColorIndex()),
                                colorTable.getColorCode(nodeElement.getColorIndex()),
                                (short) txtChildElement.getWeight(),
                                (short) txtChildElement.getLineStyle(),
                                (short) txtChildElement.getJustification(),
                                (float) txtChildElement.getTextHeight(),
                                (float) txtChildElement.getTextWidth(),
                                (float) angle,
                                sb.toString(),
                                -1
                                sb.toString()
                            }, null);
                    }
                } else {
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateShapeStrategy.java
@@ -79,10 +79,8 @@
                    fLinkage.getOccID(),
                    (short) shapeElement.getLevelIndex(),
                    colorTable.getColorCode(shapeElement.getColorIndex()),
                    colorTable.getColorCode(shapeElement.getColorIndex()),
                    (short) shapeElement.getWeight(),
                    (short) shapeElement.getLineStyle(),
                    -1
                    (short) shapeElement.getLineStyle()
                }, null);
        } else if (element instanceof ComplexShapeElement) {
            ComplexShapeElement complexShape = (ComplexShapeElement) element;
@@ -104,10 +102,8 @@
                    fLinkage.getOccID(),
                    (short) complexShape.getLevelIndex(),
                    colorTable.getColorCode(complexShape.getColorIndex()),
                    colorTable.getColorCode(complexShape.getColorIndex()),
                    (short) complexShape.getWeight(),
                    (short) complexShape.getLineStyle(),
                    -1
                    (short) complexShape.getLineStyle()
                }, null);
        }
        return feature;
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateSymbolStrategy.java
@@ -112,7 +112,6 @@
                    fLinkage.getOccID(),
                    (short) txtElement.getLevelIndex(),
                    colorTable.getColorCode(txtElement.getColorIndex()),
                    colorTable.getColorCode(txtElement.getColorIndex()),
                    (short) txtElement.getWeight(),
                    (short) txtElement.getLineStyle(),
                    (short) txtElement.getJustification(),
@@ -120,7 +119,6 @@
                    (float) txtElement.getTextWidth(),
                    (float) angle,
                    sb.toString(),
                    -1,
                    geomOrigin
                }, null);
        } else {
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/filter/CreateTextStrategy.java
@@ -84,15 +84,13 @@
                    fLinkage.getOccID(),
                    (short) txtElement.getLevelIndex(),
                    colorTable.getColorCode(txtElement.getColorIndex()),
                    colorTable.getColorCode(txtElement.getColorIndex()),
                    (short) txtElement.getWeight(),
                    (short) txtElement.getLineStyle(),
                    (short) txtElement.getJustification(),
                    (float) txtElement.getTextHeight(),
                    (float) txtElement.getTextWidth(),
                    (float) angle,
                    content,
                    -1
                    content
                }, null);
        } else if (element instanceof TextNodeElement) {
            TextNodeElement nodeElement = (TextNodeElement) element;
@@ -125,15 +123,13 @@
                    fLinkage.getOccID(),
                    (short) nodeElement.getLevelIndex(),
                    colorTable.getColorCode(nodeElement.getColorIndex()),
                    colorTable.getColorCode(nodeElement.getColorIndex()),
                    (short) nodeElement.getWeight(),
                    (short) nodeElement.getLineStyle(),
                    (short) nodeElement.getJustification(),
                    (float) nodeElement.getTextNodeHeight(),
                    (float) nodeElement.getTextNodeLength(),
                    (float) angle,
                    sb.toString(),
                    -1
                    sb.toString()
                }, null);
        }
        return feature;
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/AbstractOracleDatabaseJob.java
@@ -44,6 +44,7 @@
    private static final String CONVERTDB = "CONVERTDB";
    private static final String CONVERTFILE = "CONVERTFILE";
    private static final String CONVERTELEMIN = "CONVERTELEMIN";
    private static final String CONVERTPWTHEMES = "CONVERTPWTHEMES";
    private static final String CREATEDUMMY = "CREATEDUMMY";
    private static final String ELEMLOG = "ELEMLOG";
    private static final String ORAHOST = "ORAHOST";
@@ -70,6 +71,7 @@
    protected String _convertDB;
    protected String _convertFile;
    protected String _convertElementIn;
    protected String _convertPWThemes;
    protected String _elementLogging;
    protected String _createDummy;
    protected ArrayList<String> _orgSchema = new ArrayList<String>();
@@ -115,6 +117,7 @@
        _convertDB = dataMap.getString(CONVERTDB);
        _convertFile = dataMap.getString(CONVERTFILE);
        _convertElementIn = dataMap.getString(CONVERTELEMIN);
        _convertPWThemes = dataMap.getString(CONVERTPWTHEMES);
        _elementLogging = dataMap.getString(ELEMLOG);
        _createDummy = dataMap.getString(CREATEDUMMY);
@@ -319,6 +322,11 @@
            !_convertElementIn.equalsIgnoreCase("no") && !_convertElementIn.equalsIgnoreCase("0");
    }
    public boolean checkConvertPWThemes() {
        return _convertPWThemes != null && !_convertPWThemes.equalsIgnoreCase("false") &&
            !_convertPWThemes.equalsIgnoreCase("no") && !_convertPWThemes.equalsIgnoreCase("0");
    }
    public String getElementLogging() {
        return _elementLogging;
    }
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/DataReposVersionManager.java
@@ -6,6 +6,11 @@
        "gisrepo1", "gisrepo2"
    };
    public static final String XPTVERSIONTABLE_NAME = "xpwthemes_vsversion";
    public static final String[] DEFAULTXPTVERSIONTABLE_NAMES = new String[]{
        "xpwtheme1", "xpwtheme2"
    };
    public static final short VSSTATUS_AVAILABLE = 0x0000;
    public static final short VSSTATUS_USING = 0x0100;
    public static final short VSSTATUS_CONFIG = 0x0020;
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/GeoserverIntegrateConfigJob.java
@@ -469,6 +469,59 @@
        }
    }
    private void updateCurrentThemeStatus(Connection connection, String schemaName, short newStatus)
            throws SQLException {
        StringBuilder sbSQL = new StringBuilder("UPDATE ");
        sbSQL.append(DataReposVersionManager.XPTVERSIONTABLE_NAME).append(' ');
        sbSQL.append(" SET vptstatus = ");
        sbSQL.append(newStatus);
        sbSQL.append(", vpttimestamp = CURRENT_TIMESTAMP WHERE vptname = '");
        sbSQL.append(schemaName).append("'");
        Statement stmt = null;
        try {
            stmt = connection.createStatement();
            stmt.executeUpdate(sbSQL.toString());
        } finally {
            if (stmt != null) stmt.close();
        }
    }
    private boolean checkCurrentThemeStatus(Connection connection, short status) {
        try {
            return (retrieveCurrentThemeName(connection, status) != null);
        } catch (SQLException e) {
            logger.warn(e.getMessage(), e);
            return false;
        }
    }
    private String retrieveCurrentThemeName(Connection connection, short status) throws SQLException {
        StringBuilder sbSQL = new StringBuilder("SELECT ");
        sbSQL.append("vptname, vptstatus, vpttimestamp FROM ");
        sbSQL.append(encodeSchemaTableName(_pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME)).append(' ');
        sbSQL.append("ORDER BY vptid");
        String result = null;
        Statement stmt = null;
        ResultSet rs = null;
        try {
            stmt = connection.createStatement();
            rs = stmt.executeQuery(sbSQL.toString());
            // get first result
            if (rs.next()) {
                result = rs.getString(1);
            }
            return result;
        } finally {
            JDBCUtils.close(rs);
            JDBCUtils.close(stmt);
        }
    }
    protected void transferXGeosVersionStatus(Connection connection,
                                       short vsstatusBefore, short vsstatusAfter, boolean exclusive) throws JobExecutionException {
@@ -1019,5 +1072,4 @@
            }
        }
    }
}
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleConvertDgn2PostGISJob.java
@@ -6,12 +6,15 @@
import java.io.FileNotFoundException;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.PushbackReader;
import java.io.StringReader;
import java.math.BigDecimal;
import java.nio.BufferOverflowException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.FileChannel;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
@@ -22,6 +25,7 @@
import java.util.Map;
import java.util.TreeMap;
import com.ximple.eofms.util.DefaultColorTable;
import org.apache.commons.collections.OrderedMap;
import org.apache.commons.collections.OrderedMapIterator;
import org.apache.commons.collections.map.LinkedMap;
@@ -34,6 +38,8 @@
import org.geotools.feature.SchemaException;
import org.geotools.jdbc.JDBCDataStore;
import org.opengis.feature.IllegalAttributeException;
import org.postgresql.PGConnection;
import org.postgresql.copy.CopyManager;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
@@ -79,6 +85,15 @@
    private static final int COMMITSIZE = 100;
    private static final String INDEXPATHNAME = "index";
    private static final String OTHERPATHNAME = "other";
    private static String FETCH_CONNFDR = "SELECT FSC, UFID, FDR1 FROM BASEDB.CONNECTIVITY ORDER BY FSC";
    private static String FETCH_COLORTAB = "SELECT TAG_SFSC, TAG_LUFID, COLOR FROM OCSDB.COLOR ORDER BY TAG_SFSC";
    private static String CREATE_OWNERTABLE = "CREATE TABLE s (tid smallint not null, oid int not null, owner smallint not null)";
    private static String CREATE_COLORTABLE = "CREATE TABLE s (tid smallint not null, oid int not null, dyncolor varchar(10) not null)";
    public static final String FDYNCOLOR_SUFFIX = "_fdyncolor";
    public static final String FOWNER_SUFFIX = "_fowner";
    protected static class Pair {
        Object first;
@@ -209,11 +224,12 @@
        }
        long t1 = System.currentTimeMillis();
        String targetSchemaName;
        String targetSchemaName, targetThemeTable;
        try {
            logger.info("-- step:clearOutputDatabase --");
            clearOutputDatabase();
            targetSchemaName = determineTargetSchemaName();
            targetThemeTable = determineTargetThemeTableName();
            if (checkConvertFile()) {
                logger.info("-- step:convertIndexDesignFile --");
@@ -234,11 +250,11 @@
            }
            OracleConvertPostGISJobContext jobContext = null;
            if (checkConvertDB()) {
                logger.info("-- step:convertOracleDB --");
                OracleConvertPostGISJobContext jobContext =
                    (OracleConvertPostGISJobContext) prepareJobContext(targetSchemaName, _filterPath,
                jobContext = (OracleConvertPostGISJobContext) prepareJobContext(targetSchemaName, _filterPath,
                        isProfileMode(), isTransformed());
                jobContext.setSourceDataStore(getSourceDataStore());
                // jobContext.setConvertElementIn(_convertElementIn);
@@ -317,12 +333,32 @@
                createDummyFeatureFile(context);
            }
            updateRepoStatusToReady(targetSchemaName);
            if (checkConvertPWThemes()) {
                long tStep = System.currentTimeMillis();
                if (!convertPowerOwnerThemeWithCopyAPI(jobContext, targetThemeTable)) {
                    convertPowerOwnerTheme(jobContext, targetThemeTable);
                }
                if (isProfileMode()) {
                    long tStepEnd = System.currentTimeMillis();
                    logTimeDiff("Profile-convertFeatureDesignFile", tStep, tStepEnd);
                }
                tStep = System.currentTimeMillis();
                if (!convertDynamicColorThemeWithCopyAPI(jobContext, targetThemeTable))
                    convertDynamicColorTheme(jobContext, targetThemeTable);
                if (isProfileMode()) {
                    long tStepEnd = System.currentTimeMillis();
                    logTimeDiff("Profile-convertFeatureDesignFile", tStep, tStepEnd);
                }
            }
            updatePWThemeStatusToReady(targetThemeTable);
            long t2 = System.currentTimeMillis();
            // public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss";
            // SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
            logTimeDiff("Total ", t1, t2);
            updateRepoStatusToReady(targetSchemaName);
        } catch (SQLException e) {
            disconnect();
@@ -1174,12 +1210,12 @@
        boolean needCreate = false;
        try {
            connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT);
            // Create XGVERSIONTABLE_NAME
            rs = connection.getMetaData().getTables(null, _pgSchema, DataReposVersionManager.XGVERSIONTABLE_NAME, new String[]{"TABLE"});
            if (!rs.next()) needCreate = true;
            if (needCreate)
                createXGeosVersionTable(connection, _pgSchema);
            rs.close();
            rs = null;
            StringBuilder sbSQL = new StringBuilder("SELECT ");
            sbSQL.append("vsschema, vsstatus FROM ");
@@ -1233,6 +1269,77 @@
        return targetSchema;
    }
    private String determineTargetThemeTableName() throws IOException {
        if (targetDataStore == null) return null;
        Connection connection = null;
        Statement stmt = null;
        ResultSet rs = null;
        String targetTable = null;
        boolean needCreate = false;
        try {
            connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT);
            // Create XPTVERSIONTABLE_NAME
            needCreate = false;
            rs = connection.getMetaData().getTables(null, _pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME, new String[]{"TABLE"});
            if (!rs.next()) needCreate = true;
            if (needCreate)
                createXPWThemeVersionTable(connection, _pgSchema);
            rs.close();
            rs = null;
            StringBuilder sbSQL = new StringBuilder("SELECT ");
            sbSQL.append("vptname, vptstatus FROM ");
            sbSQL.append(encodeSchemaTableName(_pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME)).append(' ');
            sbSQL.append("ORDER BY vptid");
            stmt = connection.createStatement();
            rs = stmt.executeQuery(sbSQL.toString());
            ArrayList<Object[]> tmpTablenames = new ArrayList<Object[]>();
            int i = 0;
            int current = -1;
            while (rs.next()) {
                Object[] values = new Object[2];
                values[0] = rs.getString("vptname");
                values[1] = rs.getShort("vptstatus");
                tmpTablenames.add(values);
                if ((((Short) values[1]) & DataReposVersionManager.VSSTATUS_USING) != 0) {
                    current = i;
                }
                i++;
            }
            if (current == -1) {
                Object[] values = tmpTablenames.get(0);
                targetTable = (String) values[0];
            } else if (current < (tmpTablenames.size() - 1)) {
                Object[] values = tmpTablenames.get(current + 1);
                targetTable = (String) values[0];
            } else {
                Object[] values = tmpTablenames.get(0);
                targetTable = (String) values[0];
            }
            sbSQL = new StringBuilder("UPDATE ");
            sbSQL.append(encodeSchemaTableName(_pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME)).append(' ');
            sbSQL.append(" SET vptstatus = ");
            sbSQL.append(DataReposVersionManager.VSSTATUS_COVERT);
            sbSQL.append(" WHERE vptname = '");
            sbSQL.append(targetTable).append("'");
            int count = stmt.executeUpdate(sbSQL.toString());
            if (count != 1) {
                logger.info("update status for " + targetTable + " update result count="
                    + count);
            }
        } catch (SQLException e) {
            logger.warn(e.getMessage(), e);
        } finally {
            JDBCUtils.close(rs);
            JDBCUtils.close(stmt);
            JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null);
        }
        return targetTable;
    }
    public String encodeSchemaTableName(String schemaName, String tableName) {
        return "\"" + schemaName + "\".\"" + tableName + "\"";
    }
@@ -1275,6 +1382,42 @@
        }
    }
    private void createXPWThemeVersionTable(Connection connection, String pgSchema) throws SQLException {
        Statement stmt = null;
        StringBuilder sql = new StringBuilder("CREATE TABLE ");
        sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME));
        sql.append(" ( vptid serial PRIMARY KEY, ");
        sql.append(" vptname character varying(64) NOT NULL, ");
        sql.append(" vptstatus smallint NOT NULL, ");
        sql.append(" vpttimestamp timestamp with time zone ) ");
        try {
            stmt = connection.createStatement();
            stmt.executeUpdate(sql.toString());
            sql = new StringBuilder("ALTER TABLE ");
            sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME));
            sql.append(" OWNER TO ").append(_pgUsername);
            stmt.executeUpdate(sql.toString());
            sql = new StringBuilder("GRANT ALL ON TABLE ");
            sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME));
            sql.append(" TO public");
            stmt.executeUpdate(sql.toString());
            for (String schemaName : DataReposVersionManager.DEFAULTXPTVERSIONTABLE_NAMES) {
                sql = new StringBuilder("INSERT INTO ");
                sql.append(encodeSchemaTableName(pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME));
                sql.append(" (vptname, vptstatus) VALUES ('");
                sql.append(schemaName).append("', ");
                sql.append(DataReposVersionManager.VSSTATUS_AVAILABLE).append(" )");
                stmt.executeUpdate(sql.toString());
            }
        } finally {
            if (stmt != null) stmt.close();
        }
    }
    private void updateRepoStatusToReady(String targetSchema) {
        if (targetDataStore == null) return;
        Connection connection = null;
@@ -1287,6 +1430,38 @@
            sbSQL.append(" SET vsstatus = ");
            sbSQL.append(DataReposVersionManager.VSSTATUS_READY);
            sbSQL.append(" , vstimestamp = CURRENT_TIMESTAMP WHERE vsschema = '");
            sbSQL.append(targetSchema).append("'");
            connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT);
            stmt = connection.createStatement();
            int count = stmt.executeUpdate(sbSQL.toString());
            if (count != 1) {
                logger.info("update status for " + targetSchema + " update result count="
                    + count);
            }
        } catch (SQLException e) {
            logger.warn(e.getMessage(), e);
        } catch (IOException e) {
            logger.warn(e.getMessage(), e);
        } finally {
            JDBCUtils.close(rs);
            JDBCUtils.close(stmt);
            JDBCUtils.close(connection, Transaction.AUTO_COMMIT, null);
        }
    }
    private void updatePWThemeStatusToReady(String targetSchema) {
        if (targetDataStore == null) return;
        Connection connection = null;
        Statement stmt = null;
        ResultSet rs = null;
        boolean needCreate = false;
        try {
            StringBuilder sbSQL = new StringBuilder("UPDATE ");
            sbSQL.append(encodeSchemaTableName(_pgSchema, DataReposVersionManager.XPTVERSIONTABLE_NAME)).append(' ');
            sbSQL.append(" SET vptstatus = ");
            sbSQL.append(DataReposVersionManager.VSSTATUS_READY);
            sbSQL.append(" , vstimestamp = CURRENT_TIMESTAMP WHERE vptname = '");
            sbSQL.append(targetSchema).append("'");
            connection = targetDataStore.getConnection(Transaction.AUTO_COMMIT);
@@ -1352,4 +1527,321 @@
    public final void resetQueryTime() {
        queryTime = 0;
    }
    private void convertDynamicColorTheme(AbstractOracleJobContext context, String targetTableBaseName) throws IOException {
        if (context == null) {
            getLogger().info("jobContext is null in convertDynamicColorTheme");
            return;
        }
        Connection connection = context.getOracleConnection();
        Connection connectionPG = targetDataStore.getConnection(Transaction.AUTO_COMMIT);
        boolean found = false;
        ResultSet rs = null;
        Statement stmt = null;
        PreparedStatement pstmt = null;
        try {
            DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance();
            String targetTableName = targetTableBaseName + FDYNCOLOR_SUFFIX;
            logger.info("target table:" + targetTableName);
            stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            rs = stmt.executeQuery(FETCH_COLORTAB);
            rs.setFetchSize(50);
            createOrClearTargetTable(connectionPG, targetTableName,
                "(tid smallint not null, oid int not null, dyncolor varchar(10) not null)");
            pstmt = connectionPG.prepareStatement("INSERT INTO " +
                encodeSchemaTableName(_pgSchema, targetTableName) +
                " (tid, oid, dyncolor) VALUES (?, ?, ?)" );
            final int MAX_BATCHSIZE = 50;
            int count = 0;
            while (rs.next()) {
                int cid = rs.getInt(1);
                long oid = rs.getLong(2);
                int colorId = rs.getInt(3);
                String colorText = colorTable.getColorCode(colorId);
                pstmt.setShort(1, (short) cid);
                pstmt.setInt(2, (int) oid);
                pstmt.setString(3, colorText);
                pstmt.addBatch();
                if (count % MAX_BATCHSIZE == 0) {
                    pstmt.executeBatch();
                }
                ++count;
            }
            pstmt.executeBatch();
            createTargetTableIndex(connectionPG, targetTableName);
            logger.info("Execute Update Count=" + count);
        } catch (SQLException e) {
            logger.info(e.getMessage(), e);
            throw new IOException(e.getMessage(), e);
        } finally {
            JDBCUtils.close(rs);
            JDBCUtils.close(stmt);
            JDBCUtils.close(pstmt);
            JDBCUtils.close(connectionPG, Transaction.AUTO_COMMIT, null);
        }
    }
    private void convertPowerOwnerTheme(AbstractOracleJobContext context, String targetTableBaseName) throws IOException {
        if (context == null) {
            getLogger().info("jobContext is null in convertPowerOwnerTheme");
            return;
        }
        Connection connection = context.getOracleConnection();
        Connection connectionPG = targetDataStore.getConnection(Transaction.AUTO_COMMIT);
        boolean found = false;
        ResultSet rs = null;
        Statement stmt = null;
        PreparedStatement pstmt = null;
        try {
            connectionPG.setAutoCommit(false);
            String targetTableName = targetTableBaseName + FOWNER_SUFFIX;
            logger.info("target table:" + targetTableName);
            stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            rs = stmt.executeQuery(FETCH_CONNFDR);
            rs.setFetchSize(50);
            createOrClearTargetTable(connectionPG, targetTableName,
                "(tid smallint not null, oid int not null, fowner smallint not null)");
            pstmt = connectionPG.prepareStatement("INSERT INTO " +
                encodeSchemaTableName(_pgSchema, targetTableName) +
                " (tid, oid, fowner) VALUES (?, ?, ?)" );
            final int MAX_BATCHSIZE = 50;
            int count = 0;
            while (rs.next()) {
                int cid = rs.getInt(1);
                long oid = rs.getLong(2);
                int ownerId = rs.getInt(3);
                pstmt.setShort(1, (short) cid);
                pstmt.setInt(2, (int) oid);
                pstmt.setShort(3, (short) ownerId);
                pstmt.addBatch();
                if (count % MAX_BATCHSIZE == 0) {
                    pstmt.executeBatch();
                }
                ++count;
            }
            pstmt.executeBatch();
            createTargetTableIndex(connectionPG, targetTableName);
            logger.info("Execute Update Count=" + count);
        } catch (SQLException e) {
            logger.info(e.getMessage(), e);
            throw new IOException(e.getMessage(), e);
        } finally {
            JDBCUtils.close(rs);
            JDBCUtils.close(stmt);
            JDBCUtils.close(pstmt);
            JDBCUtils.close(connectionPG, Transaction.AUTO_COMMIT, null);
        }
    }
    private void createOrClearTargetTable(Connection connection, String tableName, String sql) throws SQLException {
        Statement stmt = connection.createStatement();
        ResultSet rs = null;
        try {
            rs = connection.getMetaData().getTables(null, _pgSchema, tableName, new String[]{"TABLE"});
            if (rs.next()) {
                stmt.execute("DROP TABLE " + encodeSchemaTableName(_pgSchema, tableName) + "CASCADE");
            }
            stmt.executeUpdate("CREATE TABLE " + encodeSchemaTableName(_pgSchema, tableName) + " " + sql);
        } finally {
            JDBCUtils.close(rs);
            JDBCUtils.close(stmt);
        }
    }
    private void createTargetTableIndex(Connection connection, String tableName) throws SQLException {
        Statement stmt = connection.createStatement();
        ResultSet rs = null;
        try {
            rs = connection.getMetaData().getTables(null, _pgSchema, tableName, new String[]{"TABLE"});
            if (rs.next()) {
                stmt.execute("ALTER TABLE " + encodeSchemaTableName(_pgSchema, tableName) +
                    " ADD PRIMARY KEY (tid, oid)");
            }
        } finally {
            JDBCUtils.close(rs);
            JDBCUtils.close(stmt);
        }
    }
    private boolean convertDynamicColorThemeWithCopyAPI(AbstractOracleJobContext context, String targetTableBaseName)
        throws IOException {
        if (context == null) {
            getLogger().info("jobContext is null in convertDynamicColorThemeWithCopyAPI");
            return false;
        }
        Connection connection = context.getOracleConnection();
        Connection connectionPG = targetDataStore.getConnection(Transaction.AUTO_COMMIT);
        if (!(connectionPG instanceof PGConnection)) {
            return false;
        }
        ResultSet rs = null;
        Statement stmt = null;
        try {
            DefaultColorTable colorTable = (DefaultColorTable) DefaultColorTable.getInstance();
            String targetTableName = targetTableBaseName + FDYNCOLOR_SUFFIX;
            String targetTempName = "tmp_" + targetTableName;
            logger.info("target table:" + targetTableName);
            stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            rs = stmt.executeQuery(FETCH_COLORTAB);
            rs.setFetchSize(50);
            createOrClearTempTargetTable(connectionPG, targetTempName,
                "(tid smallint not null, oid int not null, dyncolor varchar(10) not null)");
            StringBuilder sb = new StringBuilder();
            CopyManager cpMgr = ((PGConnection) connectionPG).getCopyAPI();
            PushbackReader reader = new PushbackReader(new StringReader(""), 4096);
            final int MAX_BATCHSIZE = 50;
            int count = 0;
            while (rs.next()) {
                int cid = rs.getInt(1);
                long oid = rs.getLong(2);
                int colorId = rs.getInt(3);
                String colorText = colorTable.getColorCode(colorId);
                sb.append(cid).append(',');
                sb.append(oid).append(",'");
                sb.append(colorText).append("'\n");
                if (count % MAX_BATCHSIZE == 0) {
                    reader.unread(sb.toString().toCharArray());
                    cpMgr.copyIn("COPY " + targetTempName + " FROM STDIN WITH CSV", reader);
                    sb.delete(0, sb.length());
                }
                ++count;
            }
            reader.unread(sb.toString().toCharArray());
            cpMgr.copyIn("COPY " + targetTempName + " FROM STDIN WITH CSV", reader);
            createTargetTableIndexAndDropTemp(connectionPG, targetTableName, targetTempName);
            logger.info("Execute Copy Count=" + count);
        } catch (SQLException e) {
            logger.info(e.getMessage(), e);
            throw new IOException(e.getMessage(), e);
        } finally {
            JDBCUtils.close(rs);
            JDBCUtils.close(stmt);
            JDBCUtils.close(connectionPG, Transaction.AUTO_COMMIT, null);
        }
        return true;
    }
    private boolean convertPowerOwnerThemeWithCopyAPI(AbstractOracleJobContext context, String targetTableBaseName)
        throws IOException {
        if (context == null) {
            getLogger().info("jobContext is null in convertPowerOwnerThemeWithCopyAPI");
            return false;
        }
        Connection connection = context.getOracleConnection();
        Connection connectionPG = targetDataStore.getConnection(Transaction.AUTO_COMMIT);
        boolean found = false;
        ResultSet rs = null;
        Statement stmt = null;
        try {
            connectionPG.setAutoCommit(false);
            String targetTableName = targetTableBaseName + FOWNER_SUFFIX;
            String targetTempName = "tmp_" + targetTableName;
            logger.info("target table:" + targetTableName);
            stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
            rs = stmt.executeQuery(FETCH_CONNFDR);
            rs.setFetchSize(50);
            createOrClearTempTargetTable(connectionPG, targetTempName,
                "(tid smallint not null, oid int not null, fowner smallint not null)");
            StringBuilder sb = new StringBuilder();
            CopyManager cpMgr = ((PGConnection) connectionPG).getCopyAPI();
            PushbackReader reader = new PushbackReader(new StringReader(""), 4096);
            final int MAX_BATCHSIZE = 50;
            int count = 0;
            while (rs.next()) {
                int cid = rs.getInt(1);
                long oid = rs.getLong(2);
                int ownerId = rs.getInt(3);
                sb.append(cid).append(',');
                sb.append(oid).append(',');
                sb.append(ownerId).append('\n');
                if (count % MAX_BATCHSIZE == 0) {
                    reader.unread(sb.toString().toCharArray());
                    cpMgr.copyIn("COPY " + targetTempName + " FROM STDIN WITH CSV", reader);
                    sb.delete(0, sb.length());
                }
                ++count;
            }
            reader.unread(sb.toString().toCharArray());
            cpMgr.copyIn("COPY " + targetTempName + " FROM STDIN WITH CSV", reader);
            createTargetTableIndexAndDropTemp(connectionPG, targetTableName, targetTempName);
            logger.info("Execute Copy Count=" + count);
        } catch (SQLException e) {
            logger.info(e.getMessage(), e);
            throw new IOException(e.getMessage(), e);
        } finally {
            JDBCUtils.close(rs);
            JDBCUtils.close(stmt);
            JDBCUtils.close(connectionPG, Transaction.AUTO_COMMIT, null);
        }
        return true;
    }
    private void createOrClearTempTargetTable(Connection connection, String tableName, String sql) throws SQLException {
        Statement stmt = connection.createStatement();
        ResultSet rs = null;
        try {
            rs = connection.getMetaData().getTables(null, _pgSchema, tableName, new String[]{"TABLE"});
            if (rs.next()) {
                stmt.execute("DROP TABLE " + encodeSchemaTableName(_pgSchema, tableName) + "CASCADE");
            }
            stmt.executeUpdate("CREATE TEMP TABLE " + encodeSchemaTableName(_pgSchema, tableName) + " " + sql);
        } finally {
            JDBCUtils.close(rs);
            JDBCUtils.close(stmt);
        }
    }
    private void createTargetTableIndexAndDropTemp(Connection connection, String tableName, String tempTable) throws SQLException {
        Statement stmt = connection.createStatement();
        ResultSet rs = null;
        try {
            stmt.execute("CREATE TABLE " + tableName +" AS SELECT * FROM " + tempTable);
            rs = connection.getMetaData().getTables(null, _pgSchema, tableName, new String[]{"TABLE"});
            if (rs.next()) {
                stmt.execute("ALTER TABLE " + encodeSchemaTableName(_pgSchema, tableName) +
                    " ADD PRIMARY KEY (tid, oid)");
            }
            stmt.execute("DROP TABLE " + tempTable);
        } finally {
            JDBCUtils.close(rs);
            JDBCUtils.close(stmt);
        }
    }
}
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/jobs/OracleTransformColorOwnerJob.java
@@ -26,6 +26,10 @@
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
/**
 *
 */
@Deprecated
public class OracleTransformColorOwnerJob extends AbstractOracleDatabaseJob {
    final static Log logger = LogFactory.getLog(OracleTransformColorOwnerJob.class);
xdgnjobs/ximple-spatialjob/src/main/java/com/ximple/eofms/util/FeatureTypeBuilderUtil.java
@@ -102,9 +102,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "geom", createGeometryType(attrBuilder, "PointType", Point.class, false, lookupCRS(defaultSRID))));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
        */
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
@@ -126,9 +128,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "context", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 254, "")));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1)));
        */
        typeBuilder.addAll(attrDescs);
        return typeBuilder;
    }
@@ -144,9 +148,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "geom", createGeometryType(attrBuilder, "LineType", LineString.class, true, lookupCRS(defaultSRID))));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
        */
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
@@ -156,9 +162,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1)));
        */
        typeBuilder.addAll(attrDescs);
        return typeBuilder;
@@ -175,9 +183,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "geom", createGeometryType(attrBuilder, "MultiLineStringType", MultiLineString.class, true, lookupCRS(defaultSRID))));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
        */
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
@@ -187,9 +197,12 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1)));
        */
        typeBuilder.addAll(attrDescs);
        return typeBuilder;
    }
@@ -205,9 +218,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "geom", createGeometryType(attrBuilder, "PolygonType", Polygon.class, true, lookupCRS(defaultSRID))));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
        */
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
@@ -217,9 +232,12 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1)));
        */
        typeBuilder.addAll(attrDescs);
        return typeBuilder;
    }
@@ -341,9 +359,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "level", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
        */
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
@@ -368,9 +388,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "context", createAttributeType(attrBuilder, "StringType", String.class, allowNull, 254, "")));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1)));
        */
        typeBuilder.addAll(attrDescs);
        return typeBuilder;
@@ -405,9 +427,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "level", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
        */
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
@@ -432,9 +456,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symbol", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 20)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1)));
        */
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "origin", createGeometryType(attrBuilder, "PointType", Point.class, notAllowNull, lookupCRS(defaultSRID))));
@@ -472,9 +498,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "level", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
        */
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
@@ -484,9 +512,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1)));
        */
        typeBuilder.addAll(attrDescs);
        return typeBuilder;
@@ -521,9 +551,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "level", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
        */
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
@@ -533,10 +565,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1)));
        */
        typeBuilder.addAll(attrDescs);
        return typeBuilder;
    }
@@ -570,9 +603,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "level", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
        */
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
@@ -582,9 +617,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symstyle", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull, 1, (short) 0)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1)));
        */
        typeBuilder.addAll(attrDescs);
        return typeBuilder;
@@ -627,9 +664,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "level", createAttributeType(attrBuilder, "ShortType", Short.class, notAllowNull)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "dyncolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
        */
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symcolor", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 12, "")));
@@ -654,9 +693,11 @@
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "symbol", createAttributeType(attrBuilder, "StringType", String.class, notAllowNull, 20)));
        /*
        attrBuilder = new AttributeTypeBuilder();
        attrDescs.add(attrBuilder.buildDescriptor(
                "fowner", createAttributeType(attrBuilder, "IntegerType", Integer.class, allowNull, 1, -1)));
        */
        typeBuilder.addAll(attrDescs);
        return typeBuilder;
xdgnjobs/ximple-spatialjob/src/main/resources/com/ximple/eofms/geoserver/config/xgeosdataconfig.xml
Diff too large