Package org.jboss.seam.wiki.core.wikitext.engine

Examples of org.jboss.seam.wiki.core.wikitext.engine.WikiLinkResolver


        return forumTopPosters;
    }

    private Long resolveForumId(String forumLink) {
        if (forumLink == null || forumLink.length() == 0) return null;
        WikiLinkResolver resolver = (WikiLinkResolver)Component.getInstance("wikiLinkResolver");
        Map<String, WikiLink> resolvedLinks = new HashMap<String, WikiLink>();
        resolver.resolveLinkText(currentDirectory.getAreaNumber(), resolvedLinks, forumLink);
        WikiLink resolvedLink = resolvedLinks.get(forumLink);
        if (resolvedLink.isBroken() || resolvedLink.getFile().getId() == null) {
            return null;
        } else {
            // Parent of forum start page is the forum directory
View Full Code Here


        return linkTargets;
    }

    public void setValueAndConvertLinks(Long areaNumber, String value) {
        log.debug("setting value and resolving wiki://links to clear text");
        WikiLinkResolver wikiLinkResolver = (WikiLinkResolver) Component.getInstance("wikiLinkResolver");
        setValue(wikiLinkResolver.convertFromWikiProtocol(areaNumber, value));
    }
View Full Code Here

        setValue(wikiLinkResolver.convertFromWikiProtocol(areaNumber, value));
    }

    public String getValueAndConvertLinks(Long areaNumber) {
        log.debug("setting value and resolving clear text to wiki://links");
        WikiLinkResolver wikiLinkResolver = (WikiLinkResolver)Component.getInstance("wikiLinkResolver");
        linkTargets = new HashSet<WikiFile>();
        return wikiLinkResolver.convertToWikiProtocol(linkTargets, areaNumber, getValue());
    }
View Full Code Here

            protected void invokeApplication() throws Exception {
                DocumentHome docHome = (DocumentHome)getInstance(DocumentHome.class);
                assert docHome.getInstance().getId().equals(6l); // Init!

                WikiLinkResolver resolver = (WikiLinkResolver)getInstance("wikiLinkResolver");
                Map<String, WikiLink> links = new HashMap<String, WikiLink>();

                docHome.getTextEditor().setValue("[=>hhh://1234]");
                resolver.resolveLinkText(3l, links, "hhh://1234");
                assert links.size()==1;
                assert links.get("hhh://1234").getUrl().equals("http://opensource.atlassian.com/projects/hibernate/browse/HHH-1234");
            }

        }.run();
View Full Code Here

            protected void invokeApplication() throws Exception {
                DocumentHome docHome = (DocumentHome)getInstance(DocumentHome.class);
                assert docHome.getInstance().getId().equals(6l); // Init!

                WikiLinkResolver resolver = (WikiLinkResolver)getInstance("wikiLinkResolver");

                checkLink(resolver, 7l, "[=>Two]", "[=>wiki://7]");
                checkLink(resolver, 7l, "[Foo Bar=>Two]", "[Foo Bar=>wiki://7]");

                checkLink(resolver, 9l, "[=>BBB|Four]", "[=>wiki://9]");
View Full Code Here

            protected void invokeApplication() throws Exception {
                DocumentHome docHome = (DocumentHome)getInstance(DocumentHome.class);
                assert docHome.getInstance().getId().equals(6l); // Init!

                WikiLinkResolver resolver = (WikiLinkResolver)getInstance("wikiLinkResolver");

                final String FRAGMENT = "#foo123.,; baz -?!()/&";

                checkLink(resolver, 7l, "[=>Two"+FRAGMENT+"]", "[=>wiki://7"+FRAGMENT+"]", FRAGMENT);
                checkLink(resolver, 9l, "[=>BBB|Four"+FRAGMENT+"]", "[=>wiki://9"+FRAGMENT+"]", FRAGMENT);
View Full Code Here

            protected void invokeApplication() throws Exception {
                DocumentHome docHome = (DocumentHome)getInstance(DocumentHome.class);
                assert docHome.getInstance().getId().equals(6l); // Init!

                WikiLinkResolver resolver = (WikiLinkResolver)getInstance("wikiLinkResolver");

                checkLink(resolver, 30l, "[=>BBB|Test Image]", "[=>wiki://30]");
            }

        }.run();
View Full Code Here

TOP

Related Classes of org.jboss.seam.wiki.core.wikitext.engine.WikiLinkResolver

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.