You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by SAXESS - Hussayn Dabbous <da...@saxess.com> on 2003/02/18 12:20:56 UTC

dynamic sitemap dependent on response mimetype ?

Hy;

Can i overcome following problem:

Within a match i read or aggregate some XML-sources from another
server, e.g.:

<map:match pattern="mypage">
   <map:generate  src="http://myserver/mypage.xml"/>
   <map:transform src="mypage.xsl"/>
   <map:serialize type = "html"/>
</map:match>

Now suppose, myserver does not send back the content of
mypage.xml, but another HTTP-200 response containing an
HTML message with some informal message in it, like
"site is currenlty down", or something similar.

What happens in the above case is, that my style sheet simply
gets something very different from what it expected. Possibly
even the response is not well formed... In fact getting the wrong
mimetype is an error, but what i received is still valuable and i
want to send this back instead of the expected xml-data:

What i search is a possibility to simply skip the transformation if i
get something else, than say "plain/xml" as mimetype back from
myserver. Instead doing the transformation, i want directly send back
what i gathered from myserver so far.
How can this be done ?

And going one step further what can i do in this case:

<map:match pattern="mypage">
   <map:generate  src="http://myserver/mypage"/>
   ...
</map:match>

Now lets say, i don't know at all, what mimetype myserver
will return, but i wanted to do something, if mimetype is plain/xml
and simply return the data as is in any other case...
How could i achieve this ?

Or is there something, that is so obvious and i simply
don't see it ?

regards, hussayn

-- 
Dr. Hussayn Dabbous
SAXESS Software Design GmbH
Neuenhöfer Allee 125
50935 Köln
Telefon: +49-221-56011-0
Fax:     +49-221-56011-20
E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: dynamic sitemap dependent on response mimetype ?

Posted by SAXESS - Hussayn Dabbous <da...@saxess.com>.
Hy;

My original problem came up, when i started to gather data
from another site under authentication. This site happened
to send back a login form instead of the expected XML-data
stream uppon first request. Unfortuntely the site did NOT
send back a HTTP-401 from which i could setup some error
handling.

It would have been great, when this login form could be
processed instead of the original datastream and handed
over to my browser instead of the expected data.
But the only hint i have here is the mime type i get back.
And even this gets broken, if the errorpage would also be
an XML-document.
OK, the whole things needs a major rethought anyway...
thanks again for your support  ;-)

hussayn

Geoff Howard wrote:
> At 10:23 AM 2/18/2003, you wrote:
> 
>> Anyway i think, your answer saved me from
>> doing unnecessary experiments...
>>
>> regards, Hussayn
> 
> 
> Good - that's why I wrote that despite not really having time to 
> understand fully what you were trying to do. ;)
> 
> Geoff
> 
>> Geoff Howard wrote:
>>
>>> Sounds like you're asking to dynamically affect the pipeline setup 
>>> after the generator is called which is by design impossible.  If so, 
>>> you'll need a component that executes before pipeline setup (which 
>>> therefore can alter pipeline setup) which limits you to actions, 
>>> matchers, and selectors.  (did i miss one?)  Most likely, you're 
>>> going to want an action.
>>> Geoff
>>> At 06:20 AM 2/18/2003, you wrote:
>>>
>>>> Hy;
>>>>
>>>> Can i overcome following problem:
>>>>
>>>> Within a match i read or aggregate some XML-sources from another
>>>> server, e.g.:
>>>>
>>>> <map:match pattern="mypage">
>>>>   <map:generate  src="http://myserver/mypage.xml"/>
>>>>   <map:transform src="mypage.xsl"/>
>>>>   <map:serialize type = "html"/>
>>>> </map:match>
>>>>
>>>> Now suppose, myserver does not send back the content of
>>>> mypage.xml, but another HTTP-200 response containing an
>>>> HTML message with some informal message in it, like
>>>> "site is currenlty down", or something similar.
>>>>
>>>> What happens in the above case is, that my style sheet simply
>>>> gets something very different from what it expected. Possibly
>>>> even the response is not well formed... In fact getting the wrong
>>>> mimetype is an error, but what i received is still valuable and i
>>>> want to send this back instead of the expected xml-data:
>>>>
>>>> What i search is a possibility to simply skip the transformation if i
>>>> get something else, than say "plain/xml" as mimetype back from
>>>> myserver. Instead doing the transformation, i want directly send back
>>>> what i gathered from myserver so far.
>>>> How can this be done ?
>>>>
>>>> And going one step further what can i do in this case:
>>>>
>>>> <map:match pattern="mypage">
>>>>   <map:generate  src="http://myserver/mypage"/>
>>>>   ...
>>>> </map:match>
>>>>
>>>> Now lets say, i don't know at all, what mimetype myserver
>>>> will return, but i wanted to do something, if mimetype is plain/xml
>>>> and simply return the data as is in any other case...
>>>> How could i achieve this ?
>>>>
>>>> Or is there something, that is so obvious and i simply
>>>> don't see it ?
>>>>
>>>> regards, hussayn
>>>>
>>>> -- 
>>>> Dr. Hussayn Dabbous
>>>> SAXESS Software Design GmbH
>>>> Neuenhöfer Allee 125
>>>> 50935 Köln
>>>> Telefon: +49-221-56011-0
>>>> Fax:     +49-221-56011-20
>>>> E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
>>>> For additional commands, e-mail:   <co...@xml.apache.org>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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:     <co...@xml.apache.org>
>>> For additional commands, e-mail:   <co...@xml.apache.org>
>>
>>
>> -- 
>> Dr. Hussayn Dabbous
>> SAXESS Software Design GmbH
>> Neuenhöfer Allee 125
>> 50935 Köln
>> Telefon: +49-221-56011-0
>> Fax:     +49-221-56011-20
>> E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
>> For additional commands, e-mail:   <co...@xml.apache.org>
>>
>>
> 
> 
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
> 

