What's New in Sculptor
Version 1.8.x
Version 1.8.0 was released February 16, 2010.
This release has the same functionality as previous 1.7.0, but internally it has been migrated to latest openArchitectureWare, which is now part of Eclipse. This means that the usability of the DSL editor is much better.
- Better content assist (ctrl+space)
- Formatting (Pretty Printing) of model files (ctrl+shift+F)
- Templates (ctrl+space). This is a good complement to ordinary content assist. For example collection references.
Installation
See Installation Guide for instructions of how to install Eclipse 3.5 Galileo and MWE/Xpand/Xtext 0.7.2, and the new Sculptor Plugins.
Migration
If you start from scratch you use the maven archetypes to create project structure, and you can of course skip these migration instructions. If you have an existing project you need to do the following tasks.
1. Change sculptor.version in the pom.xml of the parent project.
<sculptor.version>1.8.0</sculptor.version>
2. Rename src/main/resources/workflow.oaw to workflow.mwe
3. Change workflow.mwe:
<workflow>
<cartridge file="sculptorworkflow.mwe">
<modelFile value="classpath:/model.btdesign"/>
</cartridge>
<component adviceTarget="modelTransformation"
class="org.eclipse.internal.xtend.xtend.XtendAdvice">
<extensionAdvice value="extensions::SpecialCases" />
</component>
<component adviceTarget="dslTransformation"
class="org.eclipse.internal.xtend.xtend.XtendAdvice">
<extensionAdvice value="extensions::SpecialCases" />
</component>
<component adviceTarget="generator" id="reflectionAdvice"
class="org.eclipse.xpand2.GeneratorAdvice">
<advices value="templates::SpecialCases" />
<extensionAdvices value="extensions::SpecialCases" />
<fileEncoding value="iso-8859-1" />
</component>
</workflow>
4. In pom.xml add workflowEngine mwe to the configuration of fornax-oaw-m2-plugin
<plugin>
<groupId>org.fornax.toolsupport</groupId>
<artifactId>fornax-oaw-m2-plugin</artifactId>
<version>${fornax-oaw-m2.version}</version>
<configuration>
<workflowEngine>mwe</workflowEngine>
Find dependency on hybridlabs-beautifier and remove whole dependency section.
<dependency>
<groupId>org.hybridlabs</groupId>
<artifactId>hybridlabs-beautifier</artifactId>
<version>1.1.9</version>
<scope>runtime</scope>
</dependency>
5. We have removed the nested import feature, so you need to import all nested dependent models explicitly. That means that you might need to add some extra imports in model.btdesign.
6. Replace platform resource import with classpath import
For example:
import 'platform:/resource/myapp/src/main/resources/model_core.btdesign'
should be replaced with
import 'classpath:/model_core.btdesign'
7. To be able to use the new formatting feature of model files you might need to add some semicolons to define end of statement for attributes and references. It is still optional, and you don't need to add them, but then formatting will not be good.
Entity Planet {
gap
scaffold
String name key;
String message;
Integer diameter nullable min="1";
Integer population nullable min="0";
- Set<@Moon> moons opposite planet;
}
8. External import feature has been removed. If you have used external import you can replace it with defining that the module should not be generated in in sculptor-generator.properties. E.g. to skip generation of module named 'foo':
generate.module.foo=false
Version 1.7.x
Version 1.7.0 was released January 29, 2010.
This release contains:
Fixed issues:
Migration
If you start from scratch you use the maven archetypes to create project structure, and you can of course skip these migration instructions.
If you have an existing project you need to do the following tasks.
Change sculptor.version in the pom.xml of the parent project.
<sculptor.version>1.7.0</sculptor.version>
fornax-cartridges-sculptor-framework-test
Test utilities have been moved to separate jar. You need to add the following dependency in both business tier and web projects.
<dependency>
<groupId>org.fornax.cartridges</groupId>
<artifactId>fornax-cartridges-sculptor-framework-test</artifactId>
<version>${sculptor.version}</version>
<scope>test</scope>
</dependency>
Transitive dependencies from sculptor-framework are removed
All dependencies in sculptor-framework are now declared with scope provided and you must define the used dependencies yourself in your application project.
CGLIB dependency
The CGLIB dependency has been upgraded. In your business tier project you need to add an exclusion to the joda-time-hibernate dependency and you need to add an explicit dependency to the CGLIB library, see below.
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time-hibernate</artifactId>
<version>1.1</version>
<exclusions>
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
</exclusion>
<exclusion>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
</exclusion>
<exclusion>
<groupId>ehcache</groupId>
<artifactId>ehcache</artifactId>
</exclusion>
<exclusion>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
</exclusion>
<exclusion>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</exclusion>
<exclusion>
<groupId>cglib</groupId>
<artifactId>cglib-full</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>2.2</version>
<!-- Add scope provided when deployed in jboss -->
<!--scope>provided</scope-->
</dependency>
Joda for auditable timestamps
When using joda the auditable fields are now also joda types. In case you prefer the old behaviour you can add in sculptor-generator.properties:
generate.auditable.joda=false
Checksum plugin (optional)
This maven plugin is responsible for deleting unchanged files from one-time-generate directories. Read more about it in Developer's Guide. You don't need to use the checksum plugin.
To use it you need to add the folling to pom.xml files in business-tier and presentation-tier projects.
<plugin>
<groupId>org.fornax.toolsupport</groupId>
<artifactId>fornax-checksum-m2-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<executions>
<execution>
<id>clean</id>
<phase>clean</phase>
<goals><goal>run</goal></goals>
</execution>
<execution>
<id>before generate</id>
<phase>initialize</phase>
<goals><goal>run</goal></goals>
<configuration>
<action>before-generate</action>
</configuration>
</execution>
<execution>
<id>after generate</id>
<phase>generate-sources</phase>
<goals><goal>run</goal></goals>
<configuration>
<action>after-generate</action>
</configuration>
</execution>
</executions>
</plugin>
JSF client
A lot of changes has been made to improve support for customization. The eaisiest way of figuring it out is to generate a new project in parallell and compare the differences. For more info about on explicit changes, see jira-issue's that starts with 'JSF client'.
Names interfaces not generated
For each domain object there was a corresponding interface containing string constants for all attribute and association names. This is not generated any more. If you need it you can turn on generation of it with sculptor-generator.properties:
generate.domainObject.nameConstants=true
However, we recommend that you migrate to the new type and refactoring safe Properties classes instead. They are intended to be used together with the new findByCondition and ConditionalCriteriaBuilder, but they can be used standalone also. E.g.
String firstName = PersonProperties.name().first().toString();
Version 1.6.x
Version 1.6.0 was released June 14, 2009.
This release contains:
- Support for JPA
- Support for Hibernate validator
- Spring annotations instead of XML
- JUnit 4 annotations
- Jetty and inmemory Hsqldb
- Spring Webflow 2
- Don't generate gap classes by default
- And a long list of bug fixes and improvements...
Fixed issues:
Migration
If you start from scratch you use the maven archetypes to create project structure, and you can of course skip these migration instructions.
If you have an existing project you need to do the following tasks.
Dependencies
We have upgraded several frameworks to latest version. Run the Sculptor archetypes for version 1.6 and compare pom files with your existing project.
Version overview:
| Framework |
Sculptor 1.5.x |
Sculptor 1.6.x |
| Hibernate |
3.2.5.ga |
3.3.1.GA |
| hibernate-entitymanager |
- |
3.4.0.GA |
| hibernate-annotations |
- |
3.4.0.GA |
| hibernate-validator |
- |
3.1.0.GA |
| Spring |
2.0.7 |
2.5.6 |
| JUnit |
3.8.1 |
4.4 |
| DBUnit |
2.1 |
2.4.4 |
| Jetty |
- |
6.1.11 |
| Spring Webflow |
1.0.5 |
2.0.6.RELEASE |
Maven clean plugin
To remove generated files before regeneration you need to add some settings for maven-clean-plugin. Grab correct settings by running the Sculptor archetypes for version 1.6.
Change file extension of .design to .btdesign
Due to naming conflict with another plugin we have changed the file extension of model.design. It is now .btdesign. bt stands for Business Tier. You need to rename the .design files and change references in pom.xml, workflow.oaw and model.guidesign. After installing the Sculptor Eclipse plugins you might need to start Eclipse with -clean.
sculptor-generator.properties
We have changed default values to use Jetty and Hsqldb. To use JBoss and MySQL, which was default in Sculptor 1.5.0, you need to add these properties:
deployment.type=ear
deployment.applicationServer=JBoss
db.product=mysql
JPA, Spring annotations and JUnit annotations are new default features in Sculptor 1.6.0. If you still want to use the old style you need to add these properties:
generate.jpa.annotation=false
generate.spring.annotation=false
generate.test.annotation=false
This setup requires DbUnit version 2.1.
<dependency>
<groupId>dbunit</groupId>
<artifactId>dbunit</artifactId>
<version>2.1</version>
<scope>test</scope>
</dependency>
Gap Class
Prior to version 1.6.0 Sculptor generated some files once, such as subclasses to domain objects. Now those classes are generated on demand. In model.design you can specify that you need a sub class for hand written code, a gap class.
Entity Person {
gap
scaffold
Date birthDate
- @Gender sex !changeable
- @Ssn ssn key
- @PersonName name
}
To use the same behavior as before, i.e. always generate gap classes, you need to add the following property in sculptor-generator.properties.
JSP CRUD GUI
The JSP variant of the CRUD GUI has been removed, in favor of JSF.
Version 1.5.x
Version 1.5.0 was released February 1, 2009.
This release contains:
- New DSL for customization of the CRUD GUI
- New rich client dialect of the CRUD GUI
- Upgrade to oAW 4.3.1
- Port of the DDD Sample
- And a long list of bug fixes and improvements...
Fixed issues:
Migration
You have to upgrade to oAW 4.3.1, and install the Sculptor features, see Installation guide.
If you start from scratch you use the maven archetypes to create project structure, and you can of course skip these migration instructions.
If you have an existing project you need to do the following tasks.
1. Change sculptor.version in the pom.xml of the parent project.
<sculptor.version>1.5.0</sculptor.version>
2. Change fornax-oaw-m2.version in the pom.xml of the parent project.
<fornax-oaw-m2.version>2.1.1</fornax-oaw-m2.version>
3. If you use a web project. Create file src/main/resources/model.guidesign with content (replace with your own names):
import 'platform:/resource/helloworld/src/main/resources/model.design'
gui MyWeb for Universe {
}
4. If you use a web project. Edit src/main/resources/workflow-gui.oaw. It should now look something like this
<workflow>
<cartridge file="sculptorguidslworkflow.oaw">
<modelFile value="model.guidesign"/>
<appProject value="helloworld-web"/>
</cartridge>
<!--
<component adviceTarget="generator" id="reflectionAdvice"
class="oaw.xpand2.GeneratorAdvice">
<advices value="templates::WebSpecialCases" />
<fileEncoding value="iso-8859-1" />
</component>
-->
</workflow>
5. Thereafter you need to run mvn eclipse:eclipse from the parent project to update the classpath of the Eclipse projects.
Version 1.4.x
Version 1.4.1 was released October 6, 2008.
The most important features of this release:
- JSF dialect of CRUD GUI.
- Possibility to split model.design into several files.
- Upgrade to oAW 4.3
- Support for Eclipse 3.4 Ganymede. Europa 3.3.2 is also supported.
Fixed issues:
JSF dialect still in beta
There are some known issues with the JSF dialect of the CRUD GUI. JSF will be our future default choice and we are working hard to make it good. Please, try it and report issues
Migration
You have to upgrade to oAW 4.3, see Installation guide.
If you start from scratch you use the maven archetypes to create project structure, and you can of course skip these migration instructions.
If you have an existing project you need to do the following tasks.
1. Change sculptor.version in the pom.xml of the parent project.
<sculptor.version>1.4.1</sculptor.version>
2. Change fornax-oaw-m2.version in the pom.xml of the parent project.
<fornax-oaw-m2.version>2.1.0</fornax-oaw-m2.version>
3. The fornax maven repository has moved and therefore you need to change the repositories settings in pom.xml of the parent project. It should be like this:
<repositories>
<repository>
<id>releases.archiva.fornax-platform.org</id>
<name>Archiva Managed Release Repository</name>
<url>
http: </url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots.archiva.fornax-platform.org</id>
<name>Archiva Managed Snapshot Repository</name>
<url>
http: </url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>java.net</id>
<url>http: <layout>legacy</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>releases.archiva.fornax-platform.org</id>
<name>Archiva Managed Release Repository</name>
<url>
http: </url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots.archiva.fornax-platform.org</id>
<name>Archiva Managed Snapshot Repository</name>
<url>
http: </url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
4. Thereafter you need to run mvn eclipse:eclipse from the parent project to update the classpath of the Eclipse projects.
5. If you have an existing project and need correction of "CSC-207 Not possible to deploy several applications" you have to change the pom.xml in the ear project. Change version of maven-ear-plugin to 2.3.1 and add the following
You have to upgrade to oAW 4.3, see Installation guide.
jboss element to the configuration:
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<generateApplicationXml>true</generateApplicationXml>
<jboss>
<loader-repository>${groupId}.${artifactId}:archive=${artifactId}.ear</loader-repository>
</jboss>
Version 1.3.x
Version 1.3.1 was released April 11, 2008.
The most important feature of 1.3 is a totally new metamodel for the CRUD GUI. In version 1.1 we implemented theyou need to change the version of fornax-oaw-m2-plugin. You have to change the pom.xml in the parent project.
<fornax-oaw-m2.version>2.1.0</fornax-oaw-m2.version>
If you have an existing project CRUD GUI without a separate gui metamodel. The gui generation was using the business tier model. This was a good start, but the experience was that the templates and helper extensions became rather complicated. A special purpose gui metamodel simplified the templates and moved some of the logic to a transformation instead. This is important as we see the need for different dialects of the GUI. In the initial version we are using Spring WebFlow and JSP. We have also started a JSF dialect. More is likely to come, such as rich client (RCP). Another motivation for the gui metamodel is the possibility to customize the GUI by using a separate DSL (in next release).
The release also contains several other improvements and new features.
Some more bug fixes in 1.3.1.
Migration
If you start from scratch you use the maven archetypes to create project structure.
For existing projects you have to do some migration.
1. workflow.oaw
You need to rename workflow.oaw in web project to workflow-gui.oaw and also change the reference to this file in pom.xml in the same web project:
<plugin>
<groupId>org.fornax.toolsupport</groupId>
<artifactId>fornax-oaw-m2-plugin</artifactId>
<version>${fornax-oaw-m2.version}</version>
<configuration>
<workflowDescriptor>workflow-gui.oaw</workflowDescriptor>
<checkResources>
<checkResource>
../fornax-cartridges-sculptor-examples-library/src/main/resources/model.design
</checkResource>
</checkResources>
<properties>
<modelFile>model.design</modelFile>
<appProject>${artifactId}</appProject>
</properties>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>run-workflow</goal>
</goals>
</execution>
</executions>
</plugin>
2. Rename foreign key columns
The naming conventions for foreign key columns in the generated DDL file has been changed. Basically the new naming is based on names of the references, instead of names of the referred objects. Make a copy of previously generated DDL file and compare that to the new one see what has been changed. Rename columns in existing database, if you can't recreate the database.
ALTER TABLE MOON CHANGE COLUMN PLANET_ID PLANET BIGINT NOT NULL
ALTER TABLE DEPARTMENT CHANGE COLUMN EMPLOYEE_ID HEADOFDEPARTMENT BIGINT
With this version it is possible to define database table and column names in the DSL, i.e. if you can't change the database you can define the old names. See Advanced Tutorial.
Version 1.2.x
Version 1.2.0 was released December 9, 2007.
It is a technical upgrade of several core products such as Eclipse and openArchitectureWare. You have to do some migration tasks to start using 1.2.0.
Installation of Development Environment
The Installation Guide describes that you need to install Eclipse IDE for Java EE Developers (jee-europa 3.3.1.1) and plugins such as openArchitectureWare 4.2.
Note that the need for the previously manually installed Sun jar files in the maven repository has been eliminated, but you have to add java.net repository in maven settings.xml.
JBoss AS 4.2.2.GA is the application server we are using with Sculptor 1.2.
Migration of Maven pom.xml files
If you start from scratch you use the maven archetypes to create project structure and maven pom.xml files with correct dependencies. However, for existing projects you need to change some dependencies in the pom.xml.
Hibernate, add exclusion of jta:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>${hibernate.version}</version>
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>
spring-hibernate3, add exclusion of jta:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-hibernate3</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>
javaee, use javaee-api artifactId instead of javaee:
<dependency>
<groupId>javaee</groupId>
<artifactId>javaee-api</artifactId>
<version>5</version>
<scope>provided</scope>
</dependency>
castor, add exclusion of jta:
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor</artifactId>
<version>1.1.1</version>
<exclusions>
<exclusion>
<groupId>cglib</groupId>
<artifactId>cglib-full</artifactId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
</exclusion>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>
Add hybridlabs-beautifier:
<dependency>
<groupId>org.hybridlabs</groupId>
<artifactId>hybridlabs-beautifier</artifactId>
<version>1.1.8</version>
<scope>runtime</scope>
</dependency>
spring-webflow, version 1.0.5:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webflow</artifactId>
<version>1.0.5</version>
</dependency>
Add fornax-cartridges-sculptor-generator to web project.
Add hybridlabs-beautifier also.
<dependency>
<groupId>org.fornax.cartridges</groupId>
<artifactId>fornax-cartridges-sculptor-generator</artifactId>
<version>${sculptor.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.hybridlabs</groupId>
<artifactId>hybridlabs-beautifier</artifactId>
<version>1.1.8</version>
<scope>runtime</scope>
</dependency>
Remove oaw-aaa-patch dependency:
<dependency>
<!-- Patch for oAW bug 180359. This will be placed before oaw-core-xpand2-4.1.2.jar in classpath. -->
<groupId>org.fornax.cartridges</groupId>
<artifactId>oaw-aaa-patch</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
maven-surefire-plugin version 2.3:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.3</version>
<configuration>
<skip>false</skip>
<forkMode>once</forkMode>
<argLine>-Xms32m -Xmx1024m -Dlog4j.configuration=log4j-test.properties</argLine>
</configuration>
</plugin>
Change version properties in pom.xml in parent project:
<properties>
<fornax-oaw-m2.version>2.0.0</fornax-oaw-m2.version>
<hibernate.version>3.2.5.ga</hibernate.version>
<spring.version>2.0.7</spring.version>
<log4j.version>1.2.8</log4j.version>
<commons-logging.version>1.0.3</commons-logging.version>
<sculptor.version>1.2.0</sculptor.version>
</properties>
Remove the following from pom.xml in ear project:
<javaModule>
<groupId>org.eclipse.emf</groupId>
<artifactId>ecore-xmi</artifactId>
<excluded>true</excluded>
</javaModule>
<javaModule>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<excluded>true</excluded>
</javaModule>
<javaModule>
<groupId>org.antlr</groupId>
<artifactId>antlr</artifactId>
<excluded>true</excluded>
</javaModule>
<javaModule>
<groupId>org.antlr</groupId>
<artifactId>stringtemplate</artifactId>
<excluded>true</excluded>
</javaModule>
Run mvn eclipse:eclipse in the parent project to update the dependencies in the Eclipse projects.
Rename of sculptor-generator.properties
In web project the generator properties file should be named sculptor-gui-generation.properties. In the business tier project it is still named sculptor-generation.properties. If you have any properties that are identically defined in both of these files you can remove it from the web project sculptor-gui-generation.properties.
Version 1.1.x
Version 1.1.0 was released November 5, 2007. It include a lot of useful features.
- A complete, but customizable, CRUD Gui is generated based on the domain model specified with the Sculptor DSL. The generated web application uses Spring Web Flow to achieve navigation of the associations in the domain model.
- Scaffold simplifies generation of CRUD operations and is perfect for prototyping together with the CRUD Gui.
- It is efficient to develop the domain model with a textual DSL, but for communication purposes it is useful to have a visual UML view. Sculptor automatically generates a class diagram of the domain model. Instantly updated documentation!
Version 1.1.1 was released November 26. It is a minor bug fix release.