Search in sources :

Example 11 with ReferenceManager

use of org.apache.wiki.references.ReferenceManager in project jspwiki by apache.

the class ReferredPagesPlugin method getReferredPages.

/**
 * Retrieves a list of all referred pages. Is called recursively depending on the depth parameter.
 */
private void getReferredPages(final Context context, final String pagename, int depth) {
    if (depth >= m_depth) {
        // end of recursion
        return;
    }
    if (pagename == null) {
        return;
    }
    if (!m_engine.getManager(PageManager.class).wikiPageExists(pagename)) {
        return;
    }
    final ReferenceManager mgr = m_engine.getManager(ReferenceManager.class);
    final Collection<String> allPages = mgr.findRefersTo(pagename);
    handleLinks(context, allPages, ++depth, pagename);
}
Also used : ReferenceManager(org.apache.wiki.references.ReferenceManager)

Aggregations

ReferenceManager (org.apache.wiki.references.ReferenceManager)11 Attachment (org.apache.wiki.api.core.Attachment)4 AttachmentManager (org.apache.wiki.attachment.AttachmentManager)4 Test (org.junit.jupiter.api.Test)4 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 MalformedURLException (java.net.MalformedURLException)2 ResourceBundle (java.util.ResourceBundle)2 Page (org.apache.wiki.api.core.Page)2 ProviderException (org.apache.wiki.api.exceptions.ProviderException)2 WikiException (org.apache.wiki.api.exceptions.WikiException)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 TreeMap (java.util.TreeMap)1 PluginException (org.apache.wiki.api.exceptions.PluginException)1 AclManager (org.apache.wiki.auth.acl.AclManager)1 FilterManager (org.apache.wiki.filters.FilterManager)1 PageManager (org.apache.wiki.pages.PageManager)1 SearchManager (org.apache.wiki.search.SearchManager)1 URLConstructor (org.apache.wiki.url.URLConstructor)1