You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Chris Chiappone <ch...@gmail.com> on 2005/08/01 21:14:40 UTC

How to create a link to a blob

Hi I was wonder what is the best approach when creating a link to a
blob in my db.  The blob would be a pdf or other type of document.

-- 
~chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to create a link to a blob

Posted by Chris Chiappone <ch...@gmail.com>.
Yep I got it thanks for your help.

On 8/2/05, Konstantin Ignatyev <kg...@yahoo.com> wrote:
> I do not know how do you output your link but suspect
> that you should somehow use printRaw() rather than
> print() , might be matter of attribute like raw="true"
> for @Insert
> 
> --- Chris Chiappone <ch...@gmail.com> wrote:
> 
> > Well I have almost gotten this to work correctly.
> > One issue I am
> > running into is that the link that is being created
> > seems to be
> > filtered. Here is the following link that is created
> > from my service:
> >
> app?service=DocDownloaderService&sp=SExhibitor.doc&sp=l2
> >
> > if i get rid of the 'amp;' in the url the file is
> > downloaded.  Any
> > ideas on how to not have this filtered?
> >
> > On 8/1/05, Konstantin Ignatyev
> > <kg...@yahoo.com> wrote:
> > > ServiceLink component
> > >
> > > or write one like this
> > > public abstract class JasperToPDFLinkComponent
> > > extends AbstractComponent{
> > >
> > >  public abstract String getPageName();
> > >  public abstract String getJasperPrint();
> > >
> > >
> > >  protected void renderComponent(IMarkupWriter w,
> > > IRequestCycle cycle) {
> > >    if( cycle.isRewinding() ) return;
> > >    IEngineService srv =
> > cycle.getEngine().getService(
> > > JasperToPDFService.SERVICE_NAME );
> > >    String pageName = ( getPageName() == null)?
> > > cycle.getPage().getPageName(): getPageName();
> > >    ILink lnk = srv.getLink( cycle, this, new
> > > Object[]{ pageName, getJasperPrint() });
> > >    w.begin("a");
> > >    w.attribute("href", lnk.getURL() );
> > >    renderInformalParameters( w, cycle);
> > >    renderBody( w, cycle );
> > >    //w.closeTag();
> > >    w.end();
> > >
> > >  }
> > > }
> > >
> > >
> > > --- Chris Chiappone <ch...@gmail.com> wrote:
> > >
> > > > Also, how would i reference this service in my
> > html
> > > > or page file?
> > > >
> > > > On 8/1/05, Konstantin Ignatyev
> > > > <kg...@yahoo.com> wrote:
> > > > > Simply create a PDF service that will do that,
> > > > > something like this:
> > > > > in application.xml
> > > > >
> > > > >  <service name="JasperToPDFService"
> > > > > class="xxx.JasperToPDFService" />
> > > > >
> > > > >
> > > > > public class JasperToPDFService extends
> > > > > AbstractService{
> > > > >
> > > > >  public static final String SERVICE_NAME =
> > > > > "JasperToPDFService";
> > > > >
> > > > >  public String getName(){
> > > > >    return SERVICE_NAME;
> > > > >  }
> > > > >
> > > > >  /**
> > > > >   * parameters[page,ognlExpressionToGetSource]
> > > > >   * @param iEngineServiceView
> > > > >   * @param cycle
> > > > >   * @param responseOutputStream
> > > > >   * @throws javax.servlet.ServletException
> > > > >   * @throws java.io.IOException
> > > > >   */
> > > > >  public void service( IEngineServiceView
> > > > > iEngineServiceView, IRequestCycle cycle,
> > > > > ResponseOutputStream responseOutputStream )
> > throws
> > > > > ServletException, IOException{
> > > > >    Object[] params = getParameters( cycle ) ;
> > > > >    String pageName = (String) params[0];
> > > > >    String srcExpression = (String) params[1];
> > > > >    responseOutputStream.setContentType(
> > > > > "application/pdf" );
> > > > >    HttpServletResponse response =
> > > > > cycle.getRequestContext().getResponse();
> > > > >    response.setHeader("Expires", "0");
> > > > >    response.setHeader("Cache-Control",
> > > > > "must-revalidate, post-check=0, pre-check=0");
> > > > >    response.setHeader("Pragma", "public");
> > > > >    response.setHeader("Content-Disposition",
> > > > > "attachment; filename=\"" + pageName
> > +".pdf\"");
> > > > >    try{
> > > > >      JasperPrint p = (JasperPrint)
> > Ognl.getValue(
> > > > > Ognl.parseExpression( srcExpression ),
> > > > cycle.getPage(
> > > > > pageName ) );
> > > > >
> > > > >
> > > >
> > >
> >
> ConsoleServicesFactory.getJasperReportExecutor().exportReportToPDF(
> > > > > p, response.getOutputStream());
> > > > >    } catch( Exception e ){
> > > > >      throw new ServletException( e );
> > > > >    }
> > > > >  }
> > > > >
> > > > >  public ILink getLink( IRequestCycle
> > > > iRequestCycle,
> > > > > IComponent iComponent, Object[] params ){
> > > > >      return this.constructLink(
> > > > > iRequestCycle,getName(),null, params,false );
> > > > >  }
> > > > >
> > > > > }
> > > > >
> > > > > --- Chris Chiappone <ch...@gmail.com>
> > wrote:
> > > > >
> > > > > > To be more clear I am trying to figure out
> > if I
> > > > > > create an asset that
> > > > > > is used to bring up the pdf of document.  Is
> > > > that
> > > > > > the way I should do
> > > > > > this?
> > > > > >
> > > > > > On 8/1/05, Chris Chiappone
> > <ch...@gmail.com>
> > > > > > wrote:
> > > > > > > Hi I was wonder what is the best approach
> > when
> > > > > > creating a link to a
> > > > > > > blob in my db.  The blob would be a pdf or
> > > > other
> > > > > > type of document.
> > > > > > >
> > > > > > > --
> > > > > > > ~chris
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > ~chris
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail:
> > > > > > tapestry-user-unsubscribe@jakarta.apache.org
> > > > > > For additional commands, e-mail:
> > > > > > tapestry-user-help@jakarta.apache.org
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > Konstantin Ignatyev
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > PS: If this is a typical day on planet earth,
> > > > humans will add fifteen million tons of carbon
> > to
> > > > the atmosphere, destroy 115 square miles of
> > tropical
> > > > rainforest, create seventy-two miles of desert,
> > > > eliminate between forty to one hundred species,
> > > > erode seventy-one million tons of topsoil, add
> > 2,700
> > > > tons of CFCs to the stratosphere, and increase
> > their
> > > > population by 263,000
> > > > >
> > > > > Bowers, C.A.  The Culture of Denial:  Why the
> > > > Environmental Movement Needs a Strategy for
> > > > Reforming Universities and Public Schools.  New
> > > > York:  State University of New York Press, 1997:
> > (4)
> > > > (5) (p.206)
> > > > >
> > > >
> > > >
> > > > --
> > > > ~chris
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > > tapestry-user-unsubscribe@jakarta.apache.org
> >
> === message truncated ===
> 
> 
> Konstantin Ignatyev
> 
> 
> 
> 
> PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000
> 
> Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  New York:  State University of New York Press, 1997: (4) (5) (p.206)
> 


