You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Bob Morley (JIRA)" <ji...@apache.org> on 2009/07/31 08:20:14 UTC

[jira] Created: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12792455#action_12792455 ] 

Jacques Le Roux commented on OFBIZ-2778:
----------------------------------------

Should we no close since r892218?

> 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
>            Assignee: Scott Gray
>         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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Bob Morley (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743208#action_12743208 ] 

Scott Gray commented on OFBIZ-2778:
-----------------------------------

I like the concept but I'm not sure if we need another request-response type to handle json, couldn't achieve the same result using the existing view/screen/freemarker model?  After all json is just another formatted text response not really any different from html, xml, csv, etc.

Anyone else have an opinion?

> 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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Ashish Vijaywargiya (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793151#action_12793151 ] 

Ashish Vijaywargiya commented on OFBIZ-2778:
--------------------------------------------

For others at least waiting for about 2 weeks would be preferable time frame IMO if committer who has assigned issue to himself is not closing the issue.

--
Ashish 

> 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
>            Assignee: Scott Gray
>             Fix For: SVN trunk
>
>         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.


[jira] Updated: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Bob Morley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bob Morley updated OFBIZ-2778:
------------------------------

    Attachment: json.diff

> 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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Bob Morley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743232#action_12743232 ] 

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

Yep makes sense -- really we are just talking about how we implement the "jsoning" of the attributes.  It is reasonable to do this in an ftl as outlined here; my original plan was actually to do just that but I leaned towards the java class because I saw this as a "framework" behaviour -- something that you are not likely to want adjusted by an ofbiz user.  Having said that, it is certainly reasonable to do this in ftl instead of the java class.

If we feel I should convert this to ftl and remove the java class on the RequestHandler let me know; I can certainly do that.  :)  I am assuming that the event response code is available in the context to the ftl?  (There is value in telling the client if the request was "success", "error", or any custom response.

> 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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Kojo Gambrah (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791653#action_12791653 ] 

Kojo Gambrah commented on OFBIZ-2778:
-------------------------------------

I think this refactoring makes the request definition more intuitive as the service called by the event is any ofbiz service type and not specifically defined as a JSON service. 

On FTL versus Java for the jsoning, reference the discussions in the thread 'about using ofbiz as a platform'; there are some developers who would like to use parts of the ofbiz platform. I believe they would typically like to leverage the data models and services and build new user interfaces fit for their applications (adding some entities and services along the way). 

I therefore think that implementing in Java will best serve this interest as the platform users will not have to concern themselves with Freemarker even if they wanted to modify the framework.

> 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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12737439#action_12737439 ] 

Scott Gray commented on OFBIZ-2778:
-----------------------------------

Thanks Bob, this sounds like a great idea

> 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.


[jira] Assigned: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Gray reassigned OFBIZ-2778:
---------------------------------

    Assignee: Scott Gray

> 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
>            Assignee: Scott Gray
>         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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793150#action_12793150 ] 

Jacques Le Roux commented on OFBIZ-2778:
----------------------------------------

After 3 days, I decided it was time to act, sorry if that hurt yourt sensibility, I will wait more next time... :) 

> 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
>            Assignee: Scott Gray
>             Fix For: SVN trunk
>
>         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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743703#action_12743703 ] 

Jacques Le Roux commented on OFBIZ-2778:
----------------------------------------

Hi Bob,

I'm not sure I prefer one or the other. Ftl is concise adn reuse more, Java more explicit and would have been also my way to go in a 1st attempt... Mmm... Other opinions ?
Look for "Which variables are available in screen context?" in the [FAQ|http://docs.ofbiz.org/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo] page

> 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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743217#action_12743217 ] 

Scott Gray commented on OFBIZ-2778:
-----------------------------------

Yeah I completely agree about the need to remove the json event handler clutter, but what I am saying is that perhaps a common component view-map/screen/ftl would be the most consistent way to replace those event responses.

application controller.xml:
{code}
<request-map uri="markOrderViewed">
    <security https="true" auth="true"/>
    <event type="service" invoke="updateOrderHeader"/>
    <response name="success" type="view" name="json"/>
    <response name="error" type="view" name="json"/>
</request-map>
{code}

common-controller.xml:
{code}
<view-map name="json" type="screen" page="component://common/widget/CommonScreens.xml#json" content-type="application/x-json"/>
{code}

skipping CommonScreens.xml you get the idea

json.ftl
{code}
{<#list attrMap.keySet() as key>"${key}":"${attrMap[key]?if_exists}"</#list>}
{code}

> 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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793156#action_12793156 ] 

Jacques Le Roux commented on OFBIZ-2778:
----------------------------------------

OK, well noted, thanks for comments guys.

> 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
>            Assignee: Scott Gray
>             Fix For: SVN trunk
>
>         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.


[jira] Closed: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-2778.
----------------------------------

       Resolution: Fixed
    Fix Version/s: SVN trunk

Without answers, can't see any reasons to keep this open

> 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
>            Assignee: Scott Gray
>             Fix For: SVN trunk
>
>         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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793142#action_12793142 ] 

Scott Gray commented on OFBIZ-2778:
-----------------------------------

Thanks Jacques, but just FYI I'm quite capable of handling the issues assigned to me.

> 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
>            Assignee: Scott Gray
>             Fix For: SVN trunk
>
>         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.


[jira] Commented: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Bob Morley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744828#action_12744828 ] 

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

That is a good document in the FAQ, but I am not sure how it applies.  In this bug I am not really changing any functionality really just refactoring the JSON functionality and reducing code.  My first inkling is to leave this functionality as a java method because (I think) the benefits of ftl don't really apply.  Moreover, there is nothing here that precludes you from handling a custom json response as part of an ftl screen.

On the other hand if we agree that it makes sense to move it to ftl then I can go ahead and update to that implementation.

> 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.


[jira] Issue Comment Edited: (OFBIZ-2778) Alter Json controller requests to move json behaviour to response (from event)

Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743208#action_12743208 ] 

Scott Gray edited comment on OFBIZ-2778 at 8/14/09 7:19 AM:
------------------------------------------------------------

I like the concept but I'm not sure if we need another request-response type to handle json, couldn't we achieve the same result using the existing view/screen/freemarker model?  After all json is just another formatted text response not really any different from html, xml, csv, etc.

Anyone else have an opinion?

EDIT: couldn't acheive -> couldn't we achieve (sounded kind of rude with the missing we)

      was (Author: lektran):
    I like the concept but I'm not sure if we need another request-response type to handle json, couldn't achieve the same result using the existing view/screen/freemarker model?  After all json is just another formatted text response not really any different from html, xml, csv, etc.

Anyone else have an opinion?
  
> 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.