Package org.apache.lenya.cms.publication

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


            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, 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

     * @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

     * @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

            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

                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

    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

            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

            Identifiable[] recipients = { user };

            Document liveVersion = authoringDocument.getAreaVersion(Publication.LIVE_AREA);
            String url;

            Proxy proxy = liveVersion.getPublication().getProxy(liveVersion, false);
            if (proxy != null) {
                url = proxy.getURL(liveVersion);
            } else {
                Request request = ContextHelper.getRequest(this.context);
                final String serverUrl = "http://" + request.getServerName() + ":"
                        + request.getServerPort();
                final String webappUrl = liveVersion.getCanonicalWebappURL();
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

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.