Package org.apache.roller.weblogger

Examples of org.apache.roller.weblogger.WebloggerException


       
        Session mailSession = WebloggerStartup.getMailProvider() != null
                ? WebloggerStartup.getMailProvider().getSession() : null;

        if(mailSession == null) {
            throw new WebloggerException("ERROR: Notification email(s) not sent, "
                    + "Roller's mail session not properly configured");
        }
       
        try {
            ResourceBundle resources = ResourceBundle.getBundle(
                    "ApplicationResources", I18nUtils.toLocale(user.getLocale()));
           
            String from = WebloggerRuntimeConfig.getProperty(
                    "user.account.activation.mail.from");
           
            String cc[] = new String[0];
            String bcc[] = new String[0];
            String to[] = new String[] { user.getEmailAddress() };
            String subject = resources.getString(
                    "user.account.activation.mail.subject");
            String content;
           
            String rootURL = WebloggerRuntimeConfig.getAbsoluteContextURL();
           
            StringBuffer sb = new StringBuffer();
           
            // activationURL=
            String activationURL = rootURL
                    + "/roller-ui/register!activate.rol?activationCode="
                    + user.getActivationCode();
            sb.append(MessageFormat.format(
                    resources.getString("user.account.activation.mail.content"),
                    new Object[] { user.getFullName(), user.getUserName(),
                    activationURL }));
            content = sb.toString();
           
            sendHTMLMessage(from, to, cc, bcc, subject, content);
        } catch (MessagingException e) {
            throw new WebloggerException("ERROR: Problem sending activation email.", e);
        }
    }
View Full Code Here


    public void init(Map initData) throws WebloggerException {
       
        // 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");
        }
       
        if(weblogRequest instanceof WeblogFeedRequest) {
            this.feedRequest = (WeblogFeedRequest) weblogRequest;
        } else {
            throw new WebloggerException("weblogRequest is not a WeblogFeedRequest."+
                    "  FeedModel only supports feed requests.");
        }
       
        // look for url strategy
        urlStrategy = (URLStrategy) initData.get("urlStrategy");
View Full Code Here

           
            if(categories.size() > 0) {
                this.categories = categories;
            }
        } catch(IOException e) {
            throw new WebloggerException(e);
        }
    }
View Full Code Here

    public void init(Map initData) throws WebloggerException {
       
        // we expect the init data to contain a searchRequest object
        searchRequest = (WeblogSearchRequest) initData.get("searchRequest");
        if(searchRequest == null) {
            throw new WebloggerException("expected searchRequest from init data");
        }
       
        // look for url strategy
        urlStrategy = (URLStrategy) initData.get("urlStrategy");
        if(urlStrategy == null) {
View Full Code Here

           
            if(categories.size() > 0) {
                this.categories = categories;
            }
        } catch(IOException e) {
            throw new WebloggerException(e);
        }
    }
View Full Code Here

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

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.