├── LICENSE ├── NOTICE ├── README.md ├── build-docs.xml ├── build-templates ├── MANIFEST.MF └── build-template.xml ├── build.properties ├── build.xml ├── core ├── build.xml ├── pom.xml └── src │ ├── conf │ └── scriptella │ │ └── dtd │ │ └── etl.dtd │ ├── java │ └── scriptella │ │ ├── configuration │ │ ├── ConfigurationEl.java │ │ ├── ConfigurationException.java │ │ ├── ConfigurationFactory.java │ │ ├── ConnectionEl.java │ │ ├── ContentEl.java │ │ ├── DialectBasedContentEl.java │ │ ├── FallbackEl.java │ │ ├── IncludeEl.java │ │ ├── Location.java │ │ ├── OnErrorEl.java │ │ ├── PropertiesEl.java │ │ ├── QueryEl.java │ │ ├── RequiredAttributeException.java │ │ ├── ScriptEl.java │ │ ├── ScriptingElement.java │ │ ├── StringResource.java │ │ ├── XmlConfigurable.java │ │ ├── XmlConfigurableBase.java │ │ ├── XmlElement.java │ │ └── package.html │ │ ├── core │ │ ├── ConnectionInterceptor.java │ │ ├── ConnectionManager.java │ │ ├── ContentExecutor.java │ │ ├── DriverClassLoader.java │ │ ├── DriverFactory.java │ │ ├── DynamicContext.java │ │ ├── DynamicContextDecorator.java │ │ ├── ElementInterceptor.java │ │ ├── EtlCancelledException.java │ │ ├── EtlVariable.java │ │ ├── ExceptionInterceptor.java │ │ ├── ExecutableElement.java │ │ ├── IfInterceptor.java │ │ ├── OnErrorHandler.java │ │ ├── QueryExecutor.java │ │ ├── RuntimeIOException.java │ │ ├── ScriptExecutor.java │ │ ├── Session.java │ │ ├── StatisticInterceptor.java │ │ ├── SystemException.java │ │ ├── ThreadSafe.java │ │ ├── TxInterceptor.java │ │ └── package.html │ │ ├── execution │ │ ├── EtlContext.java │ │ ├── EtlExecutor.java │ │ ├── EtlExecutorException.java │ │ ├── ExecutionStatistics.java │ │ ├── ExecutionStatisticsBuilder.java │ │ ├── JmxEtlManager.java │ │ ├── JmxEtlManagerMBean.java │ │ ├── SilentExecutionStatisticsBuilder.java │ │ └── package.html │ │ ├── expression │ │ ├── Expression.java │ │ ├── JexlExpression.java │ │ ├── LineIterator.java │ │ ├── PropertiesSubstitutor.java │ │ └── package.html │ │ ├── interactive │ │ ├── ConsoleProgressIndicator.java │ │ ├── LoggingConfigurer.java │ │ ├── ProgressCallback.java │ │ ├── ProgressIndicator.java │ │ ├── ProgressIndicatorBase.java │ │ ├── SwingProgressIndicator.java │ │ └── package.html │ │ ├── jdbc │ │ ├── CachedSqlTokenizer.java │ │ ├── GenericDriver.java │ │ ├── JdbcConnection.java │ │ ├── JdbcException.java │ │ ├── JdbcTypesConverter.java │ │ ├── JdbcUtils.java │ │ ├── Lobs.java │ │ ├── ParametersParser.java │ │ ├── ResultSetAdapter.java │ │ ├── SqlExecutor.java │ │ ├── SqlParserBase.java │ │ ├── SqlReaderTokenizer.java │ │ ├── SqlTokenizer.java │ │ ├── StatementCache.java │ │ ├── StatementWrapper.java │ │ └── package.html │ │ ├── spi │ │ ├── AbstractConnection.java │ │ ├── AbstractScriptellaDriver.java │ │ ├── Connection.java │ │ ├── ConnectionParameters.java │ │ ├── DialectIdentifier.java │ │ ├── DriverContext.java │ │ ├── NativeConnectionProvider.java │ │ ├── ParametersCallback.java │ │ ├── ProviderException.java │ │ ├── QueryCallback.java │ │ ├── Resource.java │ │ ├── ScriptellaDriver.java │ │ ├── package.html │ │ └── support │ │ │ ├── HierarchicalParametersCallback.java │ │ │ ├── MapParametersCallback.java │ │ │ └── NullParametersCallback.java │ │ ├── text │ │ ├── PropertyFormat.java │ │ ├── PropertyFormatInfo.java │ │ ├── PropertyFormatter.java │ │ ├── TimestampValueFormat.java │ │ ├── TypedPropertiesSource.java │ │ ├── ValueFormatBuilder.java │ │ └── package.html │ │ └── util │ │ ├── CollectionUtils.java │ │ ├── ColumnsMap.java │ │ ├── ExceptionUtils.java │ │ ├── IOUtils.java │ │ ├── LRUMap.java │ │ ├── PropertiesMap.java │ │ ├── StringUtils.java │ │ ├── UrlPathTokenizer.java │ │ └── package.html │ └── test │ └── scriptella │ ├── AbstractTestCase.java │ ├── ConditionsTest.java │ ├── ConditionsTest.xml │ ├── DBTableCopyTest.java │ ├── DBTableCopyTest.xml │ ├── DBTableCopyTest2.xml │ ├── DBTestCase.java │ ├── DialectsTest.java │ ├── DialectsTest.xml │ ├── DialectsTest2.xml │ ├── FilePropertiesTest.java │ ├── FilePropertiesTest.xml │ ├── JDBCEscapingTest.java │ ├── JDBCEscapingTest.xml │ ├── NestedQueryTest.java │ ├── NestedQueryTest.xml │ ├── NestedQueryTest2.xml │ ├── NestedQueryTestRownum.xml │ ├── OnErrorTest.java │ ├── OnErrorTest.xml │ ├── OnErrorTest2.xml │ ├── OnErrorTest3.xml │ ├── PropertiesTest.java │ ├── PropertiesTest.properties │ ├── PropertiesTest.xml │ ├── SQLParametersTest.java │ ├── SQLParametersTest.xml │ ├── SQLParametersTest2.xml │ ├── SQLSupportPerfTest.java │ ├── SQLSupportPerfTest.xml │ ├── TestLoggingConfigurer.java │ ├── TxTest.java │ ├── TxTest.xml │ ├── TxTest2.xml │ ├── TxTest3.xml │ ├── configuration │ ├── ContentElTest.java │ ├── ContentElTest.xml │ ├── DialectBasedContentElTest.java │ ├── DynamicIncludeITest.java │ ├── DynamicIncludeITest.xml │ ├── DynamicIncludeITest1.sql │ ├── DynamicIncludeITest2.sql │ ├── MockConnectionEl.java │ ├── ValidationTest.java │ ├── ValidationTest.xml │ ├── ValidationTest2.xml │ ├── XIncludeTest.java │ ├── XIncludeTest.sql │ ├── XIncludeTest.xml │ ├── XmlElementTest.java │ └── xinctst │ │ └── XIncludeTest.sql │ ├── core │ ├── DriverFactoryTest.java │ ├── DriversClassLoaderTest.java │ ├── EtlExecutorTest.java │ ├── EtlExecutorTestRunCall.xml │ ├── EtlVariableTest.java │ └── SqlTestHelper.java │ ├── execution │ ├── CancellationTest.java │ ├── CancellationTest.xml │ ├── ExecutionStatisticsTest.java │ ├── ExecutionStatisticsTest.xml │ ├── ExecutionStatisticsTest2.xml │ ├── ExecutionStatisticsTest3.xml │ ├── JmxEtlManagerITest.java │ ├── JmxEtlManagerITest.xml │ ├── JmxEtlManagerTest.java │ ├── LazyInitConnectionTest.java │ ├── LazyInitConnectionTest.xml │ └── TestableEtlExecutor.java │ ├── expression │ ├── LineIteratorPerfTest.java │ ├── LineIteratorTest.java │ ├── PropertiesSubstitutorPerfTest.java │ └── PropertiesSubstitutorTest.java │ ├── jdbc │ ├── AutocommitITest.java │ ├── AutocommitITest.xml │ ├── CachedSqlTokenizerTest.java │ ├── ColumnAliasITest.java │ ├── ColumnAliasITest.xml │ ├── JdbcConnectionITest.java │ ├── JdbcConnectionITest.xml │ ├── LobsTest.java │ ├── NestedElementsPerfTest.java │ ├── NestedElementsPerfTest.xml │ ├── ParametersParserTest.java │ ├── QueryHelper.java │ ├── SQLParserBaseTest.java │ ├── SqlTokenizerITest.java │ ├── SqlTokenizerITest.xml │ ├── SqlTokenizerPerfTest.java │ ├── SqlTokenizerTest.java │ ├── StatementCachePerfTest.java │ ├── StatementCacheTest.java │ ├── StatementWrapperTest.java │ └── StatementWrapperTest.xml │ ├── spi │ ├── ConnectionParametersTest.java │ ├── IndexedQueryCallback.java │ ├── MockConnectionParameters.java │ ├── MockDriverContext.java │ └── MockParametersCallbacks.java │ ├── text │ ├── PropertyFormatInfoTest.java │ ├── PropertyFormatTest.java │ ├── PropertyFormatterTest.java │ ├── TimestampValueFormatTest.java │ ├── TypedPropertiesSourceTest.java │ └── ValueFormatBuilderTest.java │ └── util │ ├── ColumnsMapPerfTest.java │ ├── ColumnsMapTest.java │ ├── ExceptionUtilsTest.java │ ├── IOUtilsTest.java │ ├── PropertiesMapTest.java │ ├── ProxyAdapter.java │ ├── RepeatingInputStream.java │ ├── StringUtilsTest.java │ └── UrlPathTokenizerTest.java ├── coverage.xml ├── drivers ├── build.xml ├── pom.xml └── src │ ├── conf │ └── scriptella │ │ └── driver │ │ ├── auto │ │ └── url.properties │ │ └── spring │ │ └── beanFactory.xml │ ├── java │ └── scriptella │ │ └── driver │ │ ├── as400 │ │ ├── Driver.java │ │ └── package.html │ │ ├── auto │ │ ├── Driver.java │ │ └── package.html │ │ ├── csv │ │ ├── CsvConnection.java │ │ ├── CsvConnectionParameters.java │ │ ├── CsvProviderException.java │ │ ├── CsvQuery.java │ │ ├── Driver.java │ │ ├── opencsv │ │ │ ├── CSVReader.java │ │ │ ├── CSVWriter.java │ │ │ └── package.html │ │ └── package.html │ │ ├── cubrid │ │ ├── Driver.java │ │ └── package.html │ │ ├── db2 │ │ ├── Driver.java │ │ └── package.html │ │ ├── derby │ │ ├── Driver.java │ │ └── package.html │ │ ├── h2 │ │ ├── Driver.java │ │ └── package.html │ │ ├── hsqldb │ │ ├── Driver.java │ │ ├── HsqlConnection.java │ │ └── package.html │ │ ├── janino │ │ ├── CodeCompiler.java │ │ ├── Driver.java │ │ ├── JaninoConnection.java │ │ ├── JaninoProviderException.java │ │ ├── JaninoQuery.java │ │ ├── JaninoScript.java │ │ └── package.html │ │ ├── jexl │ │ ├── Driver.java │ │ ├── JexlConnection.java │ │ ├── JexlContextMap.java │ │ ├── JexlProviderException.java │ │ └── package.html │ │ ├── jndi │ │ ├── Driver.java │ │ ├── JndiProviderException.java │ │ └── package.html │ │ ├── ldap │ │ ├── Driver.java │ │ ├── LdapConnection.java │ │ ├── LdapProviderException.java │ │ ├── LdifScript.java │ │ ├── SearchFilterQuery.java │ │ ├── ldif │ │ │ ├── Entry.java │ │ │ ├── LdifParseException.java │ │ │ ├── LdifReader.java │ │ │ ├── TrackingLineIterator.java │ │ │ └── Utils.java │ │ └── package.html │ │ ├── mail │ │ ├── Driver.java │ │ ├── MailConnection.java │ │ ├── MailProviderException.java │ │ └── package.html │ │ ├── mssql │ │ ├── Driver.java │ │ └── package.html │ │ ├── mysql │ │ ├── Driver.java │ │ └── package.html │ │ ├── odbc │ │ ├── Driver.java │ │ └── package.html │ │ ├── oracle │ │ ├── Driver.java │ │ ├── OracleConnection.java │ │ └── package.html │ │ ├── package.html │ │ ├── postgresql │ │ ├── Driver.java │ │ └── package.html │ │ ├── script │ │ ├── BindingsParametersCallback.java │ │ ├── Driver.java │ │ ├── MissingQueryNextCallDetector.java │ │ ├── NashornBindingsParametersCallback.java │ │ ├── ParametersCallbackMap.java │ │ ├── ScriptConnection.java │ │ ├── ScriptEngineWrapper.java │ │ ├── ScriptProviderException.java │ │ └── package.html │ │ ├── scriptella │ │ ├── Driver.java │ │ ├── ScriptellaConnection.java │ │ ├── ScriptellaProviderException.java │ │ └── package.html │ │ ├── shell │ │ ├── Driver.java │ │ ├── ShellCommandRunner.java │ │ ├── ShellConnection.java │ │ ├── ShellConnectionParameters.java │ │ ├── ShellOs.java │ │ ├── ShellProviderException.java │ │ ├── ShellQueryExecutor.java │ │ ├── ShellScriptExecutor.java │ │ └── package.html │ │ ├── spring │ │ ├── BatchEtlExecutorBean.java │ │ ├── Driver.java │ │ ├── EtlExecutorBean.java │ │ ├── SpringProviderException.java │ │ └── package.html │ │ ├── sybase │ │ ├── Driver.java │ │ └── package.html │ │ ├── text │ │ ├── AbstractTextConnection.java │ │ ├── ConsoleAdapters.java │ │ ├── Driver.java │ │ ├── TextConnection.java │ │ ├── TextConnectionParameters.java │ │ ├── TextProviderException.java │ │ ├── TextQueryExecutor.java │ │ ├── TextScriptExecutor.java │ │ └── package.html │ │ ├── velocity │ │ ├── Driver.java │ │ ├── VelocityConnection.java │ │ ├── VelocityProviderException.java │ │ └── package.html │ │ ├── xls │ │ ├── Driver.java │ │ └── package.html │ │ └── xpath │ │ ├── Driver.java │ │ ├── NodeVariable.java │ │ ├── XPathConnection.java │ │ ├── XPathExpressionCompiler.java │ │ ├── XPathProviderException.java │ │ ├── XPathQueryExecutor.java │ │ └── package.html │ └── test │ └── scriptella │ └── driver │ ├── alljdbc │ ├── AllJDBCDriversTest.java │ ├── AllJDBCDriversTest.xml │ ├── h2.types.properties │ ├── hsqldb.types.properties │ ├── oracle.types.properties │ ├── schema.xml │ └── test.properties │ ├── auto │ ├── AutoDriverTest.java │ ├── AutodiscoveryITest.java │ └── AutodiscoveryITest.xml │ ├── csv │ ├── CsvConnectionPerfTest.java │ ├── CsvConnectionTest.java │ ├── CsvFormattingITest.java │ ├── CsvFormattingITest.xml │ ├── CsvQueryTest.java │ ├── CsvScriptTest.java │ └── CsvScriptTest.xml │ ├── h2 │ ├── H2ScriptTest.java │ └── H2ScriptTest.xml │ ├── hsqldb │ ├── LobsITest.java │ ├── LobsITest.xml │ └── ShutdownOnExitTest.java │ ├── janino │ ├── JaninoBaseClassesTest.java │ ├── JaninoConnectionTest.java │ ├── JaninoGetNativeDbConnectionITest.java │ ├── JaninoGetNativeDbConnectionITest.xml │ └── JaninoPerfTest.java │ ├── jexl │ ├── EtlVariableITest.java │ ├── EtlVariableITest.xml │ ├── JexlConnectionPerfTest.java │ ├── JexlConnectionTest.java │ ├── JexlDriverITest.java │ ├── JexlDriverITest.xml │ ├── JexlQueryITest.java │ └── JexlQueryITest.xml │ ├── jndi │ └── JNDIDriverTest.java │ ├── ldap │ ├── LdapConnectionTest.java │ ├── LdifScriptTest.java │ ├── SearchFilterQueryTest.java │ └── ldif │ │ ├── LdifReaderTest.java │ │ └── SubstitutingLineReaderTest.java │ ├── mail │ ├── MaiConnectionTest.java │ └── MailDriverTest.java │ ├── script │ ├── MissingQueryNextCallDetectorTest.java │ ├── ParametersCallbackMapTest.java │ ├── ScriptConnectionPerfTest.java │ ├── ScriptConnectionTest.java │ ├── ScriptDriverITest.java │ ├── ScriptDriverITest.xml │ ├── ScriptingQueryITest.java │ └── ScriptingQueryITest.xml │ ├── scriptella │ ├── ScriptellaDriverITest.java │ ├── ScriptellaDriverITest.xml │ ├── ScriptellaDriverPerfTest.java │ ├── ScriptellaDriverPerfTest.xml │ ├── file1.xml │ ├── file2.xml │ └── perf.xml │ ├── shell │ ├── ShellCommandRunnerTest.java │ ├── ShellConnectionParametersTest.java │ ├── ShellConnectionTest.java │ ├── ShellDriverITest.java │ └── ShellDriverITest.xml │ ├── spring │ ├── SpringDriverTest.java │ ├── SpringDriverTest.xml │ ├── autostart.etl.xml │ ├── batch1.etl.xml │ ├── batch2.etl.xml │ ├── bug4648.etl.xml │ └── springbeans.xml │ ├── text │ ├── TextConnectionPerfTest.java │ ├── TextConnectionTest.java │ ├── TextFormattingITest.java │ ├── TextFormattingITest.xml │ ├── TextQueryExecutorTest.java │ ├── TextQueryITest.java │ ├── TextQueryITest.xml │ ├── TextScriptExecutorTest.java │ ├── TextScriptITest.java │ └── TextScriptITest.xml │ ├── velocity │ ├── VelocityConnectionTest.java │ ├── VelocityPerfTest.java │ ├── VelocityScriptTest.java │ └── VelocityScriptTest.xml │ └── xpath │ ├── XPathConnectionPerfTest.java │ ├── XPathDriverITest.java │ ├── XPathDriverITest.xml │ ├── XPathQueryExecutorTest.java │ ├── excel.xml │ ├── xml1.xml │ └── xml2.xml ├── forrest ├── README ├── cli.xconf ├── forrest.properties ├── src │ └── documentation │ │ ├── README.txt │ │ ├── classes │ │ └── CatalogManager.properties │ │ ├── content │ │ └── xdocs │ │ │ ├── download.xml │ │ │ ├── faq.xml │ │ │ ├── favicon.ico │ │ │ ├── howto │ │ │ ├── initialize-database.xml │ │ │ └── migrate-from-ant.xml │ │ │ ├── images │ │ │ ├── blob_insert.png │ │ │ ├── howto │ │ │ │ ├── db-auto-init.png │ │ │ │ └── imagedb-schema.png │ │ │ ├── icon.png │ │ │ ├── reference │ │ │ │ ├── example1.png │ │ │ │ ├── intro.png │ │ │ │ └── jmxconsole.png │ │ │ ├── scriptella-powered.gif │ │ │ ├── site-logo.png │ │ │ ├── table_copy.png │ │ │ └── usemap.gif │ │ │ ├── index.xml │ │ │ ├── license.xml │ │ │ ├── links.xml │ │ │ ├── reference │ │ │ ├── drivers.xml │ │ │ └── index.xml │ │ │ ├── site.xml │ │ │ ├── support.xml │ │ │ ├── tabs.xml │ │ │ └── tutorial.xml │ │ ├── resources │ │ ├── schema │ │ │ ├── catalog.xcat │ │ │ └── hello-v10.dtd │ │ └── stylesheets │ │ │ └── hello2document.xsl │ │ └── skinconf.xml └── status.xml ├── lib ├── commons-jexl.jar ├── commons-jexl.license.txt ├── commons-logging.jar ├── commons-logging.license.txt ├── h2.jar ├── h2.license.txt ├── hsqldb.jar ├── hsqldb.license.txt ├── j2ee │ ├── activation.jar │ └── mail.jar ├── janino-commons-compiler.jar ├── janino.jar ├── janino.license.txt ├── junit.jar ├── lucene.license.txt ├── spring.jar ├── spring.license.txt ├── velocity-dep.jar └── versions.properties ├── pom.xml ├── samples ├── ant │ ├── build.xml │ ├── etl.properties │ └── etl.xml ├── benchmark │ ├── build.xml │ ├── createcsv.etl.xml │ ├── exportcsv.etl.xml │ └── importcsv.etl.xml ├── csv │ ├── bugs-in.csv │ ├── build.xml │ ├── etl.xml │ ├── hsqldb │ │ ├── bugs-in.csv │ │ ├── build.xml │ │ ├── csv2db.etl.xml │ │ ├── db2csv.etl.xml │ │ └── fields.sql │ ├── readme.txt │ └── text │ │ ├── build.xml │ │ └── etl.xml ├── dbupgrade │ ├── 1-2.sql │ ├── 2-1.sql │ ├── 2-3.sql │ ├── 3-2.sql │ ├── build.xml │ ├── dbinit.etl.xml │ ├── dbinit.properties │ ├── dbupdate.etl.xml │ ├── dbupdate.properties │ └── readme.txt ├── ldap │ ├── build.xml │ ├── db2ldap.etl.xml │ ├── dbschema.sql │ ├── init.ldif │ ├── jdbc │ │ ├── build.xml │ │ ├── db2ldap.etl.xml │ │ ├── ldap2db.etl.xml │ │ └── readme.txt │ ├── ldap2db.etl.xml │ └── readme.txt ├── lib │ └── readme.txt ├── mail │ ├── etl.xml │ ├── mail.properties │ ├── readme.txt │ └── users.sql ├── musicstore │ ├── build.xml │ ├── etl.properties │ ├── etl.xml │ ├── run.bat │ ├── song1.mp3 │ └── song2.mp3 ├── odbc │ ├── build.xml │ ├── etl.xml │ └── readme.txt ├── primes │ ├── build.xml │ ├── etl.properties │ ├── etl.xml │ ├── footer.vm │ ├── header.vm │ ├── readme.txt │ └── scriptella-powered.gif └── xml │ ├── build.xml │ ├── cd_catalog.xml │ ├── etl.xml │ └── readme.txt └── tools ├── build.xml ├── pom.xml └── src ├── bin ├── scriptella.bat └── scriptella.sh ├── conf ├── antscriptella.properties └── scriptella │ └── tools │ ├── ant │ └── antlib.xml │ └── template │ ├── dataMigrator.etl.properties │ ├── dataMigrator.etl.xml │ ├── dataMigratorBlock.etl.xml │ ├── default.etl.properties │ └── default.etl.xml ├── java └── scriptella │ └── tools │ ├── ant │ ├── AntHandler.java │ ├── EtlExecuteTask.java │ ├── EtlTaskBase.java │ ├── EtlTemplateTask.java │ └── package.html │ ├── launcher │ ├── BugReport.java │ ├── EtlLauncher.java │ └── package.html │ └── template │ ├── DataMigrator.java │ ├── TemplateManager.java │ └── package.html └── test └── scriptella └── tools ├── ant ├── EtlTaskBaseTest.java └── EtlTemplateTaskTest.java ├── launcher ├── BugReportTest.java ├── EtlLauncherTest.etl.xml ├── EtlLauncherTest.java └── EtlLauncherTestJmx.etl.xml └── template ├── DataMigratorITest.java ├── DataMigratorITest.xml └── TemplateManagerTest.java /NOTICE: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == NOTICE file corresponding to the section 4 d of == 3 | == the Apache License, Version 2.0, == 4 | == in this case for the Scriptella distribution. == 5 | ========================================================================= 6 | 7 | This product includes software developed by 8 | The Apache Software Foundation (http://www.apache.org/). 9 | 10 | This product also includes software developed by : 11 | - The HSQLDB Development Group (http://www.hsqldb.org) 12 | - Thomas Mueller (http://h2database.com) 13 | - Arno Unkrig (http://janino.net) 14 | - The Spring Framework Project (http://www.springframework.org) 15 | 16 | Please read the different license files present in the lib directory of 17 | this distribution. 18 | 19 | The names "Scriptella" and "The Scriptella Project Team" must not be used to 20 | endorse or promote products derived from this software without prior 21 | written permission. For written permission, please contact 22 | scriptella@gmail.com -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Scriptella 2 | ======= 3 | 4 | # What is it? 5 | 6 | Open source ETL (Extract-Transform-Load) and script execution tool 7 | written in Java. Its primary focus is simplicity. It doesn't 8 | require the user to learn another complex XML-based language to 9 | use it, but allows the use of SQL or another scripting language 10 | suitable for the data source to perform required transformations. 11 | 12 | **Note:** This project is no longer actively developed. For commercial support, please contact: scriptella@gmail.com 13 | 14 | 15 | # Latest Version 16 | 17 | Details of the latest version can be found on 18 | http://scriptella.org 19 | 20 | 21 | # Documentation 22 | 23 | Documentation is available in the docs/ directory. 24 | Up to date reference manual is available at 25 | http://scriptella.org/reference 26 | 27 | Guidelines for developers available at 28 | https://github.com/scriptella/scriptella-etl/wiki 29 | 30 | 31 | # Licensing 32 | 33 | This software is licensed under the terms you may find in the file named "LICENSE" in this directory. 34 | 35 | Thank you for using Scriptella! 36 | 37 | The Scriptella Project Team 38 | [http://scriptella.org](http://scriptella.org) 39 | -------------------------------------------------------------------------------- /build-templates/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Specification-Title: Scriptella ETL and Scripts Execution Tool. 2 | Specification-Vendor: The Scriptella Project Team 3 | Implementation-Vendor: The Scriptella Project Team 4 | Implementation-Title: Scriptella ETL and Scripts Execution Tool. 5 | Implementation-Version: ${version} 6 | Build-Date: ${TODAY} -------------------------------------------------------------------------------- /build.properties: -------------------------------------------------------------------------------- 1 | #Uncomment to turn off clean during build 2 | #noclean=on 3 | #Specify path to cobertura to produce test coverage reports 4 | #cobertura.dir=path/to/cobertura 5 | #Specify path to DTDDoc installation to produce DTD documentation 6 | #dtddoc.dir=path/to/DTDDoc 7 | #forrest.dir=path/to/forrest 8 | #Path to ant.jar file 9 | ant.jar=${ant.home}/lib/ant.jar 10 | 11 | # properties to deploy to Maven repository: see http://nexus.sonatype.org/oss-repository-hosting.html 12 | #path to maven-ant-tasks.jar 13 | #maven-ant-tasks.jar=path/to/maven-ant-tasks.jar 14 | # gpg key to sign artifacts 15 | #gpg.key=70161C62 16 | # gpg keyring passphrase 17 | #gpg.passphrase=... -------------------------------------------------------------------------------- /core/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /core/src/java/scriptella/configuration/FallbackEl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.configuration; 17 | 18 | /** 19 | * Contains alternate content to be used if the requested resource cannot be found. 20 | * 21 | * @author Fyodor Kupolov 22 | * @version 1.0 23 | */ 24 | public class FallbackEl extends ContentEl { 25 | public FallbackEl(XmlElement element) { 26 | super(element); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /core/src/java/scriptella/configuration/RequiredAttributeException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.configuration; 17 | 18 | /** 19 | * TODO: Add documentation 20 | * 21 | * @author Fyodor Kupolov 22 | * @version 1.0 23 | */ 24 | public class RequiredAttributeException extends ConfigurationException { 25 | public RequiredAttributeException(String attribute, XmlElement element) { 26 | super("Attribute " + attribute + " is required", element); 27 | } 28 | 29 | public RequiredAttributeException(String attribute, Throwable cause, 30 | XmlElement element) { 31 | super("Attribute " + attribute + " is required", cause, element); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /core/src/java/scriptella/configuration/XmlConfigurable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.configuration; 17 | 18 | 19 | /** 20 | * Implemented by classes which support configuration from XML. 21 | * 22 | * @author Fyodor Kupolov 23 | * @version 1.0 24 | */ 25 | public interface XmlConfigurable { 26 | /** 27 | * Configures the class using specified XML element. 28 | * 29 | * @param element XML element. 30 | */ 31 | public void configure(final XmlElement element); 32 | } 33 | -------------------------------------------------------------------------------- /core/src/java/scriptella/configuration/package.html: -------------------------------------------------------------------------------- 1 | 2 | Classes and interfaces to parse script files. 3 |

For now only XML format is supported

4 | 5 |

To create configuration from XML file use the following code: 6 |

 7 |         ConfigurationFactory factory = new ConfigurationFactory();
 8 |         factory.setResourceURL(resourceURL);
 9 |         Configuration configration = cf.createConfiguration();
10 |     
11 | 12 |

13 | -------------------------------------------------------------------------------- /core/src/java/scriptella/core/EtlCancelledException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.core; 17 | 18 | /** 19 | * Thrown to indicate ETL interruption. 20 | *

This exception is handled by a core execution engine and should be 21 | * propagated by drivers. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public class EtlCancelledException extends SystemException { 27 | public EtlCancelledException() { 28 | super("ETL Cancelled"); 29 | } 30 | 31 | /** 32 | * A helper method which check if the current thread is interrupted 33 | * @throws EtlCancelledException if ETL operation is cancelled. 34 | */ 35 | public static void checkEtlCancelled() throws EtlCancelledException { 36 | if (Thread.interrupted()) { 37 | throw new EtlCancelledException(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /core/src/java/scriptella/core/ExecutableElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.core; 17 | 18 | 19 | /** 20 | * Represents executable element like {@link QueryExecutor query} or {@link ScriptExecutor script}. 21 | *

{@link ElementInterceptor Interceptors} also implement this interface to act as proxies. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public interface ExecutableElement { 27 | /** 28 | * Executes the element. 29 | *

Note: the context may be decorated by {@link DynamicContextDecorator}. 30 | * 31 | * @param ctx context to use. 32 | */ 33 | void execute(final DynamicContext ctx); 34 | } 35 | -------------------------------------------------------------------------------- /core/src/java/scriptella/core/RuntimeIOException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.core; 17 | 18 | import java.io.IOException; 19 | 20 | /** 21 | * Runtime wrapper for IO exceptions propagation. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public class RuntimeIOException extends SystemException { 27 | 28 | public RuntimeIOException(IOException cause) { 29 | super(cause.getMessage(), cause); 30 | } 31 | 32 | public final Throwable initCause(Throwable cause) { 33 | throw new UnsupportedOperationException("Method not supported"); 34 | } 35 | 36 | public IOException getCause() { 37 | return (IOException) super.getCause(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /core/src/java/scriptella/core/SystemException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.core; 17 | 18 | 19 | /** 20 | * Base class for all scriptella runtime exceptions. 21 | * 22 | * @author Fyodor Kupolov 23 | * @version 1.0 24 | */ 25 | public class SystemException extends RuntimeException { 26 | public SystemException() { 27 | } 28 | 29 | public SystemException(String message) { 30 | super(message); 31 | } 32 | 33 | public SystemException(String message, Throwable cause) { 34 | super(message, cause); 35 | } 36 | 37 | public SystemException(Throwable cause) { 38 | super(cause); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /core/src/java/scriptella/core/ThreadSafe.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.core; 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | * Indicates thread safety 25 | * 26 | * @author Fyodor Kupolov 27 | * @version 1.0 28 | */ 29 | @Target({ElementType.METHOD, ElementType.TYPE}) 30 | @Retention(RetentionPolicy.SOURCE) 31 | public @interface ThreadSafe { 32 | } 33 | -------------------------------------------------------------------------------- /core/src/java/scriptella/core/package.html: -------------------------------------------------------------------------------- 1 | 2 | Core classes for scripts execution. 3 | -------------------------------------------------------------------------------- /core/src/java/scriptella/execution/SilentExecutionStatisticsBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.execution; 17 | 18 | import scriptella.configuration.Location; 19 | import scriptella.spi.Connection; 20 | 21 | 22 | /** 23 | * A minimized version of {@link ExecutionStatisticsBuilder} optimized for performance. 24 | * 25 | * @author Fyodor Kupolov 26 | * @version 1.0 27 | */ 28 | public class SilentExecutionStatisticsBuilder extends ExecutionStatisticsBuilder { 29 | 30 | @Override 31 | /** 32 | * Called when new element execution started. 33 | * 34 | * @param loc element location. 35 | */ 36 | public void elementStarted(final Location loc, Connection connection) { 37 | //Do nothing 38 | } 39 | 40 | @Override 41 | public void elementExecuted() { 42 | //Do nothing 43 | } 44 | 45 | 46 | @Override 47 | public void elementFailed() { 48 | //Do nothing 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /core/src/java/scriptella/execution/package.html: -------------------------------------------------------------------------------- 1 | 2 | Facade classes for xml scripts execution. 3 | -------------------------------------------------------------------------------- /core/src/java/scriptella/expression/package.html: -------------------------------------------------------------------------------- 1 | 2 | Classes for working with expressions and properties substitution. 3 | -------------------------------------------------------------------------------- /core/src/java/scriptella/interactive/ProgressIndicator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.interactive; 17 | 18 | 19 | /** 20 | * Script execution progress indicator. 21 | * 22 | * @author Fyodor Kupolov 23 | * @version 1.0 24 | */ 25 | public interface ProgressIndicator { 26 | /** 27 | * Invoked when script execution progress has been changed. 28 | * 29 | * @param progress progress value between 0 and 1 inclusive. 30 | * @param message completed event description. 31 | */ 32 | void showProgress(final double progress, final String message); 33 | } 34 | -------------------------------------------------------------------------------- /core/src/java/scriptella/interactive/package.html: -------------------------------------------------------------------------------- 1 | 2 | Progress Indicators and other classes related to user interaction. 3 | -------------------------------------------------------------------------------- /core/src/java/scriptella/spi/NativeConnectionProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.spi; 17 | 18 | /** 19 | * Optional interface implemented by {@link Connection} classes. It is introduced as a separate interface for 20 | * preserving backwards compatibility. 21 | *

22 | * Represents a Scriptella object which is able to return the native connection used to talk with the 23 | * datasource. It is up to the driver to decide which object is returned. 24 | * For example Scriptella adapters for JDBC drivers return an instance of 25 | * {@link java.sql.Connection}. 26 | * 27 | * 28 | * 29 | * @author Fyodor Kupolov 30 | * @since 1.2 31 | * @see Connection 32 | */ 33 | public interface NativeConnectionProvider { 34 | /** 35 | * Returns the native connection which is wrapped by this object or null if this information is not 36 | * available. 37 | * 38 | * @return native connection which is wrapped by this object. 39 | */ 40 | public Object getNativeConnection(); 41 | } 42 | -------------------------------------------------------------------------------- /core/src/java/scriptella/spi/QueryCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.spi; 17 | 18 | 19 | /** 20 | * Callback interface for query result set iteration. 21 | * 22 | * @author Fyodor Kupolov 23 | * @version 1.0 24 | */ 25 | public interface QueryCallback { 26 | /** 27 | * Called for each row in a result set. 28 | * 29 | * @param parameters parameters to get column values and other properties. 30 | */ 31 | void processRow(final ParametersCallback parameters); 32 | } 33 | -------------------------------------------------------------------------------- /core/src/java/scriptella/spi/Resource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.spi; 17 | 18 | import java.io.IOException; 19 | import java.io.Reader; 20 | 21 | 22 | /** 23 | * Represents reference to a text resource capable of creating new readers. 24 | * 25 | * @author Fyodor Kupolov 26 | * @version 1.0 27 | */ 28 | public interface Resource { 29 | /** 30 | * Opens a resource and returns a content reader. 31 | *

The returned reader implementation should be effective enough to allow usage without 32 | * extra buffering, etc. 33 | * 34 | * @return resource content reader 35 | * @throws IOException if I/O error occurs. 36 | */ 37 | Reader open() throws IOException; 38 | 39 | /** 40 | * @return location of content or meaningful description. 41 | */ 42 | String toString(); 43 | } 44 | -------------------------------------------------------------------------------- /core/src/java/scriptella/spi/ScriptellaDriver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.spi; 17 | 18 | /** 19 | * Service Provider Interface for integrating third-party systems with Scriptella. 20 | * Implementing class must have public no-args constructor. 21 | * 22 | * @author Fyodor Kupolov 23 | * @version 1.0 24 | */ 25 | public interface ScriptellaDriver { 26 | /** 27 | * Implementor should create a new connection based on specified parameters. 28 | * 29 | * @param connectionParameters connection parameters defined in <connection> element. 30 | * @return new connection. 31 | */ 32 | Connection connect(ConnectionParameters connectionParameters); 33 | 34 | 35 | /** 36 | * @return Driver's meaningful name 37 | */ 38 | String toString(); 39 | } 40 | -------------------------------------------------------------------------------- /core/src/java/scriptella/spi/support/MapParametersCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.spi.support; 17 | 18 | import scriptella.spi.ParametersCallback; 19 | 20 | import java.util.Map; 21 | 22 | /** 23 | * Map-based parameters callback implementation. 24 | * 25 | * @author Fyodor Kupolov 26 | * @version 1.0 27 | */ 28 | public class MapParametersCallback implements ParametersCallback { 29 | private Map map; 30 | 31 | public MapParametersCallback(Map map) { 32 | this.map = map; 33 | } 34 | 35 | public Object getParameter(final String name) { 36 | return map.get(name); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /core/src/java/scriptella/spi/support/NullParametersCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.spi.support; 17 | 18 | import scriptella.spi.ParametersCallback; 19 | 20 | /** 21 | * Null-object constant for {@link ParametersCallback}. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public class NullParametersCallback implements ParametersCallback { 27 | public static final ParametersCallback INSTANCE = new NullParametersCallback(); 28 | 29 | /** 30 | * Singleton. 31 | */ 32 | private NullParametersCallback() { 33 | } 34 | 35 | 36 | /** 37 | * Always return null. 38 | * 39 | * @param name parameter name. 40 | * @return null. 41 | */ 42 | public Object getParameter(final String name) { 43 | return null; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /core/src/java/scriptella/text/TimestampValueFormat.java: -------------------------------------------------------------------------------- 1 | package scriptella.text; 2 | 3 | import java.sql.Timestamp; 4 | import java.text.DateFormat; 5 | import java.text.FieldPosition; 6 | import java.text.ParsePosition; 7 | import java.util.Date; 8 | 9 | /** 10 | * Format class to work with dates represented in JDBC escape syntax. 11 | * 12 | * @author Fyodor Kupolov 13 | * @since 1.1 14 | */ 15 | public class TimestampValueFormat extends DateFormat { 16 | @Override 17 | public StringBuffer format(Date date, StringBuffer out, FieldPosition fieldPosition) { 18 | out.append(new Timestamp(date.getTime()).toString()); 19 | return out; 20 | } 21 | 22 | @Override 23 | public Date parse(String source, ParsePosition pos) { 24 | Date result = null; 25 | result = Timestamp.valueOf(source.substring(pos.getIndex())); 26 | pos.setIndex(source.length() - 1); 27 | return result; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /core/src/java/scriptella/text/package.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | Classes for formatting and parsing text. 18 | 19 | -------------------------------------------------------------------------------- /core/src/java/scriptella/util/package.html: -------------------------------------------------------------------------------- 1 | 2 | Miscellaneous utility classes. 3 | -------------------------------------------------------------------------------- /core/src/test/scriptella/ConditionsTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | n=5 5 | 6 | 7 | 12 | 13 | 16 | 19 | 22 | 23 | select * from test 24 | 27 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /core/src/test/scriptella/DBTableCopyTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | 21 | select * from Test 22 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /core/src/test/scriptella/DBTableCopyTest2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 20 | 21 | 22 | select * from Test 23 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /core/src/test/scriptella/DialectsTest2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | select * from test where id=1 18 | 24 | 25 | 26 | 27 | 30 | 31 | select * from test where id=2; 32 | 33 | 34 | select * from test where id=3 35 | 36 | 37 | 38 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /core/src/test/scriptella/FilePropertiesTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 20 | 21 | -------------------------------------------------------------------------------- /core/src/test/scriptella/JDBCEscapingTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 14 | -------------------------------------------------------------------------------- /core/src/test/scriptella/NestedQueryTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | property=! 5 | 6 | 7 | 8 | 15 | 30 | 31 | 32 | 33 | select * from test where id=?{id} 34 | 37 | 38 | select * from test 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /core/src/test/scriptella/NestedQueryTest2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 17 | 18 | select ID*4 as id from test 19 | 20 | select id+?id as id from Test 21 | 24 | 25 | 26 | 27 | 28 | select ID*2 as id from Test 29 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /core/src/test/scriptella/NestedQueryTestRownum.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Test script for rownum pseudo-column functionality. 5 | 6 | 7 | 15 | 20 | 21 | 22 | select * from test 23 | 24 | select * from test where id=?rownum 25 | 28 | 29 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /core/src/test/scriptella/OnErrorTest2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 16 | -------------------------------------------------------------------------------- /core/src/test/scriptella/OnErrorTest3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /core/src/test/scriptella/PropertiesTest.properties: -------------------------------------------------------------------------------- 1 | a=1 2 | b=2 3 | foo=bar -------------------------------------------------------------------------------- /core/src/test/scriptella/PropertiesTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #a,b and foo 5 | var=1 6 | b=$var|$var|$var|${var}|${var}|${var} 7 | 8 | url.prefix=jdbc:hsqldb:mem 9 | dbname=propertiestest 10 | driver=org.hsqldb.jdbcDriver 11 | #url should be substituted 12 | url=${url.prefix}:$dbname 13 | user=sa 14 | password= 15 | 16 | 17 | -------------------------------------------------------------------------------- /core/src/test/scriptella/SQLParametersTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | global=globalValue 8 | global2=global2Value 9 | tableName=Test 10 | insert=INSERT INTO 11 | 12 | 13 | 21 | 22 | -------------------------------------------------------------------------------- /core/src/test/scriptella/SQLParametersTest2.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 16 | 17 | ${'select * from Test'} 18 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /core/src/test/scriptella/SQLSupportPerfTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | property=1 4 | 5 | 12 | -------------------------------------------------------------------------------- /core/src/test/scriptella/TxTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 17 | -------------------------------------------------------------------------------- /core/src/test/scriptella/TxTest2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 15 | 16 | -------------------------------------------------------------------------------- /core/src/test/scriptella/TxTest3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | 20 | select * from Test 21 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /core/src/test/scriptella/configuration/ContentElTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | q 7 | 10 | 11 | -------------------------------------------------------------------------------- /core/src/test/scriptella/configuration/DynamicIncludeITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | SELECT * FROM Files 17 | 22 | 23 | -------------------------------------------------------------------------------- /core/src/test/scriptella/configuration/DynamicIncludeITest1.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO Data VALUES (1) -------------------------------------------------------------------------------- /core/src/test/scriptella/configuration/DynamicIncludeITest2.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO Data VALUES (2) -------------------------------------------------------------------------------- /core/src/test/scriptella/configuration/MockConnectionEl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.configuration; 17 | 18 | import java.util.Collections; 19 | import java.util.Map; 20 | 21 | /** 22 | * Testable mock for connection elements. 23 | * 24 | * @author Fyodor Kupolov 25 | * @version 1.0 26 | */ 27 | public class MockConnectionEl extends ConnectionEl { 28 | private Map properties; 29 | 30 | public MockConnectionEl() { 31 | properties = Collections.emptyMap(); 32 | } 33 | 34 | public MockConnectionEl(Map properties, String url) { 35 | this.properties = properties; 36 | setUrl(url); 37 | } 38 | 39 | public MockConnectionEl(Map properties) { 40 | this.properties = properties; 41 | } 42 | 43 | @Override 44 | public Map getProperties() { 45 | return properties; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /core/src/test/scriptella/configuration/ValidationTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.configuration; 17 | 18 | import scriptella.AbstractTestCase; 19 | import scriptella.execution.EtlExecutorException; 20 | 21 | /** 22 | * Tests ETL scripts validation. 23 | * 24 | * @author Fyodor Kupolov 25 | * @version 1.0 26 | */ 27 | public class ValidationTest extends AbstractTestCase { 28 | public void testConnectionId() throws EtlExecutorException { 29 | try { 30 | newEtlExecutor(); 31 | fail("No connection id validation error expected"); 32 | } catch (ConfigurationException e) { 33 | //OK 34 | } 35 | try { 36 | newEtlExecutor("ValidationTest2.xml"); 37 | fail("Duplicate connection validation error expected"); 38 | } catch (ConfigurationException e) { 39 | //OK 40 | } 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /core/src/test/scriptella/configuration/ValidationTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /core/src/test/scriptella/configuration/ValidationTest2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /core/src/test/scriptella/configuration/XIncludeTest.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE Test ( 2 | ID INT, 3 | VALUE VARCHAR(255) 4 | ); 5 | CREATE TABLE Test2 ( 6 | ID INT, 7 | VALUE VARCHAR(255) 8 | ); 9 | insert into test(id, value) values (1,'222'); 10 | insert into test(id, value) values (2,'333'); 11 | insert into test(id, value) values (3,'444'); -------------------------------------------------------------------------------- /core/src/test/scriptella/configuration/XIncludeTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 10 | 15 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /core/src/test/scriptella/configuration/xinctst/XIncludeTest.sql: -------------------------------------------------------------------------------- 1 | insert into test2(id, value) values (3,'444'); -------------------------------------------------------------------------------- /core/src/test/scriptella/core/EtlExecutorTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.core; 17 | 18 | import scriptella.AbstractTestCase; 19 | import scriptella.execution.EtlExecutor; 20 | import scriptella.execution.EtlExecutorException; 21 | 22 | /** 23 | * Tests for {@link scriptella.execution.EtlExecutor}. 24 | * 25 | * @author Fyodor Kupolov 26 | * @version 1.0 27 | */ 28 | public class EtlExecutorTest extends AbstractTestCase { 29 | /** 30 | * Just a smoke test to make sure run and call methods works correctly. 31 | * @throws EtlExecutorException if execution fails. 32 | */ 33 | public void testRunCall() throws EtlExecutorException { 34 | EtlExecutor exec = newEtlExecutor("EtlExecutorTestRunCall.xml"); 35 | exec.call(); 36 | exec.run(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /core/src/test/scriptella/core/EtlExecutorTestRunCall.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /core/src/test/scriptella/core/SqlTestHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.core; 17 | 18 | import scriptella.spi.Connection; 19 | import scriptella.spi.ConnectionParameters; 20 | 21 | import java.util.List; 22 | import java.util.Map; 23 | 24 | 25 | /** 26 | * Utility class provides accessors for SQLEngine internal state. 27 | */ 28 | public class SqlTestHelper { 29 | public static Map getConnections( 30 | final Session engine) { 31 | return engine.managedConnections; 32 | } 33 | 34 | public static Connection getConnection(final ConnectionManager cf) { 35 | return cf.connection; 36 | } 37 | 38 | public static List getNewConnections(final ConnectionManager cf) { 39 | return cf.newConnections; 40 | } 41 | 42 | public static ConnectionParameters getConnectionParameters(ConnectionManager cm) { 43 | return cm.connectionParameters; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /core/src/test/scriptella/execution/CancellationTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 23 | 24 | select * from t1 25 | 26 | select * from t1 27 | 28 | select * from t1 29 | 30 | select * from t1 31 | 32 | select * from t1 33 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /core/src/test/scriptella/execution/ExecutionStatisticsTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | select * from t1 16 | 17 | select * from t1 where id=?id 18 | 21 | 22 | 23 | 24 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /core/src/test/scriptella/execution/ExecutionStatisticsTest2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | select * from t1 16 | 19 | 22 | 23 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /core/src/test/scriptella/execution/ExecutionStatisticsTest3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | select * from t1 17 | 18 | select * from t1 where id=?id 19 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /core/src/test/scriptella/execution/JmxEtlManagerITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /core/src/test/scriptella/execution/LazyInitConnectionTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /core/src/test/scriptella/execution/TestableEtlExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.execution; 17 | 18 | import scriptella.configuration.ConfigurationEl; 19 | 20 | 21 | /** 22 | * A testable version of EtlExecutor. 23 | */ 24 | public class TestableEtlExecutor extends EtlExecutor { 25 | public TestableEtlExecutor() { 26 | } 27 | 28 | public TestableEtlExecutor(ConfigurationEl configuration) { 29 | super(configuration); 30 | } 31 | 32 | public void rollbackAll(final EtlContext ctx) { 33 | super.rollbackAll(ctx); 34 | } 35 | 36 | public void closeAll(final EtlContext ctx) { 37 | super.closeAll(ctx); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /core/src/test/scriptella/jdbc/AutocommitITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | autocommit=true 5 | 6 | 7 | autocommit.size=4 8 | 9 | 10 | 17 | 18 | 27 | 28 | -------------------------------------------------------------------------------- /core/src/test/scriptella/jdbc/ColumnAliasITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | -------------------------------------------------------------------------------- /core/src/test/scriptella/jdbc/StatementWrapperTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 13 | -------------------------------------------------------------------------------- /core/src/test/scriptella/spi/MockConnectionParameters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.spi; 17 | 18 | import scriptella.configuration.MockConnectionEl; 19 | 20 | import java.util.Map; 21 | 22 | /** 23 | * Mock implementation of {@link scriptella.spi.ConnectionParameters}. 24 | * 25 | * @author Fyodor Kupolov 26 | * @version 1.0 27 | */ 28 | public class MockConnectionParameters extends ConnectionParameters { 29 | 30 | public MockConnectionParameters() { 31 | super(new MockConnectionEl(), MockDriverContext.INSTANCE); 32 | } 33 | 34 | public MockConnectionParameters(Mapproperties, String url) { 35 | super(new MockConnectionEl(properties, url), MockDriverContext.INSTANCE); 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /core/src/test/scriptella/spi/MockDriverContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.spi; 17 | 18 | import scriptella.util.IOUtils; 19 | 20 | import java.net.MalformedURLException; 21 | import java.net.URL; 22 | 23 | /** 24 | * Mock implementation of drivers context suitable for typical cases. 25 | * 26 | * @author Fyodor Kupolov 27 | * @version 1.0 28 | */ 29 | public enum MockDriverContext implements DriverContext { 30 | INSTANCE; 31 | 32 | public URL getScriptFileURL() { 33 | try { 34 | return new URL("file:/mock"); 35 | } catch (MalformedURLException e) { 36 | throw new IllegalStateException(e); 37 | } 38 | } 39 | 40 | public URL resolve(final String uri) throws MalformedURLException { 41 | return IOUtils.resolve(getScriptFileURL(),uri); 42 | } 43 | 44 | public Object getParameter(final String name) { 45 | return null; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /core/src/test/scriptella/text/TimestampValueFormatTest.java: -------------------------------------------------------------------------------- 1 | package scriptella.text; 2 | 3 | import junit.framework.TestCase; 4 | 5 | import java.sql.Timestamp; 6 | import java.util.Date; 7 | 8 | /** 9 | * @author Fyodor Kupolov 10 | */ 11 | public class TimestampValueFormatTest extends TestCase { 12 | public void testFormat() throws Exception { 13 | String dateStr = "2012-5-25 01:02:03"; 14 | String expectedStr = "2012-05-25 01:02:03.0"; 15 | Date date = Timestamp.valueOf(dateStr); 16 | String actualStr = new TimestampValueFormat().format(date); 17 | assertEquals(expectedStr, actualStr); 18 | } 19 | 20 | public void testParse() throws Exception { 21 | String dateStr = "2012-5-25 01:02:03"; 22 | Date expectedDate = Timestamp.valueOf(dateStr); 23 | Date actualDate = new TimestampValueFormat().parse(dateStr); 24 | assertEquals(expectedDate, actualDate); 25 | 26 | //test malformed values 27 | try { 28 | new TimestampValueFormat().parse(""); 29 | } catch (IllegalArgumentException e) { 30 | System.out.println("Expected " + e); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /core/src/test/scriptella/text/ValueFormatBuilderTest.java: -------------------------------------------------------------------------------- 1 | package scriptella.text; 2 | 3 | import junit.framework.TestCase; 4 | 5 | import java.text.FieldPosition; 6 | import java.text.Format; 7 | import java.text.MessageFormat; 8 | import java.text.ParsePosition; 9 | 10 | /** 11 | * @author Fyodor Kupolov 12 | */ 13 | public class ValueFormatBuilderTest extends TestCase { 14 | public static class TestFormat extends Format { 15 | 16 | @Override 17 | public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) { 18 | return null; 19 | } 20 | 21 | @Override 22 | public Object parseObject(String source, ParsePosition pos) { 23 | return null; 24 | } 25 | } 26 | 27 | public void testCustomClass() { 28 | ValueFormatBuilder b = new ValueFormatBuilder(); 29 | b.setClassName(TestFormat.class.getName()); 30 | Format format = b.build(); 31 | assertTrue(format instanceof TestFormat); 32 | } 33 | 34 | public void testTimestamp() { 35 | ValueFormatBuilder b = new ValueFormatBuilder(); 36 | b.setType("timestamp"); 37 | 38 | Format format = b.build(); 39 | assertTrue(format instanceof TimestampValueFormat); 40 | } 41 | 42 | public void testMsgFormat() { 43 | ValueFormatBuilder b = new ValueFormatBuilder(); 44 | b.setType("number").setPattern("0.0"); 45 | 46 | Format format = b.build(); 47 | assertTrue(format instanceof MessageFormat); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /drivers/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /drivers/src/conf/scriptella/driver/auto/url.properties: -------------------------------------------------------------------------------- 1 | #Autodiscovery driver configuration 2 | #key - URL pattern 3 | #value - Scriptella driver class name or an alias. 4 | spring\:=spring 5 | jndi\:=jndi 6 | mailto\:=mail 7 | jdbc\:db2\:=db2 8 | jdbc\:h2\:=h2 9 | jdbc\:hsqldb\:=hsqldb 10 | #3 urls for MS-SQL 11 | jdbc\:sqlserver\:=mssql 12 | jdbc\:microsoft\:=mssql 13 | jdbc\:jtds\:sqlserver\:=mssql 14 | jdbc\:mysql\:=mysql 15 | jdbc\:oracle\:=oracle 16 | jdbc\:postgresql\:=postgresql 17 | #2 urls for Sybase ASE/ASA 18 | jdbc\:sybase\:=sybase 19 | jdbc\:jtds\:sybase\:=sybase 20 | ldap\:=ldap 21 | jdbc\:derby\:=derby 22 | jdbc\:as400\:=as400 23 | jdbc\:xls\:=xls 24 | jdbc\:odbc\:=odbc 25 | jdbc\:cubrid\:=cubrid -------------------------------------------------------------------------------- /drivers/src/conf/scriptella/driver/spring/beanFactory.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/as400/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.as400; 17 | 18 | import scriptella.jdbc.GenericDriver; 19 | 20 | /** 21 | * Scriptella Adapter for an IBM AS/400 System. 22 | * 23 | *

For configuration details and examples see overview page. 24 | * 25 | * @author Kirill Volgin 26 | * @version 1.0 27 | */ 28 | public class Driver extends GenericDriver { 29 | public static final String AS400_DRIVER_NAME = "com.ibm.as400.access.AS400JDBCDriver"; 30 | 31 | 32 | public Driver() { 33 | loadDrivers(AS400_DRIVER_NAME); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/as400/package.html: -------------------------------------------------------------------------------- 1 | 2 | AS/400 Driver Adapter for Scriptella. 3 |

See Overview of JDBC package for a description of common features and connection properties.

4 |

General information

5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
Driver class:scriptella.driver.as400.Driver
URL:Same as for AS400 JDBC Driver.
Runtime dependencies:jt400.jar
17 |

Driver Specific Properties

18 | 19 | 20 | 21 | 22 | 23 | 24 |
NameDescriptionRequired
25 | 26 |

Examples

27 |
28 |     <connection id="c1" driver="as400" url="jdbc:as400://your_server;naming=system;translate binary=true" user="username" password="password" classpath="lib_dir/jt400.jar">
29 |     </connection>
30 | 
31 |
32 | or using autodiscovery feature: 33 |
34 |
35 | 
36 |     <connection id="c1" url="jdbc:as400://your_server;naming=system;translate binary=true" user="username" password="password" classpath="lib_dir/jt400.jar">
37 |     </connection>
38 | 
39 | 
40 | 41 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/csv/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.csv; 17 | 18 | import scriptella.spi.AbstractScriptellaDriver; 19 | import scriptella.spi.Connection; 20 | import scriptella.spi.ConnectionParameters; 21 | import scriptella.spi.DialectIdentifier; 22 | 23 | /** 24 | * Scriptella driver for CSV files. 25 | *

For configuration details and examples see overview page. 26 | * 27 | * @author Fyodor Kupolov 28 | * @version 1.0 29 | */ 30 | public class Driver extends AbstractScriptellaDriver { 31 | static final DialectIdentifier DIALECT = new DialectIdentifier("CSV", "1.0"); 32 | 33 | public Connection connect(ConnectionParameters connectionParameters) { 34 | return new CsvConnection(connectionParameters); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/csv/opencsv/package.html: -------------------------------------------------------------------------------- 1 | 2 |

Optimized opencsv implementation for Scriptella. 3 | The standard opencsv library is too inefficient in terms of performance and memory usage. 4 | I had to fork opencsv to apply all the changes I required. 5 | See http://javaforge.com/issue/7098?navigation=true for more details.

6 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/cubrid/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2010 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.cubrid; 17 | 18 | import scriptella.jdbc.GenericDriver; 19 | 20 | /** 21 | * Scriptella Adapter for Cubrid database. 22 | *

For configuration details and examples see overview page. 23 | * 24 | * @author Arnia Software 25 | * @version 1.0 26 | */ 27 | public class Driver extends GenericDriver { 28 | public static final String CUBRID_DRIVER_NAME = "cubrid.jdbc.driver.CUBRIDDriver"; 29 | 30 | public Driver() { 31 | loadDrivers(CUBRID_DRIVER_NAME); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/cubrid/package.html: -------------------------------------------------------------------------------- 1 | 2 | Cubrid Driver Adapter for Scriptella. 3 |

Note: The driver tries to load Cubrid JDBC driver. 4 | 5 |

General information

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
Driver class:scriptella.driver.cubrid.Driver
URL:Same as for Cubrid JDBC Driver. Ex:jdbc:CUBRID:127.0.0.1:30000:demodb:::
Runtime dependencies:cubrid-connector-java.jar
20 |

Driver Specific Properties

21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
NameDescriptionRequired
Broker PortThe port number used for connectionYes
33 | 34 |

Examples

35 |
36 |     <connection url="jdbc:CUBRID:127.0.0.1:30000:demodb:::" user="dba" password="">
37 |     </connection>
38 | 
39 |
40 | 41 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/db2/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.db2; 17 | 18 | import scriptella.jdbc.GenericDriver; 19 | 20 | /** 21 | * Scriptella Adapter for DB2 database. 22 | * 23 | *

For configuration details and examples see overview page. 24 | * 25 | * @author Kirill Volgin 26 | * @version 1.0 27 | */ 28 | public class Driver extends GenericDriver { 29 | public static final String DB2_DRIVER_NAME = "com.ibm.db2.jcc.DB2Driver"; 30 | 31 | 32 | public Driver() { 33 | loadDrivers(DB2_DRIVER_NAME); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/db2/package.html: -------------------------------------------------------------------------------- 1 | 2 | DB2 Driver Adapter for Scriptella. 3 |

See Overview of JDBC package for a description of common features and connection properties.

4 |

General information

5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
Driver class:scriptella.driver.db2.Driver
URL:Same as for DB2 JDBC Driver.
Runtime dependencies:db2jcc.jar;db2jcc_license_cu.jar
17 |

Driver Specific Properties

18 | 19 | 20 | 21 | 22 | 23 | 24 |
NameDescriptionRequired
25 | 26 |

Examples

27 |
28 |     <connection id="c1" driver="db2" url="jdbc:db2://localhost:50000/sample" user="username" password="password">
29 |     </connection>
30 | 
31 | 32 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/derby/package.html: -------------------------------------------------------------------------------- 1 | 2 | Derby Driver Adapter for Scriptella. 3 |

See Overview of JDBC package for a description of common features and connection properties.

4 |

General information

5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
Driver class:scriptella.driver.derby.Driver
URL:Same as for Derby JDBC Driver.
Runtime dependencies:clientDerby.jar;derby.jar
17 |

Driver Specific Properties

18 | 19 | 20 | 21 | 22 | 23 | 24 |
NameDescriptionRequired
25 | 26 |

Examples

27 |
28 |     <connection id="c1" driver="derby" url="jdbc:derby://localhost/sample" user="username" password="password">
29 |     </connection>
30 | 
31 | 32 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/h2/package.html: -------------------------------------------------------------------------------- 1 | 2 | H2 Database Driver Adapter for Scriptella. 3 |

See Overview of JDBC package for a description of common features and connection properties.

4 |

General information

5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Driver class:scriptella.driver.h2.Driver
URL:Same as for H2. No URL means private in-memory database.
Runtime dependencies:h2.jar
16 |

Driver Specific Properties

17 | 18 | 19 | 20 | 21 | 22 | 23 |
NameDescriptionRequired
24 | 25 |

Examples

26 |
27 |     <connection driver="h2" url="jdbc:h2:file:database" user="sa">
28 |     </connection>
29 | 
30 |     <!--empty URL attribute means private In-Memory database -->
31 |     <connection driver="h2"/>
32 | 
33 | 34 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/hsqldb/package.html: -------------------------------------------------------------------------------- 1 | 2 | HSLQDB Driver Adapter for Scriptella. 3 |

Adds a possibility to control database shutdown. See Overview of JDBC package for a description of common features and connection properties.

4 |

General information

5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Driver class:scriptella.driver.hsqldb.Driver
URL:Same as for HSQLDB
Runtime dependencies:hsqldb.jar
16 |

Driver Specific Properties

17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 29 | 30 | 31 | 32 |
NameDescriptionRequired
hsql.shutdown_on_exitTrue if SHUTDOWN command should be automatically executed before last connection closed. In 1.7.2, 26 | in-process databases are no longer closed when the last connection to the database is explicitly closed via 27 | JDBC, 28 | a SHUTDOWN is requiredNo, default value is true
33 | 34 |

Example

35 |
36 |     <connection driver="hsqldb" url="jdbc:hsqldb:file:db" user="sa">
37 |         hsql.shutdown_on_exit=true;
38 |     </connection>
39 | 
40 | 41 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/jexl/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.jexl; 17 | 18 | import scriptella.spi.AbstractScriptellaDriver; 19 | import scriptella.spi.Connection; 20 | import scriptella.spi.ConnectionParameters; 21 | import scriptella.spi.DialectIdentifier; 22 | 23 | /** 24 | * Driver for JEXL. 25 | *

For configuration details and examples see overview page. 26 | * 27 | * @author Fyodor Kupolov 28 | * @version 1.0 29 | */ 30 | public class Driver extends AbstractScriptellaDriver { 31 | static final DialectIdentifier DIALECT = new DialectIdentifier("JEXL", "2.0"); 32 | 33 | public Connection connect(ConnectionParameters connectionParameters) { 34 | return new JexlConnection(connectionParameters); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/jexl/JexlProviderException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Header: $ 3 | * $Revision: $ 4 | * $Date: $ 5 | * 6 | * Copyright 2003-2005 7 | * All rights reserved. 8 | */ 9 | package scriptella.driver.jexl; 10 | 11 | import scriptella.spi.ProviderException; 12 | 13 | /** 14 | * Thrown to indicate a problem with JEXL script. 15 | * 16 | * @author Fyodor Kupolov 17 | * @version 1.0 18 | */ 19 | public class JexlProviderException extends ProviderException { 20 | public JexlProviderException() { 21 | } 22 | 23 | public JexlProviderException(String message) { 24 | super(message); 25 | } 26 | 27 | public JexlProviderException(String message, Throwable cause) { 28 | super(message, cause); 29 | } 30 | 31 | public JexlProviderException(Throwable cause) { 32 | super(cause); 33 | } 34 | 35 | public String getProviderName() { 36 | return Driver.DIALECT.getName(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/jndi/JndiProviderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.jndi; 17 | 18 | import scriptella.jdbc.JdbcException; 19 | 20 | /** 21 | * Thrown to indicate JNDI provider failure. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public class JndiProviderException extends JdbcException { 27 | public JndiProviderException(String message, Throwable cause) { 28 | super(message, cause); 29 | } 30 | 31 | public JndiProviderException(String message) { 32 | super(message); 33 | } 34 | 35 | public String getProviderName() { 36 | return "JNDI"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/jndi/package.html: -------------------------------------------------------------------------------- 1 | 2 | JNDI Datasource Driver for Scriptella. 3 |

This driver allows to work with JNDI-bound datasource connections, 4 | useful in J2EE environment

5 |

This driver acts as a proxy and relies on JDBC Bridge.

6 | 7 |

General information

8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
Driver class:scriptella.driver.jndi.Driver
Driver alias name:jndi
URL:JNDI name of the datasource
Runtime dependencies:None
22 |

Notes

23 |

Depending on your environment you may need to specify additional JNDI properties 24 | inside a connection element. These settings will take precedence over jndi.properties and System properties.

25 | 26 |

Example

27 |
28 |     <connection driver="jndi" url="ds/appDataSource">
29 |         #Default settings should work in J2EE environment, but you may reconfigure JNDI here
30 |         #java.naming.factory.initial=jndi.provider.Factory
31 |     </connection>
32 | 
33 | 34 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/ldap/ldif/LdifParseException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.ldap.ldif; 17 | 18 | import scriptella.driver.ldap.LdapProviderException; 19 | 20 | /** 21 | * Thrown to indicate a parse excpetion. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public class LdifParseException extends LdapProviderException { 27 | public LdifParseException(String message) { 28 | super(message); 29 | } 30 | 31 | public LdifParseException(String message, String errorStatement) { 32 | super(message, errorStatement); 33 | } 34 | 35 | public LdifParseException(String message, String errorStatement, Throwable cause) { 36 | super(message, errorStatement, cause); 37 | } 38 | 39 | public LdifParseException(String message, Throwable cause) { 40 | super(message, cause); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/mail/MailProviderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.mail; 17 | 18 | import scriptella.spi.ProviderException; 19 | 20 | /** 21 | * Thrown to indicate a problem with EMail producing/sending. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public class MailProviderException extends ProviderException { 27 | 28 | public MailProviderException() { 29 | } 30 | 31 | public MailProviderException(String message) { 32 | super(message); 33 | } 34 | 35 | public MailProviderException(String message, Throwable cause) { 36 | super(message, cause); 37 | } 38 | 39 | public MailProviderException(Throwable cause) { 40 | super(cause); 41 | } 42 | 43 | 44 | public String getProviderName() { 45 | return Driver.DIALECT.getName(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/mysql/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.mysql; 17 | 18 | import scriptella.jdbc.GenericDriver; 19 | 20 | /** 21 | * Scriptella Adapter for MySQL database. 22 | *

For configuration details and examples see overview page. 23 | * 24 | * @author Kirill Volgin 25 | * @version 1.0 26 | */ 27 | public class Driver extends GenericDriver { 28 | public static final String MYSQL_DRIVER_NAME = "com.mysql.jdbc.Driver"; 29 | 30 | 31 | public Driver() { 32 | loadDrivers(MYSQL_DRIVER_NAME); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/odbc/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.odbc; 17 | 18 | import scriptella.jdbc.GenericDriver; 19 | 20 | /** 21 | * Scriptella Adapter for Sun's JDBC-ODBC driver. 22 | * 23 | *

For configuration details and examples see overview page. 24 | * 25 | * @author Fyodor Kupolov 26 | * @version 1.0 27 | */ 28 | public class Driver extends GenericDriver { 29 | public static final String ODBC_DRIVER_NAME = "sun.jdbc.odbc.JdbcOdbcDriver"; 30 | 31 | public Driver() { 32 | loadDrivers(ODBC_DRIVER_NAME); 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/odbc/package.html: -------------------------------------------------------------------------------- 1 | 2 |

The JDBC-ODBC Bridge Adapter for Scriptella.

3 | The JDBC-ODBC Bridge is a JDBC driver that implements JDBC operations by translating them into ODBC operations. To ODBC it appears as a normal application program. The Bridge implements JDBC for any database for which an ODBC driver is available. The Bridge is implemented as the sun.jdbc.odbc Java package and contains a native library used to access ODBC. 4 |

See Overview of JDBC package for a description of common features and connection properties.

5 |

General information

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
Driver class:scriptella.driver.odbc.Driver
URL:Same as for Sun's JDBC-ODBC Bridge.
Runtime dependencies:None
17 |

Driver Specific Properties

18 | 19 | 20 | 21 | 22 | 23 | 24 |
NameDescriptionRequired
25 | 26 |

Examples

27 |
28 |     <connection url="jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=Northwind.mdb"/>
29 | 
30 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/package.html: -------------------------------------------------------------------------------- 1 | 2 | Parent package for Scriptella Drivers. 3 | 4 |

This package is a recommended namespace for various drivers. 5 | Scriptella drivers lookup mechanism automatically searches driver classes inside this 6 | package without a necessity to specify a full class name. The search procedure is 7 | described in DriverFactory class. 8 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/postgresql/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.postgresql; 17 | 18 | import scriptella.jdbc.GenericDriver; 19 | 20 | /** 21 | * Scriptella Adapter for PostgreSQL database. 22 | * 23 | *

For configuration details and examples see overview page. 24 | * 25 | * NOTE: Problems during migration from/to Oracle(and DB2) RDBMS could be occurred due to not supported Bit/Boolean 26 | * data types equality by Postgre SQL DB 27 | * 28 | * @author Kirill Volgin 29 | * @version 1.0 30 | */ 31 | public class Driver extends GenericDriver { 32 | public static final String POSTGRESQL_DRIVER_NAME = "org.postgresql.Driver"; 33 | 34 | public Driver() { 35 | loadDrivers(POSTGRESQL_DRIVER_NAME); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/postgresql/package.html: -------------------------------------------------------------------------------- 1 | 2 | PostgreSQL Driver Adapter for Scriptella. 3 |

See Overview of JDBC package for a description of common features and connection properties.

4 |

General information

5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
Driver class:scriptella.driver.postgresql.Driver
URL:Same as for PostgreSQL JDBC Driver.
Runtime dependencies:postgresql-8x.jdbc3.jar
17 |

Driver Specific Properties

18 | 19 | 20 | 21 | 22 | 23 | 24 |
NameDescriptionRequired
25 | 26 |

Examples

27 |
28 |     <connection url="jdbc:postgresql://localhost:5432/test" user="username" password="password">
29 |     </connection>
30 | 
31 | 32 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/script/BindingsParametersCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.script; 17 | 18 | import scriptella.spi.ParametersCallback; 19 | import scriptella.spi.QueryCallback; 20 | 21 | import javax.script.Bindings; 22 | 23 | /** 24 | * {@link javax.script.Bindings} implementation for 25 | * integration into Scriptella execution environment. 26 | *

This class simply declare {@link javax.script.Bindings} interface from Java SE 6. 27 | * 28 | * @author Fyodor Kupolov 29 | * @version 1.0 30 | */ 31 | public class BindingsParametersCallback extends ParametersCallbackMap implements Bindings { 32 | public BindingsParametersCallback(ParametersCallback parentParameters) { 33 | super(parentParameters); 34 | } 35 | 36 | 37 | public BindingsParametersCallback(ParametersCallback parentParameters, QueryCallback queryCallback) { 38 | super(parentParameters, queryCallback); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/script/ScriptProviderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.script; 17 | 18 | import scriptella.spi.ProviderException; 19 | 20 | /** 21 | * Thrown to indicate an error in scripting engine. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public class ScriptProviderException extends ProviderException { 27 | public ScriptProviderException(String message, Throwable cause) { 28 | super(message, cause); 29 | } 30 | 31 | public ScriptProviderException(String message, Throwable cause, String errorStatement) { 32 | super(message, cause); 33 | setErrorStatement(errorStatement); 34 | } 35 | 36 | 37 | public String getProviderName() { 38 | return "javax.script"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/scriptella/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.scriptella; 17 | 18 | import scriptella.spi.AbstractScriptellaDriver; 19 | import scriptella.spi.Connection; 20 | import scriptella.spi.ConnectionParameters; 21 | import scriptella.spi.DialectIdentifier; 22 | 23 | /** 24 | * This driver allows execution of external ETL files. 25 | *

For configuration details and examples see overview page. 26 | * 27 | * @author Fyodor Kupolov 28 | * @version 1.0 29 | */ 30 | public class Driver extends AbstractScriptellaDriver { 31 | static final DialectIdentifier DIALECT = new DialectIdentifier(getScriptellaTitle(), getScriptellaVersion()); 32 | 33 | public Connection connect(ConnectionParameters connectionParameters) { 34 | return new ScriptellaConnection(connectionParameters); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/scriptella/ScriptellaProviderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.scriptella; 17 | 18 | import scriptella.jdbc.JdbcException; 19 | 20 | /** 21 | * Thrown to indicate Spring provider failure. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public class ScriptellaProviderException extends JdbcException { 27 | public ScriptellaProviderException(String message, Throwable cause) { 28 | super(message, cause); 29 | } 30 | 31 | public ScriptellaProviderException(String message) { 32 | super(message); 33 | } 34 | 35 | public String getProviderName() { 36 | return "Scriptella"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/shell/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2020 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.shell; 17 | 18 | import scriptella.spi.AbstractScriptellaDriver; 19 | import scriptella.spi.Connection; 20 | import scriptella.spi.ConnectionParameters; 21 | 22 | /** 23 | * Shell scripts driver. 24 | *

For configuration details and examples see overview page. 25 | * 26 | * @author Fyodor Kupolov 27 | * @version 1.0 28 | */ 29 | public class Driver extends AbstractScriptellaDriver { 30 | 31 | public Connection connect(ConnectionParameters connectionParameters) { 32 | return new ShellConnection(new ShellConnectionParameters(connectionParameters)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/shell/ShellOs.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2020 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.shell; 17 | 18 | /** 19 | * Represents target shell OS 20 | */ 21 | public enum ShellOs { 22 | LINUX, MAC, WINDOWS; 23 | 24 | public static ShellOs fromOsNameVersion(String osName, String osVersion) { 25 | if (osName.toLowerCase().startsWith("mac")) { 26 | return MAC; 27 | } else if (osName.toLowerCase().startsWith("windows")) { 28 | return WINDOWS; 29 | } 30 | return LINUX; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/shell/ShellProviderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2020 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.shell; 17 | 18 | import scriptella.spi.ProviderException; 19 | 20 | /** 21 | * Thrown to indicate a problem with shell script execution. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public class ShellProviderException extends ProviderException { 27 | public ShellProviderException() { 28 | } 29 | 30 | public ShellProviderException(String message) { 31 | super(message); 32 | } 33 | 34 | public ShellProviderException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public ShellProviderException(Throwable cause) { 39 | super(cause); 40 | } 41 | 42 | public String getProviderName() { 43 | return "Shell"; 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/spring/SpringProviderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.spring; 17 | 18 | import scriptella.jdbc.JdbcException; 19 | 20 | /** 21 | * Thrown to indicate Spring provider failure. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public class SpringProviderException extends JdbcException { 27 | public SpringProviderException(String message, Throwable cause) { 28 | super(message, cause); 29 | } 30 | 31 | public SpringProviderException(String message) { 32 | super(message); 33 | } 34 | 35 | public String getProviderName() { 36 | return "Spring"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/sybase/package.html: -------------------------------------------------------------------------------- 1 | 2 | Scriptella Driver Adapter for Sybase ASE and ASA. 3 |

Note: The driver tries to load any of the known JDBC drivers in the following order: 4 |

8 |

See Overview of JDBC package for a description of common features and connection properties.

9 |

General information

10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 |
Driver class:scriptella.driver.sybase.Driver
URL:Same as for Sybase JDBC Driver.
Runtime dependencies:jconn3.jar 20 | or jtds-VERSION.jar. 21 |
24 |

Driver Specific Properties

25 | 26 | 27 | 28 | 29 | 30 | 31 |
NameDescriptionRequired
32 | 33 |

Examples

34 |
35 |     <connection driver="sybase" url="jdbc:sybase:Tds:localhost:2638/tst" user="username" password="password">
36 |     </connection>
37 | 
38 | 39 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/text/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.text; 17 | 18 | import scriptella.spi.AbstractScriptellaDriver; 19 | import scriptella.spi.Connection; 20 | import scriptella.spi.ConnectionParameters; 21 | import scriptella.spi.DialectIdentifier; 22 | 23 | /** 24 | * Represents a Text file driver. 25 | *

For configuration details and examples see overview page. 26 | * 27 | * @author Fyodor Kupolov 28 | * @version 1.0 29 | */ 30 | public class Driver extends AbstractScriptellaDriver { 31 | static final DialectIdentifier DIALECT = new DialectIdentifier("Text", "1.0"); 32 | 33 | public Connection connect(ConnectionParameters connectionParameters) { 34 | return new TextConnection(connectionParameters); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/text/TextProviderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.text; 17 | 18 | import scriptella.spi.ProviderException; 19 | 20 | /** 21 | * Thrown to indicate a problem with Text file processing. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public class TextProviderException extends ProviderException { 27 | public TextProviderException() { 28 | } 29 | 30 | public TextProviderException(String message) { 31 | super(message); 32 | } 33 | 34 | public TextProviderException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public TextProviderException(Throwable cause) { 39 | super(cause); 40 | } 41 | 42 | public String getProviderName() { 43 | return Driver.DIALECT.getName(); 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/velocity/VelocityProviderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.velocity; 17 | 18 | import scriptella.spi.ProviderException; 19 | 20 | /** 21 | * Thrown by Velocity Provider to indicate velocity failure. 22 | */ 23 | public class VelocityProviderException extends ProviderException { 24 | public VelocityProviderException() { 25 | } 26 | 27 | public VelocityProviderException(String message) { 28 | super(message); 29 | } 30 | 31 | public VelocityProviderException(String message, Throwable cause) { 32 | super(message, cause); 33 | } 34 | 35 | public VelocityProviderException(Throwable cause) { 36 | super(cause); 37 | } 38 | 39 | public String getProviderName() { 40 | return Driver.DIALECT.getName(); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/xls/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.xls; 17 | 18 | import scriptella.jdbc.GenericDriver; 19 | 20 | /** 21 | * Scriptella Adapter for SQLScheet. 22 | * 23 | *

For configuration details and examples see overview page. 24 | * 25 | * @author Kirill Volgin 26 | * @version 1.0 27 | */ 28 | public class Driver extends GenericDriver { 29 | public static final String XLS_DRIVER_NAME = "net.pcal.sqlsheet.XlsDriver"; 30 | 31 | 32 | public Driver() { 33 | loadDrivers(XLS_DRIVER_NAME); 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/xpath/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.xpath; 17 | 18 | import scriptella.spi.AbstractScriptellaDriver; 19 | import scriptella.spi.Connection; 20 | import scriptella.spi.ConnectionParameters; 21 | import scriptella.spi.DialectIdentifier; 22 | 23 | /** 24 | * Represents a driver for querying XML files with XPath expressions. 25 | *

For configuration details and examples see overview page. 26 | * 27 | * @author Fyodor Kupolov 28 | * @version 1.0 29 | */ 30 | public class Driver extends AbstractScriptellaDriver { 31 | static final DialectIdentifier DIALECT = new DialectIdentifier("XPath", "1.0"); 32 | 33 | public Connection connect(ConnectionParameters connectionParameters) { 34 | return new XPathConnection(connectionParameters); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /drivers/src/java/scriptella/driver/xpath/XPathProviderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.xpath; 17 | 18 | import scriptella.spi.ProviderException; 19 | 20 | /** 21 | * Thrown to indicate a problem with XML file querying. 22 | * 23 | * @author Fyodor Kupolov 24 | * @version 1.0 25 | */ 26 | public class XPathProviderException extends ProviderException { 27 | public XPathProviderException() { 28 | } 29 | 30 | public XPathProviderException(String message) { 31 | super(message); 32 | } 33 | 34 | public XPathProviderException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public XPathProviderException(Throwable cause) { 39 | super(cause); 40 | } 41 | 42 | public String getProviderName() { 43 | return Driver.DIALECT.getName(); 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/alljdbc/AllJDBCDriversTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Simply creates a table with data in one db and copy it to another database. 5 | 6 | 7 | 8 | 9 | 15 | 18 | 19 | SELECT * FROM Test 20 | 23 | 24 | 25 | 26 | SELECT * FROM Test 27 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/alljdbc/h2.types.properties: -------------------------------------------------------------------------------- 1 | INT=INT 2 | FLOAT=FLOAT 3 | VARCHAR100=VARCHAR(100) 4 | BIT=BIT 5 | DATETIME=DATETIME 6 | BINARY=BINARY 7 | LONGVARBINARY=LONGVARBINARY 8 | LONGVARCHAR=LONGVARCHAR -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/alljdbc/hsqldb.types.properties: -------------------------------------------------------------------------------- 1 | INT=INT 2 | FLOAT=FLOAT 3 | VARCHAR100=VARCHAR(100) 4 | BIT=BIT 5 | DATETIME=DATETIME 6 | BINARY=BINARY 7 | LONGVARBINARY=LONGVARBINARY 8 | LONGVARCHAR=LONGVARCHAR -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/alljdbc/oracle.types.properties: -------------------------------------------------------------------------------- 1 | INT=NUMBER(10) 2 | FLOAT=FLOAT 3 | VARCHAR100=VARCHAR(100) 4 | BIT=NUMBER(1) 5 | DATETIME=TIMESTAMP 6 | BINARY=BLOB 7 | LONGVARBINARY=BLOB 8 | LONGVARCHAR=CLOB -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/alljdbc/schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Simply creates a table with data in one db and copy it to another database. 5 | 6 | 7 | 23 | 24 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/alljdbc/test.properties: -------------------------------------------------------------------------------- 1 | drivers=hsqldb,h2 2 | urls=jdbc:hsqldb:mem:tst,jdbc:h2:mem:tst 3 | users=sa, 4 | passwords=, 5 | #Uncomment the following lines to enable remote DBs tests 6 | #drivers=hsqldb,h2,oracle 7 | #urls=jdbc:hsqldb:mem:tst,jdbc:h2:mem:tst,jdbc:oracle:thin:@pc311:1521:calendar 8 | #users=sa,,calendar 9 | #passwords=,,webde -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/auto/AutodiscoveryITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 14 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/csv/CsvScriptTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | shutdown_on_exit=false 5 | 6 | 11 | 12 | 27 | 28 | 29 | 30 | 31 | 32 | 1, 33 | col4, 34 | 6 35 | 36 | 37 | 38 | 39 | 40 | SELECT * FROM Test 41 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/h2/H2ScriptTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Simply creates a table with data in one db and copy it to another H2 database. 5 | 6 | 7 | 8 | 17 | 23 | 24 | SELECT * FROM Test 25 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/hsqldb/LobsITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 15 | 16 | i=0; 17 | s = '_1234567890'; 18 | while (i lt 15) { 19 | s=s+s; 20 | i=i+1; 21 | } 22 | query.next(); 23 | 26 | 27 | 28 | i=0; 29 | while (i lt 5) { 30 | query.next(); 31 | 32 | SELECT * FROM Test 33 | 37 | 38 | i=i+1; 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/janino/JaninoGetNativeDbConnectionITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 20 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/jexl/EtlVariableITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 13 | 14 | localVar = 'local'; 15 | query.next(); 16 | 20 | 21 | 22 | 23 | i=1; 24 | while (i lt 3) { 25 | query.next(); 26 | i=i+1; 27 | } 28 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/jexl/JexlDriverITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | n=10 5 | 6 | 7 | 8 | i=0; 9 | while(i lt n) { 10 | i=i+1; 11 | query.next(); 12 | } 13 | 16 | 17 | 21 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/jexl/JexlQueryITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | v=1; 7 | 10 | 11 | 12 | 13 | v=2; 14 | query.next(); 15 | 18 | 19 | 20 | 21 | if (1==1) { 22 | v=3; 23 | query.next(); 24 | } 25 | 28 | 29 | 30 | 31 | if (1) { 32 | v=4; 33 | } 34 | 37 | 38 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/script/ParametersCallbackMapTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package scriptella.driver.script; 18 | 19 | import junit.framework.TestCase; 20 | import scriptella.spi.MockParametersCallbacks; 21 | import scriptella.spi.ParametersCallback; 22 | 23 | import java.util.Collections; 24 | 25 | /** 26 | * @author Fyodor Kupolov 27 | */ 28 | public class ParametersCallbackMapTest extends TestCase { 29 | public void testGet() { 30 | ParametersCallback pc = MockParametersCallbacks.fromMap(Collections.singletonMap("var", "value")); 31 | ParametersCallbackMap map = new ParametersCallbackMap(pc); 32 | assertEquals("value", map.get("var")); 33 | 34 | //Test override 35 | map.put("var", "value2"); 36 | assertEquals("value2", map.get("var")); 37 | 38 | map.put("var", null); 39 | assertNull(map.get("var")); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/script/ScriptDriverITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | n=10 5 | 6 | 7 | language=JavaScript 8 | 9 | 10 | 15 | 18 | 19 | 20 | 21 | 22 | i=1; 23 | query.next(); 24 | 25 | if (i==1) { 26 | i=null; 27 | } 28 | query.next(); 29 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/scriptella/ScriptellaDriverITest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.scriptella; 17 | 18 | import scriptella.AbstractTestCase; 19 | import scriptella.driver.spring.SpringDriverTest; 20 | import scriptella.execution.EtlExecutorException; 21 | 22 | import java.io.PrintWriter; 23 | import java.io.StringWriter; 24 | import java.util.logging.Level; 25 | import java.util.logging.Logger; 26 | 27 | /** 28 | * Integration test for {@link scriptella.driver.scriptella.Driver}. 29 | * 30 | * @author Fyodor Kupolov 31 | * @version 1.0 32 | */ 33 | public class ScriptellaDriverITest extends AbstractTestCase { 34 | private static final Logger logger = Logger.getLogger(SpringDriverTest.class.getName()); 35 | public static String global = ""; 36 | 37 | public void test() throws EtlExecutorException { 38 | newEtlExecutor().execute(); 39 | assertEquals("file2_file1.xml_visible\nfile1.xml_visible\nfile2_", global); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/scriptella/ScriptellaDriverITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | f1=file1.xml 5 | 6 | 7 | 8 | 12 | 15 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/scriptella/ScriptellaDriverPerfTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | file=perf.xml 5 | 6 | 7 | 8 | 9 | i=0; 10 | while (i lt 50) { 11 | i=i+1; 12 | query.next(); 13 | } 14 | 20 | 21 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/scriptella/file1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | f1=Overriden by a parent file 6 | localProp=visible 7 | 8 | 9 | language=rhino 10 | 11 | 16 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/scriptella/file2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | language=rhino 6 | 7 | 12 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/scriptella/perf.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/shell/ShellDriverITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | encoding=UTF8 5 | 6 | 7 | 8 | 9 | 10 | 11 | echo Line${1} 12 | echo Line2 13 | 16 | 17 | 20 | 21 | 32 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/spring/SpringDriverTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/spring/autostart.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/spring/batch1.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/spring/batch2.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/spring/bug4648.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/text/TextConnectionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.driver.text; 17 | 18 | import scriptella.AbstractTestCase; 19 | import scriptella.configuration.MockConnectionEl; 20 | import scriptella.configuration.StringResource; 21 | import scriptella.spi.ConnectionParameters; 22 | import scriptella.spi.MockDriverContext; 23 | import scriptella.spi.MockParametersCallbacks; 24 | 25 | /** 26 | * Tests for {@link scriptella.driver.text.TextConnection}. 27 | */ 28 | public class TextConnectionTest extends AbstractTestCase { 29 | /** 30 | * Test console output 31 | */ 32 | public void testNoUrl() { 33 | ConnectionParameters p = new ConnectionParameters(new MockConnectionEl(), MockDriverContext.INSTANCE); 34 | TextConnection c = new TextConnection(p); 35 | c.executeScript(new StringResource("Console Output"), MockParametersCallbacks.NULL); 36 | c.close(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/text/TextQueryITest.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | trim=false 21 | 22 | 23 | 24 | 25 | 26 | (.{2})(.{10}) 27 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/text/TextScriptITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | encoding=UTF8 5 | 6 | 7 | eol=\r 8 | trim=false 9 | 10 | 11 | 12 | \D*(\d+)\D* 13 | 14 | 15 | 17 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/velocity/VelocityScriptTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 15 | 16 | 17 | SELECT * FROM Test 18 | 19 | 20 | 21 | 22 | 27 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/xpath/xml1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Header 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
Column1Column2
12
34
15 | Footer 16 | 17 | -------------------------------------------------------------------------------- /drivers/src/test/scriptella/driver/xpath/xml2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2 4 | 5 | 6 | 1 7 | 8 | el2 9 | 10 | -------------------------------------------------------------------------------- /forrest/README: -------------------------------------------------------------------------------- 1 | This folder contains project documentation files built by Apache Forrest. 2 | All proposals on better XML documentation/site solution are welcome!!! 3 | 4 | Notes: 5 | 1) Forrest 0.9 is required. Higher versions may work, 6 | but experience shows that they do not follow backward compatibility... 7 | 8 | -------------------------------------------------------------------------------- /forrest/src/documentation/README.txt: -------------------------------------------------------------------------------- 1 | This is the base documentation directory. 2 | 3 | skinconf.xml # This file customizes Forrest for your project. In it, you 4 | # tell forrest the project name, logo, copyright info, etc 5 | 6 | sitemap.xmap # Optional. This sitemap is consulted before all core sitemaps. 7 | # See http://forrest.apache.org/docs/project-sitemap.html 8 | -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/forrest/src/documentation/content/xdocs/favicon.ico -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/images/blob_insert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/forrest/src/documentation/content/xdocs/images/blob_insert.png -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/images/howto/db-auto-init.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/forrest/src/documentation/content/xdocs/images/howto/db-auto-init.png -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/images/howto/imagedb-schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/forrest/src/documentation/content/xdocs/images/howto/imagedb-schema.png -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/forrest/src/documentation/content/xdocs/images/icon.png -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/images/reference/example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/forrest/src/documentation/content/xdocs/images/reference/example1.png -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/images/reference/intro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/forrest/src/documentation/content/xdocs/images/reference/intro.png -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/images/reference/jmxconsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/forrest/src/documentation/content/xdocs/images/reference/jmxconsole.png -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/images/scriptella-powered.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/forrest/src/documentation/content/xdocs/images/scriptella-powered.gif -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/images/site-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/forrest/src/documentation/content/xdocs/images/site-logo.png -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/images/table_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/forrest/src/documentation/content/xdocs/images/table_copy.png -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/images/usemap.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/forrest/src/documentation/content/xdocs/images/usemap.gif -------------------------------------------------------------------------------- /forrest/src/documentation/content/xdocs/tabs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 21 | 22 | -------------------------------------------------------------------------------- /forrest/src/documentation/resources/schema/catalog.xcat: -------------------------------------------------------------------------------- 1 | 2 | 18 | 20 | 21 | 22 | 24 | 25 | 26 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /forrest/src/documentation/resources/stylesheets/hello2document.xsl: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 22 | 23 | 25 | 26 | 27 | 28 |

29 | 30 | <xsl:value-of select="greeting"/> 31 | 32 |
33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /lib/commons-jexl.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/lib/commons-jexl.jar -------------------------------------------------------------------------------- /lib/commons-logging.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/lib/commons-logging.jar -------------------------------------------------------------------------------- /lib/h2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/lib/h2.jar -------------------------------------------------------------------------------- /lib/hsqldb.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/lib/hsqldb.jar -------------------------------------------------------------------------------- /lib/j2ee/activation.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/lib/j2ee/activation.jar -------------------------------------------------------------------------------- /lib/j2ee/mail.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/lib/j2ee/mail.jar -------------------------------------------------------------------------------- /lib/janino-commons-compiler.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/lib/janino-commons-compiler.jar -------------------------------------------------------------------------------- /lib/janino.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/lib/janino.jar -------------------------------------------------------------------------------- /lib/janino.license.txt: -------------------------------------------------------------------------------- 1 | Janino - An embedded Java[TM] compiler 2 | 3 | Copyright (c) 2006, Arno Unkrig 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials 15 | provided with the distribution. 16 | 3. The name of the author may not be used to endorse or promote 17 | products derived from this software without specific prior 18 | written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 24 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 26 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 28 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 30 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /lib/junit.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/lib/junit.jar -------------------------------------------------------------------------------- /lib/spring.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/lib/spring.jar -------------------------------------------------------------------------------- /lib/velocity-dep.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/lib/velocity-dep.jar -------------------------------------------------------------------------------- /lib/versions.properties: -------------------------------------------------------------------------------- 1 | #Dependencies Version Information 2 | commons-jexl=2.0.1 3 | commons-logging=1.0.4 4 | hsqldb=1.8.0.10 5 | velocity-dep=1.6.2 6 | janino=3.1.0 7 | janino-commons-compiler=3.1.0 8 | junit=3.8.2 9 | h2=1.1.116 10 | spring=1.2 11 | rhino.jar=1.7.10 12 | rhino-js-engine.jar=1.7.10 -------------------------------------------------------------------------------- /samples/ant/etl.properties: -------------------------------------------------------------------------------- 1 | driver=org.hsqldb.jdbcDriver 2 | url=jdbc:hsqldb:mem:sample 3 | user=sa 4 | password= -------------------------------------------------------------------------------- /samples/ant/etl.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 32 | -------------------------------------------------------------------------------- /samples/benchmark/build.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /samples/benchmark/createcsv.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Quieries CSV data from from file and store the results in a DB and other CSV file. 5 | 6 | 7 | 8 | 9 | 10 | i=0; 11 | while (i lt 100000) { 12 | query.next(); 13 | 16 | i=i+1; 17 | } 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/benchmark/exportcsv.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Quieries CSV data from from file and store the results in a DB and other CSV file. 5 | 6 | 7 | 8 | 9 | 10 | SELECT * FROM Test 11 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /samples/benchmark/importcsv.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Quieries CSV data from from file and store the results in a DB and other CSV file. 5 | 6 | 7 | 8 | 9 | 15 | 16 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/csv/bugs-in.csv: -------------------------------------------------------------------------------- 1 | id,priority,summary,status 2 | 1,Critical,NullPointerException in Main class,Open 3 | 5,Low,"Checkstyle, PMD, Findbugs issues",Reopened 4 | 7,Low,Maven integration,Open 5 | 10,High,SPI API,Closed 6 | -------------------------------------------------------------------------------- /samples/csv/build.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/csv/hsqldb/bugs-in.csv: -------------------------------------------------------------------------------- 1 | 1,Critical,NullPointerException in Main class,Open 2 | 5,Low,"Checkstyle, PMD, Findbugs issues",Reopened 3 | 7,Low,Maven integration,Open 4 | 10,High,SPI API,Closed 5 | -------------------------------------------------------------------------------- /samples/csv/hsqldb/fields.sql: -------------------------------------------------------------------------------- 1 | ID INT PRIMARY KEY, 2 | PRIORITY VARCHAR(10), 3 | SUMMARY VARCHAR(200), 4 | STATUS VARCHAR(10) -------------------------------------------------------------------------------- /samples/csv/readme.txt: -------------------------------------------------------------------------------- 1 | This example shows how to work with CSV data. 2 | 3 | The etl.xml in csv directory use CSV driver to work with CSV files. 4 | Type scriptella or ant to run the example. 5 | 6 | The etl.xml file in the text directory use Text driver to work with CSV files. 7 | Please note that Text driver is a generic Regex based tool which does not cover 8 | escaping of CSV data. 9 | 10 | The hsqldb directory contains ETL file to work with HSQLDB text tables. 11 | -------------------------------------------------------------------------------- /samples/csv/text/build.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | Shows how process CSV data with Text driver. 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /samples/csv/text/etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Quieries CSV data from from file and store the results in another CSV file. 5 | Buil-in text driver is used. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | (.*),(.*),(.*),(.*) 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /samples/dbupgrade/1-2.sql: -------------------------------------------------------------------------------- 1 | --Upgrading from version 1 to version 2 2 | --Create 2 addtional columns. 3 | ALTER TABLE Account ADD COLUMN Suspended BOOLEAN DEFAULT FALSE NOT NULL; 4 | ALTER TABLE Account ADD COLUMN EMail VARCHAR(20); -------------------------------------------------------------------------------- /samples/dbupgrade/2-1.sql: -------------------------------------------------------------------------------- 1 | --Downgrade from version 2 to version 1 removes the Suspended column 2 | --introduced in version 2. 3 | ALTER TABLE Account DROP COLUMN Suspended; -------------------------------------------------------------------------------- /samples/dbupgrade/2-3.sql: -------------------------------------------------------------------------------- 1 | --Upgrade from version 2 to version 3 creates a new table 2 | CREATE TABLE Account_Details ( 3 | Account_ID INT, 4 | EMail VARCHAR(20), 5 | FOREIGN KEY (Account_ID) REFERENCES Account (Account_ID) 6 | ); 7 | --and copy emails from existing accounts into it. 8 | INSERT INTO Account_Details SELECT Account_ID,EMail FROM Account; 9 | --finally the email column is removed from Account table. 10 | ALTER TABLE Account DROP COLUMN EMail; 11 | -------------------------------------------------------------------------------- /samples/dbupgrade/3-2.sql: -------------------------------------------------------------------------------- 1 | --Downgrade from version 3 to version 2 restores the email column. 2 | ALTER TABLE Account ADD COLUMN EMail VARCHAR(20); 3 | --and copy emails from account_details to this column 4 | UPDATE Account a SET EMail=(SELECT EMAIL FROM Account_Details d WHERE d.Account_ID=a.Account_ID); 5 | --finally drop the table which is not used in version 2 6 | DROP TABLE Account_Details; 7 | -------------------------------------------------------------------------------- /samples/dbupgrade/build.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /samples/dbupgrade/dbinit.properties: -------------------------------------------------------------------------------- 1 | driver=org.hsqldb.jdbcDriver 2 | url=jdbc:hsqldb:file:db 3 | user=sa 4 | password= 5 | #Database model version. 6 | #Build number(or SVN revision) is a good candidate. 7 | version=1 -------------------------------------------------------------------------------- /samples/dbupgrade/dbupdate.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Database upgrade/downgrade script 4 | 5 | 6 | 7 | 8 | 9 | 12 | 15 | 16 | 17 | 20 | 23 | 24 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /samples/dbupgrade/dbupdate.properties: -------------------------------------------------------------------------------- 1 | #Connection settings 2 | driver=org.hsqldb.jdbcDriver 3 | url=jdbc:hsqldb:file:db 4 | user=sa 5 | password= 6 | 7 | #Version of the database model you are upgrading from. 8 | #Build number(or SVN revision) is a good candidate. 9 | version.from=1 10 | #Version of the database model you want to upgrade to 11 | #Downgrading is supported, i.e. to < from 12 | version.to=3 -------------------------------------------------------------------------------- /samples/dbupgrade/readme.txt: -------------------------------------------------------------------------------- 1 | This example shows how Scriptella can be used as a schema evolution tool. 2 | 3 | This example has 2 scripts: 4 | - dbinit - to create the new database 5 | - dbupdate - to upgrade/downgrade the DB from one version to another one. 6 | 7 | This sample assumes the following change history: 8 | Version 1: Table Account (Account_ID, Login, Password) 9 | Version 2: Table Account (Account_ID, Login, Password, EMail, Suspended) 10 | Version 3: Table Account (Account_ID, Login, Password, Suspended) 11 | Table Account_Details (Account_ID, EMail) 12 | 13 | Usage 14 | ----- 15 | Modify dbinit.properties to specify version of the database you want to create. 16 | Type ant init to create the database schema and fill with initial data. 17 | Modify dbupdate.properties and specify the following parameters: 18 | - Connection settings: 19 | driver, url, user, password 20 | 21 | - Version of the database model you are upgrading from 22 | version.from=1 23 | - Version of the database model you want to upgrade to 24 | Downgrading is supported, i.e. to < from 25 | version.to=3 -------------------------------------------------------------------------------- /samples/ldap/build.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /samples/ldap/dbschema.sql: -------------------------------------------------------------------------------- 1 | -- Creates users and roles tables schema suitable for Tomcat JDBCRealm. 2 | drop table users if exists; 3 | create table users ( 4 | user_name varchar(15) not null primary key, 5 | user_pass varchar(15) not null 6 | ); 7 | drop table user_roles if exists; 8 | create table user_roles ( 9 | user_name varchar(15) not null, 10 | role_name varchar(15) not null, 11 | primary key (user_name, role_name) 12 | ); 13 | -------------------------------------------------------------------------------- /samples/ldap/init.ldif: -------------------------------------------------------------------------------- 1 | #Example entries for populating LDAP 2 | #Use ldapadd -x -D "cn=root,dc=scriptella" -W -f init.ldif 3 | # top-level entry 4 | dn: dc=scriptella 5 | objectClass: dcObject 6 | objectClass: organization 7 | o: Company 8 | dc: scriptella 9 | 10 | # Define an entry to contain people 11 | dn: ou=people,dc=scriptella 12 | objectClass: organizationalUnit 13 | ou: people 14 | 15 | # Define a user entry for Janet Jones 16 | dn: uid=jjones,ou=people,dc=scriptella 17 | objectClass: inetOrgPerson 18 | uid: jjones 19 | sn: jones 20 | cn: janet jones 21 | mail: j.jones@mycompany.com 22 | userPassword: janet 23 | 24 | # Define a user entry for Fred Bloggs 25 | dn: uid=fbloggs,ou=people,dc=scriptella 26 | objectClass: inetOrgPerson 27 | uid: fbloggs 28 | sn: bloggs 29 | cn: fred bloggs 30 | mail: f.bloggs@mycompany.com 31 | userPassword: fred 32 | 33 | # Define an entry to contain LDAP groups 34 | dn: ou=groups,dc=scriptella 35 | objectClass: organizationalUnit 36 | ou: groups 37 | 38 | # Define an entry for the "admin" role 39 | dn: cn=admin,ou=groups,dc=scriptella 40 | objectClass: groupOfUniqueNames 41 | cn: admin 42 | uniqueMember: uid=jjones,ou=people,dc=scriptella 43 | uniqueMember: uid=fbloggs,ou=people,dc=scriptella 44 | 45 | # Define an entry for the "developer" role 46 | dn: cn=developer,ou=groups,dc=scriptella 47 | objectClass: groupOfUniqueNames 48 | cn: developer 49 | uniqueMember: uid=fbloggs,ou=people,dc=scriptella 50 | -------------------------------------------------------------------------------- /samples/ldap/jdbc/build.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /samples/lib/readme.txt: -------------------------------------------------------------------------------- 1 | Driver libraries used in Scriptella examples. Several examples need 2 | third-party jars which cannot be redistributed: 3 | - jdbcldap.jar - http://www.qa.octetstring.com/downloads/jdbcldap/jdbcldap20en.zip -------------------------------------------------------------------------------- /samples/mail/mail.properties: -------------------------------------------------------------------------------- 1 | mail.smtp.host=!Specify Mail Host Name 2 | #mail.smtp.port=25 3 | #mail.user=userName 4 | #mail.password=userPassword 5 | mail.from=Scriptella ETL 6 | #JavaMail debug option 7 | #mail.debug=true 8 | #Mail content type: html or text, default is text 9 | type=html 10 | -------------------------------------------------------------------------------- /samples/mail/readme.txt: -------------------------------------------------------------------------------- 1 | This example shows how to produce and send E-Mails from Scriptella. 2 | 3 | Modify mail.properties and specify smtp host and additional parameters. 4 | Modify users.sql and specify email accounts to send demo emails. 5 | 6 | Type scriptella to run the example. 7 | -------------------------------------------------------------------------------- /samples/mail/users.sql: -------------------------------------------------------------------------------- 1 | -- Email notifications will be sent to the following list 2 | -- INSERT INTO User VALUES ('_user1@nosuchhost.com', 'User 1'); 3 | -- INSERT INTO User VALUES ('_user2@nosuchhost.com', 'User 2'); 4 | -------------------------------------------------------------------------------- /samples/musicstore/build.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /samples/musicstore/etl.properties: -------------------------------------------------------------------------------- 1 | driver=org.hsqldb.jdbcDriver 2 | url=jdbc:hsqldb:file:tracks 3 | user=sa 4 | password= 5 | #Declare properties with file paths.You may use URLs. 6 | file1=song1.mp3 7 | file2=song2.mp3 -------------------------------------------------------------------------------- /samples/musicstore/run.bat: -------------------------------------------------------------------------------- 1 | java -Xbootclasspath/a:../lib/hsqldb.jar -jar ../lib/scriptella.jar 2 | -------------------------------------------------------------------------------- /samples/musicstore/song1.mp3: -------------------------------------------------------------------------------- 1 | 1234 -------------------------------------------------------------------------------- /samples/musicstore/song2.mp3: -------------------------------------------------------------------------------- 1 | 78910 -------------------------------------------------------------------------------- /samples/odbc/build.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | In order to run this example copy Northwind.mdb from Microsoft Access Samples to current directory. 22 | Northwind.mdb can be downloaded from http://office.microsoft.com/downloads/2000/Nwind2K.aspx 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /samples/odbc/readme.txt: -------------------------------------------------------------------------------- 1 | This example demonstrates working with ODBC datasources. 2 | 3 | Velocity is used to produce the report based on a SQL query. 4 | Janino is used to write images for HTML report. 5 | 6 | Usage 7 | ----- 8 | IMPORTANT: In order to run this example obtain Northwind.mdb - the 9 | MS Access sample database. It can be downloaded from: 10 | http://office.microsoft.com/downloads/2000/Nwind2K.aspx 11 | Put Northwind.mdb into this directory. 12 | 13 | Just type ant (for running from ant build file) or scriptella (to invoke 14 | without Ant bridge). -------------------------------------------------------------------------------- /samples/primes/build.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/primes/etl.properties: -------------------------------------------------------------------------------- 1 | #Interval to scan for prime numbers 2 | max_prime=1000 3 | #Title of Velocity HTML Report 4 | report_title=Scriptella Prime Numbers Report -------------------------------------------------------------------------------- /samples/primes/footer.vm: -------------------------------------------------------------------------------- 1 | ## This is a HTML report footer 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 |
Powered by ScriptellaGenerated by scriptella ETL using Velocity, JEXL and HSQLDB.
10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/primes/header.vm: -------------------------------------------------------------------------------- 1 | ## This is a HTML report header 2 | 3 | 4 | $report_title 5 | 6 | 7 |

Prime numbers in 2 .. $max_prime interval.

8 | -------------------------------------------------------------------------------- /samples/primes/readme.txt: -------------------------------------------------------------------------------- 1 | This example demonstrates a combined usage of Velocity, Janino, 2 | CSV, XLS driver and SQL. 3 | 4 | Janino is used to generate prime numbers and to produce 5 | a virtual rowset for exporting into a database. 6 | 7 | Velocity is used to produce HTML report based on a SQL query. 8 | 9 | CSV Driver produces CSV file with prime numbers. 10 | 11 | Script configuration is specified in etl.properties file. 12 | 13 | Usage 14 | ----- 15 | 16 | Just type ant (for running from ant build file) or scriptella (to invoke 17 | without Ant bridge). -------------------------------------------------------------------------------- /samples/primes/scriptella-powered.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scriptella/scriptella-etl/f34ba39c951e42caf1e794fc08f9952de5bac9ad/samples/primes/scriptella-powered.gif -------------------------------------------------------------------------------- /samples/xml/build.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | Shows how to query XML data with XPath driver. 19 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /samples/xml/etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Quieries XML with XPath expression and store the results in a CSV file. 5 | Buil-in xpath driver is used for input. 6 | Buil-in text driver is used for output. 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | /CATALOG/CD 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /samples/xml/readme.txt: -------------------------------------------------------------------------------- 1 | This example shows how to work with XML data. 2 | 3 | The etl.xml use XPath driver to query XML with XPath expressions. 4 | Type scriptella or ant to run the example. 5 | -------------------------------------------------------------------------------- /tools/build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tools/src/conf/antscriptella.properties: -------------------------------------------------------------------------------- 1 | etl=scriptella.tools.ant.EtlExecuteTask 2 | etl-template=scriptella.tools.ant.EtlTemplateTask -------------------------------------------------------------------------------- /tools/src/conf/scriptella/tools/ant/antlib.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tools/src/conf/scriptella/tools/template/dataMigrator.etl.properties: -------------------------------------------------------------------------------- 1 | #Scriptella ETL Configuration Properties 2 | #Connection properties for source database 3 | from.driver=org.jdbc.Driver 4 | from.url=jdbc:url 5 | from.user=user name 6 | from.password=user password 7 | from.classpath=file.jar;/path/to/file2.jar:../relative/path/to/file3.jar 8 | #Connection properties for destination database 9 | to.driver=org.jdbc.Driver 10 | to.url=jdbc:url 11 | to.user=user name 12 | to.password=user password 13 | to.classpath=file.jar;/path/to/file2.jar:../relative/path/to/file3.jar 14 | 15 | -------------------------------------------------------------------------------- /tools/src/conf/scriptella/tools/template/dataMigrator.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Scriptella ETL Data Migration Template. 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | $queries 14 | 15 | -------------------------------------------------------------------------------- /tools/src/conf/scriptella/tools/template/dataMigratorBlock.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SELECT $columns FROM $table 5 | 9 | -------------------------------------------------------------------------------- /tools/src/conf/scriptella/tools/template/default.etl.properties: -------------------------------------------------------------------------------- 1 | #Scriptella ETL Configuration Properties 2 | driver=org.jdbc.Driver 3 | url=jdbc:url 4 | user=user name 5 | password=user password 6 | classpath=file.jar;/path/to/file2.jar:../relative/path/to/file3.jar 7 | 8 | -------------------------------------------------------------------------------- /tools/src/conf/scriptella/tools/template/default.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Scriptella ETL File Template. 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 20 | 21 | 29 | 30 | -------------------------------------------------------------------------------- /tools/src/java/scriptella/tools/launcher/package.html: -------------------------------------------------------------------------------- 1 | 2 | Command line ETL launcher. 3 | 4 |

Examples

5 | Execute etl.xml file in the current directory: 6 |
scriptella
7 | Execute name.etl.xml file in the current directory: 8 |
scriptella name
9 | Also the full name of ETL file can be specified: 10 |
scriptella name.etl.xml
11 | 12 | Produce a quick start template named etl.xml in the current directory: 13 |
scriptella -t
14 | -------------------------------------------------------------------------------- /tools/src/java/scriptella/tools/template/package.html: -------------------------------------------------------------------------------- 1 | 2 | ETL templates and support classes. 3 | -------------------------------------------------------------------------------- /tools/src/test/scriptella/tools/ant/EtlTaskBaseTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2006-2012 The Scriptella Project Team. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package scriptella.tools.ant; 17 | 18 | import org.apache.tools.ant.Project; 19 | import scriptella.AbstractTestCase; 20 | 21 | /** 22 | * Tests for {@link scriptella.tools.ant.EtlTaskBase}. 23 | * 24 | * @author Fyodor Kupolov 25 | * @version 1.0 26 | */ 27 | public class EtlTaskBaseTest extends AbstractTestCase { 28 | public void test() { 29 | EtlTaskBase t = new EtlTaskBase(); 30 | //Just a smoke test 31 | t.setupLogging(); 32 | t.resetLogging(); 33 | Project prj = new Project(); 34 | t.setProject(prj); 35 | prj.setProperty("_a", "1"); 36 | 37 | //Not test inheritAll. By default inheritAll=true 38 | assertTrue("1".equals(t.getProperties().get("_a"))); 39 | t.setInheritAll(false); 40 | assertFalse(t.getProperties().containsKey("_a")); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tools/src/test/scriptella/tools/launcher/EtlLauncherTest.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /tools/src/test/scriptella/tools/launcher/EtlLauncherTestJmx.etl.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | -------------------------------------------------------------------------------- /tools/src/test/scriptella/tools/template/DataMigratorITest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 34 | 35 | --------------------------------------------------------------------------------