Grails JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile
Grails Scaffolding Plugin
  • Grails Scaffolding Plugin
  • GPSCAFFOLD-2 Top level task: Scaffolding improvements
  • GPSCAFFOLD-10

Scaffolding Controller template not used in Dynamic Scaffolding

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Labels:
    None
  • Environment:
    Windows XP
    Java JDK 1.6.0_04
    Grails 1.0.1
  • Testcase included:
    yes

Description

When using Dynamic Scaffolding (def scaffold = true;), the Controller scaffolding template found in src/templates/scaffolding/Controller.groovy is not used. This template IS used when performing grails generate-controller. And the View templates in this folder ARE used with Dynamic Scaffolding. This prevents mass customization of Controllers through Dynamic Scaffolding. It also breaks the expectations of the user; one works and one doesn't.

Attached an example project, where an attempt is made to add a 'Cancel' action and selection to scaffolded Controllers and Views. Files of note:

grails-app/controllers/SomeObjectController.groovy Dynamic Scaffold Controller for SomeObject Domain Class
src/templates/scaffolding/Controller.groovy Expected template for Dynamic Scaffold Controllers; added cancel action
src/templates/scaffolding/create.gsp Added a Cancel button
src/templates/scaffolding/edit.gsp Added a Cancel button

Running this project, both the Create and Edit views include the Cancel button added to the create.gsp and edit.gsp templates. But attempting to select either Cancel button results in the following Runtime Exception:
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.UnknownControllerException: No controller found for URI [/someObject/cancel]!

The included test (grails test-app SomeObjectController) also fails. Both functionalities work if the Controller and Views are generated (grails generate-all SomeObject). This confirms that the cancel action added to the Controller template is not being included in the Dynamic Scaffolding, as expected.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    CancelScaffold.zip
    28/Mar/08 9:59 AM
    196 kB
    Justin Michalczak
    1. File
      CancelScaffold/.classpath 6 kB
    2. File
      CancelScaffold/.project 0.5 kB
    3. File
      CancelScaffold/application.properties 0.1 kB
    4. XML File
      CancelScaffold/build.xml 1 kB
    5. File
      CancelScaffold/CancelScaffold.launch 2 kB
    6. File
      CancelScaffold/CancelScaffold.tmproj 2 kB
    7. File
      CancelScaffold/.../BootStrap.groovy 0.1 kB
    8. File
      CancelScaffold/grails-app/.../Config.groovy 3 kB
    9. File
      CancelScaffold/.../DataSource.groovy 0.6 kB
    10. File
      CancelScaffold/.../resources.groovy 0.0 kB
    11. File
      CancelScaffold/.../UrlMappings.groovy 0.2 kB
    12. File
      CancelScaffold/.../SomeObjectController.groovy 0.1 kB
    13. File
      CancelScaffold/.../SomeObject.groovy 0.1 kB
    14. File
      CancelScaffold/.../messages.properties 2 kB
    15. File
      CancelScaffold/.../messages_de.properties 3 kB
    16. File
      CancelScaffold/.../messages_es.properties 3 kB
    17. File
      CancelScaffold/.../messages_fr.properties 2 kB
    18. File
      CancelScaffold/.../messages_it.properties 2 kB
    19. File
      CancelScaffold/.../messages_ja.properties 2 kB
    20. File
      CancelScaffold/.../messages_nl.properties 3 kB
    21. File
      CancelScaffold/.../messages_ru.properties 4 kB
    22. File
      CancelScaffold/.../messages_th.properties 5 kB
    23. File
      CancelScaffold/.../messages_zh_CN.properties 2 kB
    24. File
      CancelScaffold/grails-app/.../error.gsp 1 kB
    25. File
      CancelScaffold/grails-app/.../main.gsp 0.7 kB
    26. File
      CancelScaffold/src/.../Controller.groovy 0.1 kB
    27. File
      CancelScaffold/src/.../DomainClass.groovy 0.0 kB
    28. File
      CancelScaffold/src/.../Script.groovy 0.3 kB
    29. File
      CancelScaffold/src/.../Service.groovy 0.1 kB
    30. File
      CancelScaffold/src/.../TagLib.groovy 0.0 kB
    Showing 30 of 134 items Download Zip
    Show
    Zip Archive
    CancelScaffold.zip
    28/Mar/08 9:59 AM
    196 kB
    Justin Michalczak

