| | |
| | | </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> |
| | |
| | | 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()) { |
| | | /* |
| | |
| | | <dependency> |
| | | <groupId>org.codehaus.plexus</groupId> |
| | | <artifactId>plexus-utils</artifactId> |
| | | <version>2.0.1</version> |
| | | <version>2.1</version> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | </entry> |
| | | <entry> |
| | | <key>ORAHOST</key> |
| | | <value>10.10.1.9</value> |
| | | <value>10.10.1.17</value> |
| | | </entry> |
| | | <entry> |
| | | <key>ORAINST</key> |
| | |
| | | <value>false</value> |
| | | </entry> |
| | | <entry> |
| | | <key>CONVERTPWTHEMES</key> |
| | | <value>true</value> |
| | | </entry> |
| | | <entry> |
| | | <key>CREATEDUMMY</key> |
| | | <value>false</value> |
| | | </entry> |
| | |
| | | </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> |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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) { |
| | |
| | | fLinkage.getOccID(), |
| | | (short) arcElement.getLevelIndex(), |
| | | colorTable.getColorCode(arcElement.getColorIndex()), |
| | | colorTable.getColorCode(arcElement.getColorIndex()), |
| | | (short) arcElement.getWeight(), |
| | | (short) arcElement.getLineStyle(), |
| | | -1 |
| | | (short) arcElement.getLineStyle() |
| | | }, null); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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) { |
| | |
| | | fLinkage.getOccID(), |
| | | (short) arcElement.getLevelIndex(), |
| | | colorTable.getColorCode(arcElement.getColorIndex()), |
| | | colorTable.getColorCode(arcElement.getColorIndex()), |
| | | (short) arcElement.getWeight(), |
| | | (short) arcElement.getLineStyle(), |
| | | -1 |
| | | (short) arcElement.getLineStyle() |
| | | }, null); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | fLinkage.getOccID(), |
| | | (short) lineElement.getLevelIndex(), |
| | | colorTable.getColorCode(lineElement.getColorIndex()), |
| | | colorTable.getColorCode(lineElement.getColorIndex()), |
| | | (short) lineElement.getWeight(), |
| | | (short) lineElement.getLineStyle(), |
| | | -1 |
| | | (short) lineElement.getLineStyle() |
| | | }, null); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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 { |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | fLinkage.getOccID(), |
| | | (short) txtElement.getLevelIndex(), |
| | | colorTable.getColorCode(txtElement.getColorIndex()), |
| | | colorTable.getColorCode(txtElement.getColorIndex()), |
| | | (short) txtElement.getWeight(), |
| | | (short) txtElement.getLineStyle(), |
| | | (short) txtElement.getJustification(), |
| | |
| | | (float) txtElement.getTextWidth(), |
| | | (float) angle, |
| | | sb.toString(), |
| | | -1, |
| | | geomOrigin |
| | | }, null); |
| | | } else { |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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"; |
| | |
| | | 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>(); |
| | |
| | | _convertDB = dataMap.getString(CONVERTDB); |
| | | _convertFile = dataMap.getString(CONVERTFILE); |
| | | _convertElementIn = dataMap.getString(CONVERTELEMIN); |
| | | _convertPWThemes = dataMap.getString(CONVERTPWTHEMES); |
| | | _elementLogging = dataMap.getString(ELEMLOG); |
| | | _createDummy = dataMap.getString(CREATEDUMMY); |
| | | |
| | |
| | | !_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; |
| | | } |
| | |
| | | "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; |
| | |
| | | } |
| | | } |
| | | |
| | | 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 { |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | 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 --"); |
| | |
| | | |
| | | } |
| | | |
| | | 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); |
| | |
| | | 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(); |
| | |
| | | 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 "); |
| | |
| | | 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 + "\""; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | 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; |
| | |
| | | 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); |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | import org.quartz.JobExecutionContext; |
| | | import org.quartz.JobExecutionException; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @Deprecated |
| | | public class OracleTransformColorOwnerJob extends AbstractOracleDatabaseJob { |
| | | final static Log logger = LogFactory.getLog(OracleTransformColorOwnerJob.class); |
| | | |
| | |
| | | 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, ""))); |
| | |
| | | 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; |
| | | } |
| | |
| | | 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, ""))); |
| | |
| | | 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; |
| | |
| | | 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, ""))); |
| | |
| | | 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; |
| | | } |
| | |
| | | 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, ""))); |
| | |
| | | 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; |
| | | } |
| | |
| | | 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, ""))); |
| | |
| | | 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; |
| | |
| | | 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, ""))); |
| | |
| | | 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)))); |
| | |
| | | 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, ""))); |
| | |
| | | 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; |
| | |
| | | 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, ""))); |
| | |
| | | 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; |
| | | } |
| | |
| | | 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, ""))); |
| | |
| | | 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; |
| | |
| | | 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, ""))); |
| | |
| | | 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; |