You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Deepa Priolkar <de...@TechMahindra.com> on 2010/10/13 17:35:55 UTC
Some Scenario
I have a scenario which is to do the following
The web browser will call the server via ajax. At the server the system should produce a pdf file and store it in the file system. Next make a database update and return some data back to web browser using json
Below is the steps as per my understanding to do the same
· Front end to call a controller entry for a particular request map
· Request map to call a service and do some things and then kick off the view map of type screenfop to generate pdf.
· This screen fop is mapped to custom handler based on org.ofbiz.widget.screen.ScreenFopViewHandler which has code tweaked to store the pdf as file on hard disk and then call another request map entry in the controller.xml
· This request map to do the rest of things like update database row and then return data in json back to client
Is there a better way to execute the above scenario
Secondly from my customer ScreenFopViewHandler how do I call another request map entry in controller.xml. Will it via RequestDispatcher?
Re: Some Scenario
Posted by Bilgin Ibryam <bi...@gmail.com>.
Some changes to your process inline
On Wed, Oct 13, 2010 at 4:35 PM, Deepa Priolkar <de...@techmahindra.com>wrote:
> I have a scenario which is to do the following
>
> The web browser will call the server via ajax. At the server the system
> should produce a pdf file and store it in the file system. Next make a
> database update and return some data back to web browser using json
>
> Below is the steps as per my understanding to do the same
>
> · Front end to call a controller entry for a particular request map
>
correct
>
> · Request map to call a service and do some things and then kick
> off the view map of type ‘screenfop’ to generate pdf.
>
You don't have to use view-map with screenfop type in order to generate. You
need that only if you want to return a pdf as response. Instead you should
use a service to generate the pdf and store it in a file. As a reference
for pdf generation you can check the pdf printing functionality order
manager.
>
> · This screen fop is mapped to custom handler based on
> org.ofbiz.widget.screen.ScreenFopViewHandler which has code tweaked to store
> the pdf as file on hard disk and then call another request map entry in the
> controller.xml
>
No, No.
>
> · This request map to do the rest of things like update database
> row and then return data in json back to client
>
Just added another request map, which is called in case of success of
previous service (where u create save the pdf) and call the service to do DB
operations.
Return json instead of a screen and view-map
>
> Is there a better way to execute the above scenario
>
> Secondly from my customer ScreenFopViewHandler how do I call another
> request map entry in controller.xml. Will it via RequestDispatcher?
>
You don't need that
HTH
Bilgin Ibryam