-- 
~chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to create a link to a blob

Posted by Konstantin Ignatyev <kg...@yahoo.com>.
I do not know how do you output your link but suspect
that you should somehow use printRaw() rather than
print() , might be matter of attribute like raw="true"
for @Insert

--- Chris Chiappone <ch...@gmail.com> wrote:

> Well I have almost gotten this to work correctly. 
> One issue I am
> running into is that the link that is being created
> seems to be
> filtered. Here is the following link that is created
> from my service:
>
app?service=DocDownloaderService&amp;sp=SExhibitor.doc&amp;sp=l2
> 
> if i get rid of the 'amp;' in the url the file is
> downloaded.  Any
> ideas on how to not have this filtered?
> 
> On 8/1/05, Konstantin Ignatyev
> <kg...@yahoo.com> wrote:
> > ServiceLink component
> > 
> > or write one like this
> > public abstract class JasperToPDFLinkComponent
> > extends AbstractComponent{
> > 
> >  public abstract String getPageName();
> >  public abstract String getJasperPrint();
> > 
> > 
> >  protected void renderComponent(IMarkupWriter w,
> > IRequestCycle cycle) {
> >    if( cycle.isRewinding() ) return;
> >    IEngineService srv =
> cycle.getEngine().getService(
> > JasperToPDFService.SERVICE_NAME );
> >    String pageName = ( getPageName() == null)?
> > cycle.getPage().getPageName(): getPageName();
> >    ILink lnk = srv.getLink( cycle, this, new
> > Object[]{ pageName, getJasperPrint() });
> >    w.begin("a");
> >    w.attribute("href", lnk.getURL() );
> >    renderInformalParameters( w, cycle);
> >    renderBody( w, cycle );
> >    //w.closeTag();
> >    w.end();
> > 
> >  }
> > }
> > 
> > 
> > --- Chris Chiappone <ch...@gmail.com> wrote:
> > 
> > > Also, how would i reference this service in my
> html
> > > or page file?
> > >
> > > On 8/1/05, Konstantin Ignatyev
> > > <kg...@yahoo.com> wrote:
> > > > Simply create a PDF service that will do that,
> > > > something like this:
> > > > in application.xml
> > > >
> > > >  <service name="JasperToPDFService"
> > > > class="xxx.JasperToPDFService" />
> > > >
> > > >
> > > > public class JasperToPDFService extends
> > > > AbstractService{
> > > >
> > > >  public static final String SERVICE_NAME =
> > > > "JasperToPDFService";
> > > >
> > > >  public String getName(){
> > > >    return SERVICE_NAME;
> > > >  }
> > > >
> > > >  /**
> > > >   * parameters[page,ognlExpressionToGetSource]
> > > >   * @param iEngineServiceView
> > > >   * @param cycle
> > > >   * @param responseOutputStream
> > > >   * @throws javax.servlet.ServletException
> > > >   * @throws java.io.IOException
> > > >   */
> > > >  public void service( IEngineServiceView
> > > > iEngineServiceView, IRequestCycle cycle,
> > > > ResponseOutputStream responseOutputStream )
> throws
> > > > ServletException, IOException{
> > > >    Object[] params = getParameters( cycle ) ;
> > > >    String pageName = (String) params[0];
> > > >    String srcExpression = (String) params[1];
> > > >    responseOutputStream.setContentType(
> > > > "application/pdf" );
> > > >    HttpServletResponse response =
> > > > cycle.getRequestContext().getResponse();
> > > >    response.setHeader("Expires", "0");
> > > >    response.setHeader("Cache-Control",
> > > > "must-revalidate, post-check=0, pre-check=0");
> > > >    response.setHeader("Pragma", "public");
> > > >    response.setHeader("Content-Disposition",
> > > > "attachment; filename=\"" + pageName
> +".pdf\"");
> > > >    try{
> > > >      JasperPrint p = (JasperPrint)
> Ognl.getValue(
> > > > Ognl.parseExpression( srcExpression ),
> > > cycle.getPage(
> > > > pageName ) );
> > > >
> > > >
> > >
> >
>
ConsoleServicesFactory.getJasperReportExecutor().exportReportToPDF(
> > > > p, response.getOutputStream());
> > > >    } catch( Exception e ){
> > > >      throw new ServletException( e );
> > > >    }
> > > >  }
> > > >
> > > >  public ILink getLink( IRequestCycle
> > > iRequestCycle,
> > > > IComponent iComponent, Object[] params ){
> > > >      return this.constructLink(
> > > > iRequestCycle,getName(),null, params,false );
> > > >  }
> > > >
> > > > }
> > > >
> > > > --- Chris Chiappone <ch...@gmail.com>
> wrote:
> > > >
> > > > > To be more clear I am trying to figure out
> if I
> > > > > create an asset that
> > > > > is used to bring up the pdf of document.  Is
> > > that
> > > > > the way I should do
> > > > > this?
> > > > >
> > > > > On 8/1/05, Chris Chiappone
> <ch...@gmail.com>
> > > > > wrote:
> > > > > > Hi I was wonder what is the best approach
> when
> > > > > creating a link to a
> > > > > > blob in my db.  The blob would be a pdf or
> > > other
> > > > > type of document.
> > > > > >
> > > > > > --
> > > > > > ~chris
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > ~chris
> > > > >
> > > > >
> > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail:
> > > > > tapestry-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail:
> > > > > tapestry-user-help@jakarta.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > > > Konstantin Ignatyev
> > > >
> > > >
> > > >
> > > >
> > > > PS: If this is a typical day on planet earth,
> > > humans will add fifteen million tons of carbon
> to
> > > the atmosphere, destroy 115 square miles of
> tropical
> > > rainforest, create seventy-two miles of desert,
> > > eliminate between forty to one hundred species,
> > > erode seventy-one million tons of topsoil, add
> 2,700
> > > tons of CFCs to the stratosphere, and increase
> their
> > > population by 263,000
> > > >
> > > > Bowers, C.A.  The Culture of Denial:  Why the
> > > Environmental Movement Needs a Strategy for
> > > Reforming Universities and Public Schools.  New
> > > York:  State University of New York Press, 1997:
> (4)
> > > (5) (p.206)
> > > >
> > >
> > >
> > > --
> > > ~chris
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > tapestry-user-unsubscribe@jakarta.apache.org
> 
=== message truncated ===


