cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sreenivasan N." <sreenivasa...@ap.sony.com>
Subject Re: Doubt which cocoon-user mailing list couldn't solve
Date Fri, 18 Oct 2002 12:04:16 GMT
Hi

Both the suggestions said, works only if  one page is generated .

but in my case i am using an xsp code which cam generate two pages.
  First generates a  FORM  which takes values form the 
user(GROUPID,PROJECTSTATUS) though a list box.
And depending on these values and on the click of a "SUBMIT" button another 
page is generated (which will be according to the code after "else").

Suppose i do what you have suggested(either ways),i get only the pdf format 
of the first page(FORM page) .
but i require to convert only the last page which will be the final output 
to pdf .

The code for the xsp is given below.


<?xml version="1.0" encoding="ISO-8859-1"?>



<xsp:page language="java"
           xmlns:xsp="http://apache.org/xsp"
           xmlns:xsp-request="http://apache.org/xsp/request/2.0"
           xmlns:xsp-hello="http://apache.org/xsp/hello/1.0"
           xmlns:esql="http://apache.org/cocoon/SQL/v2"
           xmlns:source="http://apache.org/cocoon/source/1.0"


 >

<xsp:structure>
     <xsp:include>java.util.Enumeration</xsp:include>
   </xsp:structure>



   <page>
     <title>Greetings Page</title>
       <content>


         <esql:connection>
          <esql:pool>ora</esql:pool>


       <xsp:logic>

       String[] value = request.getParameterValues("user_groups.uid");
                 String value1 = request.getParameter("user_groups.gid");
         String name = <xsp-request:get-parameter 
name="PIS_PROJECTS.PROJECTNAME"/>;
         int i =0;



           if (name == null) {
             <para>
                 <!-- Print default greeting -->




             <form>



               <!-- list box1 which will populate values from the 
table  -->
               <select multiple="1" name="user_groups.uid" size="7">
                         <esql:execute-query>
                               <esql:query>select distinct GROUPID from 
PIS_PROJECTS</esql:query>
                                <esql:results>
                                       <esql:row-results>
                                        <option>
                                          <xsp:attribute 
name="value"><esql:get-string column="GROUPID"/></xsp:attribute>
                                          <esql:get-string column="GROUPID"/>
                                        </option>
                                    </esql:row-results>
                                </esql:results>
                        </esql:execute-query>
               </select>



             <!-- list box2 which will populate values from the table  -->
               <select multiple="1" name="user_groups.gid" size="7">
                         <esql:execute-query>
                               <esql:query>select distinct PROJECTSTATUS 
from PIS_PROJECTS</esql:query>
                                <esql:results>
                                       <esql:row-results>
                                        <option>
                                          <xsp:attribute 
name="value"><esql:get-string column="PROJECTSTATUS"/></xsp:attribute>
                                          <esql:get-string 
column="PROJECTSTATUS"/>
                                        </option>
                                    </esql:row-results>
                                </esql:results>
                        </esql:execute-query>
               </select>



               <input type="hidden" name="user_groups.uid"/>
               <input type="hidden" name="PIS_PROJECTS.PROJECTNAME"/>



                  <input name="submit" type="submit" value="submit"/>

             </form>


           </para>
         }

         else
           {

           <title>Greetings Page</title>






                       for (i=0; i &lt; value.length-1; i++)
                                   {
                                      <body bgcolor="lightgreen">
                                      <table  border ="1" 
bordercolor="blue" align="center">



                                        <tr><th> PROJECTID </th>
                                             <th> PROJECTNAME 
</th>
                                             <th> DESCRIPTION  </th>
                                             <th> GROUPID  </th>
                                        </tr>




                                         <!-- Passing values captured from 
list box as a query  -->

                                   <esql:execute-query>
                                     <esql:query>select * from PIS_PROJECTS 
where PROJECTSTATUS in ('<xsp:expr>value1</xsp:expr>') and GROUPID in 
('<xsp:expr>value[i]</xsp:expr>')</esql:query>
                                        <esql:results>
                                             <esql:row-results>
                                                  <tr>
                                                      <td><esql:get-string 
column="PROJECTID"/></td>
                                                      <td><esql:get-string 
column="PROJECTNAME"/></td>
                                                      <td><esql:get-string 
column="DESCRIPTION"/>
                                                      </td><td><esql:get-string

column="GROUPID"/></td>
                                                  </tr>

                                               </esql:row-results>
                                         </esql:results>
                                       </esql:execute-query>

                                         </table>

                                 </body>

                                 <br/>
                                 <br/>
                   <br/>



                                                  }







         }

       </xsp:logic>
       </esql:connection>
     </content>






   </page>



