private static ModelBackend<?> getModelBackend( CommandLine line ) throws UnsupportedOperationException, DatasourceException { String id = "1"; if ( workspace.getResource( ConnectionProviderProvider.class, id ) == null ) { ResourceLocation<ConnectionProvider> loc = getSyntheticProvider( id, line.getOptionValue( DB_HOST ), line.getOptionValue( OPT_DB_USER ), line.getOptionValue( OPT_DB_PASS ) ); workspace.getLocationHandler().addExtraResource( loc ); } return ModelBackend.getInstance( id, null ); }
private static ModelBackend<?> getModelBackend( CommandLine line ) throws UnsupportedOperationException, DatasourceException { String id = "1"; if ( workspace.getResource( ConnectionProviderProvider.class, id ) == null ) { ResourceLocation<ConnectionProvider> loc = getSyntheticProvider( id, line.getOptionValue( DB_HOST ), line.getOptionValue( OPT_DB_USER ), line.getOptionValue( OPT_DB_PASS ) ); workspace.getLocationHandler().addExtraResource( loc ); } return ModelBackend.getInstance( id, null ); }
line.getOptionValue( OPT_DB_USER ), line.getOptionValue( OPT_DB_PASS ) ); workspace.getLocationHandler().addExtraResource( loc );
ResourceLocation<ConnectionProvider> loc = ConnectionProviderUtils.getSyntheticProvider( db_id, con, user, pass ); workspace.getLocationHandler().addExtraResource( loc ); workspace.initAll(); connProvider = workspace.getResource( ConnectionProviderProvider.class, db_id );
ResourceLocation<ConnectionProvider> loc = ConnectionProviderUtils.getSyntheticProvider( id, dbURL, user, pass ); workspace.getLocationHandler().addExtraResource( loc );
file.mkdir(); Workspace workspace = new DefaultWorkspace( file ); workspace.getLocationHandler().addExtraResource( ConnectionProviderUtils.getSyntheticProvider( "style", url, user, pass ) );
/** * Simple importer for SE files, with hardcoded 'configtool' on localhost. * * @param args * @throws XMLStreamException * @throws FactoryConfigurationError * @throws IOException */ public static void main( String[] args ) throws XMLStreamException, FactoryConfigurationError, IOException { Style style = new SymbologyParser( true ).parse( XMLInputFactory.newInstance().createXMLStreamReader( new FileInputStream( args[0] ) ) ); Workspace workspace = new DefaultWorkspace( new File( "nonexistant" ) ); ResourceLocation<ConnectionProvider> loc = ConnectionProviderUtils.getSyntheticProvider( "configtool", "jdbc:postgresql://localhost/configtool", "postgres", "postgres" ); workspace.getLocationHandler().addExtraResource( loc ); workspace.initAll(); if ( style.isSimple() ) { new PostgreSQLWriter( "configtool", "schematest", workspace ).write( style, null ); } else { new PostgreSQLWriter( "configtool", "schematest", workspace ).write( new FileInputStream( args[0] ), style.getName() ); } workspace.destroy(); }
user, pass ); workspace.startup(); workspace.getLocationHandler().addExtraResource( loc ); workspace.initAll();