Konstantin Ignatyev




PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000

Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  New York:  State University of New York Press, 1997: (4) (5) (p.206)

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to create a link to a blob

Posted by Chris Chiappone <ch...@gmail.com>.
Well I have almost gotten this to work correctly.  One issue I am
running into is that the link that is being created seems to be
filtered. Here is the following link that is created from my service:
app?service=DocDownloaderService&amp;sp=SExhibitor.doc&amp;sp=l2

if i get rid of the 'amp;' in the url the file is downloaded.  Any
ideas on how to not have this filtered?

On 8/1/05, Konstantin Ignatyev <kg...@yahoo.com> wrote:
> ServiceLink component
> 
> or write one like this
> public abstract class JasperToPDFLinkComponent
> extends AbstractComponent{
> 
>  public abstract String getPageName();
>  public abstract String getJasperPrint();
> 
> 
>  protected void renderComponent(IMarkupWriter w,
> IRequestCycle cycle) {
>    if( cycle.isRewinding() ) return;
>    IEngineService srv = cycle.getEngine().getService(
> JasperToPDFService.SERVICE_NAME );
>    String pageName = ( getPageName() == null)?
> cycle.getPage().getPageName(): getPageName();
>    ILink lnk = srv.getLink( cycle, this, new
> Object[]{ pageName, getJasperPrint() });
>    w.begin("a");
>    w.attribute("href", lnk.getURL() );
>    renderInformalParameters( w, cycle);
>    renderBody( w, cycle );
>    //w.closeTag();
>    w.end();
> 
>  }
> }
> 
> 
> --- Chris Chiappone <ch...@gmail.com> wrote:
> 
> > Also, how would i reference this service in my html
> > or page file?
> >
> > On 8/1/05, Konstantin Ignatyev
> > <kg...@yahoo.com> wrote:
> > > Simply create a PDF service that will do that,
> > > something like this:
> > > in application.xml
> > >
> > >  <service name="JasperToPDFService"
> > > class="xxx.JasperToPDFService" />
> > >
> > >
> > > public class JasperToPDFService extends
> > > AbstractService{
> > >
> > >  public static final String SERVICE_NAME =
> > > "JasperToPDFService";
> > >
> > >  public String getName(){
> > >    return SERVICE_NAME;
> > >  }
> > >
> > >  /**
> > >   * parameters[page,ognlExpressionToGetSource]
> > >   * @param iEngineServiceView
> > >   * @param cycle
> > >   * @param responseOutputStream
> > >   * @throws javax.servlet.ServletException
> > >   * @throws java.io.IOException
> > >   */
> > >  public void service( IEngineServiceView
> > > iEngineServiceView, IRequestCycle cycle,
> > > ResponseOutputStream responseOutputStream ) throws
> > > ServletException, IOException{
> > >    Object[] params = getParameters( cycle ) ;
> > >    String pageName = (String) params[0];
> > >    String srcExpression = (String) params[1];
> > >    responseOutputStream.setContentType(
> > > "application/pdf" );
> > >    HttpServletResponse response =
> > > cycle.getRequestContext().getResponse();
> > >    response.setHeader("Expires", "0");
> > >    response.setHeader("Cache-Control",
> > > "must-revalidate, post-check=0, pre-check=0");
> > >    response.setHeader("Pragma", "public");
> > >    response.setHeader("Content-Disposition",
> > > "attachment; filename=\"" + pageName +".pdf\"");
> > >    try{
> > >      JasperPrint p = (JasperPrint) Ognl.getValue(
> > > Ognl.parseExpression( srcExpression ),
> > cycle.getPage(
> > > pageName ) );
> > >
> > >
> >
> ConsoleServicesFactory.getJasperReportExecutor().exportReportToPDF(
> > > p, response.getOutputStream());
> > >    } catch( Exception e ){
> > >      throw new ServletException( e );
> > >    }
> > >  }
> > >
> > >  public ILink getLink( IRequestCycle
> > iRequestCycle,
> > > IComponent iComponent, Object[] params ){
> > >      return this.constructLink(
> > > iRequestCycle,getName(),null, params,false );
> > >  }
> > >
> > > }
> > >
> > > --- Chris Chiappone <ch...@gmail.com> wrote:
> > >
> > > > To be more clear I am trying to figure out if I
> > > > create an asset that
> > > > is used to bring up the pdf of document.  Is
> > that
> > > > the way I should do
> > > > this?
> > > >
> > > > On 8/1/05, Chris Chiappone <ch...@gmail.com>
> > > > wrote:
> > > > > Hi I was wonder what is the best approach when
> > > > creating a link to a
> > > > > blob in my db.  The blob would be a pdf or
> > other
> > > > type of document.
> > > > >
> > > > > --
> > > > > ~chris
> > > > >
> > > >
> > > >
> > > > --
> > > > ~chris
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > > tapestry-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
> > > > tapestry-user-help@jakarta.apache.org
> > > >
> > > >
> > >
> > >
> > > Konstantin Ignatyev
> > >
> > >
> > >
> > >
> > > PS: If this is a typical day on planet earth,
> > humans will add fifteen million tons of carbon to
> > the atmosphere, destroy 115 square miles of tropical
> > rainforest, create seventy-two miles of desert,
> > eliminate between forty to one hundred species,
> > erode seventy-one million tons of topsoil, add 2,700
> > tons of CFCs to the stratosphere, and increase their
> > population by 263,000
> > >
> > > Bowers, C.A.  The Culture of Denial:  Why the
> > Environmental Movement Needs a Strategy for
> > Reforming Universities and Public Schools.  New
> > York:  State University of New York Press, 1997: (4)
> > (5) (p.206)
> > >
> >
> >
> > --
> > ~chris
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> >
> >
> 
> 
> Konstantin Ignatyev
> 
> 
> 
> 
> PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000
> 
> Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  New York:  State University of New York Press, 1997: (4) (5) (p.206)
> 


