Package org.jboss.seam.wiki.core.ui

Examples of org.jboss.seam.wiki.core.ui.WikiURLRenderer


                    public boolean isReadAccessChecked() {
                        return true;
                    }

                    public SearchHit extractHit(Query query, WikiDocument doc) throws Exception {
                        WikiURLRenderer urlRenderer = (WikiURLRenderer) Component.getInstance(WikiURLRenderer.class);
                        return new SearchHit(
                            WikiDocument.class.getSimpleName(),
                            "icon.doc.gif",
                            "(" + doc.getCreatedBy().getFullname() + ") " + escapeBestFragments(query, new NullFragmenter(), doc.getName(), 0, 0),
                            urlRenderer.renderURL(doc),
                            escapeBestFragments(query, new SimpleFragmenter(100), doc.getContent(), 5, 350)
                        );
                    }
                }
            );

            add(
                new SearchableEntityHandler<WikiComment>() {
                    public SearchHit extractHit(Query query, WikiComment comment) throws Exception {
                        WikiURLRenderer urlRenderer = (WikiURLRenderer)Component.getInstance(WikiURLRenderer.class);
                        return new SearchHit(
                            WikiComment.class.getSimpleName(),
                            "icon.user.gif",
                            "(" + (comment.getCreatedBy() != null ? comment.getCreatedBy().getFullname() : comment.getFromUserName()) + ") "
                                + escapeBestFragments(query, new NullFragmenter(), comment.getSubject(), 0, 0),
                            urlRenderer.renderURL(comment),
                            escapeBestFragments(query, new SimpleFragmenter(100), comment.getContent(), 5, 350)
                        );
                    }
                }
            );
View Full Code Here


    }

    public void createHomeDirectory(User user) {

        WikiNodeDAO nodeDAO = (WikiNodeDAO)Component.getInstance(WikiNodeDAO.class);
        WikiURLRenderer urlRenderer = (WikiURLRenderer)Component.getInstance(WikiURLRenderer.class);

        // Create home directory
        WikiDirectory memberArea = (WikiDirectory)Component.getInstance("memberArea");

        WikiDirectory homeDirectory = new WikiDirectory();
        homeDirectory.setName(user.getUsername());
        homeDirectory.setWikiname(WikiUtil.convertToWikiName(homeDirectory.getName()));
        homeDirectory.setAreaNumber(memberArea.getAreaNumber());
        homeDirectory.setCreatedBy(user);
        homeDirectory.setWriteAccessLevel(Role.ADMINROLE_ACCESSLEVEL);
        homeDirectory.setReadAccessLevel(Role.GUESTROLE_ACCESSLEVEL);
        homeDirectory.setParent(memberArea);
        user.setMemberHome(homeDirectory);

        // Create feed for home directory
        WikiFeed feed = new WikiFeed();
        feed.setLink(urlRenderer.renderURL(homeDirectory));
        feed.setDirectory(homeDirectory);
        feed.setAuthor(homeDirectory.getCreatedBy().getFullname());
        feed.setTitle(homeDirectory.getName());
        homeDirectory.setFeed(feed);
View Full Code Here

    }

    /* ############################# FEED CUD ################################ */

    public void createFeed(WikiDirectory dir) {
        WikiURLRenderer urlRenderer = (WikiURLRenderer)Component.getInstance(WikiURLRenderer.class);
        WikiFeed feed = new WikiFeed();
        feed.setDirectory(dir);
        feed.setLink(urlRenderer.renderURL(dir));
        feed.setAuthor(dir.getCreatedBy().getFullname());
        feed.setTitle(dir.getName());
        feed.setDescription(dir.getDescription());
        dir.setFeed(feed);
    }
View Full Code Here

        feed.setDescription(dir.getDescription());
        dir.setFeed(feed);
    }

    public void updateFeed(WikiDirectory dir) {
        WikiURLRenderer urlRenderer = (WikiURLRenderer)Component.getInstance(WikiURLRenderer.class);
        dir.getFeed().setLink(urlRenderer.renderURL(dir));
        dir.getFeed().setTitle(dir.getName());
        dir.getFeed().setAuthor(dir.getCreatedBy().getFullname());
        dir.getFeed().setDescription(dir.getDescription());
    }
View Full Code Here

TOP

Related Classes of org.jboss.seam.wiki.core.ui.WikiURLRenderer

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.