You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Ryan Sweet <ry...@sourcelabs.com> on 2008/03/27 19:25:37 UTC

how to return the response directly?

I want to be able to have the request handler pass the response from the 
event handler directly back to the client.  In this case, the request 
handler is just sending back simple strings.  I'd like to be able to 
either just pass these directly back to the client, or pass them through a 
StringViewHandler class if I have to have a view handler.

>From going through RequestHandler it doesn't seem like <response 
type="none"> does what I want.

In this particular case, I don't need freemarker templates or any other 
munging of the response data, and so I'm reluctant to setup the normal 
pile of views/templates.  Is there a way in controller.xml to tell the 
ControlServlet to just pass on the values spit out by the request handler?

If not, is there a way to setup the <response/> element such that name= 
can match whatever is returned (ie default response if no match on name is 
found)?

Does that make sense?

regards,
-Ryan

Re: how to return the response directly?

Posted by Mark Ellul <ma...@catalystic.com>.
Hi Ryan,
 that looks like a good approach... however you might have to be careful on
the size of your session over time.

I would be interested if you would like to share the code...

I am looking at approaches of connecting to ofbiz via HTTP without exporting
all the commands...

In essence what you are doing with a bit more work could provide a REST
interface to Ofbiz? or am I off track

Thanks in advance..

Regards

Mark

On Thu, Mar 27, 2008 at 8:09 PM, Ryan Sweet <ry...@sourcelabs.com> wrote:

>
>
> On Thu, 27 Mar 2008, BJ Freeman wrote:
>
> > not sure why you can't pass it back thru the controller and specify the
> > view you want to use.
> > it would seem a lot less efforts and keep it simple.
> > When you say client, are you speaking of a http client of some other.
>
> an http client (another app, not a browser).
>
> I think I got it worked out:
>
> I went ahead and changed my request handler to put the return values in
> the session object, and return success/error and then built a ViewHandler
> that gets the values from the session.
>
> Seems like extra lifting but maybe it will make sense to me later.
>
> thanks,
> -Ryan
>
> >
> >
> > Ryan Sweet sent the following on 3/27/2008 10:25 AM:
> >>
> >> I want to be able to have the request handler pass the response from
> the
> >> event handler directly back to the client.  In this case, the request
> >> handler is just sending back simple strings.  I'd like to be able to
> >> either just pass these directly back to the client, or pass them
> through
> >> a StringViewHandler class if I have to have a view handler.
> >>
> >>> From going through RequestHandler it doesn't seem like <response
> >> type="none"> does what I want.
> >>
> >> In this particular case, I don't need freemarker templates or any other
> >> munging of the response data, and so I'm reluctant to setup the normal
> >> pile of views/templates.  Is there a way in controller.xml to tell the
> >> ControlServlet to just pass on the values spit out by the request
> handler?
> >>
> >> If not, is there a way to setup the <response/> element such that name=
> >> can match whatever is returned (ie default response if no match on name
> >> is found)?
> >>
> >> Does that make sense?
> >>
> >> regards,
> >> -Ryan
> >>
> >>
> >>
> >
> >
>

Moving Next and Previous through a ordered table/view using an ftl

Posted by "skip@thedevers" <sk...@thedevers.org>.
I have create a Jira issue here:

https://issues.apache.org/jira/browse/OFBIZ-1723

Included is code to allow you to create a ftl/widget based screen to allow
users to move through an arbitrary ordered list using next and previous
buttons.

This code creates a self-referencing hash table.  The entries are removed on
a timer after 5 minutes and the class is garbage collected.  It would be way
nicer to be able to have a listener on the servlet controller so that when
the user moved to a different url base, the container could kill itself.
Alas, I can find no such interface and would love to hear from someone that
knows of a way to do this.  Fortunately, the unused overhead is under a
hundred bytes and only hangs around for 5 minutes.

This could be improved on very large tables on some DBs using a binary
search in find() instead of the current sequential one.  However, the last()
call required to determine the size reads the entire table on some DBs, so I
didn't think it prudent, and the time consumption on a 10k record table is
more than adequately small in my testing.