-- 
~chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to create a link to a blob

Posted by Konstantin Ignatyev <kg...@yahoo.com>.
ServiceLink component

or write one like this
public abstract class JasperToPDFLinkComponent 
extends AbstractComponent{

  public abstract String getPageName();
  public abstract String getJasperPrint();


  protected void renderComponent(IMarkupWriter w,
IRequestCycle cycle) {
    if( cycle.isRewinding() ) return;
    IEngineService srv = cycle.getEngine().getService(
JasperToPDFService.SERVICE_NAME );
    String pageName = ( getPageName() == null)?
cycle.getPage().getPageName(): getPageName();
    ILink lnk = srv.getLink( cycle, this, new
Object[]{ pageName, getJasperPrint() });
    w.begin("a");
    w.attribute("href", lnk.getURL() );
    renderInformalParameters( w, cycle);
    renderBody( w, cycle );
    //w.closeTag();
    w.end();

  }
}


--- Chris Chiappone <ch...@gmail.com> wrote:

> Also, how would i reference this service in my html
> or page file?
> 
> On 8/1/05, Konstantin Ignatyev
> <kg...@yahoo.com> wrote:
> > Simply create a PDF service that will do that,
> > something like this:
> > in application.xml
> > 
> >  <service name="JasperToPDFService"
> > class="xxx.JasperToPDFService" />
> > 
> > 
> > public class JasperToPDFService extends
> > AbstractService{
> > 
> >  public static final String SERVICE_NAME =
> > "JasperToPDFService";
> > 
> >  public String getName(){
> >    return SERVICE_NAME;
> >  }
> > 
> >  /**
> >   * parameters[page,ognlExpressionToGetSource]
> >   * @param iEngineServiceView
> >   * @param cycle
> >   * @param responseOutputStream
> >   * @throws javax.servlet.ServletException
> >   * @throws java.io.IOException
> >   */
> >  public void service( IEngineServiceView
> > iEngineServiceView, IRequestCycle cycle,
> > ResponseOutputStream responseOutputStream ) throws
> > ServletException, IOException{
> >    Object[] params = getParameters( cycle ) ;
> >    String pageName = (String) params[0];
> >    String srcExpression = (String) params[1];
> >    responseOutputStream.setContentType(
> > "application/pdf" );
> >    HttpServletResponse response =
> > cycle.getRequestContext().getResponse();
> >    response.setHeader("Expires", "0");
> >    response.setHeader("Cache-Control",
> > "must-revalidate, post-check=0, pre-check=0");
> >    response.setHeader("Pragma", "public");
> >    response.setHeader("Content-Disposition",
> > "attachment; filename=\"" + pageName +".pdf\"");
> >    try{
> >      JasperPrint p = (JasperPrint) Ognl.getValue(
> > Ognl.parseExpression( srcExpression ),
> cycle.getPage(
> > pageName ) );
> > 
> >
>
ConsoleServicesFactory.getJasperReportExecutor().exportReportToPDF(
> > p, response.getOutputStream());
> >    } catch( Exception e ){
> >      throw new ServletException( e );
> >    }
> >  }
> > 
> >  public ILink getLink( IRequestCycle
> iRequestCycle,
> > IComponent iComponent, Object[] params ){
> >      return this.constructLink(
> > iRequestCycle,getName(),null, params,false );
> >  }
> > 
> > }
> > 
> > --- Chris Chiappone <ch...@gmail.com> wrote:
> > 
> > > To be more clear I am trying to figure out if I
> > > create an asset that
> > > is used to bring up the pdf of document.  Is
> that
> > > the way I should do
> > > this?
> > >
> > > On 8/1/05, Chris Chiappone <ch...@gmail.com>
> > > wrote:
> > > > Hi I was wonder what is the best approach when
> > > creating a link to a
> > > > blob in my db.  The blob would be a pdf or
> other
> > > type of document.
> > > >
> > > > --
> > > > ~chris
> > > >
> > >
> > >
> > > --
> > > ~chris
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > > tapestry-user-help@jakarta.apache.org
> > >
> > >
> > 
> > 
> > Konstantin Ignatyev
> > 
> > 
> > 
> > 
> > PS: If this is a typical day on planet earth,
> humans will add fifteen million tons of carbon to
> the atmosphere, destroy 115 square miles of tropical
> rainforest, create seventy-two miles of desert,
> eliminate between forty to one hundred species,
> erode seventy-one million tons of topsoil, add 2,700
> tons of CFCs to the stratosphere, and increase their
> population by 263,000
> > 
> > Bowers, C.A.  The Culture of Denial:  Why the
> Environmental Movement Needs a Strategy for
> Reforming Universities and Public Schools.  New
> York:  State University of New York Press, 1997: (4)
> (5) (p.206)
> > 
> 
> 
> -- 
> ~chris
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 


