You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Dana Cordes <dc...@warmfuzzyland.com> on 2004/02/05 01:47:34 UTC

HTML Generator Question

I'm looking to pull XML from another webserver (in this case a Lotus Domino server) and integrate that into my pipeline.  The problem is that the remote site requires a login.  Fortunately, I can redirect from that login directly to the xml I want, so I get get the XML in a single request.  The problem is that I need to send a bunch of parameters along with the request.
Here's a snippet from my sitemap.xmap

    <map:match pattern="hi.html">
     <map:generate src="http://DOMINOSERVER/mail/username.nsf?Login&Username=me&Password=pass&RedirectTo=/mail/username.nsf/($Inbox)?ReadViewEntries" type="xml"/>
     <map:transform src="style/xsl/process.xsl"/>
     <map:serialize type="html"/>
    </map:match>

But, this of course doesn't work since the "&" character that I use in the url src is a no no in an XML document.  If I replace the "&" with "&amp;" or even "&#x0026;" or "&#38;" the url does not resolve correctly, and I cannot get my content.  Is there another, better way to do this?  I'd use the WebServiceProxyGenerator but I'd find the same problem there.  Is there a way for me to pass request parameters to a url and get the content back in the HTML or File Generator?


I've seen this come up in the mail archives regarding POST requests, but I haven't found a real clear answer yet.

-Dana Cordes

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


Re: HTML Generator Question

Posted by Joerg Heinicke <jo...@gmx.de>.
On 05.02.2004 20:31, Dana Cordes wrote:

>  > That & does not work is clear, but I don't see any reason why &amp;
>  > shall not work.
> 
> No only does it not respond to anything by an 
> actual "&" character, but the parameters are expected in a specific 
> order.

I don't get the first part of the sentence. What I meant when saying the 
&amp; should work it the fact that &amp; is only the XML escaping for &. 
This means the generator does indeed send a & to the server.

> The other being that the HTML Generator can handle non well formed xml, 
> and fix it.  I don't trust these systems to spit out well formed xml all 
> the time, so that's why I'm using that one.

I see.

> The Proxy Generator still 
> won't help me get around my ampersand problem.

Which should not exist :)

> Is there any way for me to use an actual & character in any block to 
> help me get this external data?  Besides making changes to, or rewriting 
> one of those generators?  I think something like this would be ideal:
>  <map:match pattern="hi.html">
>     <map:generate src="http://DOMINOSERVER/mail/username.nsf">
>     <map:parameter name="Login" value=""/>
>     <map:parameter name="Username" value="me"/>
>     <map:parameter name="Password" value="Password"/>
>     <map:parameter name="RedirectTo" 
> value="/mail/username.nsf/($Inbox)?ReadViewEntries"/>
>     </map:generate>
>     <map:transform src="style/xsl/process.xsl"/>
>     <map:serialize type="html"/>
>  </map:match>

This would avoid misunderstandings about & and &amp; but not solve the 
problem as written above. The problem must be somewhere else. Do you 
have an access log for the domino server? Try to look whether the 
request came in correctly. You can also do debugging to Cocoon and see 
if the request is fired correctly.

Joerg

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


Re: HTML Generator Question

Posted by Dana Cordes <dc...@warmfuzzyland.com>.
Thanks for the response Joerg!  I appreciate your input.

 > That & does not work is clear, but I don't see any reason why &amp;
 > shall not work.

This seems to be a limitation of the Domino server that I am attempting to communicate with.  No only does it not respond to anything by an actual "&" character, but the parameters are expected in a specific order.  It's not so much fun working with closed systems like that.  Alas, it's my job to make this work, or find another integration solution for my company...  =(

 > The difference of the wsproxy is that you can send the request with the
 > POST method.

The other being that the HTML Generator can handle non well formed xml, and fix it.  I don't trust these systems to spit out well formed xml all the time, so that's why I'm using that one.  The Proxy Generator still won't help me get around my ampersand problem.

Is there any way for me to use an actual & character in any block to help me get this external data?  Besides making changes to, or rewriting one of those generators?  I think something like this would be ideal:
  <map:match pattern="hi.html">
     <map:generate src="http://DOMINOSERVER/mail/username.nsf">
	<map:parameter name="Login" value=""/>
	<map:parameter name="Username" value="me"/>
	<map:parameter name="Password" value="Password"/>
	<map:parameter name="RedirectTo" value="/mail/username.nsf/($Inbox)?ReadViewEntries"/>
     </map:generate>
     <map:transform src="style/xsl/process.xsl"/>
     <map:serialize type="html"/>
  </map:match>

Or something to that effect...

-Dana Cordes

Joerg Heinicke wrote:
> On 05.02.2004 01:47, Dana Cordes wrote:
> 
>>     <map:generate 
>> src="http://DOMINOSERVER/mail/username.nsf?Login&Username=me&Password=pass&RedirectTo=/mail/username.nsf/($Inbox)?ReadViewEntries" 
>> type="xml"/>
>>
>> But, this of course doesn't work since the "&" character that I use in 
>> the url src is a no no in an XML document.  If I replace the "&" with 
>> "&amp;" or even "&#x0026;" or "&#38;" the url does not resolve 
>> correctly, and I cannot get my content.
> 
> 
> That & does not work is clear, but I don't see any reason why &amp; 
> shall not work.
> 
>>  Is there another, better way to do this?  I'd use the 
>> WebServiceProxyGenerator but I'd find the same problem there.
> 
> 
> The difference of the wsproxy is that you can send the request with the 
> POST method.
> 
>> I've seen this come up in the mail archives regarding POST requests, 
>> but I haven't found a real clear answer yet.
> 
> 
> I only remember problems when you want to reuse request parameters sent 
> to Cocoon on the request to the other server. There was a problem with 
> encoded and decoded parameters, but not with an URL built like yours above.
> 
> Joerg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


-- 
"A lot of nerds who graduated from AD&D and couldn't get their fix probably moved on to Scientology. It provides a lot of the same attractions. Geekiness, advancement levels, psionics, continued financial investment."
--http://www.rotten.com/library/culture/dungeons-dragons/

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


Re: HTML Generator Question

Posted by Joerg Heinicke <jo...@gmx.de>.
On 05.02.2004 01:47, Dana Cordes wrote:

>     <map:generate 
> src="http://DOMINOSERVER/mail/username.nsf?Login&Username=me&Password=pass&RedirectTo=/mail/username.nsf/($Inbox)?ReadViewEntries" 
> type="xml"/>
> 
> But, this of course doesn't work since the "&" character that I use in 
> the url src is a no no in an XML document.  If I replace the "&" with 
> "&amp;" or even "&#x0026;" or "&#38;" the url does not resolve 
> correctly, and I cannot get my content.

That & does not work is clear, but I don't see any reason why &amp; 
shall not work.

>  Is there another, better way to 
> do this?  I'd use the WebServiceProxyGenerator but I'd find the same 
> problem there.

The difference of the wsproxy is that you can send the request with the 
POST method.

> I've seen this come up in the mail archives regarding POST requests, but 
> I haven't found a real clear answer yet.

I only remember problems when you want to reuse request parameters sent 
to Cocoon on the request to the other server. There was a problem with 
encoded and decoded parameters, but not with an URL built like yours above.

Joerg

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