Search in sources :

Example 66 with WikiEngine

use of org.apache.wiki.WikiEngine in project jspwiki by apache.

the class EditorIteratorTag method doStartTag.

public final int doStartTag() {
    m_wikiContext = WikiContext.findContext(pageContext);
    WikiEngine engine = m_wikiContext.getEngine();
    EditorManager mgr = engine.getEditorManager();
    String[] editorList = mgr.getEditorList();
    Collection<Editor> editors = new ArrayList<Editor>();
    for (int i = 0; i < editorList.length; i++) {
        editors.add(new Editor(m_wikiContext, editorList[i]));
    }
    setList(editors);
    return super.doStartTag();
}
Also used : ArrayList(java.util.ArrayList) Editor(org.apache.wiki.ui.Editor) WikiEngine(org.apache.wiki.WikiEngine) EditorManager(org.apache.wiki.ui.EditorManager)

Example 67 with WikiEngine

use of org.apache.wiki.WikiEngine in project jspwiki by apache.

the class HasAttachmentsTag method doWikiStartTag.

public final int doWikiStartTag() throws IOException {
    WikiEngine engine = m_wikiContext.getEngine();
    WikiPage page = m_wikiContext.getPage();
    AttachmentManager mgr = engine.getAttachmentManager();
    try {
        if (page != null && engine.pageExists(page) && mgr.attachmentsEnabled()) {
            if (mgr.hasAttachments(page)) {
                return EVAL_BODY_INCLUDE;
            }
        }
    } catch (ProviderException e) {
        log.fatal("Provider failed while trying to check for attachements", e);
    // FIXME: THrow something.
    }
    return SKIP_BODY;
}
Also used : ProviderException(org.apache.wiki.api.exceptions.ProviderException) WikiPage(org.apache.wiki.WikiPage) AttachmentManager(org.apache.wiki.attachment.AttachmentManager) WikiEngine(org.apache.wiki.WikiEngine)

Aggregations

WikiEngine (org.apache.wiki.WikiEngine)67 WikiPage (org.apache.wiki.WikiPage)29 ProviderException (org.apache.wiki.api.exceptions.ProviderException)15 Attachment (org.apache.wiki.attachment.Attachment)10 WikiContext (org.apache.wiki.WikiContext)9 Properties (java.util.Properties)8 JspWriter (javax.servlet.jsp.JspWriter)8 TestEngine (org.apache.wiki.TestEngine)8 Element (org.jdom2.Element)7 IOException (java.io.IOException)5 SimpleDateFormat (java.text.SimpleDateFormat)5 Calendar (java.util.Calendar)5 Date (java.util.Date)5 ResourceBundle (java.util.ResourceBundle)5 PluginException (org.apache.wiki.api.exceptions.PluginException)5 Before (org.junit.Before)5 Principal (java.security.Principal)4 HttpServletRequest (javax.servlet.http.HttpServletRequest)4 InternalWikiException (org.apache.wiki.InternalWikiException)4 ArrayList (java.util.ArrayList)3