Konstantin Ignatyev




PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000

Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  New York:  State University of New York Press, 1997: (4) (5) (p.206)

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to create a link to a blob

Posted by Chris Chiappone <ch...@gmail.com>.
Also, how would i reference this service in my html or page file?

On 8/1/05, Konstantin Ignatyev <kg...@yahoo.com> wrote:
> Simply create a PDF service that will do that,
> something like this:
> in application.xml
> 
>  <service name="JasperToPDFService"
> class="xxx.JasperToPDFService" />
> 
> 
> public class JasperToPDFService extends
> AbstractService{
> 
>  public static final String SERVICE_NAME =
> "JasperToPDFService";
> 
>  public String getName(){
>    return SERVICE_NAME;
>  }
> 
>  /**
>   * parameters[page,ognlExpressionToGetSource]
>   * @param iEngineServiceView
>   * @param cycle
>   * @param responseOutputStream
>   * @throws javax.servlet.ServletException
>   * @throws java.io.IOException
>   */
>  public void service( IEngineServiceView
> iEngineServiceView, IRequestCycle cycle,
> ResponseOutputStream responseOutputStream ) throws
> ServletException, IOException{
>    Object[] params = getParameters( cycle ) ;
>    String pageName = (String) params[0];
>    String srcExpression = (String) params[1];
>    responseOutputStream.setContentType(
> "application/pdf" );
>    HttpServletResponse response =
> cycle.getRequestContext().getResponse();
>    response.setHeader("Expires", "0");
>    response.setHeader("Cache-Control",
> "must-revalidate, post-check=0, pre-check=0");
>    response.setHeader("Pragma", "public");
>    response.setHeader("Content-Disposition",
> "attachment; filename=\"" + pageName +".pdf\"");
>    try{
>      JasperPrint p = (JasperPrint) Ognl.getValue(
> Ognl.parseExpression( srcExpression ), cycle.getPage(
> pageName ) );
> 
> ConsoleServicesFactory.getJasperReportExecutor().exportReportToPDF(
> p, response.getOutputStream());
>    } catch( Exception e ){
>      throw new ServletException( e );
>    }
>  }
> 
>  public ILink getLink( IRequestCycle iRequestCycle,
> IComponent iComponent, Object[] params ){
>      return this.constructLink(
> iRequestCycle,getName(),null, params,false );
>  }
> 
> }
> 
> --- Chris Chiappone <ch...@gmail.com> wrote:
> 
> > To be more clear I am trying to figure out if I
> > create an asset that
> > is used to bring up the pdf of document.  Is that
> > the way I should do
> > this?
> >
> > On 8/1/05, Chris Chiappone <ch...@gmail.com>
> > wrote:
> > > Hi I was wonder what is the best approach when
> > creating a link to a
> > > blob in my db.  The blob would be a pdf or other
> > type of document.
> > >
> > > --
> > > ~chris
> > >
> >
> >
> > --
> > ~chris
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> >
> >
> 
> 
> Konstantin Ignatyev
> 
> 
> 
> 
> PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000
> 
> Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  New York:  State University of New York Press, 1997: (4) (5) (p.206)
> 


