Re: Handling errors retrieving a for

2016-08-24 Thread Javier Puerto
2016-08-21 18:38 GMT+02:00 Christopher Schultz :

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Javier
>
> On 6/1/16 3:19 PM, Javier Puerto wrote:
> > Hi Christopher,
> >
> > I more used to version 2.2 but it should be the same. By you
> > description I think about creating a new pipeline with a matcher to
> > handle the external request with a specific error handler[1] that
> > contains a reader with an empty file.
> >
> > It should be something like:
> >
> > 
> >
> >   > src="http://remote-server/{1}"/> 
> >
> >  
> > 
> >
> > 
> >
> > Then you could substitute all your calls to external resources
> > that needs to produce an empty XML in case of error to call to the
> > new matcher. This way you can tune up the external pipeline for
> > caching if it's needed.
>
> I tried:
>
> 
>   
> 
>   
>   
> 
> 
> 
>   
>   
> 
>   
> 
>
> When I get a "no route to host" error from the unavailable-resource, I
> get the standard Cocoon error page with a stack trace. I would have
> expected the  from the unavailable resource to simply
> provide no content to aggregate with the other sources.
>

The exception will be handled at pipeline level so if the source fails, the
handle-errors that you defined will be triggered.


>
> Do I need a more complicated handle-errors section? All of the
> examples in the docs have a  in them to check the
> exception type.
>

The problem is that you want that your resources return an empty content in
case that the application can not get the data in the middle of the
process. So you need to declare another pipeline with a matcher that will
accept any URL and retrieves it for you, this matcher will have the
"handle-errors" tag that will read an empty XML file.

Create a new pipeline like I send previously and just call the resources in
the aggregator to resolve the internal pipeline.

  
  
  


Notice the protocol and the internal pipeline matcher path preffix. You
should get what you expect with this change.


> Thanks,
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJXudkCAAoJEBzwKT+lPKRY5NIP/2j5npsvm4VZEXDkCPYDrZCv
> Zk8mfShffDkf0Xh1lOUnbXiwezv3YkQIq7gRa1rhWnR69lriAJQku1vsSsnagADH
> Re4BzJXxWhJ8a+x7Hv8Ibhvjzl53qxxVl9U/cop8R4u9tQAH4aVWPaLUrkxtnFGh
> 0G+MEnOr8x62NG1RHSVuhNfXgFTxVaXDkxcS3w47Vq/Ts+ulU7Hm0XXfPUJB5XG/
> /sREax46fY0/9Qweb82QbG5CHaI22Uv/xnxq4t+HHA1I3DJtZDpiHHcueF02Hn5R
> LtRq4gDvYqAriGSy31W+roNCT+ItT2yThQ9EdcRg4Dc2meN/0s7jTdbIhF1YU2ut
> GjfW1504z5GoPYO1kaS5pSFH5zIaOaKUp3SYCHrkCAhEY5u5u10NIqleHUnj8g6z
> latO8gp26UgdlBMZwaVXc2TOIX3BbKhZTveEjwc9wCd1EyrrryoLr6xT5hKUctaf
> u1oGOaQcgHVNAskztwDNAYzyeep+lRAIPPGQ1irhXrPA66nOuyHW6+I4EBiboQ8J
> RUi0djAUZg/srOxpWvC5ww+FyGleH+a0bJe3qz6BhSPVqy+VddjUl4SnqeT+1m6t
> yU/K+q8i3TPGHGDJwDQeGqkesB5e3okT9UJuj2SqOMOQ7yHe0aR0JOepP4Y9oNuI
> sTgQuM/AzAsTpO60ML1v
> =ewdz
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>


Re: Cocoon 3 sitemap setup

2016-08-24 Thread gelo1234
Hi,

AFAIK there is no more direct sitemap mounting in C3. You have to make a
separate C3 module/block and "mount"/assign a context to it.
Then you can connect 2 or more Cocoon blocks together in order to share
some common servlet or functionality.

Take a look at Cocoon samples:
https://github.com/ilgrosso/cocoon3EmptyProject/tree/COCOON3-105

Greetings,
Greg

24.08.2016 13:21 "Artur Synowiec"  napisał(a):

> Hello,
>
> I need some help with setting up Cocoon 3 sitemap.
>
> I have used Cocoon 2.1 and 2.2 in the past and enjoyed the simplicity of
> the XML transformation
> using sitemap language.
>
> Now I would like to get a hand of Cocoon 3. I've successfully managed to
> integrate
> C3 pipeline processor with other Java applications (based on Spring Boot)
> but
> I would love to make it work again with sitemap. I can see a few examples
> on the web
> of people using C3 inside their apps but couldn't see any example of
> mounting a sitemap.xmap
>
> Ideally I would like to integrate it with a Spring Boot app and
> mount XMLSitemapServlet in there.
> I have managed to do it using a class implementing Spring's
> ServletContextInitializer but I'm getting this exception:
>
> java.lang.IllegalStateException: Received closing 'match' but there was
> no node to close.
> I think it could be something to do with creating a Spring bean
> of org.apache.cocoon.sitemap.node.SitemapNode/sitemap
> which is needed for SitemapNodeFactory's createNode() method.
>
> I would appreciate any help on this.
>
> Regards,
> Artur
>
>


Cocoon 3 sitemap setup

2016-08-24 Thread Artur Synowiec

Hello,
I need some help with setting up Cocoon 3 sitemap.
I have used Cocoon 2.1 and 2.2 in the past and enjoyed the simplicity of the 
XML transformationusing sitemap language.
Now I would like to get a hand of Cocoon 3. I've successfully managed to 
integrateC3 pipeline processor with other Java applications (based on Spring 
Boot) butI would love to make it work again with sitemap. I can see a few 
examples on the webof people using C3 inside their apps but couldn't see any 
example of mounting a sitemap.xmap
Ideally I would like to integrate it with a Spring Boot app and mount 
XMLSitemapServlet in there.I have managed to do it using a class implementing 
Spring's ServletContextInitializer but I'm getting this exception:
java.lang.IllegalStateException: Received closing 'match' but there was no node 
to close.I think it could be something to do with creating a Spring bean of 
org.apache.cocoon.sitemap.node.SitemapNode/sitemapwhich is needed for 
SitemapNodeFactory's createNode() method.
I would appreciate any help on this.
Regards,Artur