Package org.apache.roller.weblogger

Examples of org.apache.roller.weblogger.WebloggerException


     */
    public void incrementHitCount(Weblog weblog, int amount)
    throws WebloggerException {
       
        if(amount == 0) {
            throw new WebloggerException("Tag increment amount cannot be zero.");
        }
       
        if(weblog == null) {
            throw new WebloggerException("Website cannot be NULL.");
        }
       
        Query q = strategy.getNamedQuery("WeblogHitCount.getByWeblog");
        q.setParameter(1, weblog);
        WeblogHitCount hitCount = null;
View Full Code Here


    public void saveFolder(WeblogBookmarkFolder folder) throws WebloggerException {
       
        if(folder.getId() == null || this.getFolder(folder.getId()) == null) {
            // New folder, so make sure name is unique
            if (isDuplicateFolderName(folder)) {
                throw new WebloggerException("Duplicate folder name");
            }

            // And If it has a parent, maintain relationship from both sides
            WeblogBookmarkFolder parent = folder.getParent();
            if(parent != null) {
View Full Code Here

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

                Element elem = (Element)iter.next();
                importOpmlElement( website, elem, newFolder );
            }

        } catch (Exception ex) {
            throw new WebloggerException(ex);
        }
    }
View Full Code Here

    }

    public WeblogBookmarkFolder getRootFolder(Weblog website)
            throws WebloggerException {
        if (website == null)
            throw new WebloggerException("website is null");
       
        Query q = strategy.getNamedQuery("WeblogBookmarkFolder.getByWebsite&ParentNull");
        q.setParameter(1, website);
        try {
            return (WeblogBookmarkFolder)q.getSingleResult();
View Full Code Here

    }

    public List getAllFolders(Weblog website)
            throws WebloggerException {
        if (website == null)
            throw new WebloggerException("Website is null");
       
        Query q = strategy.getNamedQuery("WeblogBookmarkFolder.getByWebsite");
        q.setParameter(1, website);
        return q.getResultList();
    }
View Full Code Here

        this.pageContext = (PageContext) initData.get("pageContext");
       
        // we expect the init data to contain a weblogRequest object
        WeblogRequest weblogRequest = (WeblogRequest) initData.get("parsedRequest");
        if(weblogRequest == null) {
            throw new WebloggerException("expected weblogRequest from init data");
        }
       
        // CalendarModel only works on page requests, so cast weblogRequest
        // into a WeblogPageRequest and if it fails then throw exception
        if(weblogRequest instanceof WeblogPageRequest) {
            this.pageRequest = (WeblogPageRequest) weblogRequest;
        } else {
            throw new WebloggerException("weblogRequest is not a WeblogPageRequest."+
                    "  CalendarModel only supports page requests.");
        }
    }
View Full Code Here

    public void init(Map initData) throws WebloggerException {
       
        // we expect the init data to contain a weblogRequest object
        this.weblogRequest = (WeblogRequest) initData.get("parsedRequest");
        if(this.weblogRequest == null) {
            throw new WebloggerException("expected weblogRequest from init data");
        }
       
        if (weblogRequest instanceof WeblogPageRequest) {
            ThemeTemplate weblogPage = ((WeblogPageRequest)weblogRequest).getWeblogPage();
            pageLink = (weblogPage != null) ? weblogPage.getLink() : null;
View Full Code Here

    public void init(Map initData) throws WebloggerException {
       
        // we expect the init data to contain a weblogRequest object
        this.weblogRequest = (WeblogRequest) initData.get("parsedRequest");
        if(this.weblogRequest == null) {
            throw new WebloggerException("expected weblogRequest from init data");
        }
       
        if (weblogRequest instanceof WeblogPageRequest) {
            ThemeTemplate weblogPage = ((WeblogPageRequest)weblogRequest).getWeblogPage();
            pageLink = (weblogPage != null) ? weblogPage.getLink() : null;
View Full Code Here

                }
            }
           
        } catch (Exception e) {
            log.error("ERROR importing theme", e);
            throw new WebloggerException( e );
        }
    }
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.