-- 
Dr. Hussayn Dabbous
SAXESS Software Design GmbH
Neuenhöfer Allee 125
50935 Köln
Telefon: +49-221-56011-0
Fax:     +49-221-56011-20
E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: dynamic sitemap dependent on response mimetype ?

Posted by Geoff Howard <co...@leverageweb.com>.
At 10:23 AM 2/18/2003, you wrote:

>Anyway i think, your answer saved me from
>doing unnecessary experiments...
>
>regards, Hussayn

Good - that's why I wrote that despite not really having time to understand 
fully what you were trying to do. ;)

Geoff

>Geoff Howard wrote:
>>Sounds like you're asking to dynamically affect the pipeline setup after 
>>the generator is called which is by design impossible.  If so, you'll 
>>need a component that executes before pipeline setup (which therefore can 
>>alter pipeline setup) which limits you to actions, matchers, and 
>>selectors.  (did i miss one?)  Most likely, you're going to want an action.
>>Geoff
>>At 06:20 AM 2/18/2003, you wrote:
>>
>>>Hy;
>>>
>>>Can i overcome following problem:
>>>
>>>Within a match i read or aggregate some XML-sources from another
>>>server, e.g.:
>>>
>>><map:match pattern="mypage">
>>>   <map:generate  src="http://myserver/mypage.xml"/>
>>>   <map:transform src="mypage.xsl"/>
>>>   <map:serialize type = "html"/>
>>></map:match>
>>>
>>>Now suppose, myserver does not send back the content of
>>>mypage.xml, but another HTTP-200 response containing an
>>>HTML message with some informal message in it, like
>>>"site is currenlty down", or something similar.
>>>
>>>What happens in the above case is, that my style sheet simply
>>>gets something very different from what it expected. Possibly
>>>even the response is not well formed... In fact getting the wrong
>>>mimetype is an error, but what i received is still valuable and i
>>>want to send this back instead of the expected xml-data:
>>>
>>>What i search is a possibility to simply skip the transformation if i
>>>get something else, than say "plain/xml" as mimetype back from
>>>myserver. Instead doing the transformation, i want directly send back
>>>what i gathered from myserver so far.
>>>How can this be done ?
>>>
>>>And going one step further what can i do in this case:
>>>
>>><map:match pattern="mypage">
>>>   <map:generate  src="http://myserver/mypage"/>
>>>   ...
>>></map:match>
>>>
>>>Now lets say, i don't know at all, what mimetype myserver
>>>will return, but i wanted to do something, if mimetype is plain/xml
>>>and simply return the data as is in any other case...
>>>How could i achieve this ?
>>>
>>>Or is there something, that is so obvious and i simply
>>>don't see it ?
>>>
>>>regards, hussayn
>>>
>>>--
>>>Dr. Hussayn Dabbous
>>>SAXESS Software Design GmbH
>>>Neuenhöfer Allee 125
>>>50935 Köln
>>>Telefon: +49-221-56011-0
>>>Fax:     +49-221-56011-20
>>>E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
>>>For additional commands, e-mail:   <co...@xml.apache.org>
>>>
>>
>>---------------------------------------------------------------------
>>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:     <co...@xml.apache.org>
>>For additional commands, e-mail:   <co...@xml.apache.org>
>
>--
>Dr. Hussayn Dabbous
>SAXESS Software Design GmbH
>Neuenhöfer Allee 125
>50935 Köln
>Telefon: +49-221-56011-0
>Fax:     +49-221-56011-20
>E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
>For additional commands, e-mail:   <co...@xml.apache.org>
>
>


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: dynamic sitemap dependent on response mimetype ?

Posted by SAXESS - Hussayn Dabbous <da...@saxess.com>.
Hy, Geoff;

Thank's for the info.
I hoped there was a better integrated solution.
Ok, then i have to think about what that means
for my current project in more detail.
Anyway i think, your answer saved me from
doing unnecessary experiments...

regards, Hussayn


