Examples of URLInformation


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

            Request request = ContextHelper.getRequest(this.context);
           
            if (publicationId == null) {
                String webappUrl = request.getRequestURI().substring(request.getContextPath().length());

                URLInformation info = new URLInformation(webappUrl);
                publicationId = info.getPublicationId();
            }

            DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, request);
            if (factory.existsPublication(publicationId)) {
                Publication pub = factory.getPublication(publicationId);
View Full Code Here

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

            DocumentFactory map = DocumentUtil.createDocumentFactory(this.serviceManager, session);

            // always check for authoring URL since the live document doesn't
            // have to exist

            URLInformation info = new URLInformation(webappUrl);
            // Danger, Will Robinson! If area or pubId is null, webappUrl.substring()
            // will be out of bounds, because null becomes "null" in string concatenation
            String pubId = info.getPublicationId();
            String area = info.getArea();
            String prefix = "/" + ((pubId != null) ? pubId + "/" : "");
            // String prefix = "/" + pubId + "/";
            String prefixWithArea = prefix + ((area != null) ? area : "");
            // String prefixWithArea = prefix + area;
            String authoringUrl = prefix + Publication.AUTHORING_AREA
View Full Code Here

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

            if (publicationId == null) {
                String webappUrl = request.getRequestURI().substring(
                        request.getContextPath().length());

                URLInformation info = new URLInformation(webappUrl);
                publicationId = info.getPublicationId();
            }

            DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, request);

            String[] uris;
View Full Code Here

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

                    Policy policy = this.policyManager.getPolicy(this.accreditableManager,
                            normalizedUrl);
                    useSsl = policy.isSSLProtected();
                }

                URLInformation info = new URLInformation(normalizedUrl);
                String pubId = info.getPublicationId();

                Publication pub = null;
                if (pubId != null) {
                    pub = getPublication(pubId);
                }
View Full Code Here

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

     * @param pub The publication to use for proxy resolving.
     * @param ssl If the URL uses SSL.
     * @return A link URL.
     */
    protected String rewriteLink(String linkUrl, Publication pub, boolean ssl) {
        URLInformation info = new URLInformation(linkUrl);
        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);
View Full Code Here

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

                areaName = steps.nextToken();
                String prefix = pubId + "/" + areaName;
                relativePath = fullPath.substring(prefix.length());
            } else if (absolutePath.startsWith("/")) {
                String webappUrl = ServletHelper.getWebappURI(request);
                URLInformation info = new URLInformation(webappUrl);
                pubId = info.getPublicationId();
                areaName = info.getArea();
                relativePath = absolutePath;
            } else {
                throw new MalformedURLException("The path [" + absolutePath
                        + "] must start with at least one slash.");
            }
View Full Code Here

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

    /**
     * @return The area without the "info-" prefix.
     */
    public String getArea() {
        URLInformation info = new URLInformation(getSourceURL());
        return info.getArea();
    }
View Full Code Here

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

            Request request = ContextHelper.getRequest(this.context);

            if (pubId == null) {
                String webappUrl = ServletHelper.getWebappURI(request);
                URLInformation info = new URLInformation(webappUrl);
                pubId = info.getPublicationId();
            }

            DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, request);

            String[] uris;
View Full Code Here

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

        try {
            util = (ContextUtility) this.manager.lookup(ContextUtility.ROLE);
            Request request = util.getRequest();
            DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, request);

            URLInformation info = new URLInformation(webappUrl);
            String pubId = info.getPublicationId();

            if (pubId != null && factory.existsPublication(pubId)) {
                publication = factory.getPublication(pubId);
            }
        } catch (Exception e) {
View Full Code Here

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

        String configurationUri = getConfigurationURI();
        // Check if the service has been parameterized with a
        // configuration URI. This can be used for testing purposes etc.
        if (configurationUri == null) {
            String webappUrl = ServletHelper.getWebappURI(request);
            URLInformation info = new URLInformation(webappUrl);
            configurationUri = getConfigurationUri(info.getPublicationId());
        }

        Role[] roles = PolicyUtil.getRoles(request);
        return authorizeUsecase(usecase, roles, configurationUri);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.