-- 
~chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to create a link to a blob

Posted by Konstantin Ignatyev <kg...@yahoo.com>.
See Chart example in Workbench.
http://jakarta.apache.org/tapestry/UsersGuide/upgrade.html#upgrade.service

I guess you will just write bytes, but still need a
parameter to get to know from where to grab those
bytes.


--- Chris Chiappone <ch...@gmail.com> wrote:

> Where is documentation on the use of tapestry
> services?  In my case
> would I just print the byte array to the respone
> after i get it?
> 
> On 8/1/05, Konstantin Ignatyev
> <kg...@yahoo.com> wrote:
> > Simply create a PDF service that will do that,
> > something like this:
> > in application.xml
> > 
> >  <service name="JasperToPDFService"
> > class="xxx.JasperToPDFService" />
> > 
> > 
> > public class JasperToPDFService extends
> > AbstractService{
> > 
> >  public static final String SERVICE_NAME =
> > "JasperToPDFService";
> > 
> >  public String getName(){
> >    return SERVICE_NAME;
> >  }
> > 
> >  /**
> >   * parameters[page,ognlExpressionToGetSource]
> >   * @param iEngineServiceView
> >   * @param cycle
> >   * @param responseOutputStream
> >   * @throws javax.servlet.ServletException
> >   * @throws java.io.IOException
> >   */
> >  public void service( IEngineServiceView
> > iEngineServiceView, IRequestCycle cycle,
> > ResponseOutputStream responseOutputStream ) throws
> > ServletException, IOException{
> >    Object[] params = getParameters( cycle ) ;
> >    String pageName = (String) params[0];
> >    String srcExpression = (String) params[1];
> >    responseOutputStream.setContentType(
> > "application/pdf" );
> >    HttpServletResponse response =
> > cycle.getRequestContext().getResponse();
> >    response.setHeader("Expires", "0");
> >    response.setHeader("Cache-Control",
> > "must-revalidate, post-check=0, pre-check=0");
> >    response.setHeader("Pragma", "public");
> >    response.setHeader("Content-Disposition",
> > "attachment; filename=\"" + pageName +".pdf\"");
> >    try{
> >      JasperPrint p = (JasperPrint) Ognl.getValue(
> > Ognl.parseExpression( srcExpression ),
> cycle.getPage(
> > pageName ) );
> > 
> >
>
ConsoleServicesFactory.getJasperReportExecutor().exportReportToPDF(
> > p, response.getOutputStream());
> >    } catch( Exception e ){
> >      throw new ServletException( e );
> >    }
> >  }
> > 
> >  public ILink getLink( IRequestCycle
> iRequestCycle,
> > IComponent iComponent, Object[] params ){
> >      return this.constructLink(
> > iRequestCycle,getName(),null, params,false );
> >  }
> > 
> > }
> > 
> > --- Chris Chiappone <ch...@gmail.com> wrote:
> > 
> > > To be more clear I am trying to figure out if I
> > > create an asset that
> > > is used to bring up the pdf of document.  Is
> that
> > > the way I should do
> > > this?
> > >
> > > On 8/1/05, Chris Chiappone <ch...@gmail.com>
> > > wrote:
> > > > Hi I was wonder what is the best approach when
> > > creating a link to a
> > > > blob in my db.  The blob would be a pdf or
> other
> > > type of document.
> > > >
> > > > --
> > > > ~chris
> > > >
> > >
> > >
> > > --
> > > ~chris
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > > tapestry-user-help@jakarta.apache.org
> > >
> > >
> > 
> > 
> > Konstantin Ignatyev
> > 
> > 
> > 
> > 
> > PS: If this is a typical day on planet earth,
> humans will add fifteen million tons of carbon to
> the atmosphere, destroy 115 square miles of tropical
> rainforest, create seventy-two miles of desert,
> eliminate between forty to one hundred species,
> erode seventy-one million tons of topsoil, add 2,700
> tons of CFCs to the stratosphere, and increase their
> population by 263,000
> > 
> > Bowers, C.A.  The Culture of Denial:  Why the
> Environmental Movement Needs a Strategy for
> Reforming Universities and Public Schools.  New
> York:  State University of New York Press, 1997: (4)
> (5) (p.206)
> > 
> 
> 
> -- 
> ~chris
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 


