Package org.apache.roller.weblogger.business

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


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

        WeblogManager weblogManager = WebloggerFactory.getWeblogger().getWeblogManager();
        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


     * 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 {
            WeblogManager wmgr = WebloggerFactory.getWeblogger().getWeblogManager();
            return wmgr.getComments(
                    getWebsite(),
                    this,
                    null,  // search String
                    null,  // startDate
                    null,
View Full Code Here

        }
       
        try {
            TreeSet categories = new TreeSet();
            Weblogger roller = WebloggerFactory.getWeblogger();
            WeblogManager weblogMgr = roller.getWeblogManager();
           
            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

     */
    public WeblogEntry getWeblogEntry(String anchor) {
        WeblogEntry entry = null;
        try {
            Weblogger roller = WebloggerFactory.getWeblogger();
            WeblogManager wmgr = roller.getWeblogManager();
            entry = wmgr.getWeblogEntryByAnchor(this, anchor);
        } catch (WebloggerException e) {
            this.log.error("ERROR: getting entry by anchor");
        }
        return entry;
    }
View Full Code Here

     */
    public Set getWeblogCategories(String categoryPath) {
        Set ret = new HashSet();
        try {
            Weblogger roller = WebloggerFactory.getWeblogger();
            WeblogManager wmgr = roller.getWeblogManager();           
            WeblogCategory category = null;
            if (categoryPath != null && !categoryPath.equals("nil")) {
                category = wmgr.getWeblogCategoryByPath(this, categoryPath);
            } else {
                category = this.getDefaultCategory();
            }
            ret = category.getWeblogCategories();
        } catch (WebloggerException e) {
View Full Code Here

     */
    public WeblogCategory getWeblogCategory(String categoryPath) {
        WeblogCategory category = null;
        try {
            Weblogger roller = WebloggerFactory.getWeblogger();
            WeblogManager wmgr = roller.getWeblogManager();
            if (categoryPath != null && !categoryPath.equals("nil")) {
                category = wmgr.getWeblogCategoryByPath(this, categoryPath);
            } else {
                category = this.getDefaultCategory();
            }
        } catch (WebloggerException e) {
            log.error("ERROR: fetching category at path: " + categoryPath, e);
View Full Code Here

        if (cat != null && "nil".equals(cat)) cat = null;
        if (length > 100) length = 100;
        List recentEntries = new ArrayList();
        if (length < 1) return recentEntries;
        try {
            WeblogManager wmgr = WebloggerFactory.getWeblogger().getWeblogManager();
            recentEntries = wmgr.getWeblogEntries(
                   
                    this,
                    null,       // user
                    null,       // startDate
                    null,       // endDate
View Full Code Here

        if (tag != null) {
            tags.add(tag);
        }
        if (length < 1) return recentEntries;
        try {
            WeblogManager wmgr = WebloggerFactory.getWeblogger().getWeblogManager();
            recentEntries = wmgr.getWeblogEntries(
                   
                    this,
                    null,       // user
                    null,       // startDate
                    null,       // endDate
View Full Code Here

    public List getRecentComments(int length) {  
        if (length > 100) length = 100;
        List recentComments = new ArrayList();
        if (length < 1) return recentComments;
        try {
            WeblogManager wmgr = WebloggerFactory.getWeblogger().getWeblogManager();
            recentComments = wmgr.getComments(
                   
                    this,
                    null,          // weblog entry
                    null,          // search String
                    null,          // startDate
View Full Code Here

     * @roller.wrapPojoMethod type="simple"
     */
    public int getTodaysHits() {
        try {
            Weblogger roller = WebloggerFactory.getWeblogger();
            WeblogManager mgr = roller.getWeblogManager();
            WeblogHitCount hitCount = mgr.getHitCountByWeblog(this);
           
            return (hitCount != null) ? hitCount.getDailyHits() : 0;
           
        } catch (WebloggerException e) {
            log.error("Error getting weblog hit count", e);
View Full Code Here

TOP

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

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.