Package org.apache.cocoon.sitemap

Examples of org.apache.cocoon.sitemap.SitemapBuilder


        this.inServletServiceFramework = CallStack.getCurrentFrame() != null;
    }

    private void initializeSitemap() throws SitemapNotFoundException, SitemapInitializationException {
        URL url = null;
        SitemapBuilder sitemapBuilder = null;
        try {
            sitemapBuilder = (SitemapBuilder) this.beanFactory.getBean(SitemapBuilder.class.getName());
            url = this.servletContext.getResource(this.getSitemapPath());
        } catch (Exception e) {
            throw new SitemapInitializationException("Can't initialize sitemap.", e);
        }

        // if the sitemap URL can't be resolved by the ServletContext, null is returned
        if (url == null) {
            // prepare a meaningful exception
            String baseURL = this.getBaseURL().toExternalForm();
            if (baseURL.endsWith("/")) {
                baseURL = baseURL.substring(0, baseURL.length() - 1);
            }
            throw new SitemapNotFoundException("Can't find sitemap at " + baseURL + this.getSitemapPath());
        }

        this.sitemapNode = sitemapBuilder.build(url);
    }
View Full Code Here


    }

    private SitemapNode getSitemap() throws Exception {
        URL sitemapURL = this.getClass().getResource("/COB-INF/sitemap.xmap");

        SitemapBuilder sb = (SitemapBuilder) applicationContext.getBean("org.apache.cocoon.sitemap.SitemapBuilder");

        return sb.build(sitemapURL);
    }
View Full Code Here

        this.inServletServiceFramework = CallStack.getCurrentFrame() != null;
    }

    private void initializeSitemap() throws SitemapNotFoundException, SitemapInitializationException {
        URL url = null;
        SitemapBuilder sitemapBuilder = null;
        try {
            sitemapBuilder = (SitemapBuilder) this.beanFactory.getBean(SitemapBuilder.class.getName());
            url = this.servletContext.getResource(this.getSitemapPath());
        } catch (Exception e) {
            throw new SitemapInitializationException("Can't initialize sitemap.", e);
        }

        // if the sitemap URL can't be resolved by the ServletContext, null is returned
        if (url == null) {
            // prepare a meaningful exception
            String baseURL = this.getBaseURL().toExternalForm();
            if (baseURL.endsWith("/")) {
                baseURL = baseURL.substring(0, baseURL.length() - 1);
            }
            throw new SitemapNotFoundException("Can't find sitemap at " + baseURL + this.getSitemapPath());
        }

        this.sitemapNode = sitemapBuilder.build(url);
    }
View Full Code Here

    }

    private SitemapNode getSitemap() throws Exception {
        URL sitemapURL = this.getClass().getResource("/COB-INF/sitemap.xmap");

        SitemapBuilder sb = (SitemapBuilder) applicationContext.getBean("org.apache.cocoon.sitemap.SitemapBuilder");

        return sb.build(sitemapURL);
    }
View Full Code Here

    }

    private synchronized void lazyInitialize(ServletConfig servletConfig) throws ServletException {
        if (!this.initialized) {
            try {
                SitemapBuilder sitemapBuilder = (SitemapBuilder) this.beanFactory.getBean(SitemapBuilder.class
                        .getName());
                URL url = servletConfig.getServletContext().getResource(this.getSitemapPath());
                this.sitemap = sitemapBuilder.build(url);
            } catch (Exception e) {
                throw this.wrapException(e, "An exception occurred while building the sitemap.");
            }
            this.initialized = true;
        }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.sitemap.SitemapBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.