You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Frank Lam (JIRA)" <ji...@apache.org> on 2009/12/17 20:00:18 UTC
[jira] Created: (OFBIZ-3365) Clean JSON Service Event Handler
Clean JSON Service Event Handler
--------------------------------
Key: OFBIZ-3365
URL: https://issues.apache.org/jira/browse/OFBIZ-3365
Project: OFBiz
Issue Type: Improvement
Components: framework
Affects Versions: Release Branch 4.0, Release Branch 9.04, SVN trunk
Reporter: Frank Lam
Priority: Minor
Fix For: Release Branch 4.0, Release Branch 9.04, SVN trunk
Attachments: cleanjson.patch
I ran into a small issue while using org.ofbiz.webapp.event.JSONServiceEventHandler (typically referred to as "jsonservice" in controller files). If I defined my service as such:
<service name="foo" engine="java" location="my.Class" invoke="someFunction">
<attribute name="mylist" mode="OUT" type="List" optional="true"/>
</service>
I would get the following in the content of my response:
{"targetRequestUri":"/foo","thisRequestUri":"foo","mylist":[{some:stuff}],"multiPartMap":{},"_CONTROL_PATH_":"/myapp/control","_CONTEXT_ROOT_":"/Users/me/Documents/workspace/ofbiz/hot-deploy/mycomponent/webapp/myapp/","_SERVER_ROOT_URL_":"http://localhost:8080"}
where I would prefer to receive simply:
{"mylist":[{some:stuff}]}
I've added another event handler to try to resolve this problem. The patch is attached.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (OFBIZ-3365) Clean JSON Service Event Handler
Posted by "Frank Lam (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-3365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Frank Lam updated OFBIZ-3365:
-----------------------------
Attachment: cleanjson.patch
> Clean JSON Service Event Handler
> --------------------------------
>
> Key: OFBIZ-3365
> URL: https://issues.apache.org/jira/browse/OFBIZ-3365
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: Release Branch 4.0, Release Branch 9.04, SVN trunk
> Reporter: Frank Lam
> Priority: Minor
> Fix For: Release Branch 4.0, Release Branch 9.04, SVN trunk
>
> Attachments: cleanjson.patch
>
>
> I ran into a small issue while using org.ofbiz.webapp.event.JSONServiceEventHandler (typically referred to as "jsonservice" in controller files). If I defined my service as such:
> <service name="foo" engine="java" location="my.Class" invoke="someFunction">
> <attribute name="mylist" mode="OUT" type="List" optional="true"/>
> </service>
> I would get the following in the content of my response:
> {"targetRequestUri":"/foo","thisRequestUri":"foo","mylist":[{some:stuff}],"multiPartMap":{},"_CONTROL_PATH_":"/myapp/control","_CONTEXT_ROOT_":"/Users/me/Documents/workspace/ofbiz/hot-deploy/mycomponent/webapp/myapp/","_SERVER_ROOT_URL_":"http://localhost:8080"}
> where I would prefer to receive simply:
> {"mylist":[{some:stuff}]}
> I've added another event handler to try to resolve this problem. The patch is attached.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (OFBIZ-3365) Clean JSON Service Event Handler
Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-3365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793319#action_12793319 ]
Scott Gray commented on OFBIZ-3365:
-----------------------------------
I'd be interested in hearing the thoughts of the community on this one, here's my mine:
* I like the approach but I'm loathe to commit another json specific event handler
* This problem can't be solved using the chained json event that I committed recently since there is no way to know what service was called earlier in the chain
* I don't like our current approach of blindly sending off all request attributes to the client
The only solution I can think of at the moment is to exclude request attributes set in the ControlServlet and RequestHandler but I fear that will only be a temporary solution because people won't remember to add new attributes to the exclusion list.
> Clean JSON Service Event Handler
> --------------------------------
>
> Key: OFBIZ-3365
> URL: https://issues.apache.org/jira/browse/OFBIZ-3365
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: Release Branch 4.0, Release Branch 9.04, SVN trunk
> Reporter: Frank Lam
> Assignee: Scott Gray
> Priority: Minor
> Fix For: Release Branch 4.0, Release Branch 9.04, SVN trunk
>
> Attachments: cleanjson.patch
>
>
> I ran into a small issue while using org.ofbiz.webapp.event.JSONServiceEventHandler (typically referred to as "jsonservice" in controller files). If I defined my service as such:
> <service name="foo" engine="java" location="my.Class" invoke="someFunction">
> <attribute name="mylist" mode="OUT" type="List" optional="true"/>
> </service>
> I would get the following in the content of my response:
> {"targetRequestUri":"/foo","thisRequestUri":"foo","mylist":[{some:stuff}],"multiPartMap":{},"_CONTROL_PATH_":"/myapp/control","_CONTEXT_ROOT_":"/Users/me/Documents/workspace/ofbiz/hot-deploy/mycomponent/webapp/myapp/","_SERVER_ROOT_URL_":"http://localhost:8080"}
> where I would prefer to receive simply:
> {"mylist":[{some:stuff}]}
> I've added another event handler to try to resolve this problem. The patch is attached.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (OFBIZ-3365) Clean JSON Service Event Handler
Posted by "Scott Gray (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OFBIZ-3365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Scott Gray reassigned OFBIZ-3365:
---------------------------------
Assignee: Scott Gray
> Clean JSON Service Event Handler
> --------------------------------
>
> Key: OFBIZ-3365
> URL: https://issues.apache.org/jira/browse/OFBIZ-3365
> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: Release Branch 4.0, Release Branch 9.04, SVN trunk
> Reporter: Frank Lam
> Assignee: Scott Gray
> Priority: Minor
> Fix For: Release Branch 4.0, Release Branch 9.04, SVN trunk
>
> Attachments: cleanjson.patch
>
>
> I ran into a small issue while using org.ofbiz.webapp.event.JSONServiceEventHandler (typically referred to as "jsonservice" in controller files). If I defined my service as such:
> <service name="foo" engine="java" location="my.Class" invoke="someFunction">
> <attribute name="mylist" mode="OUT" type="List" optional="true"/>
> </service>
> I would get the following in the content of my response:
> {"targetRequestUri":"/foo","thisRequestUri":"foo","mylist":[{some:stuff}],"multiPartMap":{},"_CONTROL_PATH_":"/myapp/control","_CONTEXT_ROOT_":"/Users/me/Documents/workspace/ofbiz/hot-deploy/mycomponent/webapp/myapp/","_SERVER_ROOT_URL_":"http://localhost:8080"}
> where I would prefer to receive simply:
> {"mylist":[{some:stuff}]}
> I've added another event handler to try to resolve this problem. The patch is attached.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.