Index: trunk/WikiWord/WikiWordIntegrator/src/main/java/de/brightbyte/wikiword/integrator/AbstractIntegratorApp.java |
— | — | @@ -1,7 +1,6 @@ |
2 | 2 | package de.brightbyte.wikiword.integrator; |
3 | 3 | |
4 | 4 | import java.beans.IntrospectionException; |
5 | | -import java.io.File; |
6 | 5 | import java.io.IOException; |
7 | 6 | import java.io.InputStream; |
8 | 7 | import java.lang.reflect.InvocationTargetException; |
— | — | @@ -17,7 +16,6 @@ |
18 | 17 | |
19 | 18 | import de.brightbyte.data.Functor; |
20 | 19 | import de.brightbyte.data.cursor.DataCursor; |
21 | | -import de.brightbyte.db.DatabaseConnectionInfo; |
22 | 20 | import de.brightbyte.db.SqlScriptRunner; |
23 | 21 | import de.brightbyte.io.IOUtil; |
24 | 22 | import de.brightbyte.text.Chunker; |
— | — | @@ -51,6 +49,7 @@ |
52 | 50 | protected FeatureSetSourceDescriptor sourceDescriptor; |
53 | 51 | private DataSource configuredDataSource; |
54 | 52 | private DatasetIdentifier configuredDataset; |
| 53 | + private String targetTableName; |
55 | 54 | |
56 | 55 | public AbstractIntegratorApp() { |
57 | 56 | super(true, true); |
— | — | @@ -70,13 +69,14 @@ |
71 | 70 | return configuredDataset; |
72 | 71 | } |
73 | 72 | |
74 | | - public void testInit(DataSource dataSource, DatasetIdentifier dataset, TweakSet tweaks, FeatureSetSourceDescriptor sourceDescriptor) { |
| 73 | + public void testInit(DataSource dataSource, DatasetIdentifier dataset, TweakSet tweaks, FeatureSetSourceDescriptor sourceDescriptor, String targetTableName) { |
75 | 74 | if (this.tweaks!=null || this.sourceDescriptor!=null) throw new IllegalStateException("application already initialized"); |
76 | 75 | |
77 | 76 | this.configuredDataSource = dataSource; |
78 | 77 | this.configuredDataset = dataset; |
79 | 78 | this.tweaks = tweaks; |
80 | 79 | this.sourceDescriptor = sourceDescriptor; |
| 80 | + this.targetTableName = targetTableName; |
81 | 81 | } |
82 | 82 | |
83 | 83 | public void testLaunch() throws Exception { |
— | — | @@ -91,12 +91,17 @@ |
92 | 92 | } |
93 | 93 | |
94 | 94 | protected String getTargetTableName() throws IOException { |
95 | | - if (args.getParameterCount() > 2) return args.getParameter(2); |
| 95 | + if (targetTableName!=null) return targetTableName; |
96 | 96 | |
97 | | - String authority = getSourceDescriptor().getAuthorityName(); |
98 | | - authority = authority.replaceAll("[^\\w\\d]", "_").toLowerCase(); |
| 97 | + if (args.getParameterCount() > 2) targetTableName = args.getParameter(2); |
| 98 | + else { |
| 99 | + String authority = getSourceDescriptor().getAuthorityName(); |
| 100 | + authority = authority.replaceAll("[^\\w\\d]", "_").toLowerCase(); |
| 101 | + |
| 102 | + targetTableName= authority+"_property"; |
| 103 | + } |
99 | 104 | |
100 | | - return authority+"_property"; |
| 105 | + return targetTableName; |
101 | 106 | } |
102 | 107 | |
103 | 108 | protected String getSourceFileName() { |
Index: trunk/WikiWord/WikiWordIntegrator/pom.xml |
— | — | @@ -51,6 +51,12 @@ |
52 | 52 | <scope>test</scope>
|
53 | 53 | </dependency>
|
54 | 54 | <dependency>
|
| 55 | + <groupId>hsqldb</groupId>
|
| 56 | + <artifactId>hsqldb</artifactId>
|
| 57 | + <version>1.8.0.7</version>
|
| 58 | + <scope>test</scope>
|
| 59 | + </dependency>
|
| 60 | + <dependency>
|
55 | 61 | <groupId>org.beanshell</groupId>
|
56 | 62 | <artifactId>bsh-core</artifactId>
|
57 | 63 | <version>2.0b4</version>
|