[ 
https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743212#action_12743212
 ] 

Bob Morley commented on OFBIZ-2778:
-----------------------------------

I see this as a replacement of the <event type="jsonservice" invoke="xx" /> 
<response name="success" type="none" /> pattern.

    <request-map uri="getFinAccountTransRunningTotalAndBalances">
        <event type="jsonservice-multi" 
invoke="getFinAccountTransRunningTotalAndBalances"/>
        <response name="success" type="none"/>
        <response name="error" type="none"/>
    </request-map>

becomes

    <request-map uri="getFinAccountTransRunningTotalAndBalances">
        <event type="service-multi" 
invoke="getFinAccountTransRunningTotalAndBalances"/>
        <response name="success" type="json"/>
        <response name="error" type="json"/>
    </request-map>

and there is no need to code "json" versions of all the event types.  aka 
jsonservice-multi, jsonservice, jsonsimple, jsonjava get removed and the 
standard event type is used.

You are absolutely right about the view/screen/freemarker model.  Best practice 
would be to use that where you want control over the renderered json or you 
want to render it dynamically in ftl (for example in the ajax auto-updaters) as 
part of a lookup widget.

> Alter Json controller requests to move json behaviour to response (from event)
> ------------------------------------------------------------------------------
>
>                 Key: OFBIZ-2778
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2778
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>            Reporter: Bob Morley
>         Attachments: json.diff
>
>
> I think it would be better to apply the Json behaviour of a controller 
> request to the response and not by having multiple Json event types.  These 
> event types always seem to be a wrapped call to another event type that only 
> adds identical Json behaviour (ie. JsonServiceEventHandler wraps 
> ServiceEventHandler and simply adds a Json string to the response).
> Attached is a patch with this change implemented on the "Mark Viewed" 
> function in Order Manager.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to