This is what I'm currently doing but it isn't working very well do to
the size of these things.

    public StreamResponse onActivate(String categoryType) {
        UrlSet urlset = new UrlSet();

        List<ZipDetail> results = crudDAO.getAll(ZipDetail.class);

        for (ZipDetail zipDetail : results) {
            Link link =
linkSource.createPageRenderLinkWithContext(VehiclesIndex.class,
categoryType, Util.getCityContext(urlEncoder, zipDetail));
            link.setSecurity(LinkSecurity.SECURE);

            SitemapXML siteMapXML = new SitemapXML();
            siteMapXML.setChangefreq(ChangeFreq.ALWAYS.toString());
            siteMapXML.setLoc(link.toAbsoluteURI());
            siteMapXML.setPriority(0.5);
            urlset.getSitemaps().add(siteMapXML);
        }

        return super.onActivate(urlset);
    }

On Mon, Jan 19, 2015 at 4:05 PM, George Christman
<gchrist...@cardaddy.com> wrote:
> Well that is what I'm currently doing, but the problem I'm facing is
> the app generates millions of pages and your only allowed to have 50k
> per sitemap. So that is the first major issue I'm facing which this
> library addresses. I was hoping to put this on a nightly task so a
> search engine wouldn't be triggering the process of generating this
> multiple times.
>
> Is there a way to get around the permission issue and write the file
> to webapp or will I be required to have to figure out an alternate
> approach as you suggested?
>
> On Mon, Jan 19, 2015 at 3:58 PM, Thiago H de Paula Figueiredo
> <thiag...@gmail.com> wrote:
>> On Mon, 19 Jan 2015 18:41:31 -0200, George Christman
>> <gchrist...@cardaddy.com> wrote:
>>
>>> Caused by: java.io.FileNotFoundException: /sitemap.xml (Permission denied)
>>
>>
>> Here's the cause: you're trying to write a file to the root folder of your
>> filesystem.
>>
>> Sitemaps are simple, so why don't you write a Tapestry page to generate it
>> pluse a little bit of URL rewriting to make it available at /sitemap.xml,
>> taking into account what you know about your webapp and caching the data so
>> you don't need to perform the whole process every time the /sitemap.xml URL
>> is requested? The library you're using for that is probably crawling the
>> whole website, hence causing the high load you noticed.
>>
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Tapestry, Java and Hibernate consultant and developer
>> http://machina.com.br
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>
>
>
> --
> George Christman
> CEO
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York



-- 
George Christman
CEO
www.CarDaddy.com
P.O. Box 735
Johnstown, New York

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to