|
|
How to update fields/relationships/entities afterwards
Hi,
I am discovering Roo at the moment and everything seem great!
I have a question though: how can we update actions done earlier through Roo? More specifically, how to update aspects with Roo?
For example I do that first:Code:
field --fieldName lastname --class Employee
But then I want to change lastname to lastName and cascading this change to every aspects generated by Roo, how can we do that?
If the Roo Shell is open for your project, just change the field name directly in the java source code.
Roo will detect that the file has changed, and will cascade the changes.
Ok damnly simple... But then in the same vein if I deleted something by error (some jsp files for example) how can I regenerate them?
Indeed, the regeneration of some Web artifacts needs some better handling. At the moment you could simply delete the controller as well and then just issue the 'controller scaffold' command again for the entity you want to provide scaffolding for.
Cheers,
Stefan
Originally Posted by Stefan SchmidtIndeed, the regeneration of some Web artifacts needs some better handling. At the moment you could simply delete the controller as well and then just issue the 'controller scaffold' command again for the entity you want to provide scaffolding for.
Cheers,
Stefan
I did just that:
-1. deleted my scaffolded controller, roo shell noticed
-2. deleted my views for it
-3. added two fields
-4. reissued controller scaffold for the entity
However the new fields are not showing up in the edit form. They are however displayed in show.jsp
Any guesses?
Which version of Roo are you using? Please try out Roo RC4 and take a look at the upgrade section in the included documentation where we describe which artifacts to delete and which commands to issue. If you still have issues, I would be very interested in some more details so we can replicate your problem and fix it .
Cheers,
Stefan
Hi Stefan,
My app (just a prototype for now) was created with RC4. I got started with RC3, carefully recorded my commands so i was able to just replay the script. I hadn't really done any programming yet myself so upgrading was really easy, i just discarded my old project
I went through the information in the upgrade section of the manual as you said and could not find anything that applies to my situation.
So I suppose you want to get more info from me? Basically my case was like this:
The domain class is called Customer, the two fields I added are called shippingAddress and billingAddress are simple strings, with notNull, sizeMin and sizeMax defined. I manually modified the class to implement Serializable.
This is all I can think of right now...
Can you please share the exact steps you did so I can replicate your issue. A step by step guide would help here. It would be good if you can also share your script.
Cheers,
Stefan
If I read between the lines, I think there is a feature request in here --
Roo command history per project, that can be dumped and sent back for bug reports
Originally Posted by JabberzIf I read between the lines, I think there is a feature request in here --
Roo command history per project, that can be dumped and sent back for bug reports
In fact that (much requested) feature already exists . Sorry I have not made this clear. When issuing commands in Roo RC4 it will create a log.roo file in the root of your project and that contains all commands you have issued. So if you start the Roo shell and then type 'backup' a zip archive will be created which contains that script. So all you have to do is to send me the zip file.
However, I would also need to know what steps you have taken outside the roo shell (changed java files (Serializable, etc)) and in which exact sequence you have taken these steps (ie. first I ran the attached script, then I added two fields in the Entities Java source, which should have updated the view artifacts). Also, it would be good to know if the Roo shell indicated any problems (ie errors, rollbacks etc). You can also run Roo shell in 'development mode' which will actually give you stack traces, etc.
Cheers,
Stefan |
|