tag:blogger.com,1999:blog-32466341399219056162024-03-17T20:03:12.220-07:00Spring Roo CookbookAnonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.comBlogger33125tag:blogger.com,1999:blog-3246634139921905616.post-34027991014126943822012-12-15T04:23:00.002-08:002012-12-15T04:23:20.822-08:00Blog specific to 'Getting started with Spring Framework'<div dir="ltr" style="text-align: left;" trbidi="on">
I've created a new blog (<a href="http://getting-started-with-spring.blogspot.in/">http://getting-started-with-spring.blogspot.in/</a>) where I'll be publishing details related to 'Getting started with Spring Framework' book.</div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com38tag:blogger.com,1999:blog-3246634139921905616.post-80656640280850586132012-12-12T12:10:00.001-08:002012-12-12T12:10:55.569-08:00Detailed ToC of 'Getting started with Spring Framework'<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<b>Chapter 1 - Spring Framework basics</b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>1-1 Introduction<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>1-2 Spring Framework modules<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>1-3 Why use Spring Framework?<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Declarative transaction management<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Security<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>JMX (Java Management Extensions)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>JMS (Java Message Service)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Caching<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>1-4 DI and Spring IoC container<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Dependency Injection (DI)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Identifying application objects and their dependencies<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Creating POJO classes corresponding to identified application objects<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Creating the configuration metadata<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Creating an instance of Spring IoC container<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Access application objects from the Spring IoC container<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>1-5 Programming to interfaces<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Scenario: Dependent class contains reference to the concrete class of dependency<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Scenario: Dependent class contains reference to the interface implemented by dependency<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Spring’s support for programming to interfaces design approach<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>1-6 Different approaches to instantiating Spring beans<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Instantiating beans via static factory methods<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Instantiating beans via instance factory methods<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>1-7 Dependency injection techniques<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Setter-based DI<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Constructor-based DI<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>1-8 Bean scopes<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Singleton<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Prototype<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Choosing the right scope for your beans<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>1-9 Frameworks built on top of Spring<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>1.10 Summary<br />
<br />
<b>Chapter 2 - Configuring beans</b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>2-1 Introduction<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>2-2 Bean definition inheritance<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>MyBank App – Bean definition inheritance example<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>What gets inherited ?<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>2-3 Constructor argument matching<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Passing simple values and bean references using element<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Constructor argument matching based on type<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Constructor argument matching based on name<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>2-4 Configuring different types of bean properties and constructor arguments<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Built-in property editors in Spring<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Specifying values for different collection types<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Specifying values for arrays<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Default collection implementation for , and elements<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>2-5 Built-in property editors<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>CustomCollectionEditor<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>CustomMapEditor<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>CustomDateEditor<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>2-6 Registering property editors with the Spring container<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Creating a PropertyEditorRegistrar implementation<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Configuring the CustomEditorConfigurer class<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>2-7 Concise bean definitions with p and c namespaces<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>p-namespace<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>c-namespace<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>2-8 Spring’s util schema<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><list><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><map><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><set><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><properties><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><constant><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><property-path><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>2-9 FactoryBean interface<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>MyBank App application – Storing events in the database<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>MyBank App – FactoryBean example<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Accessing the FactoryBean instance<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>2-10 Summary<br />
<br />
<b>Chapter 3 - Dependency injection</b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>3-1 Introduction<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>3-2 Inner beans<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>3-3 Explicitly controlling the bean initialization order with depends-on attribute<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>MyBank App – implied dependencies between beans<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Implicit dependency problem<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>3-4 Singleton- and prototype-scoped bean’s dependencies<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Singleton-scoped bean’s dependencies<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Prototype-scoped bean’s dependencies<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>3-5 Obtaining new instances of prototype beans inside singleton beans<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>ApplicationContextAware interface<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><lookup-method> element<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><replaced-method> element<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>3-6 Autowiring dependencies<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>byType<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>constructor<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>byName<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>default / no<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Making beans unavailable for autowiring<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Autowiring limitations<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>3-7 Summary<br />
<br />
<b>Chapter 4 - Customizing beans and bean definitions</b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>4-1 Introduction<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>4-2 Customizing bean’s initialization and destruction logic<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Making Spring invoke cleanup method specified by the destory-method attribute<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Cleanup methods and prototype-scoped beans<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Specifying default bean initialization and destruction methods for all beans<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>InitializingBean and DisposableBean lifecycle interfaces<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>JSR 250’s @PostConstruct and @PreDestroy annotations<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>4-3 Interacting with newly created bean instances using BeanPostProcessor<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>BeanPostProcessor example – Validating bean instances<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>BeanPostProcessor example – Resolving bean dependencies<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>BeanPostProcessor behavior for FactoryBeans<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>RequiredAnnotationBeanPostProcessor<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>DestructionAwareBeanPostProcessor<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>4-4 Modifying bean definitions using BeanFactoryPostProcessor<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>BeanFactoryPostProcessor example<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PropertySourcesPlaceholderConfigurer<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>PropertyOverrideConfigurer<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>4-5 Summary<br />
<br />
<b>Chapter 5- Annotation-driven development with Spring</b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>5-1 Introduction<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>5-2 Identifying Spring components with @Component<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>5-3 @Autowired - autowiring dependencies by type<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>5-4 @Qualifier – autowiring dependencies by name<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>5-5 JSR 330’s @Inject and @Named annotations<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>5-6 JSR 250’s @Resource annotation<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>5-7 @Scope, @Lazy, @DependsOn and @Primary annotations<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>5-8 Simplifying component configuration using @Value annotation<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>5-9 Validating objects using Spring’s Validator interface<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>5-10 Specifying constraints using JSR 303 annotations<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>JSR 303 support in Spring<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>5-11 Programmatically configuring Spring beans using @Configuration and @Bean annotations<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>5-12 Summary<br />
<br />
<b>Chapter 6 - Database interaction using Spring</b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>6-1 Introduction<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>6-2 MyBank App application’s requirements<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>6-3 Developing the MyBank App application using Spring’s JDBC module<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Configuring a data source<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Creating DAOs that use Spring’s JDBC module classes<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>6-4 Developing the MyBank App application using Hibernate<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Configuring SessionFactory instance<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Creating DAOs that use Hibernate API for database interaction<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>6-5 Transaction management using Spring<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>MyBank App’s transaction management requirements<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Programmatic transaction management<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Declarative transaction management<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Spring’s support for JTA<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>6-6 Summary<br />
<br />
<b>Chapter 7 - Messaging, emailing, asynchronous method execution, and caching using Spring</b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>7-1 Introduction<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>7-2 MyBank App application’s requirements<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>7-3 Sending JMS messages<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Configuring ActiveMQ broker to run in embedded mode<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Configuring a JMS ConnectionFactory<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Sending JMS messages using JmsTemplate<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Sending JMS messages within a transaction<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Dynamic JMS destinations and JmsTemplate configuration<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>JmsTemplate and message conversion<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>7-4 Receiving JMS messages<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Synchronously receiving JMS messages using JmsTemplate<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Asynchronously receiving JMS messages using message listener containers<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>7-5 Sending emails<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>7-6 Task scheduling and asynchronous execution<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TaskExecutor interface<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TaskScheduler interface<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Async and @Scheduled annotations<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>7-7 Caching<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Configuring a CacheManager<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Caching annotations - @Cacheable, @CacheEvict and @CachePut<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>7-8 Running the MyBank App application<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>7-9 Summary<br />
<br />
<b>Chapter 8 - Aspect-oriented programming</b><br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>8-1 Introduction<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>8-2 A simple AOP example<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>8-3 Spring AOP framework<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Proxy creation<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>expose-proxy attribute<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>8-4 Pointcut expressions<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>@Pointcut annotation<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>execution and args pointcut designators<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>bean pointcut designator<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Annotations-based pointcut designators<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>8-5 Advice types<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Before advice<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>After returning advice<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>After throwing advice<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>After advice<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Around advice<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>8-6 Spring AOP - XML schema-style<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Configuring an AOP aspect<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Configuring an advice<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Associating a pointcut expression with an advice<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>8-7 Summary<br />
</div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com5tag:blogger.com,1999:blog-3246634139921905616.post-26726740993004668172012-12-10T18:59:00.003-08:002012-12-10T19:00:37.692-08:00Book 'Getting started with Spring Framework' is now available<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<span style="font-family: inherit;">'<a href="http://www.amazon.com/dp/1480013978">Getting started with Spring Framework</a>' book that I started writing couple of months back with J Sharma is now available at amazon : <a href="http://amzn.to/VwbjdX">http://amzn.to/VwbjdX</a> </span><br />
<span style="font-family: inherit;"><br /></span><span style="font-family: inherit;">You can download the source code of the book from here: <a href="http://code.google.com/p/getting-started-with-spring-framework/downloads/list">http://code.google.com/p/getting-started-with-spring-framework/downloads/list</a></span><br />
<span style="font-family: inherit;"><br /></span><span style="font-family: inherit;">You can post your questions and feedback here: <a href="https://groups.google.com/forum/#!forum/getting-started-with-spring-framework">https://groups.google.com/forum/#!forum/getting-started-with-spring-framework</a></span></div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-46650548888278392942012-01-14T23:30:00.000-08:002012-01-14T23:30:29.816-08:00Spring Roo 1.1 Cookbook review by Shekhar Gulati<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Many thanks to Shekhar for reviewing Spring Roo 1.1 Cookbook :)<br />
<br />
You can visit Shekhar's blog and read the complete review here : <a href="http://whyjava.wordpress.com/2011/12/21/spring-roo-1-1-cookbook-review/">http://whyjava.wordpress.com/2011/12/21/spring-roo-1-1-cookbook-review/</a><br />
</div>Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-70928693860521020212012-01-14T23:20:00.000-08:002012-01-14T23:20:28.579-08:00View and add dynamic finder methods<div dir="ltr" style="text-align: left;" trbidi="on">
<i><span style="font-family: inherit;">A dynamic finder method is a finder method for which you don't need to write a JPA query.</span></i><br />
<b><span style="font-family: inherit;"><br /></span></b><br />
<span style="font-family: inherit;">Download <b>ch03_persistent_entities.roo </b>script from the source code that accompanies Spring Roo 1.1 Cookbook: <a href="http://code.google.com/p/spring-roo-cookbook/downloads/list">http://code.google.com/p/spring-roo-cookbook/downloads/list</a></span><br />
<br />
<span style="font-family: inherit;">The script sets up Hibernate as a persistence provider and creates a <b>Flight </b>entity, which</span><br />
<span style="font-family: inherit;">has <b>FlightKey </b>as its composite primary key class. Additionally, the script adds fields to the</span><br />
<span style="font-family: inherit;"><b>Flight </b>and <b>FlightKey </b>classes. If you are using a different database than MySQL or your</span><br />
<span style="font-family: inherit;">connection settings are different than what is specified in the script, then modify the script</span><br />
<span style="font-family: inherit;">accordingly.</span><br />
<br />
<span style="font-family: inherit;"><br /></span><br />
<b>To view dynamic finder methods, follow the given steps:
</b><br />
<br />
<br />
<div style="text-align: left;">
<span style="font-family: inherit;"><b>1. </b>Start Roo shell and set the focus of the subsequent commands on the <b>Flight</b> entity using the <b>focus</b></span></div>
<span style="font-family: inherit;">command:</span><br />
<span style="font-family: 'Trebuchet MS', sans-serif;">roo> focus --class ~.domain.Flight</span><br />
<b><br /></b><br />
<span style="font-family: inherit;"><b>2.</b> Execute the <b>finder list</b> command to view the list of candidate dynamic finder</span><br />
<span style="font-family: inherit;">methods for the <b>Flight </b>entity, as shown here:</span><br />
<span style="font-family: 'Trebuchet MS', sans-serif;">~.domain.Flight roo> finder list</span><br />
<span style="font-family: 'Trebuchet MS', sans-serif;">.....</span><br />
<span style="font-family: 'Trebuchet MS', sans-serif;">findFlightsByCreatedDateBetween(Date minCreatedDate, Date</span><br />
<span style="font-family: 'Trebuchet MS', sans-serif;">maxCreatedDate)</span><br />
<span style="font-family: 'Trebuchet MS', sans-serif;">findFlightsByCreatedDateGreaterThan(Date createdDate)</span><br />
<span style="font-family: 'Trebuchet MS', sans-serif;">.....</span><br />
<br />
<br />
<br />
<span style="font-family: inherit;"><b>To add dynamic finder methods, follow the given steps:</b></span><br />
<span style="font-family: inherit;"><br /></span><br />
<span style="font-family: inherit;">1. Add the <b>findFlightsByDestinationLikeAndOriginLike</b> dynamic finder</span><br />
<span style="font-family: inherit;">method to the <b>Flight</b> entity using the <b>finder add</b> command:</span><br />
<span style="font-family: inherit;"><br /></span><br />
<span style="font-family: 'Trebuchet MS', sans-serif;">.. roo> finder add findFlightsByDestinationLikeAndOriginLike</span><br />
<span style="font-family: 'Trebuchet MS', sans-serif;">Updated SRC_MAIN_JAVA\sample\roo\flightapp\domain\Flight.java</span><br />
<span style="font-family: 'Trebuchet MS', sans-serif;">Created SRC_MAIN_JAVA\sample\roo\flightapp\domain\Flight_Roo_</span><span style="font-family: 'Trebuchet MS', sans-serif;">Finder.aj</span><br />
<br />
<div style="font-family: 'Trebuchet MS', sans-serif;">
<br /></div>
<span style="font-family: inherit;">The following code shows the auto-generated implementation of the</span><br />
<span style="font-family: inherit;"><b>findFlightsByDestinationLikeAndOriginLike </b>finder method in the <b>Flight_Roo_</b></span><b style="font-family: inherit;">Finder.aj</b><span style="font-family: inherit;"> file:</span><br />
<div style="font-family: 'Trebuchet MS', sans-serif;">
<br /></div>
<div style="font-family: 'Trebuchet MS', sans-serif;">
</div>
import javax.persistence.EntityManager;<br />
import javax.persistence.TypedQuery;<br />
...<br />
public static TypedQuery<flight></flight><br />
Flight.findFlightsByDestinationLikeAndOriginLike(String destination, String origin) {<br />
if (destination == null || destination.length() == 0)<br />
throw new IllegalArgumentException("The destination argument is required");<br />
...<br />
if (origin == null || origin.length() == 0)<br />
throw new IllegalArgumentException("The origin argument is required");<br />
...<br />
EntityManager em = Flight.entityManager();<br />
TypedQuery<flight> q = em.createQuery("SELECT Flight FROM Flight AS flight WHERE </flight><br />
LOWER(flight.destination) LIKE<br />
LOWER(:destination) AND LOWER(flight.origin) LIKE<br />
LOWER(:origin)", Flight.class);<br />
q.setParameter("destination", destination);<br />
q.setParameter("origin", origin);<br />
return q;<br />
}<br />
<br />
<br />
<span style="font-family: 'Trebuchet MS', sans-serif;"><br /></span><br />
</div>Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com1tag:blogger.com,1999:blog-3246634139921905616.post-5497453982599356982011-12-12T21:53:00.000-08:002011-12-12T21:53:08.958-08:00Adding JSON support to domain objects and controllers<div dir="ltr" style="text-align: left;" trbidi="on">
This post shows how you can add JSON support to your applications using Spring Roo. The information in this post has been taken from <a href="http://www.amazon.com/Spring-Roo-Cookbook-Ashish-Sarin/dp/1849514585/" target="_blank">Spring Roo 1.1 Cookbook</a>.<div>
<br /></div>
<div>
<b>Step 1: </b>Download Roo scripts and sample code from the following location:<a href="http://code.google.com/p/spring-roo-cookbook/downloads/list#columnprefs">http://code.google.com/p/spring-roo-cookbook/downloads/list#columnprefs</a></div>
<div>
<br /></div>
<div>
<b>Step 2: </b>Execute the ch04_web-app.roo script that creates the <b>flight-app</b> Roo project, sets up</div>
<div>
Hibernate as the persistence provider, configures MySQL as the database for the application,</div>
<div>
creates the Flight and FlightDescription JPA entities, and defines a many-to-one</div>
<div>
relationship between the <b>Flight </b>and <b>FlightDescription </b>entities. If you are using a</div>
<div>
different database than MySQL or your connection settings are different than what is specified</div>
<div>
in the script, then modify the script accordingly.</div>
<div>
<br /></div>
<div>
<b>Step 3: </b>Execute the controller all command to create controllers and JSPX views corresponding</div>
<div>
to JPA entities in the <b>flight-app</b> project, as shown here:</div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">.. roo> controller all --package ~.web</span></div>
<div>
Execute the perform eclipse command to update the project's classpath settings, as</div>
<div>
shown here:</div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">.. roo> perform eclipse</span></div>
<div>
Now, import the <b>flight-app</b> project into your Eclipse IDE.</div>
<div>
<br /></div>
<div>
<b>Step 4</b>: To add the json support execute the <b>json add</b> command against the <b>Flight </b>JPA entity:</div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">~.domain.Flight roo> json add --class ~.domain.Flight</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">Updated SRC_MAIN_JAVA\...\domain\Flight.java</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">Created SRC_MAIN_JAVA\...\domain\Flight_Roo_Json.aj</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">Created SRC_MAIN_JAVA\...\web\FlightController_Roo_Controller_Json.aj</span></div>
<div>
<br /></div>
<div>
<div>
Executing the <b>json add</b> command creates</div>
<div>
a <b>*_Roo_Json.aj </b>AspectJ ITD, which defines methods for converting objects of the class to</div>
<div>
JSON documents and vice versa, as shown here:</div>
</div>
<div>
<br /></div>
<div>
<div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">import flexjson.JSONDeserializer;</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">import flexjson.JSONSerializer;</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">privileged aspect Flight_Roo_Json {</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> public String Flight.toJson() {</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b> return new JSONSerializer().exclude("*.class").serialize(this);</b></span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> }</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> public static Flight Flight.fromJsonToFlight(String json) {</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b> return new JSONDeserializer<flight>().use(null, Flight.class).deserialize(json);</flight></b></span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> }</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> public static String Flight.toJsonArray(</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> Collection<flight> collection) {</flight></span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> ...</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> }</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> public static Collection<flight></flight></span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b> Flight.fromJsonArrayToFlights(String json) {</b></span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> ...</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> }</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">}</span></div>
</div>
</div>
<div>
<br /></div>
<div>
<div>
The following code shows the <b>FlightController_Roo_Controller_Json.aj</b> ITD, which</div>
<div>
was generated:</div>
<div>
import org.springframework.http.ResponseEntity;</div>
<div>
import org.springframework.web.bind.annotation.ResponseBody;</div>
<div>
<br /></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">privileged aspect FlightController_Roo_Controller_Json {</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> @RequestMapping(value = "/{flightId}", method = RequestMethod.GET, </span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> <b>headers = "Accept=application/json"</b>)</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> @ResponseBody</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> public Object FlightController.showJson(@PathVariable("flightId") Long flightId) {</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> Flight flight = Flight.findFlight(flightId);</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> if (flight == null) {</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> HttpHeaders headers= new HttpHeaders();</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> headers.add("Content-Type", "application/text");</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> return new ResponseEntity<string>(headers, HttpStatus.NOT_FOUND);</string></span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> }</span></div>
<div>
<b><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> return flight.toJson();</span></b></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> }</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> ...</span></div>
<div>
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">}</span></div>
</div>
<div>
<br /></div>
</div>Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com1tag:blogger.com,1999:blog-3246634139921905616.post-53176058034491712792011-11-28T23:36:00.001-08:002011-11-28T23:40:44.787-08:00Spring Roo 1.1 Cookbook review by Cengiz Öner<div dir="ltr" style="text-align: left;" trbidi="on">
I just came across review of Spring Roo 1.1 Cookbook b<span style="color: black;">y </span><a class="profile-name-link" href="http://www.blogger.com/profile/10471886955497473463" rel="author" style="color: black;">Cengiz Öner</a><span style="color: black;">. </span>Many thanks to Cengiz for writing the review :)<br />
<br />
You can visit Cengiz's blog and read the complete review here : <a href="http://gwtsts.blogspot.com/2011/11/review-spring-roo-11-cookbook-by-ashish.html">http://gwtsts.blogspot.com/2011/11/review-spring-roo-11-cookbook-by-ashish.html</a><br />
</div>Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-54956967399905997352011-10-31T03:54:00.000-07:002011-10-31T03:54:51.369-07:00Spring Roo podcast<div dir="ltr" style="text-align: left;" trbidi="on">
You can download the Spring Roo podcast from Banglore Software Radio website: <a href="http://www.bangaloresoftwareradio.info/">http://www.bangaloresoftwareradio.info/</a></div>Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-86171614631408419692011-10-18T12:19:00.000-07:002011-10-18T12:19:27.647-07:00Spring Roo presentation<div dir="ltr" style="text-align: left;" trbidi="on">
Last week I gave a presentation on Spring Roo in Silicon India conference held in Hyderabad. I tried my best to give a complete example that makes use of Spring Roo features to develop a Flight Booking application. Link to PDF: <a href="http://www.siliconindia.com/events/siliconindia_events/Java_Hyd_Conf/Ashish_Spring_Roo.pdf">http://www.siliconindia.com/events/siliconindia_events/Java_Hyd_Conf/Ashish_Spring_Roo.pdf</a></div>Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-11417889162062372512011-10-05T20:51:00.000-07:002011-10-05T20:51:12.645-07:00Quick introduction to AspectJ ITD<div dir="ltr" style="text-align: left;" trbidi="on">
In this post, I'll show a few examples of AspectJ ITDs that are generated by Spring Roo and the declarations contained in those ITDs. You'll find a more detailed discussion in Chapter 1 (which is available for download) of <a href="http://www.amazon.com/Spring-Roo-Cookbook-Ashish-Sarin/dp/1849514585/">Spring Roo 1.1 Cookbook</a>.<div>
<b><br /></b></div>
<div>
<b>Example 1: </b><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b>FlightService_Roo_ToString.aj</b></span></div>
<div>
<div style="border-left: solid windowtext 1.0pt; border: none; margin-left: 18.0pt; margin-right: 0cm; mso-border-left-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 0cm 0cm 0cm 4.0pt;">
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="background-color: white; color: black;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">package
sample.roo.flightapp.service;<o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<br /></div>
<div class="CodeHighlightedPACKT" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-left: 0cm;">
<span lang="EN-GB" style="background-color: white; color: black;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">privileged aspect FlightService_Roo_ToString {<o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="background-color: white; color: black;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><span> </span><o:p></o:p></span></span></div>
<div class="CodeHighlightedPACKT" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; margin-left: 0cm;">
<span lang="EN-GB" style="background-color: white; color: black;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><span> </span>public
String FlightService.toString() {<o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="background-color: white; color: black;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><span> </span>StringBuilder sb = new StringBuilder();<o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="background-color: white; color: black;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><span> </span>sb.append("Origin: ")<o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="background-color: white; color: black;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><span> </span><span>
</span>.append(getOrigin());<o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="background-color: white; color: black;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><span> </span>return sb.toString();<o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="background-color: white; color: black;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><span> </span>}<o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="background-color: white; color: black;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">}</span></span> </div>
</div>
<div>
<br /></div>
<div>
<span lang="EN-GB" style="color: black; font-size: 11pt;"><span class="Apple-style-span" style="font-family: inherit;">The following figure shows what the above declaration implies:</span><!--[endif]--></span></div>
<div>
<span lang="EN-GB" style="color: black; font-size: 11pt;"><span class="Apple-style-span" style="font-family: inherit;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-TiV7-ojhagw/To0jsDNmfkI/AAAAAAAAADk/wTYzzfPaJtw/s1600/itd1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="http://4.bp.blogspot.com/-TiV7-ojhagw/To0jsDNmfkI/AAAAAAAAADk/wTYzzfPaJtw/s640/itd1.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Example 2</b>: <span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b>FlightService_Roo_Serializable.aj</b></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b><br /></b></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"></span></div>
<div style="background-color: white; border-bottom-style: none; border-color: initial; border-left-color: windowtext; border-left-style: solid; border-left-width: 1pt; border-right-style: none; border-top-style: none; border-width: initial; margin-left: 18pt; margin-right: 0cm; padding-bottom: 0cm; padding-left: 4pt; padding-right: 0cm; padding-top: 0cm;">
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="color: black;">package
sample.roo.flightapp.service;<o:p></o:p></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<br /></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="color: black;">import
java.io.Serializable;<o:p></o:p></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<br /></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="color: black;">privileged
aspect FlightService_Roo_Serializable {<o:p></o:p></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="color: black;"><span> </span><o:p></o:p></span></div>
<div class="CodeHighlightedPACKT" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-left: 0cm;">
<span lang="EN-GB" style="color: black;"><span> </span>declare
parents: FlightService implements Serializable;<o:p></o:p></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="color: black;"><span> </span><o:p></o:p></span></div>
<div class="CodeHighlightedPACKT" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-left: 0cm;">
<span lang="EN-GB" style="color: black;"><span> </span>private
static final long FlightService.serialVersionUID <o:p></o:p></span></div>
<div class="CodeHighlightedPACKT" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; margin-left: 0cm;">
<span lang="EN-GB" style="color: black;"><span> </span>=
5059552858884348572L<o:p></o:p></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="color: black;">}<b><o:p></o:p></b></span></div>
</span></div>
<br />
<div>
<span class="Apple-style-span" style="font-size: 15px;"><br /></span></div>
<div>
<div>
<span class="Apple-style-span" style="font-size: 15px;">The following figure shows what the above declaration implies:</span></div>
<div>
<br /></div>
</div>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-wojQMNaZDZY/To0lYsI4ByI/AAAAAAAAADo/x32sx3H_cSU/s1600/itd2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="312" src="http://2.bp.blogspot.com/-wojQMNaZDZY/To0lYsI4ByI/AAAAAAAAADo/x32sx3H_cSU/s640/itd2.png" width="640" /></a></div>
<div>
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-24386293121377796652011-10-04T04:41:00.000-07:002011-10-04T04:42:02.743-07:00Spring Roo 1.1 Cookbook promotion at Javaranch<div dir="ltr" style="text-align: left;" trbidi="on">
This week I'll be responding to questions related to Spring Roo in the Spring forum of Javaranch (<a href="http://www.coderanch.com/forums/f-96/Spring">http://www.coderanch.com/forums/f-96/Spring</a>). You can win a copy of the book by posting questions in the Spring forum.</div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com3tag:blogger.com,1999:blog-3246634139921905616.post-43513360583329127872011-10-04T03:54:00.000-07:002011-10-04T03:54:05.814-07:00Spring Roo - future of Java application development<div dir="ltr" style="text-align: left;" trbidi="on">
Traditional Java enterprise application development required developers to write the boilerplate code. The Spring Framework simplified Java enterprise application development with DI and POJO-based approach to developing applications. No wonder, Spring Framework has become the most popular platform for developing applications.<br />
<br />
Spring Framework simplifies developing enterprise applications using standard technologies, like JPA, Hibernate, JDBC, Flex, JavaMail, JMS, and so on. Still, you need to write some generic configuration and generic code which can be generated by a tool. Let's look at a few examples:<br />
<br />
1. If you write a class, you normally override the <span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">toString </span>method<br />
2. If you write a JPA entity class, then you provide<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> getter/setters methods</span> for persistent fields, method to obtain reference to <span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">EntityManager</span>, create <span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">persistence.xml</span>, and so on.<br />
3. When using Spring Web MVC, you need to configure handler mappings, create controller classes corresponding to JPA entities, create JSP views, and so on.<br />
...<br />
<br />
And the list goes on and on, depending upon the technology or framework that you are using. If all these generic configurations and code are generated and managed by a development tool, developers will be more productive. And, if the code generated follows best practices of development, then you don't need to even worry about incorporating best practices in your application architecture. This is where Spring Roo comes as the next generation productivity improvement tool.<br />
<br />
Spring Roo generates generic configurations and code to help developers focus on writing the business logic. There are no runtime dependencies of application on Spring Roo, and you can easily modify the Roo-generated code by using Push-in refactoring. So, even though you are using a productivity improvement tool, you have full control over modifying the generated code, and you don't need to learn any new language or frameworks to do so. If you know Spring, you can easily get started with using Spring Roo effectively. Spring Roo truely defines the future of enterprise Java application development.</div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com1tag:blogger.com,1999:blog-3246634139921905616.post-2783512512788070532011-09-29T23:12:00.000-07:002011-09-29T23:12:43.382-07:00How to get the most out of Spring Roo 1.1 Cookbook<div dir="ltr" style="text-align: left;" trbidi="on">
The recipes covered in <a href="http://www.amazon.com/Spring-Roo-Cookbook-Ashish-Sarin/dp/1849514585/"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">Spring Roo 1.1 Cookbook</span></a> are applicable to version <b>1.1.3</b>, <b>1.1.4</b> and <b>1.1.5</b> version of Spring Roo. The Spring Roo 1.2 is currently in the milestone release, and it's final release will come sometime in December or early next year. Here, a few of my recommendations when going through recipes in Spring Roo 1.1 Cookbook:<div>
<br /><div>
<span class="Apple-style-span" style="font-family: inherit;">1 - Use <b>Spring Roo 1.1.5</b> when working with recipes described in Spring Roo 1.1 Cookbook. </span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">2 -<b> Don't do copy-paste of commands</b> from eBook to Roo shell. Instead, type it yourself on the Roo shell (you don't need to type everything because Roo offers auto-completion feature)</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">3 - If you are evaluating Spring Roo for developing an application which makes use of a set of technologies or frameworks, then pay close attention to <b>'How it works...' </b>section, which describes what all configuration and code is generated by Spring Roo.</span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">4 - If you are using Spring Roo to <b>learn a technology</b>, it is important to focus on <b>'How it works...'</b> section.</span></div>
</div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">5 - <b>Be prepared to write code or customize the Roo-generated code</b>. A lot of recipes show what to customize and how to customize Roo-generated code.</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-86992563184838886822011-09-29T09:42:00.000-07:002011-09-29T09:42:34.521-07:002 recipes from Chapter 4 of Spring Roo 1.1 Cookbook<div dir="ltr" style="text-align: left;" trbidi="on">
2 recipes from Chapter 4 of <span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><a href="http://www.amazon.com/Spring-Roo-Cookbook-Ashish-Sarin/dp/1849514585">Spring Roo 1.1 Cookbook</a></span> are now available at Packt website: <a href="http://www.packtpub.com/article/working-with-roo-generated-web-applications">http://www.packtpub.com/article/working-with-roo-generated-web-applications</a></div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-17459576244566702272011-09-28T23:30:00.000-07:002011-09-28T23:33:26.326-07:00What is covered in Spring Roo 1.1 Cookbook<div dir="ltr" style="text-align: left;" trbidi="on">
<span class="Apple-style-span" style="background-color: #f3f3f3;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">As a follow up to the previous post, here I've detailed what information you'll find in Spring Roo 1.1 Cookbook and for what information you need to refer to other resources.</span></span><br />
<br />
<span class="Apple-style-span" style="background-color: white;"><b><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">AspectJ ITDs</span></b> - Information about AspectJ ITDs and how they are used by Spring Roo is covered in extensive detail. You'll recipes related to Push-in and Push-out refactoring also.</span><br />
<b><br /></b><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b>Spring framework and Maven</b> -</span> The Spring Roo Cookbook assumes that you have enough understanding of Spring and Maven. If not, then please refer to Spring reference documentation or any other tutorial or book.<br />
<br />
<span class="Apple-style-span" style="background-color: white;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b>Technology or framework information</b> -</span> Spring Roo Cookbook attempts to give a crash course in JPA, GWT, Flex, Spring Web Flow, Spring Web MVC, Selenium, Solr, and other technologies for which base add-ons are provided by Roo. If you have never used these frameworks, Spring Roo Cookbook woul;d still be an easy read for you. If you are looking for details on these technologies or frameworks, then it is recommended that you refer to some other resources.</span><br />
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
<span class="Apple-style-span" style="background-color: white;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b>OSGi</b> -</span> You'll find some introductory information about OSGi, as this forms the heart of Spring Roo add-ons</span><br />
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
<span class="Apple-style-span" style="background-color: white;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b>Roo-generated code information</b> - </span>This is at the <b>heart </b>of Spring Roo Cookbook. It attempts to cover all the Roo-generated code and configuration information. You'll find information about maven plugins that are configured by Roo in pom.xml file, AspectJ ITDs, Java source code, and so on.</span><br />
<span class="Apple-style-span" style="background-color: white;"><br /></span><br />
<span class="Apple-style-span" style="background-color: white;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><b>Add-on development</b> - </span>Chapter 7 shows the code generated by Roo for simple and advanced add-ons. It should give you a solid starting point to create your own add-ons. This should give enough information about internal workings of Spring Roo.</span></div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-49461323339483674372011-09-28T01:32:00.000-07:002011-09-28T01:32:13.089-07:00How to get the most out of Spring Roo development tool<div dir="ltr" style="text-align: left;" trbidi="on">
Let me say this upfront -<span style="font-family: "Trebuchet MS",sans-serif;"> </span><b style="font-family: "Trebuchet MS",sans-serif;">Spring Roo is not a replacement for a developer's technical skills. It'll only help you to be more productive but don't expect the tool to do everything for you.</b><br />
<br />
To get the most out of Spring Roo, you need understanding of the following areas:<br />
<br />
<div style="font-family: "Trebuchet MS",sans-serif;">
1. AspectJ ITDs</div>
<div style="font-family: "Trebuchet MS",sans-serif;">
2. Maven</div>
<div style="font-family: "Trebuchet MS",sans-serif;">
3. Spring framework</div>
<i><span style="background-color: #f3f3f3;"><br /></span></i><br />
<i><span style="background-color: #f3f3f3;">The first 3 points address the must-haves for using Spring Roo or you
won't be able to understand what's going on when you execute commands. </span></i><br />
<i><span style="background-color: #f3f3f3;"></span></i><br />
<div style="font-family: "Trebuchet MS",sans-serif;">
4. Good understanding of the framework or technology for which you are using Spring Roo to generate code<span style="font-family: inherit;"><span style="font-family: inherit;"> </span></span></div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<span style="font-family: inherit;"><span style="font-family: inherit;"><br /></span></span></div>
<div style="background-color: #eeeeee; font-family: inherit;">
<i><span style="background-color: white;"></span>This is important if you want to modify the code generated by Spring Roo.
For instance, if you don't know Spring Web MVC, then it won't be easy
for you to figure out what you need to change to meet your application's
requirements.</i></div>
<br />
<br />
<div style="font-family: "Trebuchet MS",sans-serif;">
5. Some understanding of OSGi</div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<br /></div>
<div style="background-color: #eeeeee; font-family: "Trebuchet MS",sans-serif;">
<i><span style="font-family: inherit;">If you have some understanding of OSGi, then you can easily understand what add-ons are and why Spring Roo follows add-on based architecture. This could also be helpful if you want to get started with developing your custom add-ons.</span></i></div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<span style="font-family: inherit;"> </span> </div>
<div style="font-family: "Trebuchet MS",sans-serif;">
6. A solid understanding of the code generated by Spring Roo</div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<br /></div>
<div style="background-color: #eeeeee; font-family: "Trebuchet MS",sans-serif;">
<i><span style="font-family: inherit;">The code generated by Spring Roo follows best practices and gives a solid foundation for developing your application. This understanding is important if you want to make changes to Roo-generated code to meet specific requirements of your applications.</span></i></div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<span style="font-family: inherit;"> </span> </div>
<div style="font-family: "Trebuchet MS",sans-serif;">
7. A good understanding of add-ons</div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<br /></div>
<div style="background-color: #eeeeee; font-family: "Trebuchet MS",sans-serif;">
<span style="font-family: inherit;"><i>Not all features that you need are part of base add-ons provided by Spring Roo. So some understanding of how to install and remove add-ons is helpful. For instance, if there is a Portlet add-on, you need to know how to install it in your Spring Roo installation to create portlets.</i></span></div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<br /></div>
<div style="font-family: "Trebuchet MS",sans-serif;">
8. A good understanding of how Spring Roo works when you execute commands from Roo shell</div>
<br />
<br />
<i style="background-color: #eeeeee;">It is important to know how code generation works in Spring Roo. For instance, add-ons are responsible for managing AspectJ ITDs </i><i style="background-color: #eeeeee;">so you should not modify them.</i></div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-12893184762843439552011-09-27T20:56:00.000-07:002011-09-27T20:56:03.491-07:00Scaffolding a Spring Web MVC application<div dir="ltr" style="text-align: left;" trbidi="on">
We saw in earlier two posts that using <b>project</b> command you can create a Java project, and by using <b>persistence setup</b> command you can setup a persistence provider (Hibernate, OpenJPA, and so on).<br />
<br />
It's important to note the following when using Spring Roo:<br />
- You don't need to remember commands because Roo is a very user-friendly development tool. You can look at all the Roo commands and their brief description using <b>help</b> command.<br />
- Also, Roo offers <i>auto-completion</i> features - which means you partially type a command or an argument name, and Roo auto-completes it for you.<br />
<br />
You can scaffold a Spring Web MVC application from JPA entities using <b>controller all</b> command.<br />
<br />
<b>Step 1: </b>Download <span class="CodeInTextPACKT"><span lang="EN-US"><b>ch04_web-app.roo</b></span></span><span lang="EN-US"> script from the Google Code project for Spring Roo 1.1 Cookbook (</span><a href="http://code.google.com/p/spring-roo-cookbook/downloads/list">http://code.google.com/p/spring-roo-cookbook/downloads/list</a><span lang="EN-US">). Execute <b>ch04_web-app.roo </b>script using <b>script</b> command of Spring Roo. A Roo script contains a sequence of commands which are executed when you execute script command, as shown here:</span><br />
<br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">roo> script --file ch04_web-app.roo</span><br />
<br />
<span lang="EN-US">Executing <b>ch04_web-app.roo</b> script creates<b> </b></span><span class="CodeInTextPACKT"><span lang="EN-US"><b>flight-app</b></span></span><span lang="EN-US"><b> </b>Roo project, sets up
Hibernate as persistence provider, configures MySQL as the database for the
application, creates </span><span class="CodeInTextPACKT"><span lang="EN-US"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">Flight</span></span></span><span lang="EN-US"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> </span>and </span><span class="CodeInTextPACKT"><span lang="EN-US"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">FlightDescription</span></span></span><span lang="EN-US"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> </span>JPA entities and defines many-to-one relationship between </span><span class="CodeInTextPACKT"><span lang="EN-US"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">Flight</span></span></span><span lang="EN-US"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> </span>and </span><span class="CodeInTextPACKT"><span lang="EN-US"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">FlightDescription</span></span></span><span lang="EN-US"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> </span>entities. If you are
using a different database than MySQL or your connection settings are different
than what is specified in the script, then modify the script accordingly.</span><br />
<span lang="EN-US"><br /></span><br />
<span lang="EN-US"><b>Step 2</b>: Execute <b>controller all</b> command:</span><br />
<br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">.. roo>
controller all --package ~.web</span><br />
<br />
The <b>controller all</b> command creates JSPX views, controllers, copies custom tags, default themes, and so on. The <b>package</b> argument specifies the location where the Spring Web MVC controllers are created by Roo.<br />
<br />
<b>Step 3. </b>You can now convert the project into an Eclipse IDE project using <b>perform eclipse</b> command. The perform eclipse command generates <b>.project </b>and <b>.classpath </b>files required by Eclipse IDE.<br />
<br />
<b>Step 4.</b> You can also run the <b>flight-app</b> application in embedded Tomcat container by exiting the Roo shell (by executing <b>quit</b> command) and executing <b>mvn tomcat:run </b>goal from the command prompt. Now, you access the web application by going to the following URL: <a href="http://localhost:8080/flight-app">http://localhost:8080/flight-app</a><br />
<br />
The following figure shows how the scaffolded web application looks like:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-jI15fC2Fzn8/ToKZoFCGUPI/AAAAAAAAADg/eb_LMJ-CPW0/s1600/4503_04_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="297" src="http://1.bp.blogspot.com/-jI15fC2Fzn8/ToKZoFCGUPI/AAAAAAAAADg/eb_LMJ-CPW0/s640/4503_04_1.png" width="640" /></a></div>
<br />
By default, the scaffolded web application allows you to perform CRUD operations on JPA entities, and to search entities based on the <i>dynamic finder methods</i> that you added to them.<br />
<div class="NormalPACKT">
<span lang="EN-US"><o:p></o:p></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-85948504950897143772011-09-27T06:33:00.000-07:002011-09-27T19:07:50.952-07:00Spring Roo 1.1 Cookbook published<div dir="ltr" style="text-align: left;" trbidi="on">
I just heard from Packt that Spring Roo 1.1 Cookbook is now available.
Spring Roo 1.1 Cookbook provides a comprehensive coverage of Spring Roo
development tool features. <br />
<br />
For more details, please refer the following links:<br />
<br />
1. <b>List of recipes covered in Spring Roo 1.1 Cookbook:</b> <a href="https://groups.google.com/forum/#%21topic/spring-roo-cookbook/mnM_GJMTto8">https://groups.google.com/forum/#!topic/spring-roo-cookbook/mnM_GJMTto8</a><br />
2. <b>Book page at Packt:</b> <a href="https://www.packtpub.com/spring-roo-1-1-cookbook/book">https://www.packtpub.com/spring-roo-1-1-cookbook/book</a> You can download sample Chapter 1 from this page.<br />
3. <b>Amazon link:</b> <a href="http://www.amazon.com/gp/product/1849514585/">http://www.amazon.com/gp/product/1849514585/</a><br />
4. <b>Book review:</b> <a href="http://www.owal.co.uk/a/springroocookbook">http://www.owal.co.uk/a/springroocookbook</a><br />
5. <b>Book source code:</b> <a href="http://code.google.com/p/spring-roo-cookbook/downloads/list">http://code.google.com/p/spring-roo-cookbook/downloads/list</a></div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-50563341506769095932011-09-26T11:40:00.000-07:002011-09-26T11:42:21.231-07:00Creating JPA entities using Spring Roo<div dir="ltr" style="text-align: left;" trbidi="on">
In the previous post we saw how you can create a Java project using <b>project</b> command of Roo. In this post, you'll see that how you can create JPA entities using Roo.<br />
<br />
Before we go about creating JPA entities, if you take a quick look at the <b>pom.xml</b> file of <b>flight-app</b> project, you'll see that it contains standard dependencies that you'll typically have in your Spring-based Java projects. The extra dependencies that you see are related to <b>AspectJ</b> and Spring Roo's annotation. You'll also notice that <b>pom.xml </b>configures Eclipse Maven plugin and Tomcat Maven Plugin.<br />
<br />
Follow these steps to create a <b>Flight</b> JPA entity:<br />
<b>1. Setup a Hibernate as the persistence provider. </b>Open command prompt and execute <b>persistence setup</b> command, as shown here:<br />
<br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">... roo> persistence setup --provider HIBERNATE --database MYSQL</span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">--databaseName myFlightAppDB</span><br />
<br />
<b>provider</b> argument identifier a JPA provider (a couple of JPA providers are supported by Spring Roo)<br />
<b>database</b> argument identifies the database that you are going to use for your application (a couple of databases are supported by Spring Roo)<br />
<b>databaseName</b> argument identifies the name of the database<br />
<br />
Executing <b>persistence setup</b> command creates a <b>database.properties</b> file which contains database configuration information (username, password, database name, database driver class). It also creates a <b>persistence.xml</b> file required by the JPA provider.<br />
<br />
2. Create a persistence entity using <b>entity</b> command, as shown here:<br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">..roo> entity --class ~.domain.Flight</span><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"> --table FLIGHT_TBL</span><br />
<br />
<br />
The entity command shown above creates a <b>Flight.java</b> class (representing a JPA entity) in <b>com.sample.flightapp.domain</b> package. The <b>table</b> argument identifies the table to which the <b>Flight</b> entity maps. You'll see couple of more files created with <b>.aj</b> extension....these <b>AspectJ ITD</b> files, which you should <i>never</i> modify.<br />
<br />
The following code shows the <b>Flight.java</b> class:<br />
<br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">@RooJavaBean</span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">@RooToString</span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">@RooEntity(...)</span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;">public class Flight {...}</span><br />
<span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"><br /></span><br />
As you can see, <b>Flight.java</b> is annotated with couple of<b> @Roo*</b> annotations. These annotations trigger code generation in Spring Roo. The identifier definition, getter/setters for properties defined in <b>Flight.java</b> class, the persistence related methods (create, merge, update, and so on), and the <b>toString</b> methods are all inside the AspectJ ITD files generated by Roo.<br />
<br />
The following things to note:<br />
- <span class="Apple-style-span" style="background-color: #eeeeee;">AspectJ ITD files are like any other Java file</span>, with a slightly different syntax. You don't need to learn a new language to understand AspecJ ITDs.<br />
- The method, constructor, and so on, definitions in AspectJ ITD files are compiled into the corresponding Java source file. In our case, declarations contained in <b>Flight_Roo_Entity.aj</b> file are compiled into <b>Flight</b> class. <span class="Apple-style-span" style="background-color: #eeeeee;">This means resulting bytecode is not dependent on Roo at all.</span><br />
- <span class="Apple-style-span" style="background-color: #eeeeee;">AspectJ ITD files are managed by Spring Roo</span> when you make modifications to Java source file. So, you should not change them.<br />
- If you want to modify a declaration in AspectJ ITD file, you can simply use <span class="Apple-style-span" style="background-color: #eeeeee;">Push-in Refactoring</span> (using your IDE) to push the declaration (which could be method, attribute or constructor) into the corresponding Java source file. After doing push-in refactoring, you can modify the code manually in Java source file.<br />
<br />
In the next post we'll go a step further and scaffold a Spring Web MVC application.<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com1tag:blogger.com,1999:blog-3246634139921905616.post-51224592140859790742011-09-25T11:14:00.000-07:002011-09-28T23:45:38.363-07:00Creating your first Java project using Spring Roo<div dir="ltr" style="text-align: left;" trbidi="on">
Spring Roo is a productivity improvement tool....and you got to use it to believe this. In this post I'll show how to quickly get started with Spring Roo and create a Roo project. I will also talk about some of the artifacts created by Roo.<br />
<div>
<br /></div>
<div>
<span class="Apple-style-span" style="background-color: #eeeeee;"><b>Note</b> - Some of the information covered in this post are covered in Chapter 1 of Spring Roo 1.1 Cookbook. Once the book is released, Chapter 1 will become freely available. </span><span class="Apple-style-span" style="background-color: #f3f3f3; font-family: 'Trebuchet MS', sans-serif;"><b><span class="Apple-style-span">(Update - Sample Chapter 1 of book is now available here: </span><span class="Apple-style-span"><a href="https://www.packtpub.com/spring-roo-1-1-cookbook/book">https://www.packtpub.com/spring-roo-1-1-cookbook/book</a>)</span></b></span></div>
<div>
<br /></div>
<div>
<b>Pre-requisite</b></div>
<div>
<div>
<i>Install Java SE 6 or later and set JAVA_HOME variable</i></div>
<div>
<i>Install Maven 3.x or later</i></div>
<div>
<br /></div>
<div>
<b>1. Setting up Roo</b></div>
<div>
Setting up Roo is simple, download the ZIP file from SpringSource website (<a href="http://www.springsource.org/roo/start">http://www.springsource.org/roo/start</a>) and unzip into a folder. Now, add path to <b>bin </b>directory of Roo to your <b>PATH</b> variable.</div>
</div>
<div>
<b>2. Verify installation</b></div>
<div>
Create a directory named <b>myfirst-app</b>. Open command prompt and go to <b>myfirst-app</b> directory and enter <b>roo</b> on the command line. You'll see the following output if your installation was correct:</div>
<div>
<div>
<div style="border-bottom-style: none; border-color: initial; border-left-color: windowtext; border-left-style: solid; border-left-width: 1pt; border-right-style: none; border-top-style: none; border-width: initial; padding-bottom: 0cm; padding-left: 4pt; padding-right: 0cm; padding-top: 0cm;">
<div class="CommandLinePACKT" style="font-family: Verdana, sans-serif;">
<span lang="EN-GB" style="color: black;"> ____ ____ ____<o:p></o:p></span></div>
<div class="CommandLinePACKT" style="font-family: Verdana, sans-serif;">
<span lang="EN-GB" style="color: black;"> / __ \/ __ \/ __ \<o:p></o:p></span></div>
<div class="CommandLinePACKT" style="font-family: Verdana, sans-serif;">
<span lang="EN-GB" style="color: black;"> / /_/ / / / / / / /<o:p></o:p></span></div>
<div class="CommandLinePACKT" style="font-family: Verdana, sans-serif;">
<span lang="EN-GB" style="color: black;"> / _, _/ /_/ / /_/ /<o:p></o:p></span></div>
<div class="CommandLinePACKT" style="font-family: Verdana, sans-serif;">
<span lang="EN-GB" style="color: black;">/_/ |_|\____/\____/ x.y.z.RELEASE</span></div>
<div class="CommandLinePACKT" style="font-family: Verdana, sans-serif;">
<span lang="EN-GB" style="color: black;"><br />
</span></div>
<div class="CommandLinePACKT" style="font-family: Verdana, sans-serif;">
<span lang="EN-GB" style="color: black;">roo></span></div>
</div>
</div>
</div>
<div>
<br /></div>
<div>
The command prompt now becomes <b>roo></b> indicating that you are now inside the <b>Roo shell</b>. The output shows the Spring Roo release that you are using. All the commands that you enter now will be processed by Spring Roo. You can think of a Roo shell as nothing but a standalone Java application that processes commands.</div>
<div>
<br /></div>
<div>
<b>3. Creating a project</b></div>
<div>
The first step is to create a <b>Roo project</b>. Though this is called a Roo project, it's just a simple mavenized project. To create a Roo project enter <b>project</b> command of Roo, as shown here:</div>
<div>
<br /></div>
<div>
<div style="border-left: solid windowtext 1.0pt; border: none; margin-left: 18.0pt; margin-right: 0cm; mso-border-left-alt: solid windowtext .5pt; mso-element: para-border-div; padding: 0cm 0cm 0cm 4.0pt;">
<div class="CommandLinePACKT">
<span lang="EN-GB" style="color: black;"><span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;">roo>project --topLevelPackage sample.roo.flightapp --java 6 --projectName flight-app<b><o:p></o:p></b></span></span></div>
<div class="CommandLinePACKT">
<span class="Apple-style-span" style="background-color: #eeeeee;"><br />
</span></div>
<div class="CommandLinePACKT">
<span lang="EN-GB" style="color: black;"><span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;">Created C:\roo-cookbook\ch01-recipe\pom.xml<b><o:p></o:p></b></span></span></div>
<div class="CommandLinePACKT">
<span lang="EN-GB" style="color: black;"><span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;">.....<b><o:p></o:p></b></span></span></div>
<div class="CommandLinePACKT">
<span lang="EN-GB" style="color: black;"><span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;">Created SRC_MAIN_RESOURCES\META-INF\spring\applicationContext.xml<b><o:p></o:p></b></span></span></div>
<div class="CommandLinePACKT">
<span lang="EN-GB" style="color: black;"><span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;">Created SRC_MAIN_RESOURCES\log4j.properties<b><o:p></o:p></b></span></span></div>
<div class="CommandLinePACKT">
<b><span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"><br />
</span></b></div>
<div class="CommandLinePACKT">
<span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;">sample.roo.flightapp roo></span></div>
</div>
</div>
<div>
<br /></div>
<div>
As you can see from the above output, nothing specific to Spring Roo is created. It is like any maven project for creating a Spring-based application. </div>
<div>
<br /></div>
<div>
<b>topLevelPackage</b> specifies the root package of your project.</div>
<div>
<b>projectName</b> specifies the name of the project. This becomes the <artifact-id> and <name> element values in <b>pom.xml</b> file.</div>
<div>
<br /></div>
<div>
The <b>applicationContext.xml</b> file is shown here:</div>
<div>
<br /></div>
<div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="color: black;"><span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"><beans ..><o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span class="Apple-style-span" style="background-color: #eeeeee;"><br />
</span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"><span class="BoldPACKT"><span lang="EN-GB" style="color: black;"> <</span></span><span lang="EN-GB" style="color: black;">context:property-placeholder<span class="BoldPACKT"><o:p></o:p></span></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"><span class="BoldPACKT"><span lang="EN-GB" style="color: black;"> </span></span><span lang="EN-GB" style="color: black;">location="<span class="BoldPACKT">classpath*:META-INF/spring/*.properties</span>"/><o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span class="Apple-style-span" style="background-color: #eeeeee;"><br />
</span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="color: black;"><span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"> <span class="BoldPACKT"> <context:spring-configured/><o:p></o:p></span></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span class="Apple-style-span" style="background-color: #eeeeee;"><br />
</span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"><span lang="EN-GB" style="color: black;"> <context:component-scan base-package="<span class="BoldPACKT">sample.roo.flightapp</span>"<o:p></o:p></span>></span></div>
<span class="Apple-style-span" style="background-color: #eeeeee;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"></span></span><br />
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="color: black;"><span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"> <context:exclude-filter<o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"><span lang="EN-GB" style="color: black;"> expression=".*_Roo_.*" type="regex"/<o:p></o:p></span>></span></div>
<span class="Apple-style-span" style="background-color: #eeeeee;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"></span></span><br />
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="color: black;"><span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"> <context:exclude-filter expression=<o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span lang="EN-GB" style="color: black;"><span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"> "org.springframework.stereotype.Controller" <o:p></o:p></span></span></div>
<div class="CodePACKT" style="margin-left: 0cm;">
<span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"><span lang="EN-GB" style="color: black;"> type="annotation"/<o:p></o:p></span>></span></div>
<span class="Apple-style-span" style="background-color: #eeeeee;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"></span></span><br />
<div class="CodePACKT" style="margin-left: 0cm;">
<span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"><span lang="EN-GB" style="color: black;"> </context:component-scan<o:p></o:p></span>></span></div>
<span class="Apple-style-span" style="background-color: #eeeeee;"><span class="Apple-style-span" style="font-family: 'Trebuchet MS', sans-serif;"></span></span><br />
<div class="CodePACKT" style="margin-left: 0cm;">
<span class="Apple-style-span" style="background-color: #eeeeee; font-family: 'Trebuchet MS', sans-serif;"><span lang="EN-GB" style="color: black;"></beans<o:p></o:p></span>></span></div>
</div>
<div>
<br /></div>
<div>
As the above listing shows, it contain <component-scan> element to auto-register Spring components. It excludes classes that follow the naming convention <b>*_Roo_* </b>and which are annotated with <b>@Controller</b> annotation.</div>
<div>
<br /></div>
<div>
As you can see, <b>project</b> command simply creates a maven project with some Roo-specific configuration. <span class="Apple-style-span" style="background-color: #eeeeee;">These Roo-specific configurations are quite limited and you can remove them, when you decide to do so. For instance, you can modify the <b><component-scan></b> shown above to exclude Roo-specific exclusion rule, and you can use this project as any other Spring project.</span></div>
<div>
<br /></div>
<div>
In the next post, we'll look at how create a JPA entity and import the <b>flight-app</b> project into Eclipse or STS or IDEA IDE.</div>
</div>
Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com1tag:blogger.com,1999:blog-3246634139921905616.post-14949154476256947742011-09-20T11:32:00.000-07:002011-09-20T11:32:20.394-07:00Creating service layer in Spring Roo<div dir="ltr" style="text-align: left;" trbidi="on">In <i>Installing an installable add-on</i> recipe of Spring Roo Cookbook, I showed how to download and install <a href="https://code.google.com/p/gvnix/">gvNIX </a>add-on for creating Services in your Roo-based application.<br />
Spring Roo 1.2 M1 adds a new <b>service</b> command which you can use to create service layer of your application, as mentioned in this <a href="http://blog.springsource.com/2011/09/14/spring-roo-1-2-0-m1-released/">Spring Roo </a>blog entry.<br />
<br />
<br />
<br />
</div>Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-88577869738116609282011-09-17T23:22:00.000-07:002011-09-17T23:22:39.797-07:00Source code of Spring Roo 1.1 Cookbook<div dir="ltr" style="text-align: left;" trbidi="on">The final source code of Spring Roo 1.1 Cookbook is now available at Google Code project: <a href="http://code.google.com/p/spring-roo-cookbook/downloads/list">http://code.google.com/p/spring-roo-cookbook/downloads/list</a><br />
<br />
If you have any questions, then please post it in the forum for Spring Roo Cookbook: <a href="https://groups.google.com/forum/#!forum/spring-roo-cookbook">https://groups.google.com/forum/#!forum/spring-roo-cookbook</a></div>Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-4262276339735223002011-09-15T07:39:00.000-07:002011-09-15T07:39:12.325-07:00List of recipes in Spring roo cookbook<div dir="ltr" style="text-align: left;" trbidi="on"><br />
<div class="MsoNormal"><b><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Chapter 1: Getting started with Spring Roo<o:p></o:p></span></b></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-GB"><span>1.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Setting up Roo<o:p></o:p></span></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-GB"><span>2.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Getting help and hints from Roo<o:p></o:p></span></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-GB"><span>3.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Creating a Roo project<o:p></o:p></span></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-GB"><span>4.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Configuring logging<o:p></o:p></span></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-GB"><span>5.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Importing Roo project into Eclipse/IntelliJ IDEA IDE<o:p></o:p></span></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-GB"><span>6.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Viewing properties defined in a properties file<o:p></o:p></span></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-GB"><span>7.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Managing properties defined in a properties file<o:p></o:p></span></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-GB"><span>8.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Creating a<span> </span>Java class<o:p></o:p></span></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-GB"><span>9.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Adding attributes to a Java class<o:p></o:p></span></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-GB"><span>10.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Creating a Java interface<o:p></o:p></span></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-GB"><span>11.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Referring to a type from Roo shell<o:p></o:p></span></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-GB"><span>12.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;">Creating application </span><span lang="EN-US" style="color: black;">artifacts</span><span lang="EN-GB" style="color: black; mso-ansi-language: EN-GB;"> from Roo script</span></div><div class="BulletPACKT" style="margin-left: 18.0pt; mso-list: l4 level1 lfo2; tab-stops: list 18.0pt; text-indent: -18.0pt;"><br />
</div><div class="MsoNormal"><b><span lang="EN-US">Chapter 2: Persisting objects using JPA<o:p></o:p></span></b></div><div class="MsoListParagraphCxSpFirst" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>1.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Setting up a JPA provider for your project<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>2.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Viewing database configuration properties<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>3.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Managing database configuration properties<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>4.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Creating persistent entities<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>5.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Adding JSR 303 constraints to persistent fields<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>6.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Creating integration tests for persistent entities<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>7.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Creating new ‘data on demand’ for testing entities<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>8.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Creating mock tests for persistent entities<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>9.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Executing persistent entities tests<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>10.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Controlling auto-generated methods of persistent entities<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>11.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Creating applications that interact with multiple databases<o:p></o:p></span></div><div class="MsoListParagraphCxSpLast" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>12.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Packaging your Roo project<o:p></o:p></span></div><div class="MsoListParagraphCxSpLast" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l5 level1 lfo3; text-indent: -18.0pt;"><span lang="EN-US"><br />
</span></div><div class="MsoNormal"><b><span lang="EN-US">Chapter 3: Advanced JPA support in Spring Roo<o:p></o:p></span></b></div><div class="MsoListParagraphCxSpFirst" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l7 level1 lfo4; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>1.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Viewing candidate dynamic finder methods<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l7 level1 lfo4; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>2.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Adding dynamic finder methods to an entity<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l7 level1 lfo4; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>3.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Creating many-to-one (or one-to-one) relationship between entities<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l7 level1 lfo4; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>4.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Creating one-to-many (or many-to-many) relationship between entities<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l7 level1 lfo4; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>5.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Creating a mapped superclass<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l7 level1 lfo4; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>6.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Customizing Roo-generated identifier definition<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l7 level1 lfo4; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>7.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Generating database metadata<o:p></o:p></span></div><div class="MsoListParagraphCxSpLast" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l7 level1 lfo4; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>8.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Creating entities from database<o:p></o:p></span></div><div class="MsoListParagraphCxSpLast" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l7 level1 lfo4; text-indent: -18.0pt;"><span lang="EN-US"><br />
</span></div><div class="MsoNormal"><b><span lang="EN-US">Chapter 4: Web application development with Spring Web MVC<o:p></o:p></span></b></div><div class="MsoListParagraphCxSpFirst" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo5; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>1.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Auto-generating Spring MVC controllers and JSPX views from JPA entities<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo5; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>2.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Packaging, deploying and using Roo-generated Spring MVC application<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo5; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>3.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Modifying Roo-generated views<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo5; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>4.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Round-tripping support in Spring Roo for web controllers and views<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo5; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>5.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Creating a Spring MVC controller for a specific JPA entity<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo5; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>6.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Manually creating a Spring MVC controller for a JPA entity<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo5; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>7.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Adding static views to Roo-generated web application<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo5; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>8.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Internationalizing Roo-generated web applications <o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo5; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>9.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Adding or modifying themes generated by Roo<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo5; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>10.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Adding JSON support to domain objects and controllers<o:p></o:p></span></div><div class="MsoListParagraphCxSpLast" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo5; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>11.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Creating and executing selenium tests for web controllers<o:p></o:p></span></div><div class="MsoListParagraphCxSpLast" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l0 level1 lfo5; text-indent: -18.0pt;"><span lang="EN-US"><br />
</span></div><div class="MsoNormal"><b><span lang="EN-US">Chapter 5: Web application development with GWT, Flex and Spring Web Flow<o:p></o:p></span></b></div><div class="MsoListParagraphCxSpFirst" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l1 level1 lfo6; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>1.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Scaffolding GWT application from JPA entities<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l1 level1 lfo6; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>2.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Getting started with Flex application development<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l1 level1 lfo6; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>3.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Scaffolding Flex application from JPA entities<o:p></o:p></span></div><div class="MsoListParagraphCxSpLast" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l1 level1 lfo6; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>4.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Getting started with Spring Web Flow<o:p></o:p></span></div><div class="MsoListParagraphCxSpLast" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l1 level1 lfo6; text-indent: -18.0pt;"><span lang="EN-US"><br />
</span></div><div class="MsoNormal"><b><span lang="EN-US">Chapter 6: Emailing, Messaging, Spring Security, Solr and GAE<o:p></o:p></span></b></div><div class="MsoListParagraphCxSpFirst" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo7; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>1.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Sending emails using JavaMail API<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo7; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>2.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Sending and receiving JMS messages<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo7; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>3.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Configuring Spring security for your application<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo7; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>4.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Using Spring Security with Apache Directory Server<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo7; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>5.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Deploying a GWT application on GAE<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo7; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>6.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Deploying a Spring Web MVC application on GAE<o:p></o:p></span></div><div class="MsoListParagraphCxSpLast" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo7; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>7.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Adding search capability to your domain model with Solr<o:p></o:p></span></div><div class="MsoListParagraphCxSpLast" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l2 level1 lfo7; text-indent: -18.0pt;"><span lang="EN-US"><br />
</span></div><div class="MsoNormal"><b><span lang="EN-US">Chapter 7: Developing add-ons and removing Roo from projects<o:p></o:p></span></b></div><div class="MsoListParagraphCxSpFirst" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l3 level1 lfo8; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>1.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Setting up GnuPG for add-on development<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l3 level1 lfo8; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>2.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Installing an installable add-on<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l3 level1 lfo8; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>3.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Developing a simple add-on<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l3 level1 lfo8; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>4.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Developing an advanced add-on<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l3 level1 lfo8; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>5.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Converting non-OSGi JDBC drivers into OSGi-compliant bundles<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l3 level1 lfo8; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>6.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Removing Roo with push-in refactoring<o:p></o:p></span></div><div class="MsoListParagraphCxSpMiddle" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l3 level1 lfo8; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>7.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Adding Roo to a project using pull-out refactoring<o:p></o:p></span></div><div class="MsoListParagraphCxSpLast" style="margin-left: 18.0pt; mso-add-space: auto; mso-list: l3 level1 lfo8; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US"><span>8.<span style="font: 7.0pt "Times New Roman";"> </span></span></span><!--[endif]--><span lang="EN-US">Upgrading to latest version of Roo<o:p></o:p></span></div></div>Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-31393455125548226012011-09-14T10:56:00.001-07:002011-09-14T10:56:03.622-07:00Spring Roo Cookbook status<div dir="ltr" style="text-align: left;" trbidi="on">Spring Roo Cookbook is now complete and is scheduled to go into print next week.</div>Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0tag:blogger.com,1999:blog-3246634139921905616.post-16999515742625280772011-08-01T06:49:00.000-07:002011-08-01T06:49:39.014-07:00Status of Spring Roo Cookbook<div dir="ltr" style="text-align: left;" trbidi="on">The book has now entered production and I'm currently doing pre-final review of Chapter 4. I think starting next week, I'll start receiving comments from copy-editor and technical editor of the book. I expect that the book will be published as per the revised date of 31st September. I'll publish a revised list of recipes sometime towards the end of August to reflect the recipes that will be in the printed book.</div>Anonymoushttp://www.blogger.com/profile/02520956111709154386noreply@blogger.com0