Package org.apache.lenya.cms.linking

Examples of org.apache.lenya.cms.linking.Link


            String name = "default";
            if (url.length() > PROTOCOL.length()) {
                String suffix = url.substring(PROTOCOL.length());
                String linkUri = "lenya-document:" + suffix;
                try {
                    Link link = getLink(linkUri, pubId, area);
                    LinkTarget target = IconUrlTransformer.this.linkResolver.resolve(
                            IconUrlTransformer.this.factory, link.getUri());
                    if (target.exists()) {
                        Document doc = target.getDocument();
                        ResourceType type = doc.getResourceType();
                        if (Arrays.asList(type.getFormats()).contains("icon")) {
                            name = type.getName();
View Full Code Here


            return iconUrl.toString();
        }

        protected Link getLink(String linkUri, String pubId, String area)
                throws MalformedURLException {
            Link link = new Link(linkUri);
            if (link.getArea() == null) {
                link.setArea(area);
            }
            if (link.getPubId() == null) {
                link.setPubId(pubId);
            }
            return link;
        }
View Full Code Here

            if (factory.isDocument(webappUrl)) {
                Document currentDoc = factory.getFromURL(webappUrl);
                target = resolver.resolve(currentDoc, linkUri);
            }
            else {
                Link link = new Link(linkUri);
                contextualize(link, webappUrl);
                target = resolver.resolve(factory, link.getUri());
            }

            Document doc = target.getDocument();

            if (target.isRevisionSpecified()) {
View Full Code Here

            LinkTarget target;
            if (this.currentDoc != null) {
                target = this.linkResolver.resolve(this.currentDoc, linkUri);
            } else {
                Link link = getAbsoluteLink(info, linkUri);
                target = this.linkResolver.resolve(this.factory, link.getUri());
            }

            if (target.exists() && target.getDocument().hasLink()) {
                Document targetDocument = target.getDocument();
                String extension = getExtension(targetDocument, requiredExtension);
View Full Code Here

     * @return A link.
     * @throws MalformedURLException if the linkUri parameter is malformed.
     */
    protected Link getAbsoluteLink(URLInformation info, String linkUri)
            throws MalformedURLException {
        Link link = new Link(linkUri);
        if (link.getPubId() == null) {
            link.setPubId(info.getPublicationId());
        }
        if (link.getArea() == null) {
            link.setArea(info.getArea());
        }
        return link;
    }
View Full Code Here

    }

    protected String getLinkUri(String href) throws MalformedURLException {
        int qm = href.indexOf("?");
        String linkUri = qm < 0 ? href : href.substring(0, qm - 1);
        Link link = new Link(linkUri);
        if (link.getArea() == null) {
            link.setArea(this.area.getName());
        }
        if (link.getPubId() == null) {
            link.setPubId(this.area.getPublication().getId());
        }
        return link.getUri();
    }
View Full Code Here

            if (factory.isDocument(webappUrl)) {
                Document currentDoc = factory.getFromURL(webappUrl);
                target = resolver.resolve(currentDoc, linkUri);
            }
            else {
                Link link = new Link(linkUri);
                contextualize(link, webappUrl);
                target = resolver.resolve(factory, link.getUri());
            }
           
            if (!target.exists()) {
                throw new SourceNotFoundException("Source not found: [" + location + "]");
            }
View Full Code Here

            String name = "default";
            if (url.length() > PROTOCOL.length()) {
                String suffix = url.substring(PROTOCOL.length());
                String linkUri = "lenya-document:" + suffix;
                try {
                    Link link = getLink(linkUri, pubId, area);
                    LinkTarget target = IconUrlTransformer.this.linkResolver.resolve(
                            IconUrlTransformer.this.factory, link.getUri());
                    if (target.exists()) {
                        Document doc = target.getDocument();
                        ResourceType type = doc.getResourceType();
                        if (Arrays.asList(type.getFormats()).contains("icon")) {
                            name = type.getName();
View Full Code Here

            return "/modules/sitetree/" + name + ".gif";
        }

        protected Link getLink(String linkUri, String pubId, String area)
                throws MalformedURLException {
            Link link = new Link(linkUri);
            if (link.getArea() == null) {
                link.setArea(area);
            }
            if (link.getPubId() == null) {
                link.setPubId(pubId);
            }
            return link;
        }
View Full Code Here

TOP

Related Classes of org.apache.lenya.cms.linking.Link

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.