Message Boards

« Back to 3.- Suggestions

Avoid Overwriting Files

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Avoid Overwriting Files
overwrite
Answer
2/13/12 8:40 PM
Hello

We're using XMLPF to create some applications for our clients and we had the need to change some generated things. For instance, we changed some of the input fields to support the rich text editor.

Thing is, we're adding new portlets using the same XML file. When we re-generate it, XMLPF simply overwrites all of our modified files and this is not desirable.

My suggestion here is to avoid writing to files that already exists, but, instead, write to a file with a simillar name but with another suffix or prefix (i.e "NewClass.java.new") and let the users apply the difference using a diff/merge tool.

Thanks.

Leonardo.

RE: Avoid Overwriting Files
Answer
2/15/12 8:49 PM as a reply to Leonardo Guilherme Freitas.
Hola Leonardo,

Very nice to have you here, welcome.

About your changes of some of the input fields to support the rich text editor, If you could send me the example "http://www.xmlportletfactory.org/1-table-2-fields-varchar-and-text" with your changes, I would try to insert them as part of the "standard". Your contribution is very welcome.

About the re-generating / overwrite, probably you would do just remarking the corresponding application.

Use <!-- before <application> tag and --> after </application> tag. This way it wont generate code for it, but wont erase previous generated code, will keep JSPs and .javas, but will overwrite language.properties.

Dont forget to get back to comment your results.emoticon

Saludos, Jack.