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

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


    @Test
    public void countTags() throws Exception {
        new FacesRequest() {

            protected void invokeApplication() throws Exception {
                WikiDirectory wikiRoot = (WikiDirectory)getInstance("wikiRoot");

                TagDAO dao = (TagDAO)getInstance(TagDAO.class);
                List<DisplayTagCount> tags = dao.findTagCounts(wikiRoot, null, 0, 1l);
                assert tags.size() == 3;
                assert tags.get(0).getTag().equals("Tag One");
View Full Code Here


    @Test
    public void countTagsLimit() throws Exception {
        new FacesRequest() {

            protected void invokeApplication() throws Exception {
                WikiDirectory startDir = ((WikiNodeDAO)getInstance(WikiNodeDAO.class)).findWikiDirectory(4l);

                TagDAO dao = (TagDAO)getInstance(TagDAO.class);
                List<DisplayTagCount> tags = dao.findTagCounts(startDir, null, 2, 1l);

                assert tags.size() == 2;
View Full Code Here

    @Test
    public void findTaggedFiles() throws Exception {
        new FacesRequest() {

            protected void invokeApplication() throws Exception {
                WikiDirectory startDir = ((WikiNodeDAO)getInstance(WikiNodeDAO.class)).findWikiDirectory(3l);

                TagDAO dao = (TagDAO)getInstance(TagDAO.class);
                List<WikiFile> taggedFiles = dao.findWikFiles(startDir, null, "Tag One", WikiNode.SortableProperty.name, true);

                Assert.assertEquals(taggedFiles.size(), 3);
View Full Code Here

    WikiTreeNode<WikiDirectory> selectedDir;
    boolean directorySelected = false;

    public void loadTree() {
        log.debug("loading faq root, starting search for parent default file with macro in directory: " + currentDirectory);
        WikiDirectory faqRoot = faqBrowserDAO.findFaqRootDir(currentDirectory);
        if (faqRoot != null) {
            log.debug("found faq root: " + faqRoot);
            tree = wikiNodeDAO.findWikiDirectoryTree(faqRoot, WikiNode.SortableProperty.createdOn, true);
        } else {
            log.warn("did not find faq root, started search in: " + currentDirectory);
View Full Code Here

    @Create
    public void setDefaultDir() {
        if (requestedCategory != null) {
            log.debug("trying to resolve requested category: " + requestedCategory);
            WikiDirectory dir = wikiNodeDAO.findWikiDirectoryInArea(currentDirectory.getAreaNumber(), requestedCategory);
            if (dir != null) {
                log.debug("found requested category, setting selected directory: " + dir);
                selectedDir = new WikiTreeNode(0, dir);
                showQuestions();
            }
View Full Code Here

        // This was a database query once... now it's in-memory iteration
        List<WikiDirectory> parents = new ArrayList();
        parents.add(startDir);
        parents.addAll(startDir.getParentsRecursive());
        WikiDirectory faqRootDir = null;
        // We need the highest level directory that has a document with a "faqBrowser" macro
        for (WikiDirectory parent : parents) {
            if (parent.getDefaultFile() == null) continue;
            if (((WikiDocument)parent.getDefaultFile()).getHeaderMacrosString().contains("faqBrowser")) {
                faqRootDir = parent;
View Full Code Here

            DirTocPreferences prefs = Preferences.instance().get(DirTocPreferences.class, macro);

            if (prefs.getRootDocumentLink() != null) {
                Long id = ((WikiLinkResolver)Component.getInstance("wikiLinkResolver"))
                            .resolveWikiDirectoryId(currentDirectory.getAreaNumber(), prefs.getRootDocumentLink());
                WikiDirectory foundDir = WikiNodeDAO.instance().findWikiDirectory(id);
                if (foundDir != null)
                    currentDirectory = foundDir;
            }

            // Query the directory tree
View Full Code Here

        final String conversationId = new FacesRequest() {

            protected void updateModelValues() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forumDir = nodeDAO.findWikiDirectory(102l);
                Contexts.getPageContext().set("currentDirectory", forumDir);
                Contexts.getPageContext().set("currentDocument", forumDir.getDefaultFile());
            }

            protected void invokeApplication() throws Exception {
                TopicHome home = (TopicHome)getInstance(TopicHome.class);
                home.newTopic();
            }
        }.run();

        new FacesRequest() {

            protected void beforeRequest() {
                setParameter("cid", conversationId);
            }

            protected void updateModelValues() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forumDir = nodeDAO.findWikiDirectory(102l);
                Contexts.getPageContext().set("currentDirectory", forumDir);
                Contexts.getPageContext().set("currentDocument", forumDir.getDefaultFile());
            }

            protected void invokeApplication() throws Exception {
                TopicHome home = (TopicHome)getInstance(TopicHome.class);
View Full Code Here

        final String conversationId = new FacesRequest() {

            protected void updateModelValues() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forumDir = nodeDAO.findWikiDirectory(102l);
                Contexts.getPageContext().set("currentDirectory", forumDir);
                Contexts.getPageContext().set("currentDocument", forumDir.getDefaultFile());
            }

            protected void invokeApplication() throws Exception {
                TopicHome home = (TopicHome)getInstance(TopicHome.class);
                home.newTopic();
            }
        }.run();

        new FacesRequest() {

            protected void beforeRequest() {
                setParameter("cid", conversationId);
            }

            protected void updateModelValues() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forumDir = nodeDAO.findWikiDirectory(102l);
                Contexts.getPageContext().set("currentDirectory", forumDir);
                Contexts.getPageContext().set("currentDocument", forumDir.getDefaultFile());
            }

            protected void invokeApplication() throws Exception {
                TopicHome home = (TopicHome)getInstance(TopicHome.class);
View Full Code Here

        final String conversationId = new FacesRequest() {

            protected void updateModelValues() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forumDir = nodeDAO.findWikiDirectory(102l);
                Contexts.getPageContext().set("currentDirectory", forumDir);
                Contexts.getPageContext().set("currentDocument", forumDir.getDefaultFile());
            }

            protected void invokeApplication() throws Exception {
                TopicHome home = (TopicHome)getInstance(TopicHome.class);
                home.newTopic();
            }
        }.run();

        new FacesRequest() {

            protected void beforeRequest() {
                setParameter("cid", conversationId);
            }

            protected void updateModelValues() throws Exception {
                WikiNodeDAO nodeDAO = (WikiNodeDAO)getInstance(WikiNodeDAO.class);
                WikiDirectory forumDir = nodeDAO.findWikiDirectory(102l);
                Contexts.getPageContext().set("currentDirectory", forumDir);
                Contexts.getPageContext().set("currentDocument", forumDir.getDefaultFile());
            }

            protected void invokeApplication() throws Exception {
                TopicHome home = (TopicHome)getInstance(TopicHome.class);
View Full Code Here

TOP

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

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.