Fornax-Platform
Forum

Sculptor - Problem in web-tier when using createWith

View: New views
4 Messages — Rating Filter:   Alert me  

Sculptor - Problem in web-tier when using createWith

by ylizzi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm trying to use the createWith statement in a CreateTask but the corresponding generated CreateAction does not reflect it in Event save(RequestContext) mehtod. It leads to a compilation failure.

I reproduce it starting from helloworld / Archetype Tutorial:
Business model:
Service MilkyService {
   savePlanet => @PlanetRepository.save;
}
Entity Planet {
   String name key;
   String message;
   Integer diameter nullable;
   Integer population nullable;
   - Set<@Moon> moons opposite planet;
         
   Repository PlanetRepository {
      save;
   }
}
GUI model:
CreateTask for Planet {
  createWith MilkyService.savePlanet
}

This leads to a compilation failure in CreatePlanetAction.save (cannot find symbol save) because it is generated like this:
public Event save(RequestContext ctx) {
        CreatePlanetForm form = formObject(ctx);
        Planet model = form.toModel();

        model = milkyService.save(ServiceContextStore.get(), model);

        putModelInFlashScope(ctx, "Planet", model);
        return success();
}
where milkyService.save does not exists and should be savePlanet instead.

What do I miss?

Thanks
Yannick

Re: Sculptor - Problem in web-tier when using createWith

by Andreas Källberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
It doesn't sound right.
We will have a look at it a.s.a.p.
Though, it might take a few days because of holidays...
 
.../Andreas

On Wed, Aug 5, 2009 at 11:21 AM, ylizzi <yannick.lizzi@...> wrote:

Hi,

I'm trying to use the createWith statement in a CreateTask but the
corresponding generated CreateAction does not reflect it in Event
save(RequestContext) mehtod. It leads to a compilation failure.

I reproduce it starting from helloworld / Archetype Tutorial:
Business model:
Service MilkyService {
  savePlanet => @PlanetRepository.save;
}
Entity Planet {
  String name key;
  String message;
  Integer diameter nullable;
  Integer population nullable;
  - Set<@Moon> moons opposite planet;

  Repository PlanetRepository {
     save;
  }
}
GUI model:
CreateTask for Planet {
 createWith MilkyService.savePlanet
}

This leads to a compilation failure in CreatePlanetAction.save (cannot find
symbol save) because it is generated like this:
public Event save(RequestContext ctx) {
       CreatePlanetForm form = formObject(ctx);
       Planet model = form.toModel();

       model = milkyService.save(ServiceContextStore.get(), model);

       putModelInFlashScope(ctx, "Planet", model);
       return success();
}
where milkyService.save does not exists and should be savePlanet instead.

What do I miss?

Thanks
Yannick
--
View this message in context: http://www.nabble.com/Sculptor---Problem-in-web-tier-when-using-createWith-tp24823520s17564p24823520.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Fornax-developer mailing list
Fornax-developer@...
https://lists.sourceforge.net/lists/listinfo/fornax-developer


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Fornax-developer mailing list
Fornax-developer@...
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Re: Sculptor - Problem in web-tier when using createWith

by Patrik Nordwall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for reporting. I have fixed the bug in trunk. If you need an immediate workaround you can add a piece of code in WebSpecialCases.xpt. See http://fornax.itemis.de/jira/browse/CSC-389

/Patrik

Re: Sculptor - Problem in web-tier when using createWith

by ylizzi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the workaround.
To make it works on 1.6.0 version, I just had to change a bit the code you provided by this:

«AROUND templates::web::JSFCrudGuiJava::saveMethod FOR UserTask»
«LET getPrimaryServiceOperation() AS saveOperation»
public org.springframework.webflow.execution.Event save(org.springframework.webflow.execution.RequestContext ctx) «
IF saveOperation != null »«EXPAND templates::Exception::throws FOR saveOperation»«ENDIF» {
«name.toFirstUpper()»Form form = formObject(ctx);
«for.getDomainPackage()».«this.for.name» model = form.toModel();
«IF saveOperation != null »
model = «saveOperation.service.name.toFirstLower()».«saveOperation.name»(«IF isServiceContextToBeGenerated()»«serviceContextStoreClass()».get(), «ENDIF»model);
«ENDIF»
putModelInFlashScope(ctx, "«for.name»", model);
return success();
}
«ENDLET»
«ENDAROUND»

Otherwise, I get an error while creating the object in web interface. It complains it expects an Event instead of a String.

Yannick


Patrik Nordwall wrote:
Thanks for reporting. I have fixed the bug in trunk. If you need an immediate workaround you can add a piece of code in WebSpecialCases.xpt. See http://fornax.itemis.de/jira/browse/CSC-389

/Patrik