Package org.jboss.seam.wiki.core.model

Examples of org.jboss.seam.wiki.core.model.WikiTextMacro


    @Override
    protected boolean beforePersist() {
        // TODO: Use macro parameters for "sticky" and "notify" options instead of additional macros
        if (isSticky()) {
            getInstance().removeHeaderMacros("forumPosting");
            getInstance().addHeaderMacro(new WikiTextMacro("forumStickyPosting"));
        }
        if (isNotifyReplies()) {
            getInstance().addHeaderMacro(new WikiTextMacro(TOPIC_NOTIFY_ME_MACRO));
        }
        return super.beforePersist();
    }
View Full Code Here


                assert docHome.getInstance().getHeaderMacros().size() == 2;
                assert docHome.getInstance().getContentMacros().size() == 1;
                assert docHome.getInstance().getFooterMacros().size() == 2;

                // Check WikiMacro.equals() as well
                WikiTextMacro macro = new WikiTextMacro("contentMacro");
                macro.setPosition(0);

                boolean macroFound = false;
                for (WikiTextMacro wikiMacro : docHome.getInstance().getContentMacros()) {
                    if (wikiMacro.equals(macro)) {
                        assert wikiMacro.getParams().size()==1;
View Full Code Here

        purgeFeedEntries();
       
        // Plain text can only be set on persist(), never changed later with update()
        if (textEditor.isValuePlaintext())
            getInstance().addHeaderMacro(new WikiTextMacro(WikiDocument.MACRO_DISABLE_CONTENT_MARKUP));

        return true;
    }
View Full Code Here

                assert doc.getHeader().contains("[<=testMacro1[param1=value1]]\n");
                assert doc.getHeader().contains("[<=testMacro2]\n");
                assert doc.getHeader().indexOf("foo") == doc.getHeader().length()-3;

                doc.removeHeaderMacros("testMacro1");
                WikiTextMacro replacement = new WikiTextMacro("testMacro3");
                replacement.getParams().put("p1", "value1");
                replacement.getParams().put("p2", "value2");
                doc.addHeaderMacro(replacement);
                assert doc.getHeaderMacros().size() == 2;
                assert doc.getHeaderMacrosString().contains("testMacro3");
                assert doc.getHeaderMacrosString().contains("testMacro2");
                assert doc.getHeader().contains("[<=testMacro3[p1=value1][p2=value2]]\n");
View Full Code Here

        WikiDocumentDefaults defaults = new WikiDocumentDefaults() {
            @Override
            public List<WikiTextMacro> getContentMacros() {
                return new ArrayList<WikiTextMacro>() {{
                   add(new WikiTextMacro("contentMacro1", 0));
                   add(new WikiTextMacro("contentMacro2", 1));
                }};
            }
            @Override
            public String getContentText() {
                return "foo";
            }
            @Override
            public List<WikiTextMacro> getHeaderMacros() {
                return new ArrayList<WikiTextMacro>() {{
                   add(new WikiTextMacro("headerMacro1", 0));
                   add(new WikiTextMacro("headerMacro2", 1));
                }};
            }
            @Override
            public String getHeaderText() {
                return "bar";
            }
            @Override
            public List<WikiTextMacro> getFooterMacros() {
                return new ArrayList<WikiTextMacro>() {{
                   add(new WikiTextMacro("footerMacro1", 0));
                   add(new WikiTextMacro("footerMacro2", 1));
                }};
            }
            @Override
            public String getFooterText() {
                return "baz";
View Full Code Here

TOP

Related Classes of org.jboss.seam.wiki.core.model.WikiTextMacro

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.