Issue Details (XML | Word | Printable)

Key: CSC-225
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Patrik Nordwall
Reporter: Patrik Nordwall
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Fornax Cartridge Sculptor

Improve possibilities for customization

Created: 13/Aug/08 08:36 PM   Updated: 31/Jan/09 10:32 AM
Component/s: Generator
Affects Version/s: None
Fix Version/s: 1.5.0

Time Tracking:
Not Specified


 Description  « Hide
There is a requested need to improve the possibilities for customization. See forum: http://www.nabble.com/-Sculptor--Template-modifications-in-a-separate-plugin-or-fragment--tt18935207s17564.html

Some templates (Xpand DEFINE) need to be more fine grained to support AOP overrides better.

It is also possible to use AOP for Xtend functions, which we haven't utilized yet.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Patrik Nordwall added a comment - 19/Aug/08 10:30 PM
Added getResourceDir extension in properties.ext to be able to customize the location of spring and hibernate files.
Documentation in Developer's Guide:
http://fornax-platform.org/cp/display/fornax/7.+Developer%27s+Guide+%28CSC%29#7.Developer%27sGuide%28CSC%29-ChangeGenerationTemplates

Polly Chang added a comment - 20/Aug/08 11:14 PM
It would also be nice if there's an easier way to add in a header at the top of each generated Java file. We need our copyright notice at the top of every file, and I find that I have to edit the template or copy an entire definition to use AOP to add the header.

Polly Chang added a comment - 06/Oct/08 05:43 PM
Another thing is that it would be nice if I can add interfaces more easily to Base class definition in the DomainObject template. Right now the template calls getExtendsAndImplementsLitteral(), which is kind of cumbersome to intercept. It would be easier if the "extends" and "implements" are separate calls that are easier to intercept.

Patrik Nordwall added a comment - 07/Oct/08 09:53 PM
I have added the possibility to define the header. Documented in Developer's Guide: http://fornax-platform.org/cp/display/fornax/7.+Developer%27s+Guide+%28CSC%29#7.Developer%27sGuide%28CSC%29-FileHeader

Patrik Nordwall added a comment - 07/Oct/08 10:06 PM
I have improved the possibility to intercept extends and implements. Now you have the following functions:
String getExtendsAndImplementsLitteral(DomainObject domainObject) :
String getExtendsLitteral(DomainObject domainObject) :
String getExtendsClassName(DomainObject domainObject) :
String getImplementsLitteral(DomainObject domainObject) :
String getImplementsInterfaceNames(DomainObject domainObject) :
String getImplementsInterfaceNames(Entity entity) :

If you need to add interfaces you can intercept getImplementsInterfaceNames.