Konstantin Ignatyev




PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000

Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  New York:  State University of New York Press, 1997: (4) (5) (p.206)

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to create a link to a blob

Posted by Chris Chiappone <ch...@gmail.com>.
Where is documentation on the use of tapestry services?  In my case
would I just print the byte array to the respone after i get it?

On 8/1/05, Konstantin Ignatyev <kg...@yahoo.com> wrote:
> Simply create a PDF service that will do that,
> something like this:
> in application.xml
> 
>  <service name="JasperToPDFService"
> class="xxx.JasperToPDFService" />
> 
> 
> public class JasperToPDFService extends
> AbstractService{
> 
>  public static final String SERVICE_NAME =
> "JasperToPDFService";
> 
>  public String getName(){
>    return SERVICE_NAME;
>  }
> 
>  /**
>   * parameters[page,ognlExpressionToGetSource]
>   * @param iEngineServiceView
>   * @param cycle
>   * @param responseOutputStream
>   * @throws javax.servlet.ServletException
>   * @throws java.io.IOException
>   */
>  public void service( IEngineServiceView
> iEngineServiceView, IRequestCycle cycle,
> ResponseOutputStream responseOutputStream ) throws
> ServletException, IOException{
>    Object[] params = getParameters( cycle ) ;
>    String pageName = (String) params[0];
>    String srcExpression = (String) params[1];
>    responseOutputStream.setContentType(
> "application/pdf" );
>    HttpServletResponse response =
> cycle.getRequestContext().getResponse();
>    response.setHeader("Expires", "0");
>    response.setHeader("Cache-Control",
> "must-revalidate, post-check=0, pre-check=0");
>    response.setHeader("Pragma", "public");
>    response.setHeader("Content-Disposition",
> "attachment; filename=\"" + pageName +".pdf\"");
>    try{
>      JasperPrint p = (JasperPrint) Ognl.getValue(
> Ognl.parseExpression( srcExpression ), cycle.getPage(
> pageName ) );
> 
> ConsoleServicesFactory.getJasperReportExecutor().exportReportToPDF(
> p, response.getOutputStream());
>    } catch( Exception e ){
>      throw new ServletException( e );
>    }
>  }
> 
>  public ILink getLink( IRequestCycle iRequestCycle,
> IComponent iComponent, Object[] params ){
>      return this.constructLink(
> iRequestCycle,getName(),null, params,false );
>  }
> 
> }
> 
> --- Chris Chiappone <ch...@gmail.com> wrote:
> 
> > To be more clear I am trying to figure out if I
> > create an asset that
> > is used to bring up the pdf of document.  Is that
> > the way I should do
> > this?
> >
> > On 8/1/05, Chris Chiappone <ch...@gmail.com>
> > wrote:
> > > Hi I was wonder what is the best approach when
> > creating a link to a
> > > blob in my db.  The blob would be a pdf or other
> > type of document.
> > >
> > > --
> > > ~chris
> > >
> >
> >
> > --
> > ~chris
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> >
> >
> 
> 
> Konstantin Ignatyev
> 
> 
> 
> 
> PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000
> 
> Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  New York:  State University of New York Press, 1997: (4) (5) (p.206)
> 


