Package org.apache.roller.pojos

Examples of org.apache.roller.pojos.WeblogEntryTagData


        }
       
        // remove tags aggregates
        if(entry.getTags() != null) {
            for(Iterator it = entry.getTags().iterator(); it.hasNext(); ) {
                WeblogEntryTagData tag = (WeblogEntryTagData) it.next();
                updateTagCount(tag.getName(), entry.getWebsite(), -1);
            }
        }
       
        // remove entry
        this.strategy.remove(entry);
View Full Code Here


       
        // remove tags
        Criteria tagQuery = session.createCriteria(WeblogEntryTagData.class)
            .add(Expression.eq("weblog.id", website.getId()));
        for(Iterator iter = tagQuery.list().iterator(); iter.hasNext();) {
            WeblogEntryTagData tagData = (WeblogEntryTagData) iter.next();
            this.strategy.remove(tagData);
        }
       
        // remove site tag aggregates
        List tags = wmgr.getTags(website, null, null, -1);
View Full Code Here

        TestUtils.endSession(true);

        entry = mgr.getWeblogEntry(id);
        HashSet tagNames = new HashSet();
        for (Iterator it = entry.getTags().iterator(); it.hasNext();) {
            WeblogEntryTagData tagData = (WeblogEntryTagData) it.next();
            tagNames.add(tagData.getName());
        }

        assertEquals(3, entry.getTags().size());
        assertEquals(3, tagNames.size());
        assertEquals(true, tagNames.contains("testwillstaytag"));
View Full Code Here

        assertEquals(2, entry.getTags().size());

        Timestamp original = null;

        for (Iterator it = entry.getTags().iterator(); it.hasNext();) {
            WeblogEntryTagData tagData = (WeblogEntryTagData) it.next();
            if (tagData.getName().equals("testwillstaytag"))
                original = tagData.getTime();
        }

        List updateTags = new ArrayList();
        updateTags.add("testwillstaytag");
        updateTags.add("testnewtag");
        updateTags.add("testnewtag3");
        entry.updateTags(updateTags);
        mgr.saveWeblogEntry(entry);
        TestUtils.endSession(true);

        entry = mgr.getWeblogEntry(id);
        HashSet tagNames = new HashSet();
        for (Iterator it = entry.getTags().iterator(); it.hasNext();) {
            WeblogEntryTagData tagData = (WeblogEntryTagData) it.next();
            tagNames.add(tagData.getName());
            if (tagData.getName().equals("testwillstaytag"))
                assertEquals(original, tagData.getTime());
        }

        assertEquals(3, entry.getTags().size());
        assertEquals(3, tagNames.size());
        assertEquals(true, tagNames.contains("testwillstaytag"));
View Full Code Here

TOP

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

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.