Announcement Announcement Module
Collapse
No announcement yet.
multi module Roo project Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • multi module Roo project

    Hi all.
    I recently started multi module project with Roo 1.2 (starting point c:\springsource-3.1.0.M1\spring-roo-1.2.2.RELEASE\samples\multimodule.roo).

    My intention is to create not one but three web UI layers and introduce service layer. So project directory layout would be:

    Code:
    	project
    		core
    		businessSrv
    		ui
    			extranetWeb
    			intranetWeb
    			mobileWeb
    First problem I run into:
    I didn't have any problem to add services inside core project

    Code:
    	repository jpa --interface ~.repository.PetRepository --entity ~.domain.Pet
    	repository jpa --interface ~.repository.OwnerRepository --entity ~.domain.Owner
    	repository jpa --interface ~.repository.VetRepository --entity ~.domain.Vet
    	repository jpa --interface ~.repository.VisitRepository --entity ~.domain.Visit
    
    	//==================== services ==================================
    	service --interface ~.service.PetService --entity com.mymindmap.dblayer.domain.Pet
    	finder add --finderName findPetsByNameAndWeight --class com.mymindmap.dblayer.domain.Pet
    	finder add --finderName findPetsByOwner
    	finder add --finderName findPetsBySendRemindersAndWeightLessThan
    	finder add --finderName findPetsByTypeAndNameLike
    
    	service --interface ~.service.VisitService --entity com.mymindmap.dblayer.domain.Visit
    	finder add --finderName findVisitsByDescriptionAndVisitDate --class com.mymindmap.dblayer.domain.Visit
    	finder add --finderName findVisitsByVisitDateBetween
    	finder add --finderName findVisitsByDescriptionLike
    
    	service --interface ~.service.VetService --entity com.mymindmap.dblayer.domain.Vet
    	service --interface ~.service.OwnerService --entity com.mymindmap.dblayer.domain.Owner
    But when I added new busServices module before service definition

    Code:
    	repository jpa --interface ~.repository.PetRepository --entity ~.domain.Pet
    	repository jpa --interface ~.repository.OwnerRepository --entity ~.domain.Owner
    	repository jpa --interface ~.repository.VetRepository --entity ~.domain.Vet
    	repository jpa --interface ~.repository.VisitRepository --entity ~.domain.Visit
    
    	//==================== services ==================================
    	module focus --moduleName ~
    	module create --moduleName busServices --topLevelPackage com.mymindmap.services
    	service --interface ~.service.PetService --entity com.mymindmap.dblayer.domain.Pet
    	finder add --finderName findPetsByNameAndWeight --class com.mymindmap.dblayer.domain.Pet
    	finder add --finderName findPetsByOwner
    	finder add --finderName findPetsBySendRemindersAndWeightLessThan
    	finder add --finderName findPetsByTypeAndNameLike
    
    	service --interface ~.service.VisitService --entity com.mymindmap.dblayer.domain.Visit
    	finder add --finderName findVisitsByDescriptionAndVisitDate --class com.mymindmap.dblayer.domain.Visit
    	finder add --finderName findVisitsByVisitDateBetween
    	finder add --finderName findVisitsByDescriptionLike
    
    	service --interface ~.service.VetService --entity com.mymindmap.dblayer.domain.Vet
    	service --interface ~.service.OwnerService --entity com.mymindmap.dblayer.domain.Owner

    I receive error message in Roo console

    Code:
    	Command 'finder add --finderName findPetsByNameAndWeight --class com.mymindmap.dblayer.domain.Pet' was found but is not
    	currently available (type 'help' then ENTER to learn about this command)

    I see that Roo generated four files in RooWithServiceLayer\busServices\src\main\java\com\ mymindmap\services

    PetService.java
    PetServiceImpl.java
    PetServiceImpl_Roo_Service.aj
    PetService_Roo_Service.aj

    Can someone advise me how I can make Roo generate finders in services defined in different module?

    Second problem:

    If I try to add extra UI module at the end of original multimodule.roo


    Code:
    	// 2nd web UI sub project
    	module focus --moduleName frontend
    	module create --moduleName ext --topLevelPackage com.mymindmap.frontend.ext
    
    	web mvc setup
    	web mvc all --package ~
    	web mvc finder all
    
    	web mvc language --code de
    	web mvc language --code es
    
    	// ================ test web controllers ===============
    	selenium test --controller ~.OwnerController
    	selenium test --controller ~.PetController
    	selenium test --controller ~.VetController
    	selenium test --controller ~.VisitController
    
    	module focus --moduleName frontend/ext
    	logging setup --level DEBUG
    Roo add dependency to the first UI module and do not generate controllers for second UI module

    Code:
    	web mvc finder all
    	Updated frontend\ext|ROOT\pom.xml [added dependency com.mymindmap.frontend.plain:plain:0.1.0.BUILD-SNAPSHOT;]
    Did not generate any view and fail on generating selenium tests for these missing controllers.

    Code:
    	// ================ test web controllers ===============
    	selenium test --controller ~.OwnerController
    	Class or interface type details for type 'com.mymindmap.frontend.ext.OwnerController' could not be resolved
    From my understanding I was expected to get just one more web project.
    May be I misunderstand the concept of Roo modules or what I could do wrong?

    Thank you for any help.
    Last edited by alexei; Nov 1st, 2012, 03:33 PM.
Working...
X