You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Andres Artigas <an...@manquehue.net> on 2002/08/22 02:58:39 UTC

Download.vm and Download.java example

Hi,

Could somebody send me an example of .vm and .java  files (or another 
required file)  to be able to download files from a turbine app.

Thanks in advace


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


no select in SQL statement in Torque?

Posted by peter neubauer <pe...@yahoo.se>.
Hi,
I tried to extend the TurbineUser by making an alias in my app-schema.
The code compiles, however, when I want to execute
member.getAppUser (extends TurbineUser), I get an error:

Invocation of method 'getAppUser' in  class .....om.Member threw
exception class org.apache.torque.TorqueException : Syntax error or
access violation: You have an error in your SQL syntax near 'FROM
TURBINE_USER WHERE (TURBINE_USER.USER_ID=3)' at line 1

It seems that there is no select in the SQL. Why? My app-schema looks
something like

 <table name="APP_USER" javaName="AppUser" alias="TurbineUser"
  	baseClass="com.app.om.TurbineUserAdapter"
	basePeer="com.app.om.TurbineUserPeerAdapter">
    <!-- Unique identifier -->
    <column name="USER_ID" primaryKey="true" required="true"
type="INTEGER"/>
  </table>
<table name="MEMBER" idMethod="idbroker">
    <column name="MEMBER_ID" required="true" primaryKey="true"
type="INTEGER"/>
    <column name="NAME" size="255" type="VARCHAR"/>
    <column name="FIRST_NAME" required="true" size="99" type="VARCHAR"/>
    <column name="LAST_NAME" required="true" size="99" type="VARCHAR"/>
    <column name="EMAIL" size="99" type="VARCHAR"/>
    <column name="CONFIRM_VALUE" size="99" type="VARCHAR"/>
    <column name="POINTS" type="INTEGER" default="0"/>
    <column name="BRANCH_ID" type="INTEGER" description=""/>
    <column name="INFO" type="LONGVARCHAR" description=""/>
    <column name="LOOKING_FOR" type="LONGVARCHAR" description=""/>
    <column name="PHOTO_ID" type="INTEGER" description=""/>
    <column name="USER_ID" type="INTEGER" description=""/>
    <foreign-key foreignTable="FOTONYTT_USER">
      <reference local="USER_ID" foreign="USER_ID"/>
    </foreign-key>
  </table>

Thanks for any hints!

/peter

_____________________________________________________
Gratis e-mail resten av livet p� www.yahoo.se/mail
Busenkelt!

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


RE: Download.vm and Download.java example

Posted by Gonzalo Diethelm <go...@aditiva.com>.
Hola!

> but what address I have to use to down load de file? , asume the 
> application is in
> 
> http:localhost:8080/newapp/servlet/newapp
> 
> and the extend file is in
> 
> ../WEB-INF/classes/com/cportal/bbx25/modules/screens/download.class

You probably have to address the screen directly, NOT a template:

  http://foo/app/servlet/app/screen/download

> Thanks

Un abrazo,


-- 
Gonzalo A. Diethelm
gonzalo.diethelm@aditiva.com


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


Re: Download.vm and Download.java example

Posted by Andres Artigas <an...@manquehue.net>.
Thanks Rohan,

but what address I have to use to down load de file? , asume the 
application is in

http:localhost:8080/newapp/servlet/newapp

and the extend file is in

../WEB-INF/classes/com/cportal/bbx25/modules/screens/download.class

Thanks

Rohan Osieck wrote:

> G'day Andres,
>    Just extend a RawScreen and implement
> doOutput(RunData data) throws Exception
> and
> getContentType(RunData data) throws Exception
>
> e.g.
> /**
> * A full LDAP export in LDIF format happens from this screen, which 
> means that the content type has to be LDIF and
> * we don't use the default layout for the screens.
> */
> public class LDIFExport extends RawScreen {
>
>    /**
>     * Outputs the LDIF file.
>     */
>    protected void doOutput(RunData data) throws Exception {
>
>        // This sets the filename that the export is saved as when the 
> user downloads the file
>        data.getResponse().setHeader("Content-Disposition", "inline; 
> filename=export.ldif");
>
>        
> data.getOut().print(LDAPProviderBaseService.getInstance().export());
>    }
>
>    /**
>     * Returns the content type of the data.
>     */
>    protected String getContentType(RunData data) {
>        return "application/x-ldif";
>    }
> }
>
> Andres Artigas wrote:
>
>> Hi,
>>
>> Could somebody send me an example of .vm and .java  files (or another 
>> required file)  to be able to download files from a turbine app.
>>
>> Thanks in advace
>>
>>
>> -- 
>> To unsubscribe, e-mail:   
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail: 
>> <ma...@jakarta.apache.org>
>>
>>
>
>
>
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>
>



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


Re: Download.vm and Download.java example

Posted by Rohan Osieck <ro...@paradigmone.com.au>.
G'day Andres,
    Just extend a RawScreen and implement
doOutput(RunData data) throws Exception
and
getContentType(RunData data) throws Exception

e.g.
/**
 * A full LDAP export in LDIF format happens from this screen, which 
means that the content type has to be LDIF and
 * we don't use the default layout for the screens.
 */
public class LDIFExport extends RawScreen {

    /**
     * Outputs the LDIF file.
     */
    protected void doOutput(RunData data) throws Exception {

        // This sets the filename that the export is saved as when the 
user downloads the file
        data.getResponse().setHeader("Content-Disposition", "inline; 
filename=export.ldif");

        data.getOut().print(LDAPProviderBaseService.getInstance().export());
    }

    /**
     * Returns the content type of the data.
     */
    protected String getContentType(RunData data) {
        return "application/x-ldif";
    }
}

Andres Artigas wrote:

> Hi,
>
> Could somebody send me an example of .vm and .java  files (or another 
> required file)  to be able to download files from a turbine app.
>
> Thanks in advace
>
>
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>
>



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