Package org.apache.lenya.cms.publication

Examples of org.apache.lenya.cms.publication.Proxy


                    rewrittenUrl = rewriteLink(normalizedUrl, pub, useSsl);
                }

                // link doesn't point to publication
                else {
                    Proxy proxy = getGlobalProxies().getProxy(ssl);
                    rewrittenUrl = proxy.getUrl() + normalizedUrl;
                }
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here


        String rewrittenUrl;
        String areaName = info.getArea();

        // valid area
        if (areaName != null && hasArea(pub, areaName)) {
            Proxy proxy = pub.getProxy(areaName, ssl);
            rewrittenUrl = proxy.getUrl() + info.getDocumentUrl();
        }

        // invalid area
        else {
            Proxy proxy = getGlobalProxies().getProxy(ssl);
            rewrittenUrl = proxy.getUrl() + linkUrl;
        }
        return rewrittenUrl;
    }
View Full Code Here

                return;
        }

        String url;
        Document authoringVersion = authoringDocument.getAreaVersion(Publication.AUTHORING_AREA);
        Proxy proxy = authoringVersion.getPublication().getProxy(authoringVersion, false);

        if (proxy != null) {
            url = proxy.getURL(authoringVersion);
        } else {
            Request request = ContextHelper.getRequest(this.context);
            final String serverUrl = "http://" + request.getServerName() + ":"
                    + request.getServerPort();
            final String webappUrl = authoringVersion.getCanonicalWebappURL();
View Full Code Here

     * @param document A document.
     * @return The complete HTTP URL of the document when requested via the web.
     */
    protected String getWebUrl(Document document) {
        String url;
        Proxy proxy = document.getPublication().getProxy(document, false);
        if (proxy != null) {
            url = proxy.getURL(document);
        } else {
            Request request = ContextHelper.getRequest(this.context);
            final String serverUrl = "http://" + request.getServerName() + ":"
                    + request.getServerPort();
            final String webappUrl = document.getCanonicalWebappURL();
View Full Code Here

                    rewrittenUrl = rewriteLink(normalizedUrl, pub, useSsl);
                }

                // link doesn't point to publication
                else {
                    Proxy proxy = getGlobalProxies().getProxy(ssl);
                    rewrittenUrl = proxy.getUrl() + normalizedUrl;
                }
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

        String rewrittenUrl;
        String areaName = info.getArea();

        // valid area
        if (areaName != null && hasArea(pub, areaName)) {
            Proxy proxy = pub.getProxy(areaName, ssl);
            rewrittenUrl = proxy.getUrl() + info.getDocumentUrl();
        }

        // invalid area
        else {
            Proxy proxy = getGlobalProxies().getProxy(ssl);
            rewrittenUrl = proxy.getUrl() + linkUrl;
        }
        return rewrittenUrl;
    }
View Full Code Here

    private Map ssl2proxy = new HashMap();
    private ServiceManager manager;

    public Proxy getProxy(boolean ssl) {
        Object key = Boolean.valueOf(ssl);
        Proxy proxy = (Proxy) this.ssl2proxy.get(key);
        if (proxy == null) {
            proxy = initializeProxy(key);
        }
        return proxy;
    }
View Full Code Here

        }
        return proxy;
    }

    protected synchronized Proxy initializeProxy(Object key) {
        Proxy proxy;
        proxy = new Proxy();
        ContextUtility context = null;
        try {
            context = (ContextUtility) manager.lookup(ContextUtility.ROLE);
            proxy.setUrl(context.getRequest().getContextPath());
        } catch (ServiceException e) {
            throw new RuntimeException(e);
        }
        finally {
            if (context != null) {
View Full Code Here

    public void configure(Configuration config) throws ConfigurationException {
        Configuration[] proxyConfigs = config.getChildren("proxy");
        for (int p = 0; p < proxyConfigs.length; p++) {
            boolean ssl = proxyConfigs[p].getAttributeAsBoolean("ssl");
            String url = proxyConfigs[p].getAttribute("url");
            Proxy proxy = new Proxy();
            proxy.setUrl(url);
            setProxy(ssl, proxy);
        }
    }
View Full Code Here

            Document authoringVersion = authoringDocument
                    .getAreaVersion(Publication.AUTHORING_AREA);
            String url;

            Proxy proxy = authoringVersion.getPublication().getProxy(authoringVersion, false);
            if (proxy != null) {
                url = proxy.getURL(authoringVersion);
            } else {
                Request request = ContextHelper.getRequest(this.context);
                final String serverUrl = "http://" + request.getServerName() + ":"
                        + request.getServerPort();
                final String webappUrl = authoringVersion.getCanonicalWebappURL();
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.publication.Proxy

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.