Results 1 to 6 of 6

Thread: Creation of custom scaffolding with ROO

Hybrid View

  1. #1
    Join Date
    Feb 2011
    Location
    Oviedo (Spain)
    Posts
    28

    Exclamation Creation of custom scaffolding with ROO

    Hi all,

    I'm trying to create my own addon to generate a different scaffold of the one which is created with 'controller all ...'

    I first built a simple addon which only has an 'AddonNameCommands.java' class, I added a dependency to the Roo 'addon-web-mvc-controller', and I only changed the syntax of the commands. That worked right.

    But now I'd like to know how can I create an addon to generate a different scaffold, based in the default scaffold of MVC and ROO but changing something, for example, adding the editing form of an object in the same view of the list instead of redirecting to another view with only the form.

    I was wondering which part of the addon have I to modify or overwrite to get it.

    Could anyone help me?

  2. #2

    Default

    I'm also interested on it

  3. #3
    Join Date
    Feb 2011
    Location
    Oviedo (Spain)
    Posts
    28

    Default

    Could anyone help me PLEASE? I'm very interested on it

  4. #4
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    You could write an add-on which disables the WebScaffoldMetadataProvider OSGi service to effectively disable all MVC controller ITDs. Then implement your own WebScaffoldMetadataProvider type (you could copy all of it) and instead of instantiating a new WebScaffoldMetadata type you would need to instantiate your own sub type. The subtype would then override the method you wish to customize.

    I have not tried this out but it is a solution that seems doable.

    We will be looking at providing more convenient extension hooks for this type of situation hopefully as part of the 1.2 release cycle.

    HTH,
    Stefan
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

  5. #5
    Join Date
    Feb 2011
    Location
    Oviedo (Spain)
    Posts
    28

    Default

    Thanks for your reply Stefan,

    I'm going to try that, but I'm not sure how to disable the WebScaffoldMetadataProvider, could you help me please?

    Can I do that with 'osgi scr disable...'?
    Last edited by r.rodriguez; Feb 23rd, 2011 at 03:59 AM.

  6. #6
    Join Date
    Feb 2011
    Location
    Oviedo (Spain)
    Posts
    28

    Default

    Hi again Stefan,

    I tried what you said, and I was able to disable the existing WebScaffoldMetadataProviderImpl. but I had problems after that.

    I have a problem after the activation of my addon, it seems to be correctly installed (it appears as activated), I can execute my command to disable the previous WebScaffoldMetadataProviderImpl, but after that, when I execute 'entity --class ~.domain.MyEntity', it sometimes fails, and after executing 'controller all....' any view, tagx, ... is created. It also creates a MyEntityController.java but doesn't create any .aj

    Could you help me please?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •