Package org.apache.roller.pojos

Examples of org.apache.roller.pojos.WeblogCategoryData


       
        RollerContext rollerCtx = RollerContext.getRollerContext( );
       
        WebsiteData weblog = null;
        WeblogEntryData entry = null;
        WeblogCategoryData category = null;
        Template page = null;
        FolderData folder = null// don't even know how this is involved :/
        Date date = null;
        boolean isDay = false;
        boolean isMonth = false;
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

    }

    private static final class CategoryPathComparator implements Comparator
    {
        public int compare(Object o1, Object o2) {
            WeblogCategoryData f1 = (WeblogCategoryData)o1;
            WeblogCategoryData f2 = (WeblogCategoryData)o2;
            return f1.getPath().compareTo(f2.getPath());
        }
View Full Code Here

            if (null != cat.getParent())
            {
                catPath = new LinkedList();
                catPath.add(0, cat);
                WeblogCategoryData parent = cat.getParent();
                while (parent != null)
                {
                    catPath.add(0, parent);
                    parent = parent.getParent();  
                }
                //request.setAttribute("categoryPath", catPath);

                request.setAttribute(
                    RequestConstants.PARENT_ID, cat.getParent().getId());
            }

            // Build collection of all Categories, except for current one,
            // sorted by path.
            Iterator iter = wmgr.getWeblogCategories(website).iterator();
            while (iter.hasNext())
            {
                WeblogCategoryData cd = (WeblogCategoryData) iter.next();
                if (!cd.getId().equals(catId))
                {
                    allCategories.add(cd);
                }
            }
            // For Struts tags
View Full Code Here

            ret = (List)mCategories.get("zzz_null_zzz");
        }
       
        if (null == ret) {
            try {
                WeblogCategoryData category = null;
                if (categoryName != null) {
                    category = mWeblogMgr.getWeblogCategoryByPath(
                            mWebsite, null, categoryName);
                } else {
                    category = mWebsite.getDefaultCategory();
                }
               
                List mRet = category.getWeblogCategories();
               
                // wrap pojos
                ret = new ArrayList(mRet.size());
                Iterator it = mRet.iterator();
                int i=0;
View Full Code Here

                    AtomService.Categories cats = new AtomService.Categories();
                    cats.setFixed(true);
                    cats.setScheme(URLUtilities.getWeblogURL(perm.getWebsite(), null, true));
                    List rollerCats = mRoller.getWeblogManager().getWeblogCategories(perm.getWebsite(), false);
                    for (Iterator it = rollerCats.iterator(); it.hasNext();) {
                        WeblogCategoryData rollerCat = (WeblogCategoryData)it.next();
                        AtomService.Category cat = new AtomService.Category();
                        cat.setTerm(rollerCat.getPath());
                        cat.setLabel(rollerCat.getName());
                        cats.addCategory(cat);
                    }
                    entryCol.addCategories(cats);
                } catch (Exception e) {
                    throw new AtomException("ERROR fetching weblog categories");
View Full Code Here

            for (int i=0; i<categories.size(); i++) {
                Category cat = (Category)categories.get(i);
                // Caller has no way of knowing our categories, so be lenient here
                String catString = cat.getTerm() != null ? cat.getTerm() : cat.getLabel();
                if (catString != null) {
                    WeblogCategoryData rollerCat =
                            mRoller.getWeblogManager().getWeblogCategoryByPath(
                            website, catString);
                    if (rollerCat != null) {
                        // Found a valid category, so break out
                        rollerEntry.setCategory(rollerCat);
View Full Code Here

        }
       
        WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
       
        if (getDefaultCategoryId() != null) {
            WeblogCategoryData defaultCat =
                wmgr.getWeblogCategory(getDefaultCategoryId());
            dataHolder.setDefaultCategory(defaultCat);
        }
       
        if (getBloggerCategoryId() != null) {
            WeblogCategoryData bloggerCat =
                wmgr.getWeblogCategory(getBloggerCategoryId());
            dataHolder.setBloggerCategory(bloggerCat);
        }
    }
View Full Code Here

        }
       
        WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
       
        if (getDefaultCategoryId() != null) {
            WeblogCategoryData defaultCat =
                wmgr.getWeblogCategory(getDefaultCategoryId());
            dataHolder.setDefaultCategory(defaultCat);
        }
       
        if (getBloggerCategoryId() != null) {
            WeblogCategoryData bloggerCat =
                wmgr.getWeblogCategory(getBloggerCategoryId());
            dataHolder.setBloggerCategory(bloggerCat);
        }
    }
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.