Package org.apache.lenya.cms.linking

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


        try {
            linkMgr = (LinkManager) this.manager.lookup(LinkManager.ROLE);
            resolver = (LinkResolver) this.manager.lookup(LinkResolver.ROLE);
            org.apache.lenya.cms.linking.Link[] links = linkMgr.getLinksFrom(getSourceDocument());
            for (int i = 0; i < links.length; i++) {
                LinkTarget target = resolver.resolve(getSourceDocument(), links[i].getUri());
                if (!target.exists()) {
                    return true;
                }
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
View Full Code Here


            try {
                linkMgr = (LinkManager) this.manager.lookup(LinkManager.ROLE);
                resolver = (LinkResolver) this.manager.lookup(LinkResolver.ROLE);
                org.apache.lenya.cms.linking.Link[] links = linkMgr.getLinksFrom(this.document);
                for (int i = 0; i < links.length; i++) {
                    LinkTarget target = resolver.resolve(this.document, links[i].getUri());
                    if (target.exists()) {
                        Document doc = target.getDocument();
                        if (!doc.existsAreaVersion(Publication.LIVE_AREA)) {
                            docs.add(doc);
                        }
                    }
                }
View Full Code Here

        try {
            linkMgr = (LinkManager) this.manager.lookup(LinkManager.ROLE);
            resolver = (LinkResolver) this.manager.lookup(LinkResolver.ROLE);
            org.apache.lenya.cms.linking.Link[] links = linkMgr.getLinksFrom(getSourceDocument());
            for (int i = 0; i < links.length; i++) {
                LinkTarget target = resolver.resolve(getSourceDocument(), links[i].getUri());
                if (!target.exists()) {
                    return true;
                }
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
View Full Code Here

            try {
                linkMgr = (LinkManager) this.manager.lookup(LinkManager.ROLE);
                resolver = (LinkResolver) this.manager.lookup(LinkResolver.ROLE);
                org.apache.lenya.cms.linking.Link[] links = linkMgr.getLinksFrom(this.document);
                for (int i = 0; i < links.length; i++) {
                    LinkTarget target = resolver.resolve(this.document, links[i].getUri());
                    if (target.exists()) {
                        Document doc = target.getDocument();
                        if (!doc.existsAreaVersion(Publication.LIVE_AREA)) {
                            docs.add(doc);
                        }
                    }
                }
View Full Code Here

            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

            }

            resolver = (LinkResolver) this.manager.lookup(LinkResolver.ROLE);
            DocumentFactory factory = DocumentUtil.getDocumentFactory(this.manager, request);
            String webappUrl = ServletHelper.getWebappURI(request);
            LinkTarget target;
            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()) {
                if (queryString == null) {
                    queryString = "";
                }
                queryString += "rev=" + target.getRevisionNumber();
            }

            String format = null;
            if (queryString != null) {
                Query query = new Query(queryString);
View Full Code Here

        try {
            linkMgr = (LinkManager) this.manager.lookup(LinkManager.ROLE);
            resolver = (LinkResolver) this.manager.lookup(LinkResolver.ROLE);
            org.apache.lenya.cms.linking.Link[] links = linkMgr.getLinksFrom(getSourceDocument());
            for (int i = 0; i < links.length; i++) {
                LinkTarget target = resolver.resolve(getSourceDocument(), links[i].getUri());
                if (!target.exists()) {
                    return true;
                }
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
View Full Code Here

            try {
                linkMgr = (LinkManager) this.manager.lookup(LinkManager.ROLE);
                resolver = (LinkResolver) this.manager.lookup(LinkResolver.ROLE);
                org.apache.lenya.cms.linking.Link[] links = linkMgr.getLinksFrom(this.document);
                for (int i = 0; i < links.length; i++) {
                    LinkTarget target = resolver.resolve(this.document, links[i].getUri());
                    if (target.exists()) {
                        Document doc = target.getDocument();
                        if (!doc.existsAreaVersion(Publication.LIVE_AREA)) {
                            docs.add(doc);
                        }
                    }
                }
View Full Code Here

                requiredExtension = query.getValue(EXTENSION_PARAM);
                query.removeValue(EXTENSION_PARAM);
                queryString = query.toString();
            }

            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);
                rewriteLink(newAttrs, config.attribute, targetDocument, anchor, queryString,
                        extension);
            } else if (info.getArea().equals(Publication.AUTHORING_AREA)) {
                markBrokenLink(newAttrs, config.attribute, linkUrl);
View Full Code Here

        try {
            linkMgr = (LinkManager) this.manager.lookup(LinkManager.ROLE);
            resolver = (LinkResolver) this.manager.lookup(LinkResolver.ROLE);
            org.apache.lenya.cms.linking.Link[] links = linkMgr.getLinksFrom(getSourceDocument());
            for (int i = 0; i < links.length; i++) {
                LinkTarget target = resolver.resolve(getSourceDocument(), links[i].getUri());
                if (!target.exists()) {
                    return true;
                }
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
View Full Code Here

TOP

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

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.