3 Replies Latest reply on Jul 30, 2008 12:07 AM by tnine

    generate-ui camel case issues

    tnine

      Hi all,
        I'm trying SEAM for the first time, and it seems great.  I've used Hibernate and JSF for years, just never so easily!  I'm taking on a small project in which I'm converting an excel spreadsheet with a ton of macros into a SEAM application.  I'm running into a few issues and I could use some help. 




      1. I defined all of my entities using seam new-entity.  I then went through each entity and added the properties and corresponding setters/getters/annotations.  Once that's done I run seam generate-ui.  This is where I'm running into an issue.  I have Hibernate auto create my schema, so the back end is fine.  I'm currently using MySQL and it creates all the tables correctly.  However, I'm having issues with the camel case naming convention the generate-ui is using.  For instance, all the link targets are in the format of FraudCase.seam, but my pages are named fraudCase.seam.  As a result, all links to other entity entry forms are all completely broken.  Has anyone else experienced this?  If so, how do you fix what the generate-ui gives you(preferably at the generation phase as I'm rapidly changing my entities).  Below is a list of all the pages created for my FraudCase entity.  As you can see the case seems to be a bit random.
        
        FraudCase.page.xml
        fraudCase.xhtml
        FraudCaseEdit.page.xml
        FraudCaseEdit.xhml
        FraudCaseList.page.xml
        fraudCaseList.xhtml
        
        


      2. I'm currently developing on MySQL 5 to get the project rolling.  Once I have Oracle Express Edition set up I need to migrate all my dialects and connections over to Oracle.  Is there an easy way to do this with the seam commands?  I did a search and the oracle driver class, dialect, and url appear in quite a few files so I'd prefer to not have to manually change them all.  I thought doing a seam setup then a seam create-project would overwrite all the existing config files for MySQL, but this doesn't appear to be the case.

      3. Is it possible to have Hibernate output the DDL generation to a SQL file so I can give it to the DBA from the command line?  I'm assuming Hibernate Tools can do this, I'm just not sure how to invoke it from the seam environment.



      My Environment



      Seam: 2.0.2.SP1
      JBoss: 4.2.3 GA (default config)
      Java: 1.5
      Platform: OS X 10.5.4




      Thanks in advance,


      Todd



        • 1. Re: generate-ui camel case issues

          Todd,


          I will try and help. I did some customization for seam-gen but did not change the names, I can live with those names.


          But if I had to, here are the steps that I think you should follow.


          make a copy of files before you edit :)


          - C:\jboss-seam-2.0.2.SP1\seam-gen\build.xml 


          Go to target generate-ui


          Change case in lines like ..


          <hbmtemplate filepattern="{class-name}Edit.xhtml"
          


          Also change case in
          C:\jboss-seam-2.0.2.SP1\seam-gen\view\list.xhtml.ftl


          <#assign editPageName = entityName + "Edit">
          <#assign listPageName = entityName + "List">
          


          You might also have to change case in
          view\edit.page.xml.ftl
          view\layout\menu.xhtml.ftl


          Run generate-ui again


          About updating to Oracle schema, I think you have to edit hibernate properties in
          C:\jboss-seam-2.0.2.SP1\seam-gen\build.properties
          or seam.properties in your application folder


          hibernate.connection.username=xxx
          hibernate.connection.password=sonycard
          hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
          hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider
          hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
          hibernate.connection.url=jdbc\:oracle\:thin\:@localhost\:1521\:ORCL
          hibernate.default_schema=scott
          



          and then run seam update-project again.


          If that does not do it, manually edit app-dev-ds.xml and peristence*.xml files in \resources folder



          Franco














          • 2. Re: generate-ui camel case issues
            pmuir

            Please report this in JIRA.

            • 3. Re: generate-ui camel case issues
              tnine

              It appears this has already been logged.  Its just not fixed yet.