Examples of WeblogEntryManager


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

       
        // 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

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

     * 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

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

     */
    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

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

        }
       
        try {
            TreeSet categories = new TreeSet();
            Weblogger roller = WebloggerFactory.getWeblogger();
            WeblogEntryManager weblogMgr = roller.getWeblogEntryManager();
           
            WeblogEntry entry = null;
            Document doc = null;
            String handle = null;
            Timestamp now = new Timestamp(new Date().getTime());
            for(int i = offset; i < offset+limit; i++) {
               
                entry = null; // reset for each iteration
               
                doc = hits.doc(i);
                handle = doc.getField(FieldConstants.WEBSITE_HANDLE).stringValue();
               
                if(websiteSpecificSearch &&
                        handle.equals(feedRequest.getWeblogHandle())) {
                   
                    entry = weblogMgr.getWeblogEntry(
                            doc.getField(FieldConstants.ID).stringValue());
                } else {
                   
                    entry = weblogMgr.getWeblogEntry(
                            doc.getField(FieldConstants.ID).stringValue());
                   
                    if (doc.getField(FieldConstants.CATEGORY) != null) {
                        categories.add(
                                doc.getField(FieldConstants.CATEGORY).stringValue());
View Full Code Here

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

        }
       
        try {
            TreeSet categories = new TreeSet();
            Weblogger roller = WebloggerFactory.getWeblogger();
            WeblogEntryManager weblogMgr = roller.getWeblogEntryManager();
           
            WeblogEntry entry = null;
            Document doc = null;
            String handle = null;
            Timestamp now = new Timestamp(new Date().getTime());
            for(int i = offset; i < offset+limit; i++) {
               
                entry = null; // reset for each iteration
               
                doc = hits.doc(i);
                handle = doc.getField(FieldConstants.WEBSITE_HANDLE).stringValue();
               
                if(websiteSpecificSearch &&
                        handle.equals(searchRequest.getWeblogHandle())) {
                   
                    entry = weblogMgr.getWeblogEntry(
                            doc.getField(FieldConstants.ID).stringValue());
                } else {
                   
                    entry = weblogMgr.getWeblogEntry(
                            doc.getField(FieldConstants.ID).stringValue());
                   
                    if (doc.getField(FieldConstants.CATEGORY) != null) {
                        categories.add(
                                doc.getField(FieldConstants.CATEGORY).stringValue());
View Full Code Here

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

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

            } else {
                newTags.remove(tag.getName());
            }
        }

        WeblogEntryManager weblogManager = WebloggerFactory.getWeblogger().getWeblogEntryManager();
        for (Iterator it = removeTags.iterator(); it.hasNext();) {
            weblogManager.removeWeblogEntryTag((String) it.next(), this);
        }
       
        for (Iterator it = newTags.iterator(); it.hasNext();) {
            addTag((String) it.next());
        }
View Full Code Here

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

     * TODO: why is this method exposed to users with ability to get spam/non-approved comments?
     */
    public List getComments(boolean ignoreSpam, boolean approvedOnly) {
        List list = new ArrayList();
        try {
            WeblogEntryManager wmgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
            return wmgr.getComments(
                    getWebsite(),
                    this,
                    null,  // search String
                    null,  // startDate
                    null,
View Full Code Here

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

    public static WeblogCategory setupWeblogCategory(Weblog weblog,
                                                         String name,
                                                         WeblogCategory parent)
            throws Exception {
       
        WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
        WeblogCategory root = mgr.getRootWeblogCategory(weblog);
       
        WeblogCategory catParent = root;
        if(parent != null) {
            catParent = parent;
        }
        WeblogCategory testCat = new WeblogCategory(weblog, catParent, name, null, null);
        mgr.saveWeblogCategory(testCat);
       
        // flush to db
        WebloggerFactory.getWeblogger().flush();
       
        // query for object
        WeblogCategory cat = mgr.getWeblogCategory(testCat.getId());
       
        if(cat == null)
            throw new WebloggerException("error setting up weblog category");
       
        return cat;
View Full Code Here

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

     * Convenience method for removing a weblog category.
     */
    public static void teardownWeblogCategory(String id) throws Exception {
       
        // lookup the cat
        WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
        WeblogCategory cat = mgr.getWeblogCategory(id);
       
        // remove the cat
        mgr.removeWeblogCategory(cat);
       
        // flush to db
        WebloggerFactory.getWeblogger().flush();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.