Package org.apache.roller.weblogger.business

Examples of org.apache.roller.weblogger.business.WeblogEntryManager


    public void loadComments() {
       
        List comments = Collections.EMPTY_LIST;
        boolean hasMore = false;
        try {
            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
            List rawComments = wmgr.getComments(
                    null,
                    null,
                    getBean().getSearchString(),
                    getBean().getStartDate(),
                    getBean().getEndDate(),
View Full Code Here


       
        // load bean data using comments list
        getBean().loadCheckboxes(getPager().getItems());
       
        try {
            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
            List allMatchingComments = wmgr.getComments(
                    null,
                    null,
                    getBean().getSearchString(),
                    getBean().getStartDate(),
                    getBean().getEndDate(),
View Full Code Here

     * Bulk delete all comments matching query criteria.
     */
    public String delete() {
       
        try {
            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
            int deleted = wmgr.removeMatchingComments(
                    null,
                    null,
                    getBean().getSearchString(),
                    getBean().getStartDate(),
                    getBean().getEndDate(),
View Full Code Here

     */
    public String update() {
        if (!"POST".equals(httpMethod)) return ERROR;
       
        try {
            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
           
            List<Weblog> flushList = new ArrayList<Weblog>();
           
            // delete all comments with delete box checked
            List<String> deletes = Arrays.asList(getBean().getDeleteComments());
            if(deletes != null && deletes.size() > 0) {
                log.debug("Processing deletes - "+deletes.size());
               
                WeblogEntryComment deleteComment = null;
                for(String deleteId : deletes) {
                    deleteComment = wmgr.getComment(deleteId);
                    flushList.add(deleteComment.getWeblogEntry().getWebsite());
                    wmgr.removeComment(deleteComment);
                }
            }
           
            // loop through IDs of all comments displayed on page
            List spamIds = Arrays.asList(getBean().getSpamComments());
            log.debug(spamIds.size()+" comments marked as spam");
           
            String[] ids = Utilities.stringToStringArray(getBean().getIds(),",");
            for (int i=0; i < ids.length; i++) {
                log.debug("processing id - "+ ids[i]);
               
                // if we already deleted it then skip forward
                if(deletes.contains(ids[i])) {
                    log.debug("Already deleted, skipping - "+ids[i]);
                    continue;
                }
               
                WeblogEntryComment comment = wmgr.getComment(ids[i]);
               
                // mark/unmark spam
                if (spamIds.contains(ids[i]) &&
                        !WeblogEntryComment.SPAM.equals(comment.getStatus())) {
                    log.debug("Marking as spam - "+comment.getId());
                    comment.setStatus(WeblogEntryComment.SPAM);
                    wmgr.saveComment(comment);
                   
                    flushList.add(comment.getWeblogEntry().getWebsite());
                } else if(WeblogEntryComment.SPAM.equals(comment.getStatus())) {
                    log.debug("Marking as approved - "+comment.getId());
                    comment.setStatus(WeblogEntryComment.APPROVED);
                    wmgr.saveComment(comment);
                   
                    flushList.add(comment.getWeblogEntry().getWebsite());
                }
            }
           
View Full Code Here

    }
   
   
    public void myPrepare() {
        try {
            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
            if(!StringUtils.isEmpty(getRemoveId())) {
                setCategory(wmgr.getWeblogCategory(getRemoveId()));
            }
        } catch (WebloggerException ex) {
            log.error("Error looking up category", ex);
        }
    }
View Full Code Here

        // build list of categories for display
        TreeSet allCategories = new TreeSet(new WeblogCategoryPathComparator());
       
        try {
            // Build list of all categories, except for current one, sorted by path.
            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
            List<WeblogCategory> cats = wmgr.getWeblogCategories(getActionWeblog(), true);
            for(WeblogCategory cat : cats) {
                if (!cat.getId().equals(getRemoveId())) {
                    allCategories.add(cat);
                }
            }
View Full Code Here

     * Remove a new template.
     */
    public String remove() {
       
        if(getCategory() != null) try {
            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
           
            if(getTargetCategoryId() != null) {
                WeblogCategory target = wmgr.getWeblogCategory(getTargetCategoryId());
                wmgr.moveWeblogCategoryContents(getCategory(), target);
                WebloggerFactory.getWeblogger().flush();
            }
           
            // notify cache
            String id = getCategory().getId();
            CacheManager.invalidate(getCategory());
           
            wmgr.removeWeblogCategory(getCategory());
            WebloggerFactory.getWeblogger().flush();
           
            // set category id to parent for next page
            setRemoveId(id);
           
View Full Code Here

        List<WeblogEntry> entries = null;
        boolean hasMore = false;
        try {
            String status = getBean().getStatus();
           
            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
            List<WeblogEntry> rawEntries = wmgr.getWeblogEntries(
                    getActionWeblog(),
                    null,
                    getBean().getStartDate(),
                    getBean().getEndDate(),
                    getBean().getCategoryPath(),
View Full Code Here

        tmpCat.setPath("");
        cats.add(tmpCat);
       
        List<WeblogCategory> weblogCats = Collections.EMPTY_LIST;
        try {
            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
            weblogCats = wmgr.getWeblogCategories(getActionWeblog(), false);
        } catch (WebloggerException ex) {
            log.error("Error getting category list for weblog - "+getWeblog(), ex);
        }
       
        cats.addAll(weblogCats);
View Full Code Here

   
   
    public void myPrepare() {
       
        try {
            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
           
            // set categories list
            setWeblogCategories(wmgr.getWeblogCategories(getActionWeblog(), false));
           
            // set the Editor Page list
            UIPluginManager pmgr = RollerContext.getUIPluginManager();
            List editorsList = pmgr.getWeblogEntryEditors();
            if(editorsList != null) {
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.business.WeblogEntryManager

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.