1 2 Previous Next 17 Replies Latest reply on Jan 9, 2004 8:53 AM by velthuiz

    Postgres port

    wimflam

      Hi,
      I am interested in contributing to this project.

      I would like to begin by adding support for postgres.

      Unfortunately, I haven't the faintest idea how the build system works.

      Any comments on where I should start?

        • 1. I need your help !
          tfreund

          Someone can tell me how to upload a file and store it in the database with Nukes?
          It's very important for me !!
          Thanks a lot !

          • 2. Re: Postgres port

            The directory nukes, from the CVS, contains sub directories, some of them are nukes modules ( sections and jounal ), the directory called nukes is the core of module of nukes application. The directory called build, is the directory where u can build the core and the modules, just type build.sh ( or build.bat ) and the build system will build the entire thing.
            In order to deploy nukes, type build.sh deploy with a $JBOSS_HOME env variable set to your jboss directory path, normally this will deploy nukes, you can access to nukes with this url http://localhost:8080/nukes/index.html

            • 3. Re: Postgres port

              support for postgres comes first with
              the development of a Postgres specific
              entity command.

              entity command are used by cmp2.0 fwk to
              retrieve the PK from DB after it's been inserted.

              if you know how to retrieve the key generated
              by Postgres with generated PK it's easy to
              develop.

              Usually there are two ways to do that :

              1st downcasting the jdbc statement/driver to the specific and there is a method to get the pk (mysql case)

              2nd executing a sepcific DB command that fetch the last inserted PK (HSQLDB case)

              if you are inserted, please continue this here.

              julien

              • 4. Re: Postgres port
                wimflam

                Unfortunately, there doesn't seem to be any way of doing this in
                Postgres at the moment.

                The getGeneratedKeys method isn't implemented in the JDBC drivers.

                Are there any other posibilities? e.g. generating the keys in JBoss?

                • 5. Re: Postgres port

                  so bad.

                  yes JBoss has several generators but it won't fit in nukes because of pk format. these usually creates UUID pks that are very long strings.

                  nukes use an Integer PK.
                  are you sure there is no way to get the PK via SQL ?

                  for instance in HsqlDB you execute special SQL that gives you the generated PK. its
                  as far as I remember something like :

                  "SELECT IDENTITY".

                  so if you do an insert then execute SELECT IDENTITY it give you back the generated PK.

                  check PostGres in that way, I am pretty sure
                  there is something there.

                  julien

                  • 6. Re: Postgres port
                    wimflam

                    OK, I figured out a way to do it.

                    I've submitted a patch into sourceforge (#28346) for a class
                    that does the key generation thing for postgres.

                    Unfortunately I probably cannot spend any more time porting nukes to postgres, but if anyone else wants to try, it should be dead simple now with my new class.

                    • 7. Re: Postgres port
                      wimflam

                      Oops, that should have read patch #728346

                      • 8. Re: Postgres port

                        great, one more.

                        I don't have much time these days, if someone takes it cool, otherwise it will be postponed.

                        julien

                        • 9. Re: Postgres port

                          Postgres entity command is in 3.2.1, the only thing missing are the ddl files compatible for postgres.

                          And the testing of course.

                          julien

                          • 10. Re: Postgres port

                            it's ok there, I'll look at it later since I have not a lot of time now.

                            julien

                            • 11. Re: Postgres port
                              qlk

                              Just wanted to post to this thread that I'm working on Postgres as well. I've got the entity command merging into the deployment and have all of the DDL files working with Postgres, but I haven't tested everything yet, and I plan to go back and add referential integrity to the tables. So far, nukes, adminmessage, and faq are working.


                              • 12. Re: Postgres port
                                boomhauer

                                Just FYI, postgres does support sequences, so that a uique id can be generated via a special sql call to a function, i believe its called nextval(sequence_name). This can even be auto-inserted into a field on the table upon insert, but if the jdbc driver doesnt support the getauto(whatever) function then this will not help.

                                Ive used postgres for 4 years now and would be glad to help where needed, Im new to this project so would rather work under anothers direction for now, let me know where any of you require assistance.

                                I just joind the forum and must add that I am THRILLED that someone has finally build a good open java cms... how long Ive looked for one, tried building one, and wished something like this would get off the ground!

                                • 13. Re: Postgres port
                                  velthuiz

                                  I've got nukes working with postgres. If anyone is interrested, I can dump the database description and post it here.

                                  • 14. Re: Postgres port

                                    we have the statements for all modules except the forum, do you have that ?

                                    otherwise, how your statements compare to the ones in nukes sources ?

                                    1 2 Previous Next