Package org.apache.roller.weblogger

Examples of org.apache.roller.weblogger.WebloggerException


     */
    public void saveWeblogCategory(WeblogCategory cat) throws WebloggerException {
        boolean exists = getWeblogCategory(cat.getId()) != null;
        if (!exists) {
            if (isDuplicateWeblogCategoryName(cat)) {
                throw new WebloggerException("Duplicate category name, cannot save category");
            }
            // Newly added object. If it has a parent,
            // maintain relationship from both sides
            WeblogCategory parent = cat.getParent();
            if(parent != null) {
View Full Code Here


     * @inheritDoc
     */
    public void removeWeblogCategory(WeblogCategory cat)
    throws WebloggerException {
        if(cat.retrieveWeblogEntries(true).size() > 0) {
            throw new WebloggerException("Cannot remove category with entries");
        }
       
        // remove cat
        this.strategy.remove(cat);
        //relationship management for the other side
View Full Code Here

    public void moveWeblogCategory(WeblogCategory srcCat, WeblogCategory destCat)
    throws WebloggerException {
       
        // TODO: this check should be made before calling this method?
        if (destCat.descendentOf(srcCat)) {
            throw new WebloggerException(
                    "ERROR cannot move parent category into it's own child");
        }
       
        log.debug("Moving category "+srcCat.getPath() +
                " under "+destCat.getPath());
View Full Code Here

            WeblogCategory destCat)
            throws WebloggerException {
       
        // TODO: this check should be made before calling this method?
        if (destCat.descendentOf(srcCat)) {
            throw new WebloggerException(
                    "ERROR cannot move parent category into it's own child");
        }
       
        // get all entries in category and subcats
        List results = srcCat.retrieveWeblogEntries(true);
View Full Code Here

            category = getWeblogCategoryByPath(current.getWebsite(), catName);
            if (category != null) {
                params.add(size++, category);
                whereClause.append(" AND e.category = ?" + size);
            } else {
                throw new WebloggerException("Cannot find category: " + catName);
            }
        }
       
        if(locale != null) {
            params.add(size++, locale + '%');
View Full Code Here

     * @inheritDoc
     */
    public WeblogCategory getRootWeblogCategory(Weblog website)
    throws WebloggerException {
        if (website == null)
            throw new WebloggerException("website is null");
       
        Query q = strategy.getNamedQuery(
                "WeblogCategory.getByWebsite&ParentNull");
        q.setParameter(1, website);
        try {
View Full Code Here

     * @inheritDoc
     */
    public List getWeblogCategories(Weblog website, boolean includeRoot)
    throws WebloggerException {
        if (website == null)
            throw new WebloggerException("website is null");
       
        if (includeRoot) return getWeblogCategories(website);
       
        Query q = strategy.getNamedQuery(
                "WeblogCategory.getByWebsite&ParentNotNull");
View Full Code Here

     * @inheritDoc
     */
    public List getWeblogCategories(Weblog website)
    throws WebloggerException {
        if (website == null)
            throw new WebloggerException("website is null");
       
        Query q = strategy.getNamedQuery(
                "WeblogCategory.getByWebsite");
        q.setParameter(1, website);
        return q.getResultList();
View Full Code Here

     */
    public WeblogEntry getWeblogEntryByAnchor(Weblog website,
            String anchor) throws WebloggerException {
       
        if (website == null)
            throw new WebloggerException("Website is null");
       
        if (anchor == null)
            throw new WebloggerException("Anchor is null");
       
        // mapping key is combo of weblog + anchor
        String mappingKey = website.getHandle()+":"+anchor;
       
        // check cache first
View Full Code Here

     * @inheritDoc
     */
    public void updateTagCount(String name, Weblog website, int amount)
    throws WebloggerException {
        if(amount == 0) {
            throw new WebloggerException("Tag increment amount cannot be zero.");
        }
       
        if(website == null) {
            throw new WebloggerException("Website cannot be NULL.");
        }
       
        // The reason why add order lastUsed desc is to make sure we keep picking the most recent
        // one in the case where we have multiple rows (clustered environment)
        // eventually that second entry will have a very low total (most likely 1) and
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.WebloggerException

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.