Package org.apache.roller.weblogger.pojos

Examples of org.apache.roller.weblogger.pojos.WeblogCategory


                    Categories cats = new Categories();
                    cats.setFixed(true);
                    cats.setScheme(getWeblogCategoryScheme(weblog));
                    List rollerCats = roller.getWeblogEntryManager().getWeblogCategories(weblog, false);
                    for (Iterator it = rollerCats.iterator(); it.hasNext();) {
                        WeblogCategory rollerCat = (WeblogCategory) it.next();
                        Category cat = new Category();
                        cat.setTerm(rollerCat.getPath().substring(1));
                        cat.setLabel(rollerCat.getName());
                        cats.addCategory(cat);
                    }
                    entryCol.addCategories(cats);

                    // Add tags as free-form categories using scheme that points
View Full Code Here


        log.info("BEGIN");
       
        WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
       
        // start at root
        WeblogCategory root = mgr.getRootWeblogCategory(TestUtils.getManagedWebsite(testWeblog));
       
        // walk first level
        Set cats = root.getWeblogCategories();
        assertEquals(2, cats.size());
        assertTrue(cats.contains(testCat));
       
        // find cat1
        WeblogCategory cat = null;
        for(Iterator it = cats.iterator(); it.hasNext(); ) {
            cat = (WeblogCategory) it.next();
            if(cat.getName().equals(cat1.getName())) {
                break;
            }
        }
       
        // walk second level
        cats = cat.getWeblogCategories();
        assertEquals(1, cats.size());
        assertTrue(cats.contains(cat2));
       
        // find cat2
        cat = (WeblogCategory) cats.iterator().next();
       
        // walk third level
        cats = cat.getWeblogCategories();
        assertEquals(1, cats.size());
        assertTrue(cats.contains(cat3));
       
        // find cat3
        cat = (WeblogCategory) cats.iterator().next();
       
        // make sure this is the end of the tree
        cats = cat.getWeblogCategories();
        assertEquals(0, cats.size());
       
        log.info("END");
    }
View Full Code Here

       
        log.info("BEGIN");
       
        WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
       
        WeblogCategory root = mgr.getRootWeblogCategory(TestUtils.getManagedWebsite(testWeblog));
       
        // check that root has category
        assertTrue(root.hasCategory(testCat.getName()));
       
        log.info("END");
    }
View Full Code Here

       
        log.info("BEGIN");
       
        WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
       
        WeblogCategory cat = mgr.getWeblogCategory(testCat.getId());
        assertNotNull(cat);
        assertEquals(cat, testCat);
       
        log.info("END");
    }
View Full Code Here

        log.info("BEGIN");
       
        WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
       
        testWeblog = TestUtils.getManagedWebsite(testWeblog);
        WeblogCategory cat = mgr.getWeblogCategoryByPath(testWeblog, "/catTest-cat1");
        assertNotNull(cat);
        assertEquals(cat, cat1);
       
        cat = mgr.getWeblogCategoryByPath(testWeblog, "/catTest-cat1/catTest-cat2/catTest-cat3");
        assertNotNull(cat);
        assertEquals(cat, cat3);
       
        // test lazy lookup, specifying just a name without slashes
        cat = mgr.getWeblogCategoryByPath(testWeblog, "catTest-cat1");
        assertNotNull(cat);
        assertEquals(cat, cat1);
       
        // if no path is specified we should get the root category
        cat = mgr.getWeblogCategoryByPath(testWeblog, null);
        assertNotNull(cat);
        assertEquals(cat.getPath(), "/");
       
        log.info("END");
    }
View Full Code Here

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

       
        mLogger.debug("setupContext( ctx = "+ctx+")");
       
        Weblog weblog = null;
        WeblogEntry entry = null;
        WeblogCategory category = null;
        ThemeTemplate page = null;
        WeblogBookmarkFolder folder = null// don't even know how this is involved :/
        Date date = null;
        boolean isDay = false;
        boolean isMonth = false;
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.pojos.WeblogCategory

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.