-
1. Re: Nukes DB installer
jmatt May 2, 2003 6:24 AM (in response to julien1)I'm still working on the web links module. Should have it done this weekend, but I would like to do the installer as well. I have the weekend off so I should be able to complete both of them. How does that sound?
Matt -
2. Re: Nukes DB installer
julien1 May 2, 2003 6:54 AM (in response to julien1)> I'm still working on the web links module. Should
cool
> have it done this weekend, but I would like to do the
> installer as well. I have the weekend off so I
> should be able to complete both of them. How does
> that sound?
pretty simple,
1.take html + gfx from postnuke so it looks fancy
2.let user choose its target database providing
the jndi name of its configured datasource.
(you can assume hsqldb will always be installed since bundled with jboss)
3.parse some ddl file and execute statements one by one in the target DB. log what's done on the installer
providing errors info if any / outputting statement one by one, etc....
that's a piece of code we need. I am currently working on mbean persistence in database. After that we need more configuration modules : security / blocks / modules, but these needs the persistence stuff to work.
Still doco to do. If someone wants to help, welcome.
julien
>
>
> Matt -
3. Re: Nukes DB installer
yanikc May 5, 2003 7:05 PM (in response to julien1)I have just checked Ant documentation version 1.5.
There is a task names "SQL".
To have it working no need:
- Class name of the jdbc driver
- Database connection url
- Database user name
- Database password
- File containing SQL statements
So, if you have in the build.xml file (at root) the following lines:
it should do the work. -
4. Re: Nukes DB installer
yanikc May 5, 2003 7:06 PM (in response to julien1)I have just checked Ant documentation version 1.5.
There is a task names "SQL".
To have it working no need:
- Class name of the jdbc driver
- Database connection url
- Database user name
- Database password
- File containing SQL statements
So, if you have in the build.xml file (at root) the following lines:
it should do the work. -
5. Re: Nukes DB installer
jmatt May 6, 2003 6:46 AM (in response to julien1)I'll get this posted tonight. Sorry for the delay.
-
-
7. Re: Nukes DB installer
julien1 May 7, 2003 1:23 PM (in response to julien1)jmatt, when will you post it ? we need this as soon as possible.
julien -
8. Re: Nukes DB installer
jmatt May 7, 2003 3:44 PM (in response to julien1)I've got to add comments and logging. And then test it. I 'm working on it right now. Should be real soon.
-
9. Re: Nukes DB installer
jmatt May 8, 2003 12:45 PM (in response to julien1)Almost there. I am a little stuck though. I can successfully create the database from the Jndi name but I don't know how to get the other modules to see the database. Currently there is a DatabasePollerFilter filter that tries to get a connection to the database based on a init-param in the web.xml file. Any guidance would be appreciated. Let me know if you want me to post what I have now.
tx
Matt -
10. Re: Nukes DB installer
julien1 May 8, 2003 3:00 PM (in response to julien1)no no, keep it simple, we can improve later
we have a set of named script, let's say in jar archive as resources. we hardcode in the servlet the script name like :
String scripts = { "org/jboss/nukes/install/script1.ddl", etc.... };
and the servlet enable the execution of each script.
julien -
11. Re: Nukes DB installer
julien1 May 8, 2003 3:12 PM (in response to julien1)what I am going to do : unify datasource, always
use "java:NukesDS"
so the guy deploys its datasource.
run the servlet db feeder :
choose its database implementation, i/e the datasource installed : mysql, etc.....
the we get the scripts for the appropriate DB and execute them, each statement is written in the servlet GUI with a report : succesfull or not.
ok ?
julien -
12. Re: Nukes DB installer
jmatt May 9, 2003 8:30 AM (in response to julien1)> what I am going to do : unify datasource, always
> use "java:NukesDS"
>
are you being serious.
> so the guy deploys its datasource.
> run the servlet db feeder :
> choose its database implementation, i/e the
> datasource installed : mysql, etc.....
> the we get the scripts for the appropriate DB and
> execute them, each statement is written in the
> servlet GUI with a report : succesfull or not.
>
> ok ?
ok. Got it. ONe more day.
>
> julien -
13. Re: Nukes DB installer
jmatt May 10, 2003 4:03 AM (in response to julien1)Sorry for the delay.
Attached is the dbinstaller.zip.
It needs to be i18n and probably better error handling.
It runs off of a properties file (I would like to turn this into an xml file, but that is probably a low priority). To add support for another database just add entries in the properties file like:
database3.name=oracle
database3.setup=/WEB-INF/oracle/setup.ddl
database3.parser=org.jboss.nukes.install.parser.DefaultSQLParser
I made the parser pluggable in case the default one does not handle all situations. To create a new parser just implement the org.jboss.nukes.install.parser.SQLParser interface, it has one method:
public List parse(String sqlStatements, NukesInstallForm form);
I started out trying to make a generic Wizard type app that just moved the app from step to step. I simplified it some and it is not so generic.
Feel free to throw this away, rewrite, or use it as you wish. Again sorry for the delay.
tx
Matt -
14. Re: Nukes DB installer
jmatt May 10, 2003 4:04 AM (in response to julien1)Sorry for the delay.
Attached is the dbinstaller.zip.
It needs to be i18n and probably better error handling.
It runs off of a properties file (I would like to turn this into an xml file, but that is probably a low priority). To add support for another database just add entries in the properties file like:
database3.name=oracle
database3.setup=/WEB-INF/oracle/setup.ddl
database3.parser=org.jboss.nukes.install.parser.DefaultSQLParser
I made the parser pluggable in case the default one does not handle all situations. To create a new parser just implement the org.jboss.nukes.install.parser.SQLParser interface, it has one method:
public List parse(String sqlStatements, NukesInstallForm form);
I started out trying to make a generic Wizard type app that just moved the app from step to step. I simplified it some and it is not so generic.
Feel free to throw this away, rewrite, or use it as you wish. Again sorry for the delay.
tx
Matt