</xsp:page>


At 02:19 PM 10/11/02 +0200, you wrote:
>To get a PDF, you must have an XML file. See if you can use a pipeline which
>outputs xml and another one which matches the link to the pdf for example,
>so that the second pipeline can call the first one.
>
>Or, after the xsp transformation, use an xsl fo stylesheet (transform
>src="myxslfo.xsl") then serialize as pdf (serialize type="fo2pdf"). This
>should work fine.
>
>Just my 2 cents,
>
>Babs
>----- Original Message -----
>From: "Sreenivasan N." <sreenivasan.n@ap.sony.com>
>To: <stefano@apache.org>
>Cc: <cocoon-users@xml.apache.org>
>Sent: Friday, October 11, 2002 1:47 PM
>Subject: Doubt which cocoon-user mailing list couldn't solve
>
>
> > Hi Stefano
> >
> > This is sreenivasan from India. Infact i am contacting you for the second
> > time personally.  I am working for a company as a consultant to develop an
> > xml based intranet and also as a add-on to a product.
> >
> > The requirement is something like this. We have got two set of category
> > like admin and user. The admin will be able to create templates for the
> > users where the user enter data and xml file is generated (We are using
> > Chiba for this ). Is there any good mean to achieve this. Now there is a
> > performance issue is there.
> >
> > We will be generating html, xml, rtf and pdf from a query to database
>based
> > on a form. That is XSP page is loaded with listbox where value to be send
> > as parameter is taken from the database. Once the query is executed the
> > user should have a flexible to take the output as pdf, rtf. Now the
>problem
> > is our sitemap is like this
> >
> > <map:match pattern="xsp/*">
> > <map:generate src="docs/samples/xsp/{1}.xsp" type="serverpages"/>
> > <map:transform src="stylesheets/dynamic-page2html.xsl">
> > </map:transform>
> > <map:serialize type="html"/>
> > </map:match>
> >
> > When we click on the link the xsp with parameter data is loaded. After
> > query i couldn't capture the output if i want to generate pdf since the
> > pipeline to over.
> >
> > And also is there any way to generate charts where data comming from
> > database? we could generate pie chart from a static xml but legends are
>not
> > dynamic.
> >
> > I will be grateful if you suggest someway because we have to finalize our
> > requirement.
> >
> > Regards
> > Sreenivasan.
> >
> >
> >
> >
> >
> >
> >
> > "Attitudes are much more important than aptitudes."
> > "Nothing is impossible for a willing heart"
> >
> > Sreenivasan N.
> > Sony SARD
> > Ext 5816
> >
> > Email. sreenivasan.n@ap.sony.com
> > Per: nsreenivasan@yahoo.com
> >
> >
> > ---------------------------------------------------------------------
> > Please check that your question  has not already been answered in the
> > FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> > For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
> >
> > ______________________________________________________________________
> > Etudiant: Wanadoo t'offre le Pack eXtense Haut D├ębit soit 150,92 euros
> > d'├ęconomies ! Clique ici : http://www.ifrance.com/_reloc/mail.etudiant
>
>
>---------------------------------------------------------------------
>Please check that your question  has not already been answered in the
>FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
>To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
>For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>








"Attitudes are much more important than aptitudes."
"Nothing is impossible for a willing heart"

Sreenivasan N.
Sony SARD
Ext 5816

Email. sreenivasan.n@ap.sony.com
Per: nsreenivasan@yahoo.com


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message