You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Omar Adobati <om...@gmail.com> on 2006/08/28 16:27:35 UTC

SendMail Action problem

Good Morning,

  based on what write at
http://cocoon.apache.org/2.1/userdocs/optional/sendmail-action.html
I'm trying to develop a small app to send mails (yes, still doing this
:P).

But I think I have a problems/questions:

1. If i left the form "blank" I have an error the tell me no pipeline
matches for my request... It seems to ignore the <map:act> tag... is
this the correct way it should work? I was expected to have back an
error "status" (user-error status) reporting the blank form, but it
wasn't. So, there's a way to avoid this or I need a kind of javascript
control to prevent the form to be submitted?

2. the action, instead of the problem at point 1, works nice. It could
send e-mails. But a strange thinks happened too. It sends e-mail
without configuration for the MTA. How it is possible? I was expected
to have a kind of server-error status...

3. There's a way to pout on a web page the values that an action gives
back to the sitemap? It would be useful to a debug process...

Looking to my results, my idea is that I can have back just the
success status, and no user/server-error status. This because I can
have the pipeline works good only if i fill the form in the correct
way...

Am I wrong in anything? here follow the snippet of my sitmap.xmap file:

<!-- Sendmail Action -->
      <map:match pattern="send">
        <map:act type="sendmail">

          <!-- To override defaults specified in cocoon.xconf: --> 	
          <map:parameter name="smtp-host" value="smtp.unimi.it"/>
          <map:parameter name="smtp-user" value=""/>
    	  <map:parameter name="smtp-password" value=""/>       	
    	
    	  <map:parameter name="from" value="{request-param:from}"/>
    	  <map:parameter name="to" value="{request-param:to}"/>
    	  <map:parameter name="subject" value="{request-param:subject}"/>
    	  <map:parameter name="body" value="{request-param:body}"/>
    	  <map:parameter name="cc" value="{request-param:cc}"/>    	
    	  <map:parameter name="charset" value="ISO-8859-1"/>
    	
          <map:generate src="xsp/{status}.xsp"/>
          <map:serialize type="xml"/>
        </map:act>
      </map:match>


-- 
Omar Adobati

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


Re: SendMail Action problem

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 8/28/06, Omar Adobati <om...@gmail.com> wrote:

> ...3. There's a way to pout on a web page the values that an action gives
> back to the sitemap? It would be useful to a debug process...

I haven't checked which values that particular action sets, but yes,
the values of any action can be output, for example:

<map:act type="foo">
  <map:generate src="bar"/>
  <map:transform src="foo.xsl">
    <map:parameter name="valueOneFromAction" value="{valueOneFromAction}"/>
    <map:parameter name="valueTwoFromAction" value="{valueTwoFromAction}"/>
  </map:transform>

And get the values with <xsl:param name="valueOneFromAction"/> in the XSLT.

-Bertrand

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


Re: SendMail Action problem

Posted by Kamal Bhatt <kb...@tt.com.au>.
Omar Adobati wrote:
> On 8/29/06, Kamal Bhatt <kb...@tt.com.au> wrote:
>> Omar Adobati wrote:
>> > Good Morning,
>> >
>> >  based on what write at
>> > http://cocoon.apache.org/2.1/userdocs/optional/sendmail-action.html
>> > I'm trying to develop a small app to send mails (yes, still doing this
>> > :P).
>> >
>> > But I think I have a problems/questions:
>> >
>> > 1. If i left the form "blank" I have an error the tell me no pipeline
>> > matches for my request... It seems to ignore the <map:act> tag... is
>> > this the correct way it should work? I was expected to have back an
>> > error "status" (user-error status) reporting the blank form, but it
>> > wasn't. So, there's a way to avoid this or I need a kind of javascript
>> > control to prevent the form to be submitted?
>> >
>> > 2. the action, instead of the problem at point 1, works nice. It could
>> > send e-mails. But a strange thinks happened too. It sends e-mail
>> > without configuration for the MTA. How it is possible? I was expected
>> > to have a kind of server-error status...
>> >
>> > 3. There's a way to pout on a web page the values that an action gives
>> > back to the sitemap? It would be useful to a debug process...
>> >
>> > Looking to my results, my idea is that I can have back just the
>> > success status, and no user/server-error status. This because I can
>> > have the pipeline works good only if i fill the form in the correct
>> > way...
>> >
>> > Am I wrong in anything? here follow the snippet of my sitmap.xmap 
>> file:
>> >
>> > <!-- Sendmail Action -->
>> >      <map:match pattern="send">
>> >        <map:act type="sendmail">
>> >
>> >          <!-- To override defaults specified in cocoon.xconf: -->
>> >          <map:parameter name="smtp-host" value="smtp.unimi.it"/>
>> >          <map:parameter name="smtp-user" value=""/>
>> >          <map:parameter name="smtp-password" value=""/>
>> >
>> >          <map:parameter name="from" value="{request-param:from}"/>
>> >          <map:parameter name="to" value="{request-param:to}"/>
>> >          <map:parameter name="subject" 
>> value="{request-param:subject}"/>
>> >          <map:parameter name="body" value="{request-param:body}"/>
>> >          <map:parameter name="cc" value="{request-param:cc}"/>
>> >          <map:parameter name="charset" value="ISO-8859-1"/>
>> >
>> >          <map:generate src="xsp/{status}.xsp"/>
>> >          <map:serialize type="xml"/>
>> >        </map:act>
>> >      </map:match>
>> >
>> >
>
>> Try passing status into your XSP as a parameter.
>
> How I could pass the status to an XSP Page?
> Anyway, browsing the ML archives I found that the problem I'm having
> is a bug, but I'm wondering about why it "still" is a bug....
>
Sorry, my mistake, misunderstood the problem.
>> -- 
>> Kamal Bhatt
>
> Omar
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


