| | |
| | | |
| | | static final String SHPOUTPATH = "shpout"; |
| | | |
| | | private OracleElementLogging elmLogger = null; |
| | | |
| | | static |
| | | { |
| | | try |
| | |
| | | private String dataOut = null; |
| | | private String _convertDB = null; |
| | | private String _convertFile = null; |
| | | private String currentSchema = null; |
| | | private boolean schemaChanged = false; |
| | | |
| | | public OracleConvertJobContext(String filterConfig) |
| | | { |
| | |
| | | { |
| | | // config = new File("conf/DefaultConvertShpFilter.xml"); |
| | | filterURL = this.getClass().getResource("/conf/DefaultConvertShpFilter.xml"); |
| | | // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); |
| | | // filterURL = this.getClass().getResource("/conf/ConvertShpFilterForLevel.xml"); |
| | | } |
| | | assert filterURL != null; |
| | | return (ElementDispatcher) digester.parse(filterURL); |
| | |
| | | ":type=" + element.getType() + ":lv=" + element.getLevelIndex() + ":id=" + |
| | | (linkage == null ? "NULL" : (linkage.getFsc() + "|" + linkage.getComponentID()))); |
| | | |
| | | getElementLogging().logElement(element, getCurrentSchema()); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | public void startTransaction() |
| | | { |
| | | //txFeaturesContext.startTransaction(); |
| | | //txFeaturesContext.startTransaction(); |
| | | } |
| | | |
| | | public void commitTransaction() |
| | | { |
| | | if (!txFeaturesContext.isEmpty()) |
| | | { |
| | | if (!txFeaturesContext.isEmpty()) |
| | | { |
| | | logger.debug("Transaction size = " + txFeaturesContext.size()); |
| | | //txFeaturesContext.commitTransaction(); |
| | | //txFeaturesContext.commitTransaction(); |
| | | } else |
| | | { |
| | | logger.debug("Transaction is empty."); |
| | |
| | | { |
| | | updateDataStore(); |
| | | } |
| | | |
| | | if (this.getElementLogging() != null) |
| | | this.getElementLogging().flashLogging(); |
| | | } |
| | | |
| | | public void rollbackTransaction() |
| | | { |
| | | //txFeaturesContext.rollbackTransaction(); |
| | | //txFeaturesContext.rollbackTransaction(); |
| | | if (!featuresContext.isEmpty()) |
| | | { |
| | | updateDataStore(); |
| | |
| | | logger.debug("Begin Save shapefile:" + sfile.toURI()); |
| | | |
| | | FeatureWriter writer = null; |
| | | if(featuresWriterContext.containsKey(featureType.getTypeName())) |
| | | if (featuresWriterContext.containsKey(featureType.getTypeName())) |
| | | { |
| | | writer = featuresWriterContext.get(featureType.getTypeName()) ; |
| | | } |
| | | else |
| | | writer = featuresWriterContext.get(featureType.getTypeName()); |
| | | } else |
| | | { |
| | | ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL()); |
| | | shapefileDataStore.createSchema(featureType); |
| | | writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); |
| | | featuresWriterContext.put(featureType.getTypeName() , writer); |
| | | ShapefileDataStore shapefileDataStore = new ShapefileDataStore(sfile.toURI().toURL()); |
| | | shapefileDataStore.createSchema(featureType); |
| | | writer = shapefileDataStore.getFeatureWriter(featureType.getTypeName(), Transaction.AUTO_COMMIT); |
| | | featuresWriterContext.put(featureType.getTypeName(), writer); |
| | | } |
| | | |
| | | ArrayList features = (ArrayList) featuresContext.get(featureType); |
| | |
| | | |
| | | /** |
| | | * Ãö³¬³]³Æ¼g¤J¾¹ |
| | | * |
| | | * @throws IOException IOµo¥Í¿ù»~ |
| | | */ |
| | | public void closeFeatureWriter() throws IOException { |
| | | public void closeFeatureWriter() throws IOException |
| | | { |
| | | |
| | | for (FeatureWriter featureWriter : this.featuresWriterContext.values()) |
| | | { |
| | |
| | | |
| | | /** |
| | | * ¨ú±o¸ê®Æ¿é¥X¸ô®| |
| | | * |
| | | * @return ¸ô®|ªº¦r¦ê |
| | | */ |
| | | public String getDataOutPath() |
| | |
| | | { |
| | | _convertFile = convertFile; |
| | | } |
| | | |
| | | private OracleElementLogging getElementLogging() |
| | | { |
| | | if (elmLogger == null) |
| | | { |
| | | elmLogger = new OracleElementLogging(getOracleConnection()); |
| | | elmLogger.setDataPath(this.getDataPath()); |
| | | } |
| | | return elmLogger; |
| | | } |
| | | |
| | | public String getCurrentSchema() |
| | | { |
| | | return currentSchema; |
| | | } |
| | | |
| | | public void setCurrentSchema(String querySchema) |
| | | { |
| | | this.currentSchema = querySchema; |
| | | this.schemaChanged = true; |
| | | } |
| | | } |