Package org.apache.roller.pojos

Examples of org.apache.roller.pojos.WeblogCategoryData


        // remove cat
        this.strategy.remove(cat);
       
        // update website default cats if needed
        if(cat.getWebsite().getBloggerCategory().equals(cat)) {
            WeblogCategoryData rootCat = this.getRootWeblogCategory(cat.getWebsite());
            cat.getWebsite().setBloggerCategory(rootCat);
            this.strategy.store(cat.getWebsite());
        }
       
        if(cat.getWebsite().getDefaultCategory().equals(cat)) {
            WeblogCategoryData rootCat = this.getRootWeblogCategory(cat.getWebsite());
            cat.getWebsite().setDefaultCategory(rootCat);
            this.strategy.store(cat.getWebsite());
        }
       
        // update weblog last modified date.  date updated by saveWebsite()
View Full Code Here


        } else {
            conjunction.add(Expression.lt("pubTime", current.getPubTime()));
        }
       
        if (catName != null && !catName.trim().equals("/")) {
            WeblogCategoryData category =
                    getWeblogCategoryByPath(current.getWebsite(), null, catName);
            if (category != null) {
                conjunction.add(Expression.eq("category", category));
            } else {
                throw new RollerException("Cannot find category: "+catName);
View Full Code Here

            String      sortby,
            String      locale,
            int         offset,
            int         length) throws RollerException {
       
        WeblogCategoryData cat = null;
        if (StringUtils.isNotEmpty(catName) && website != null) {
            cat = getWeblogCategoryByPath(website, catName);
            if (cat == null) catName = null;
        }
        if (catName != null && catName.trim().equals("/")) {
View Full Code Here

        }
    }
   
    public Date getWeblogLastPublishTime(WebsiteData website, String catName)
    throws RollerException {
        WeblogCategoryData cat = null;
        Roller mRoller = RollerFactory.getRoller();
        if (catName != null && website != null) {
            cat = getWeblogCategoryByPath(website, null, catName);
            if (cat == null) catName = null;
        }
View Full Code Here

    }
   
    public boolean isDuplicateWeblogCategoryName(WeblogCategoryData cat)
    throws RollerException {
        // ensure that no sibling categories share the same name
        WeblogCategoryData parent =
                null == cat.getId() ? (WeblogCategoryData)cat.getNewParent() : cat.getParent();
       
        if (null != parent) // don't worry about root
        {
            List sameNames;
View Full Code Here

                return true;
            }
           
            Iterator cats = cat.getWeblogCategories().iterator();
            while (cats.hasNext()) {
                WeblogCategoryData childCat = (WeblogCategoryData)cats.next();
                if (childCat.isInUse()) {
                    return true;
                }
            }
           
            if (cat.getWebsite().getBloggerCategory().equals(cat)) {
View Full Code Here

        } else {
            cats = category.getWeblogCategories().iterator();
        }
       
        while (cats.hasNext()) {
            WeblogCategoryData possibleMatch = (WeblogCategoryData)cats.next();
            if (possibleMatch.getName().equals(pathArray[0])) {
                if (pathArray.length == 1) {
                    return possibleMatch;
                } else {
                    String[] subpath = new String[pathArray.length - 1];
                    System.arraycopy(pathArray, 1, subpath, 0, subpath.length);
View Full Code Here

        ActionForward forward = mapping.findForward("categories");
        WeblogCategoryFormEx form = (WeblogCategoryFormEx)actionForm;
        RollerRequest rreq = RollerRequest.getRollerRequest(request);
        WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();

        WeblogCategoryData cd = null;
        if (null != form.getId() && !form.getId().trim().equals(""))
        {
            cd = wmgr.getWeblogCategory(form.getId());
        }
        else
        {
            cd = new WeblogCategoryData();
            String pid = form.getParentId();
            WeblogCategoryData parentCat = wmgr.getWeblogCategory(pid);
            cd.setWebsite(parentCat.getWebsite());
            cd.setParent(parentCat);
        }

        RollerSession rses = RollerSession.getRollerSession(request);
        if (cd.getWebsite().hasUserPermissions(
View Full Code Here

            this.queryForm = queryForm;
            this.website = website;

            if (null != queryForm.getCategoryId() && !queryForm.getCategoryId().equals("")) {
                WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
                WeblogCategoryData cd = wmgr.getWeblogCategory(queryForm.getCategoryId());
                category = cd.getPath();
            }

            final DateFormat df =
                    DateFormat.getDateInstance(DateFormat.SHORT, request.getLocale());
            String start = queryForm.getStartDateString();
View Full Code Here

                mLogger.debug("Moving categories to category, id="
                    + form.getMoveToCategoryId());
                   
                // Move subCategories to new category.
                String Categories[] = form.getSelectedCategories();
                WeblogCategoryData parent =
                    wmgr.getWeblogCategory(form.getMoveToCategoryId());
                if (null != Categories)
                {
                    for (int i = 0; i < Categories.length; i++)
                    {
                        WeblogCategoryData cd =
                            wmgr.getWeblogCategory(Categories[i]);
                       
                        // Don't move category into itself.                 
                        if (    !cd.getId().equals(parent.getId())
                             && !parent.descendentOf(cd))
                        {
                            cd.setParent(parent);
                            wmgr.saveWeblogCategory(cd);
                        }
                        else
                        {
                            messages.add(null, new ActionMessage(
                                "categoriesForm.warn.notMoving",cd.getName()));
                        }
                    }
                }   
                // TODO: new manager method, moveCategory(cat, newPath)
                RollerFactory.getRoller().flush();
View Full Code Here

TOP

Related Classes of org.apache.roller.pojos.WeblogCategoryData

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.