Announcement Announcement Module
Collapse
No announcement yet.
Generated list.jspx, generate all fields Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Generated list.jspx, generate all fields

    Hi,

    When generating list.jspx file, spring roo is not generating <table:column> tag for every entity field.

    How can I configure Roo (or controller) so that every field is included in the table?

    Also, can I disable trimming for all columns?

  • #2
    Hi,

    I have found snippet of code that limits number of table columns to 7

    /org.springframework.roo.addon.web.mvc.jsp/src/main/java/org/springframework/roo/addon/web/mvc/jsp/JspViewManager.java
    Line 105
    Code:
    int fieldCounter = 0;
    for (FieldMetadata field : fields) {
    	if (++fieldCounter < 7) {
    		Element columnElement = new XmlElementBuilder("table:column", document).addAttribute("id", XmlUtils.convertId("c:" + formbackingType.getFullyQualifiedTypeName() + "." + field.getFieldName().getSymbolName())).addAttribute("property", uncapitalize(field.getFieldName().getSymbolName())).build();

    what is the suggested way to increase it?
    should I compile my own version of spring roo? send some kind of patch to someone? raise an issue?

    Comment


    • #3
      I've tried building, but I'm stuck

      any ideas?

      Code:
      [INFO] --- maven-surefire-plugin:2.8:test (default-test) @ org.springframework.roo.startlevel ---
      [INFO] No tests to run.
      [INFO] Surefire report directory: F:\roo\startlevel\target\surefire-reports
      [INFO]
      [INFO] --- maven-bundle-plugin:2.3.4:bundle (default-bundle) @ org.springframework.roo.startlevel ---
      [ERROR] Error building bundle org.springframework.roo:org.springframework.roo.startlevel:bundle:1.2.0.BUILD-SNAPSHOT : Exception: invalid he
      ader field
      [ERROR] Error building bundle org.springframework.roo:org.springframework.roo.startlevel:bundle:1.2.0.BUILD-SNAPSHOT : Error in processing i
      ncluded file: F:\roo\startlevel\target/build-number.mf
      [ERROR] Error(s) found in bundle configuration
      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Summary:
      [INFO]
      [INFO] Spring Roo ........................................ SUCCESS [4.084s]
      [INFO] Spring Roo - Deployment Support ................... SUCCESS [1.194s]
      [INFO] Spring Roo - OSGi Bundle Module Parent ............ SUCCESS [4.875s]
      [INFO] Spring Roo - OSGi Roo Bundle Module Parent ........ SUCCESS [1.672s]
      [INFO] Spring Roo - Bootstrap ............................ SUCCESS [12.658s]
      [INFO] Spring Roo - OSGi Start Level Control ............. FAILURE [6.968s]
      [INFO] Spring Roo - Support .............................. SKIPPED
      [INFO] Spring Roo - Support for OSGi Features ............ SKIPPED
      [INFO] Spring Roo - URL Stream API Contract .............. SKIPPED
      [INFO] Spring Roo - Shell ................................ SKIPPED
      [INFO] Spring Roo - Shell (OSGi Launcher) ................ SKIPPED
      [INFO] Spring Roo - URL Stream - JDK ..................... SKIPPED
      [INFO] Spring Roo - Shell - JLine ........................ SKIPPED
      [INFO] Spring Roo - Shell - JLine (OSGi Launcher) ........ SKIPPED
      [INFO] Spring Roo - Metadata ............................. SKIPPED
      [INFO] Spring Roo - User Agent Analysis (UAA) Integration  SKIPPED
      [INFO] Spring Roo - Felix Interoperability ............... SKIPPED
      [INFO] Spring Roo - Model ................................ SKIPPED
      [INFO] Spring Roo - File Undo ............................ SKIPPED
      [INFO] Spring Roo - File Monitor ......................... SKIPPED
      [INFO] Spring Roo - File Monitor - Polling ............... SKIPPED
      [INFO] Spring Roo - File Monitor - Polling (Roo Launcher)  SKIPPED
      [INFO] Spring Roo - Process Manager ...................... SKIPPED
      [INFO] Spring Roo - Project .............................. SKIPPED
      [INFO] Spring Roo - Classpath ............................ SKIPPED
      [INFO] Spring Roo - Classpath (JavaParser Implementation)  SKIPPED
      [INFO] Spring Roo - Addon - toString ..................... SKIPPED
      [INFO] Spring Roo - Addon - JavaBean Method Manager ...... SKIPPED
      [INFO] Spring Roo - Addon - Plural Details ............... SKIPPED
      [INFO] Spring Roo - Addon - Property Files ............... SKIPPED
      [INFO] Spring Roo - Addon - @Configurable Support ........ SKIPPED
      [INFO] Spring Roo - Addon - Email ........................ SKIPPED
      [INFO] Spring Roo - Addon - JPA .......................... SKIPPED
      [INFO] Spring Roo - Addon - JMS .......................... SKIPPED
      [INFO] Spring Roo - Addon - Test Data On Demand .......... SKIPPED
      [INFO] Spring Roo - Addon - Automated Integration Testing  SKIPPED
      [INFO] Spring Roo - Addon - Serializable ................. SKIPPED
      [INFO] Spring Roo - Addon - Entity ....................... SKIPPED
      [INFO] Spring Roo - Addon - Finder ....................... SKIPPED
      [INFO] Spring Roo - Addon - Logging ...................... SKIPPED
      [INFO] Spring Roo - Addon - Property Editor .............. SKIPPED
      [INFO] Spring Roo - Addon - Backup ....................... SKIPPED
      [INFO] Spring Roo - Addon - JSON ......................... SKIPPED
      [INFO] Spring Roo - Addon - Web MVC Controller ........... SKIPPED
      [INFO] Spring Roo - Addon - Web MVC JSP View ............. SKIPPED
      [INFO] Spring Roo - Addon - Web MVC Embedded Extensions .. SKIPPED
      [INFO] Spring Roo - Addon - Spring Security .............. SKIPPED
      [INFO] Spring Roo - Addon - Solr ......................... SKIPPED
      [INFO] Spring Roo - Addon - Web - Flow ................... SKIPPED
      [INFO] Spring Roo - Addon - Web Selenium Test Generator .. SKIPPED
      [INFO] Spring Roo - Addon - Google Web Toolkit ........... SKIPPED
      [INFO] Spring Roo - Addon - JDBC Driver Acquisition ...... SKIPPED
      [INFO] Spring Roo - Addon - Database Reverse Engineering . SKIPPED
      [INFO] Spring Roo - Addon - Creator ...................... SKIPPED
      [INFO] Spring Roo - Addon - RooBot Client ................ SKIPPED
      [INFO] Spring Roo - Addon - Op4J ......................... SKIPPED
      [INFO] Spring Roo - Addon - GIT .......................... SKIPPED
      [INFO] Spring Roo - Addon - Cloud Foundry ................ SKIPPED
      [INFO] Spring Roo - Annotations (ASLv2/GPLv3 Dual Licensed)  SKIPPED
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 39.212s
      [INFO] Finished at: Mon Jul 25 14:58:28 CEST 2011
      [INFO] Final Memory: 18M/53M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.4:bundle (default-bundle) on project org.springframework.roo.startle
      vel: Error(s) found in bundle configuration -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.felix:maven-bundle-plugin:2.3.4:bundle (default-bu
      ndle) on project org.springframework.roo.startlevel: Error(s) found in bundle configuration
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
              at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
              at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
              at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
              at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
              at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
              at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
              at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
              at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
              at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Error(s) found in bundle configuration
              at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:341)
              at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:224)
              at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:215)
              at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
              at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
              ... 19 more
      Caused by: org.apache.maven.plugin.MojoFailureException: Error(s) found in bundle configuration
              at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:293)
              ... 23 more
      [ERROR]
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
      [ERROR]
      [ERROR] After correcting the problems, you can resume the build with the command
      [ERROR]   mvn <goals> -rf :org.springframework.roo.startlevel

      Comment


      • #4
        The table:column element has a 'maxLength' attribute you can use to increase the length of labels in your views as needed. No need to recompile Roo . You should also be able to add more column definitions to your jspx which relate to other fields in your domain object (you may need to provide the relevant labels for those in application.properties).

        Comment


        • #5
          Thank you for the answer

          I'm aware of that, but there are more than few fields to add... so it would be more convenient for me to try recompile again. I'll try using Linux virtual machine this time, hope it works.

          Thanks
          Emir

          Comment


          • #6
            You should be able to build Roo from any OS. Keep in mind you need to have git and pgp command line tools installed in order to do so. There is a readme.txt in Roo trunk which explains how to build Roo from sources.

            Comment


            • #7
              Originally posted by ashikwindu View Post
              I've tried building, but I'm stuck
              any ideas?
              I have exactly the same issue when trying to build roo (branch 1.1.5).

              Did you find the solution?

              Thanks.

              P.S.: having the source code available via git from http://git.springsource.org/roo/roo.git (in addition to git://git.springsource.org/roo/roo.git) could be nice too: company firewalls give a hard time...

              Comment


              • #8
                Originally posted by landrain View Post
                I have exactly the same issue when trying to build roo (branch 1.1.5).
                Did you find the solution?
                Problem solved: git command wasn't in the path. The error message wasn't very clear.

                Comment


                • #9
                  Thank you.

                  Adding git to the path, resolved the issue

                  I was just wondering, how did you figure it out? It doesn't seems to be very related

                  Comment


                  • #10
                    Just want to +1 for adding git to the terminals path.

                    Comment

                    Working...
                    X