The code likely has some tabs in it and does have the opening { on the next
line unlike the ofbiz guidelines, but it is still entirely functional as
well as easier to me to read.

Skip


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
4:43 PM


RE: org.ofbiz.minerva.pool.jdbc.xa

Posted by "skip@thedevers" <sk...@thedevers.org>.
Thanks BJ

However, I was looking for the source to download.  This is a fisheye view.
Is this the only way to look at the source?

Anyway, thanks for this.  This fisheye is so slick, I think I am gonna go
buy it.

Skip

-----Original Message-----
From: BJ Freeman [mailto:bjfree@free-man.net]
Sent: Thursday, March 27, 2008 8:34 PM
To: user@ofbiz.apache.org
Subject: Re: org.ofbiz.minerva.pool.jdbc.xa


https://svn.hotwaxmedia.com/crucible/browse/ofbizext/minerva/src/org/ofbiz/m
inerva/pool/ObjectPool.java

skip@thedevers sent the following on 3/27/2008 1:59 PM:
> Anyone know where I can find the source for the
> org.ofbiz.minerva.pool.jdbc.xa and decendant packages?
>
> I find the class files in ofbiz-minerva.jar, but can't find the source
> anywhere.
>
> Skip
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
> 4:43 PM
>
>
>
>


No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
4:43 PM

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
4:43 PM


Re: org.ofbiz.minerva.pool.jdbc.xa

Posted by Jacques Le Roux <ja...@les7arts.com>.
Yes, you can : MIT licence

Jacques

From: "skip@thedevers" <sk...@thedevers.org>
> BJ
> 
> Hmmm, I see how to download the file now, but am I supposed to?  Looks like
> hotwaxmedia source to me.
> 
> Skip
> 
> -----Original Message-----
> From: BJ Freeman [mailto:bjfree@free-man.net]
> Sent: Thursday, March 27, 2008 8:34 PM
> To: user@ofbiz.apache.org
> Subject: Re: org.ofbiz.minerva.pool.jdbc.xa
> 
> 
> https://svn.hotwaxmedia.com/crucible/browse/ofbizext/minerva/src/org/ofbiz/m
> inerva/pool/ObjectPool.java
> 
> skip@thedevers sent the following on 3/27/2008 1:59 PM:
>> Anyone know where I can find the source for the
>> org.ofbiz.minerva.pool.jdbc.xa and decendant packages?
>>
>> I find the class files in ofbiz-minerva.jar, but can't find the source
>> anywhere.
>>
>> Skip
>> No virus found in this outgoing message.
>> Checked by AVG.
>> Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
>> 4:43 PM
>>
>>
>>
>>
> 
> 
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
> 4:43 PM
> 
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
> 4:43 PM
>

RE: org.ofbiz.minerva.pool.jdbc.xa

Posted by "skip@thedevers" <sk...@thedevers.org>.
BJ

Hmmm, I see how to download the file now, but am I supposed to?  Looks like
hotwaxmedia source to me.

Skip

-----Original Message-----
From: BJ Freeman [mailto:bjfree@free-man.net]
Sent: Thursday, March 27, 2008 8:34 PM
To: user@ofbiz.apache.org
Subject: Re: org.ofbiz.minerva.pool.jdbc.xa


https://svn.hotwaxmedia.com/crucible/browse/ofbizext/minerva/src/org/ofbiz/m
inerva/pool/ObjectPool.java

skip@thedevers sent the following on 3/27/2008 1:59 PM:
> Anyone know where I can find the source for the
> org.ofbiz.minerva.pool.jdbc.xa and decendant packages?
>
> I find the class files in ofbiz-minerva.jar, but can't find the source
> anywhere.
>
> Skip
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
> 4:43 PM
>
>
>
>


No virus found in this incoming message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
4:43 PM

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
4:43 PM


Re: org.ofbiz.minerva.pool.jdbc.xa

Posted by BJ Freeman <bj...@free-man.net>.
https://svn.hotwaxmedia.com/crucible/browse/ofbizext/minerva/src/org/ofbiz/minerva/pool/ObjectPool.java

skip@thedevers sent the following on 3/27/2008 1:59 PM:
> Anyone know where I can find the source for the
> org.ofbiz.minerva.pool.jdbc.xa and decendant packages?
> 
> I find the class files in ofbiz-minerva.jar, but can't find the source
> anywhere.
> 
> Skip
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
> 4:43 PM
> 
> 
> 
> 


org.ofbiz.minerva.pool.jdbc.xa

Posted by "skip@thedevers" <sk...@thedevers.org>.
Anyone know where I can find the source for the
org.ofbiz.minerva.pool.jdbc.xa and decendant packages?

I find the class files in ofbiz-minerva.jar, but can't find the source
anywhere.

Skip
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
4:43 PM


Re: how to return the response directly?

Posted by Ryan Sweet <ry...@sourcelabs.com>.

On Thu, 27 Mar 2008, BJ Freeman wrote:

> not sure why you can't pass it back thru the controller and specify the
> view you want to use.
> it would seem a lot less efforts and keep it simple.
> When you say client, are you speaking of a http client of some other.

an http client (another app, not a browser).

I think I got it worked out:

I went ahead and changed my request handler to put the return values in 
the session object, and return success/error and then built a ViewHandler 
that gets the values from the session.

Seems like extra lifting but maybe it will make sense to me later.

thanks,
-Ryan

>
>
> Ryan Sweet sent the following on 3/27/2008 10:25 AM:
>>
>> I want to be able to have the request handler pass the response from the
>> event handler directly back to the client.  In this case, the request
>> handler is just sending back simple strings.  I'd like to be able to
>> either just pass these directly back to the client, or pass them through
>> a StringViewHandler class if I have to have a view handler.
>>
>>> From going through RequestHandler it doesn't seem like <response
>> type="none"> does what I want.
>>
>> In this particular case, I don't need freemarker templates or any other
>> munging of the response data, and so I'm reluctant to setup the normal
>> pile of views/templates.  Is there a way in controller.xml to tell the
>> ControlServlet to just pass on the values spit out by the request handler?
>>
>> If not, is there a way to setup the <response/> element such that name=
>> can match whatever is returned (ie default response if no match on name
>> is found)?
>>
>> Does that make sense?
>>
>> regards,
>> -Ryan
>>
>>
>>
>
>

Re: how to return the response directly?

Posted by BJ Freeman <bj...@free-man.net>.
not sure why you can't pass it back thru the controller and specify the
view you want to use.
it would seem a lot less efforts and keep it simple.
When you say client, are you speaking of a http client of some other.


Ryan Sweet sent the following on 3/27/2008 10:25 AM:
> 
> I want to be able to have the request handler pass the response from the
> event handler directly back to the client.  In this case, the request
> handler is just sending back simple strings.  I'd like to be able to
> either just pass these directly back to the client, or pass them through
> a StringViewHandler class if I have to have a view handler.
> 
>> From going through RequestHandler it doesn't seem like <response 
> type="none"> does what I want.
> 
> In this particular case, I don't need freemarker templates or any other
> munging of the response data, and so I'm reluctant to setup the normal
> pile of views/templates.  Is there a way in controller.xml to tell the
> ControlServlet to just pass on the values spit out by the request handler?
> 
> If not, is there a way to setup the <response/> element such that name=
> can match whatever is returned (ie default response if no match on name
> is found)?
> 
> Does that make sense?
> 
> regards,
> -Ryan
> 
> 
>