Package org.apache.lenya.cms.publication

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


        ProxyConfiguration config = null;
        String[] areas = this.pub.getAreaNames();
        Boolean[] sslValues = { Boolean.FALSE, Boolean.TRUE };
        for (int a = 0; a < areas.length; a++) {
            for (int s = 0; s < sslValues.length; s++) {
                Proxy proxy = this.pub.getProxy(areas[a], sslValues[s].booleanValue());
                if (config == null && url.startsWith(proxy.getUrl())) {
                    config = new ProxyConfiguration(areas[a], sslValues[s].booleanValue());
                }
            }
        }
        return config;
View Full Code Here


    public String rewrite(String url) {
        ProxyConfiguration config = getMatchingProxyConfiguration(url);
        if (config == null) {
            throw new RuntimeException("No matching proxy config for URL [" + url + "]");
        }
        Proxy proxy = this.pub.getProxy(config.area, config.ssl);
        String suffix = url.substring(proxy.getUrl().length());
        return "/" + this.pub.getId() + "/" + config.area + suffix;
    }
View Full Code Here

                }
            }

            Policy policy = policyManager.getPolicy(accreditableManager, url);

            Proxy proxy = doc.getPublication().getProxy(doc, policy.isSSLProtected());

            if (proxy != null) {
                value = proxy.getURL(doc);
            } else {
                // Take server name and port from request.
                Request request = ObjectModelHelper.getRequest(objectModel);
                value = "http://" + request.getServerName() + ":" + request.getServerPort()
                        + request.getContextPath() + doc.getCanonicalWebappURL();
View Full Code Here

            throws AccessControlException {

        String webappUrl = targetDocument.getCanonicalWebappURL();
        Policy policy = this.policyManager.getPolicy(this.accreditableManager, webappUrl);

        Proxy proxy = targetDocument.getPublication().getProxy(targetDocument,
                policy.isSSLProtected());

        String rewrittenURL;
        if (proxy == null) {
            rewrittenURL = this.request.getContextPath() + webappUrl;
        } else {
            rewrittenURL = proxy.getURL(targetDocument);
        }

        if (anchor != null) {
            rewrittenURL += "#" + anchor;
        }
View Full Code Here

    protected void rewriteLink(AttributesImpl newAttrs, Document targetDocument, String anchor, String queryString)
            throws AccessControlException, PublicationException {
        String webappUrl = targetDocument.getCompleteURL();
        Policy policy = this.policyManager.getPolicy(this.accreditableManager, webappUrl);

        Proxy proxy = targetDocument.getPublication().getProxy(targetDocument, policy.isSSLProtected());

        String rewrittenURL;
        if (proxy == null) {
            rewrittenURL = this.request.getContextPath() + webappUrl;
        } else {
            rewrittenURL = proxy.getURL(targetDocument);
        }
       
        if (anchor != null) {
            rewrittenURL += "#" + anchor;
        }
View Full Code Here

            Policy policy = policyManager.getPolicy(accreditableManager, canonicalUrl);

            Document doc = builder.buildDocument(publication, canonicalUrl);

            Proxy proxy = doc.getPublication().getProxy(doc, policy.isSSLProtected());

            if (proxy != null) {
                value = proxy.getURL(doc);
            } else {
                // Take server name and port from request.
                Request request = ObjectModelHelper.getRequest(objectModel);
                value = "http://" + request.getServerName() + ":" + request.getServerPort()
                        + request.getContextPath() + doc.getCompleteURL();
View Full Code Here

    protected void rewriteLink(AttributesImpl newAttrs, Document targetDocument, String anchor)
            throws AccessControlException, PublicationException {
        String webappUrl = targetDocument.getCompleteURL();
        Policy policy = this.policyManager.getPolicy(this.accreditableManager, webappUrl);

        Proxy proxy = targetDocument.getPublication().getProxy(targetDocument, policy.isSSLProtected());

        String rewrittenURL;
        if (proxy == null) {
            rewrittenURL = this.request.getContextPath() + webappUrl;
        } else {
            rewrittenURL = proxy.getURL(targetDocument);
        }
       
        if (anchor != null) {
            rewrittenURL += "#" + anchor;
        }
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.