Package org.apache.roller

Examples of org.apache.roller.RollerException


   
   
    public void saveWeblogCategory(WeblogCategoryData cat) throws RollerException {
       
        if(this.isDuplicateWeblogCategoryName(cat)) {
            throw new RollerException("Duplicate category name");
        }
       
        this.strategy.store(cat);
    }
View Full Code Here


   
   
    public void removeWeblogCategory(WeblogCategoryData cat) throws RollerException {
       
        if(cat.retrieveWeblogEntries(true).size() > 0) {
            throw new RollerException("Cannot remove category with entries");
        }
       
        // remove cat
        this.strategy.remove(cat);
       
View Full Code Here

                (WeblogCategoryData) this.strategy.load(
                destId, WeblogCategoryData.class);
       
        // TODO: this check should be made before calling this method?
        if (destCd.descendentOf(srcCd)) {
            throw new RollerException(
                    "ERROR cannot move parent category into it's own child");
        }
       
        // get all entries in category and subcats
        List results = getWeblogEntries(srcCd, true);
View Full Code Here

   
   
    private void removeWeblogEntryContents(WeblogEntryData entry) throws RollerException {
       
        if(entry == null) {
            throw new RollerException("cannot remove null entry");
        }
       
        Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
       
        // remove referers
View Full Code Here

            WeblogCategoryData category =
                    getWeblogCategoryByPath(current.getWebsite(), null, catName);
            if (category != null) {
                conjunction.add(Expression.eq("category", category));
            } else {
                throw new RollerException("Cannot find category: "+catName);
            }
        }
       
        try {
            Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
            Criteria criteria = session.createCriteria(WeblogEntryData.class);
            criteria.addOrder(next ? Order.asc("pubTime") : Order.desc("pubTime"));
            criteria.add(conjunction);
            criteria.setMaxResults(maxEntries);
            List results = criteria.list();
            return results;
        } catch (HibernateException e) {
            throw new RollerException(e);
        }
    }
View Full Code Here

    }
   
    public WeblogCategoryData getRootWeblogCategory(WebsiteData website)
    throws RollerException {
        if (website == null)
            throw new RollerException("website is null");
       
        try {
            Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
            Criteria criteria = session.createCriteria(WeblogCategoryAssoc.class);
            criteria.createAlias("category","c");
           
            criteria.add(Expression.eq("c.website", website));
            criteria.add(Expression.isNull("ancestorCategory"));
            criteria.add(Expression.eq("relation", WeblogCategoryAssoc.PARENT));
           
            criteria.setMaxResults(1);
           
            List list = criteria.list();
            return ((WeblogCategoryAssoc)list.get(0)).getCategory();
        } catch (HibernateException e) {
            throw new RollerException(e);
        }
    }
View Full Code Here

    }
   
    public List getWeblogCategories(WebsiteData website, boolean includeRoot)
    throws RollerException {
        if (website == null)
            throw new RollerException("website is null");
       
        if (includeRoot) return getWeblogCategories(website);
       
        try {
            Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
            Criteria criteria = session.createCriteria(WeblogCategoryAssoc.class);
            criteria.createAlias("category", "c");
            criteria.add(Expression.eq("c.website", website));
            criteria.add(Expression.isNotNull("ancestorCategory"));
            criteria.add(Expression.eq("relation", "PARENT"));
            Iterator assocs = criteria.list().iterator();
            List cats = new ArrayList();
            while (assocs.hasNext()) {
                WeblogCategoryAssoc assoc = (WeblogCategoryAssoc) assocs.next();
                cats.add(assoc.getCategory());
            }
            return cats;
        } catch (HibernateException e) {
            throw new RollerException(e);
        }
    }
View Full Code Here

        }
    }
   
    public List getWeblogCategories(WebsiteData website) throws RollerException {
        if (website == null)
            throw new RollerException("website is null");
       
        try {
            Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
            Criteria criteria = session.createCriteria(WeblogCategoryData.class);
            criteria.add(Expression.eq("website", website));
            return criteria.list();
        } catch (HibernateException e) {
            throw new RollerException(e);
        }
    }
View Full Code Here

                criteria.setMaxResults(maxEntries.intValue());
            }
            return criteria.list();
        } catch (HibernateException e) {
            log.error(e);
            throw new RollerException(e);
        }
    }
View Full Code Here

                criteria.setMaxResults(max.intValue());
            }
            return criteria.list();
        } catch (HibernateException e) {
            log.error(e);
            throw new RollerException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.roller.RollerException

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.