Geoff Howard wrote:
> Sounds like you're asking to dynamically affect the pipeline setup after 
> the generator is called which is by design impossible.  If so, you'll 
> need a component that executes before pipeline setup (which therefore 
> can alter pipeline setup) which limits you to actions, matchers, and 
> selectors.  (did i miss one?)  Most likely, you're going to want an action.
> 
> Geoff
> 
> At 06:20 AM 2/18/2003, you wrote:
> 
>> Hy;
>>
>> Can i overcome following problem:
>>
>> Within a match i read or aggregate some XML-sources from another
>> server, e.g.:
>>
>> <map:match pattern="mypage">
>>   <map:generate  src="http://myserver/mypage.xml"/>
>>   <map:transform src="mypage.xsl"/>
>>   <map:serialize type = "html"/>
>> </map:match>
>>
>> Now suppose, myserver does not send back the content of
>> mypage.xml, but another HTTP-200 response containing an
>> HTML message with some informal message in it, like
>> "site is currenlty down", or something similar.
>>
>> What happens in the above case is, that my style sheet simply
>> gets something very different from what it expected. Possibly
>> even the response is not well formed... In fact getting the wrong
>> mimetype is an error, but what i received is still valuable and i
>> want to send this back instead of the expected xml-data:
>>
>> What i search is a possibility to simply skip the transformation if i
>> get something else, than say "plain/xml" as mimetype back from
>> myserver. Instead doing the transformation, i want directly send back
>> what i gathered from myserver so far.
>> How can this be done ?
>>
>> And going one step further what can i do in this case:
>>
>> <map:match pattern="mypage">
>>   <map:generate  src="http://myserver/mypage"/>
>>   ...
>> </map:match>
>>
>> Now lets say, i don't know at all, what mimetype myserver
>> will return, but i wanted to do something, if mimetype is plain/xml
>> and simply return the data as is in any other case...
>> How could i achieve this ?
>>
>> Or is there something, that is so obvious and i simply
>> don't see it ?
>>
>> regards, hussayn
>>
>> -- 
>> Dr. Hussayn Dabbous
>> SAXESS Software Design GmbH
>> Neuenhöfer Allee 125
>> 50935 Köln
>> Telefon: +49-221-56011-0
>> Fax:     +49-221-56011-20
>> E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
>> For additional commands, e-mail:   <co...@xml.apache.org>
>>
>>
> 
> 
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
> 

-- 
Dr. Hussayn Dabbous
SAXESS Software Design GmbH
Neuenhöfer Allee 125
50935 Köln
Telefon: +49-221-56011-0
Fax:     +49-221-56011-20
E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: dynamic sitemap dependent on response mimetype ?

Posted by Geoff Howard <co...@leverageweb.com>.
Sounds like you're asking to dynamically affect the pipeline setup after 
the generator is called which is by design impossible.  If so, you'll need 
a component that executes before pipeline setup (which therefore can alter 
pipeline setup) which limits you to actions, matchers, and selectors.  (did 
i miss one?)  Most likely, you're going to want an action.

Geoff

At 06:20 AM 2/18/2003, you wrote:
>Hy;
>
>Can i overcome following problem:
>
>Within a match i read or aggregate some XML-sources from another
>server, e.g.:
>
><map:match pattern="mypage">
>   <map:generate  src="http://myserver/mypage.xml"/>
>   <map:transform src="mypage.xsl"/>
>   <map:serialize type = "html"/>
></map:match>
>
>Now suppose, myserver does not send back the content of
>mypage.xml, but another HTTP-200 response containing an
>HTML message with some informal message in it, like
>"site is currenlty down", or something similar.
>
>What happens in the above case is, that my style sheet simply
>gets something very different from what it expected. Possibly
>even the response is not well formed... In fact getting the wrong
>mimetype is an error, but what i received is still valuable and i
>want to send this back instead of the expected xml-data:
>
>What i search is a possibility to simply skip the transformation if i
>get something else, than say "plain/xml" as mimetype back from
>myserver. Instead doing the transformation, i want directly send back
>what i gathered from myserver so far.
>How can this be done ?
>
>And going one step further what can i do in this case:
>
><map:match pattern="mypage">
>   <map:generate  src="http://myserver/mypage"/>
>   ...
></map:match>
>
>Now lets say, i don't know at all, what mimetype myserver
>will return, but i wanted to do something, if mimetype is plain/xml
>and simply return the data as is in any other case...
>How could i achieve this ?
>
>Or is there something, that is so obvious and i simply
>don't see it ?
>
>regards, hussayn
>
>--
>Dr. Hussayn Dabbous
>SAXESS Software Design GmbH
>Neuenhöfer Allee 125
>50935 Köln
>Telefon: +49-221-56011-0
>Fax:     +49-221-56011-20
>E-Mail:  dabbous@saxess.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:     <co...@xml.apache.org>
>For additional commands, e-mail:   <co...@xml.apache.org>
>
>


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>