Feb 11th, 2011, 06:55 AM
Creation of custom scaffolding with ROO
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?
Feb 17th, 2011, 11:48 AM
I'm also interested on it
Feb 22nd, 2011, 10:09 AM
Could anyone help me PLEASE? I'm very interested on it
Feb 22nd, 2011, 05:12 PM
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.
Feb 23rd, 2011, 03:30 AM
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.
Feb 28th, 2011, 06:34 AM
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