You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Gaasch, Derek" <dg...@montana.edu> on 2002/11/26 06:40:31 UTC

file stream

Hello. I'm implementing some extranet functionality, allowing users to
access a samba fileshare (that is not publicly accessible) through turbine
(which is)... however I'm kind of stumped. Since the file server is remote
to the web server (and its content is only accessed through the SMB protocol
from local IPs), the client can not directly download a file from the file
server (i.e. get directed to the fileserver by the web server). Instead, I
need to create a stream is the samba share to the turbine VM... how do I
send that stream to the client? Is a custom servlet necessary? Or is there
some clever way to do this with Turbine that I'm overlooking or don't know
about (I am admittedly still a novice to Turbine)?

Thanks for any thoughts.

-Derek

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: file stream

Posted by Rodney Schneider <ro...@actf.com.au>.
On Tue, 26 Nov 2002 16:40, you wrote:
> Hello. I'm implementing some extranet functionality, allowing users
> to access a samba fileshare (that is not publicly accessible) through
> turbine (which is)... however I'm kind of stumped. Since the file
> server is remote to the web server (and its content is only accessed
> through the SMB protocol from local IPs), the client can not directly
> download a file from the file server (i.e. get directed to the
> fileserver by the web server). Instead, I need to create a stream is
> the samba share to the turbine VM... how do I send that stream to the
> client? Is a custom servlet necessary? Or is there some clever way to
> do this with Turbine that I'm overlooking or don't know about (I am
> admittedly still a novice to Turbine)?

Hi Derek,

You could write a sublclass of RawScreen that sucks the file in via the 
SMB protocol (possibly using a custom InputStream) and squirts it down 
the ServletOutputStream of the response one byte array at a time (ie: 
data.getResponse().getOutputStream()).

Regards,

-- Rodney

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: multiple tables ...

Posted by michael shek sia lim <mi...@eigentechnology.com>.
I think I have got it working ...

thanks for any potential help
michael



> Hi,
>
> The example given in TDK has one table in it. Does one have to write
> complete new code if one has more than one to work with? Given the Java
> code coming out of "ant compile" works with one table at a time only...
>
> /org/mycompany/eigen/modules/screens/Form.java
>
>
> public void doBuildTemplate( RunData data, Context context )
> {
>  try
>     {
>      int entry_id = data.getParameters().getInt("id");
>      Criteria criteria = new Criteria();
>      criteria.add(InvoiceitemPeer.ID, entry_id);
>      Invoiceitem invoiceitem =
> (Invoiceitem)InvoiceitemPeer.doSelect(criteria).elementAt(0);
>      Invoice invoice =
> (Invoice)InvoicePeer.doSelect(criteria).elementAt(0);
>      context.put("entry", invoiceitem);
>      }
>  catch (Exception e)
>     {
>      // log something ?
>  }
> }
>
> best wishes
> michael lim




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


multiple tables ...

Posted by michael shek sia lim <mi...@eigentechnology.com>.
Hi,

The example given in TDK has one table in it. Does one have to write
complete new code if one has more than one to work with? Given the Java
code coming out of "ant compile" works with one table at a time only...

/org/mycompany/eigen/modules/screens/Form.java


public void doBuildTemplate( RunData data, Context context )
{
 try
    {
     int entry_id = data.getParameters().getInt("id");
     Criteria criteria = new Criteria();
     criteria.add(InvoiceitemPeer.ID, entry_id);
     Invoiceitem invoiceitem =
(Invoiceitem)InvoiceitemPeer.doSelect(criteria).elementAt(0);
     Invoice invoice =
(Invoice)InvoicePeer.doSelect(criteria).elementAt(0);
     context.put("entry", invoiceitem);
     }
 catch (Exception e)
    {
     // log something ?
 }
}

best wishes
michael lim













--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>