Yesterday I gave a session on Cloud Foundry at SiliconIndia Cloud conference and I showed audience how they can create a blog in couple of minutes. I developed blog using Spring Roo and deployed to Cloud Foundry public cloud using roo cloud foundry add-on. The audience really liked the demo and saw the power of Spring Roo and Cloud Foundry. In case you want to create your blog using Spring Roo and Cloud Foundry . Open the roo shell and fire these commands.
project --topLevelPackage com.xebia.blog --projectName xebiablog mongo setup entity mongo --class ~.domain.Blog field string --fieldName title --class ~.domain.Blog --notNull field string --fieldName body --notNull --sizeMax 200000 field date --type java.util.Date --fieldName publishDate --notNull field boolean --fieldName publish --primitive --notNull field string --fieldName author --notNull entity mongo --class ~.domain.Comment field string --fieldName email --notNull --class ~.domain.Comment field string --fieldName comment --notNull --sizeMax 4000 field set --type ~.domain.Comment --fieldName comments --class ~.domain.Blog field reference --type ~.domain.Blog --fieldName blog --class ~.domain.Comment --notNull repository mongo --interface ~.repository.BlogRepository --entity ~.domain.Blog repository mongo --interface ~.repository.CommentRepository --entity ~.domain.Comment service --interface ~.service.BlogService --entity ~.domain.Blog service --interface ~.service.CommentService --entity ~.domain.Comment web mvc setup web mvc all --package ~.web mongo setup --cloudFoundry true perform package cloud foundry login --email <username> --password <password> cloud foundry deploy --appName xebiablog --path /target/xebiablog-0.1.0.BUILD-SNAPSHOT.war --memory 512 cloud foundry create service --serviceName xebiablog-mongo --serviceType mongodb cloud foundry bind service --appName xebiablog --serviceName xebiablog-mongo cloud foundry start app --appName xebiablog cloud foundry list apps
This blog will use MongoDB as its datastore. If you already have Spring Roo and CloudFoundry addon installed it will take less than couple of minutes to have your blog created and deployed in cloud.
Thanks for the post, I have been thinking of porting my blog to some thing based on Roo and mongodb and your roo commands are more or less what I have for https://github.com/geoaxis/roo-press.
please note that if you want to try it with the latest version: 1.2.0.M1 first you have to manually install the cloudfoundry add-on:
pgp automatic trust
addon install bundle –bundleSymbolicName org.springframework.roo.addon.cloud.foundry
How do you get around the problem of the Blog entity reference on the Comment being copied rather than being referenced?
I’ve posted to the spring forums about this issue, but haven’t had any response. If you have any ideas it would be helpful.
http://forum.springsource.org/showthread.php?126547-mongo-entity-reference
I like the valuable info you provide in your articles.
I’ll bookmark your weblog and check again here regularly.
I am quite certain I will learn a lot of new stuff right here!
Good luck for the next!