-- 
Kamal Bhatt


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


Re: SendMail Action problem

Posted by Omar Adobati <om...@gmail.com>.
On 8/29/06, Kamal Bhatt <kb...@tt.com.au> wrote:
> Omar Adobati wrote:
> > Good Morning,
> >
> >  based on what write at
> > http://cocoon.apache.org/2.1/userdocs/optional/sendmail-action.html
> > I'm trying to develop a small app to send mails (yes, still doing this
> > :P).
> >
> > But I think I have a problems/questions:
> >
> > 1. If i left the form "blank" I have an error the tell me no pipeline
> > matches for my request... It seems to ignore the <map:act> tag... is
> > this the correct way it should work? I was expected to have back an
> > error "status" (user-error status) reporting the blank form, but it
> > wasn't. So, there's a way to avoid this or I need a kind of javascript
> > control to prevent the form to be submitted?
> >
> > 2. the action, instead of the problem at point 1, works nice. It could
> > send e-mails. But a strange thinks happened too. It sends e-mail
> > without configuration for the MTA. How it is possible? I was expected
> > to have a kind of server-error status...
> >
> > 3. There's a way to pout on a web page the values that an action gives
> > back to the sitemap? It would be useful to a debug process...
> >
> > Looking to my results, my idea is that I can have back just the
> > success status, and no user/server-error status. This because I can
> > have the pipeline works good only if i fill the form in the correct
> > way...
> >
> > Am I wrong in anything? here follow the snippet of my sitmap.xmap file:
> >
> > <!-- Sendmail Action -->
> >      <map:match pattern="send">
> >        <map:act type="sendmail">
> >
> >          <!-- To override defaults specified in cocoon.xconf: -->
> >          <map:parameter name="smtp-host" value="smtp.unimi.it"/>
> >          <map:parameter name="smtp-user" value=""/>
> >          <map:parameter name="smtp-password" value=""/>
> >
> >          <map:parameter name="from" value="{request-param:from}"/>
> >          <map:parameter name="to" value="{request-param:to}"/>
> >          <map:parameter name="subject" value="{request-param:subject}"/>
> >          <map:parameter name="body" value="{request-param:body}"/>
> >          <map:parameter name="cc" value="{request-param:cc}"/>
> >          <map:parameter name="charset" value="ISO-8859-1"/>
> >
> >          <map:generate src="xsp/{status}.xsp"/>
> >          <map:serialize type="xml"/>
> >        </map:act>
> >      </map:match>
> >
> >

> Try passing status into your XSP as a parameter.

How I could pass the status to an XSP Page?
Anyway, browsing the ML archives I found that the problem I'm having
is a bug, but I'm wondering about why it "still" is a bug....

> --
> Kamal Bhatt

Omar

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


Re: SendMail Action problem

Posted by Kamal Bhatt <kb...@tt.com.au>.
Omar Adobati wrote:
> Good Morning,
>
>  based on what write at
> http://cocoon.apache.org/2.1/userdocs/optional/sendmail-action.html
> I'm trying to develop a small app to send mails (yes, still doing this
> :P).
>
> But I think I have a problems/questions:
>
> 1. If i left the form "blank" I have an error the tell me no pipeline
> matches for my request... It seems to ignore the <map:act> tag... is
> this the correct way it should work? I was expected to have back an
> error "status" (user-error status) reporting the blank form, but it
> wasn't. So, there's a way to avoid this or I need a kind of javascript
> control to prevent the form to be submitted?
>
> 2. the action, instead of the problem at point 1, works nice. It could
> send e-mails. But a strange thinks happened too. It sends e-mail
> without configuration for the MTA. How it is possible? I was expected
> to have a kind of server-error status...
>
> 3. There's a way to pout on a web page the values that an action gives
> back to the sitemap? It would be useful to a debug process...
>
> Looking to my results, my idea is that I can have back just the
> success status, and no user/server-error status. This because I can
> have the pipeline works good only if i fill the form in the correct
> way...
>
> Am I wrong in anything? here follow the snippet of my sitmap.xmap file:
>
> <!-- Sendmail Action -->
>      <map:match pattern="send">
>        <map:act type="sendmail">
>
>          <!-- To override defaults specified in cocoon.xconf: -->    
>          <map:parameter name="smtp-host" value="smtp.unimi.it"/>
>          <map:parameter name="smtp-user" value=""/>
>          <map:parameter name="smtp-password" value=""/>          
>       
>          <map:parameter name="from" value="{request-param:from}"/>
>          <map:parameter name="to" value="{request-param:to}"/>
>          <map:parameter name="subject" value="{request-param:subject}"/>
>          <map:parameter name="body" value="{request-param:body}"/>
>          <map:parameter name="cc" value="{request-param:cc}"/>       
>          <map:parameter name="charset" value="ISO-8859-1"/>
>       
>          <map:generate src="xsp/{status}.xsp"/>
>          <map:serialize type="xml"/>
>        </map:act>
>      </map:match>
>
>
Try passing status into your XSP as a parameter. Are you sure that 
serverpage is the default generator? Also, try flowscript to control 
flow. I would recommend CForms, if you are using 2.1.7 for this. I would 
recommend CForms for 2.1.8 or beyond, but now they bundle those darn 
Ajax libraries, it isn't worth it for simple forms (much to my annoyance).

-- 
Kamal Bhatt


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