Issue Links

relates to

Sub-task - The sub-task of the issue GPSCAFFOLD-20 View Template Files - Dynamic Identification

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Graeme Rocher added a comment - 29/May/08 4:45 AM

This is a large issue and I prefer to not introduce such a big change in a point release

Show
Graeme Rocher added a comment - 29/May/08 4:45 AM This is a large issue and I prefer to not introduce such a big change in a point release
Hide
Permalink
Marcel Overdijk added a comment - 29/May/08 4:50 AM

I totally agree. Good to see the scaffolding pluggability and extensibility is a candidate for 1.1.
This morning I already started a thread about it on the dev mailing list.

Show
Marcel Overdijk added a comment - 29/May/08 4:50 AM I totally agree. Good to see the scaffolding pluggability and extensibility is a candidate for 1.1. This morning I already started a thread about it on the dev mailing list.
Hide
Permalink
Graeme Rocher added a comment - 19/Sep/08 4:50 AM

Reduced priority of non critical issues which have current workarounds

Show
Graeme Rocher added a comment - 19/Sep/08 4:50 AM Reduced priority of non critical issues which have current workarounds
Hide
Permalink
Marcel Overdijk added a comment - 29/Sep/08 1:45 PM

Hope this issue won't be forgotten due to lowering the priority.

I think it's still annoying that - when changing the templates - the generate commands behave differently then the dynamic scaffold property.

Show
Marcel Overdijk added a comment - 29/Sep/08 1:45 PM Hope this issue won't be forgotten due to lowering the priority. I think it's still annoying that - when changing the templates - the generate commands behave differently then the dynamic scaffold property.
Hide
Permalink
Rob Hunter added a comment - 30/Sep/08 4:37 AM

I assume the work around is simply the regeneration of controllers. I too hope this won't be forgotten with the lowering of priorities. Is a fix likely in the 1.1 release.

Show
Rob Hunter added a comment - 30/Sep/08 4:37 AM I assume the work around is simply the regeneration of controllers. I too hope this won't be forgotten with the lowering of priorities. Is a fix likely in the 1.1 release.
Hide
Permalink
Marcel Overdijk added a comment - 30/Sep/08 4:48 AM

Yes the wourkaround is to use the static scaffolding using the generate-* commands.

6 voters already for this issue so I have the feeling a lot of uses think this feature isimportant.

Show
Marcel Overdijk added a comment - 30/Sep/08 4:48 AM Yes the wourkaround is to use the static scaffolding using the generate-* commands. 6 voters already for this issue so I have the feeling a lot of uses think this feature isimportant.
Hide
Permalink
Les Martin added a comment - 30/Sep/08 7:56 AM

I think that this is a must. Up until running into this little twig all my Grails research was going smooth, but this is confusing to most users since when you generate templates you can update other dynamic scaffolding options (via the views).

+1 to make this into the 1.1 since I can't vote again

Show
Les Martin added a comment - 30/Sep/08 7:56 AM I think that this is a must. Up until running into this little twig all my Grails research was going smooth, but this is confusing to most users since when you generate templates you can update other dynamic scaffolding options (via the views). +1 to make this into the 1.1 since I can't vote again

People

  • Assignee:
    Burt Beckwith
    Reporter:
    Justin Michalczak
Vote (11)
Watch (9)

Dates

  • Created:
    28/Mar/08 9:59 AM
    Updated:
    24/Apr/13 1:10 AM
    Resolved:
    24/Nov/08 9:56 AM

Agile

  • View on Board
  • Atlassian JIRA (v5.2.1#813-sha1:277a546)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Grails project. Try JIRA - bug tracking software for your team.