-- 
~chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to create a link to a blob

Posted by Konstantin Ignatyev <kg...@yahoo.com>.
Simply create a PDF service that will do that,
something like this:
in application.xml

 <service name="JasperToPDFService"
class="xxx.JasperToPDFService" />


public class JasperToPDFService extends
AbstractService{

  public static final String SERVICE_NAME =
"JasperToPDFService";

  public String getName(){
    return SERVICE_NAME;
  }

  /**
   * parameters[page,ognlExpressionToGetSource]
   * @param iEngineServiceView
   * @param cycle
   * @param responseOutputStream
   * @throws javax.servlet.ServletException
   * @throws java.io.IOException
   */
  public void service( IEngineServiceView
iEngineServiceView, IRequestCycle cycle,
ResponseOutputStream responseOutputStream ) throws
ServletException, IOException{
    Object[] params = getParameters( cycle ) ;
    String pageName = (String) params[0];
    String srcExpression = (String) params[1];
    responseOutputStream.setContentType(
"application/pdf" );
    HttpServletResponse response =
cycle.getRequestContext().getResponse();
    response.setHeader("Expires", "0");
    response.setHeader("Cache-Control",
"must-revalidate, post-check=0, pre-check=0");
    response.setHeader("Pragma", "public");
    response.setHeader("Content-Disposition",
"attachment; filename=\"" + pageName +".pdf\"");
    try{
      JasperPrint p = (JasperPrint) Ognl.getValue(
Ognl.parseExpression( srcExpression ), cycle.getPage(
pageName ) );
     
ConsoleServicesFactory.getJasperReportExecutor().exportReportToPDF(
p, response.getOutputStream());
    } catch( Exception e ){
      throw new ServletException( e );
    }
  }

  public ILink getLink( IRequestCycle iRequestCycle,
IComponent iComponent, Object[] params ){
      return this.constructLink(
iRequestCycle,getName(),null, params,false );
  }

}

--- Chris Chiappone <ch...@gmail.com> wrote:

> To be more clear I am trying to figure out if I
> create an asset that
> is used to bring up the pdf of document.  Is that
> the way I should do
> this?
> 
> On 8/1/05, Chris Chiappone <ch...@gmail.com>
> wrote:
> > Hi I was wonder what is the best approach when
> creating a link to a
> > blob in my db.  The blob would be a pdf or other
> type of document.
> > 
> > --
> > ~chris
> > 
> 
> 
> -- 
> ~chris
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 


Konstantin Ignatyev




PS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000

Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools.  New York:  State University of New York Press, 1997: (4) (5) (p.206)

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: How to create a link to a blob

Posted by Chris Chiappone <ch...@gmail.com>.
To be more clear I am trying to figure out if I create an asset that
is used to bring up the pdf of document.  Is that the way I should do
this?

On 8/1/05, Chris Chiappone <ch...@gmail.com> wrote:
> Hi I was wonder what is the best approach when creating a link to a
> blob in my db.  The blob would be a pdf or other type of document.
> 
> --
> ~chris
> 


-- 
~chris

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org