Examples of PlanetGroupData


Examples of org.apache.roller.pojos.PlanetGroupData

           
            String feed_url1 = "http://rollerweblogger.org/rss/roller";
            String feed_url2 = "http://linuxintegrators.com/acoliver/?flavor=rss2";
           
            {
                PlanetGroupData group = new PlanetGroupData();
                group.setDescription("test_group_desc");
                group.setHandle("test_handle");
                group.setTitle("test_title");
                planet.saveGroup(group);
               
                PlanetSubscriptionData sub1 = new PlanetSubscriptionData();
                sub1.setFeedUrl(feed_url1);
                planet.saveSubscription(sub1);
               
                PlanetSubscriptionData sub2 = new PlanetSubscriptionData();
                sub2.setFeedUrl(feed_url2);
                planet.saveSubscription(sub2);
               
                group.addSubscription(sub1);
                group.addSubscription(sub2);
                planet.saveGroup(group);
                TestUtils.endSession(true);
            }
            {
                planet.refreshEntries();
                TestUtils.endSession(true);
               
                int count = 0;
                Iterator subs = planet.getAllSubscriptions();
                while  (subs.hasNext()) {
                    PlanetSubscriptionData sub= (PlanetSubscriptionData)subs.next();
                    count += sub.getEntries().size();
                }
                PlanetSubscriptionData sub1 = planet.getSubscription(feed_url1);
                assertTrue(sub1.getEntries().size() > 0);
                PlanetSubscriptionData sub2 = planet.getSubscription(feed_url2);
                assertTrue(sub2.getEntries().size() > 0);
                assertEquals(count, sub1.getEntries().size() + sub2.getEntries().size());
               
                PlanetGroupData group = planet.getGroup("test_handle");
                assertNotNull(group);
               
                List bigag = planet.getAggregation(group, 30);
                assertEquals(30, bigag.size());
               
View Full Code Here

Examples of org.apache.roller.pojos.PlanetGroupData

        config.setCacheDir("");
        config.setTitle("Test");
        config.setAdminEmail("admin@example.com");
        planet.saveConfiguration(config);
       
        PlanetGroupData group = new PlanetGroupData();
        group.setHandle("external");
        group.setTitle("external");
        planet.saveGroup(group);
    }
View Full Code Here

Examples of org.apache.roller.pojos.PlanetGroupData

     */
    public void tearDown() throws Exception {
        try {
            PlanetManager planet = getRoller().getPlanetManager();
            PlanetConfigData config = planet.getConfiguration();
            PlanetGroupData group = planet.getGroup("external");
            planet.deleteGroup(group);
           
            deleteWebsite(testUsername);
        } catch (RollerException e) {
            mLogger.error("Tearing down",e);
View Full Code Here

Examples of org.apache.roller.pojos.PlanetGroupData

               
                String groupHandle = request.getParameter("groupHandle");
                groupHandle = (groupHandle == null) ? form.getGroupHandle() : groupHandle;
                groupHandle = (groupHandle == null) ? "external" : groupHandle;
               
                PlanetGroupData targetGroup = planet.getGroup(groupHandle);
                form.setGroupHandle(groupHandle);
                request.setAttribute("model",
                        new SubscriptionsPageModel(
                        targetGroup, request, response, mapping, form));
            } else {
View Full Code Here

Examples of org.apache.roller.pojos.PlanetGroupData

               
                String groupHandle = request.getParameter("groupHandle");
                groupHandle = (groupHandle == null) ? form.getGroupHandle() : groupHandle;
                groupHandle = (groupHandle == null) ? "external" : groupHandle;
               
                PlanetGroupData targetGroup = planet.getGroup(groupHandle);
                form.setGroupHandle(groupHandle);
                request.setAttribute("model",
                        new SubscriptionsPageModel(
                        targetGroup, request, response, mapping, form));
            } else {
View Full Code Here

Examples of org.apache.roller.pojos.PlanetGroupData

                   
                    String groupHandle = request.getParameter("groupHandle");
                    groupHandle = (groupHandle == null) ? form.getGroupHandle() : groupHandle;
                    groupHandle = (groupHandle == null) ? "external" : groupHandle;
                   
                    PlanetGroupData targetGroup = planet.getGroup(groupHandle);
                   
                    targetGroup.removeSubscription(sub);
                    planet.deleteSubscription(sub);
                    roller.flush();
                    // TODO: why release here?
                    roller.release();
                   
View Full Code Here

Examples of org.apache.roller.pojos.PlanetGroupData

           
            String groupHandle = request.getParameter("groupHandle");
            groupHandle = (groupHandle == null) ? form.getGroupHandle() : groupHandle;
            groupHandle = (groupHandle == null) ? "external" : groupHandle;
           
            PlanetGroupData targetGroup = planet.getGroup(groupHandle);
           
            if (RollerSession.getRollerSession(request).isGlobalAdminUser()) {
               
                ActionMessages messages = new ActionMessages();
                PlanetSubscriptionData sub = null;
                ActionErrors errors = validate(planet, form);
                if (errors.isEmpty()) {
                    if (form.getId() == null || form.getId().trim().length() == 0) {                       
                        // Adding new subscription to group                       
                        // But, does subscription to that feed already exist?
                        if (form.getFeedUrl() != null) {
                            sub = planet.getSubscription(form.getFeedUrl());
                        }
                        if (sub != null) {
                            // Yes, we'll use it instead
                            messages.add(null, new ActionMessage(
                                "planetSubscription.foundExisting", sub.getTitle()));
                        } else {
                            // No, add new subscription
                            sub = new PlanetSubscriptionData();
                            form.copyTo(sub, request.getLocale());
                        }                       
                        targetGroup.addSubscription(sub);
                       
                    } else {
                        // User editing an existing subscription within a group
                        sub = planet.getSubscriptionById(form.getId());
                        form.copyTo(sub, request.getLocale());                       
View Full Code Here

Examples of org.apache.roller.pojos.PlanetGroupData

                PlanetManager planet = roller.getPlanetManager();
                PlanetGroupForm form = (PlanetGroupForm)actionForm;
                if (request.getParameter("groupHandle") != null)
                {
                    String feedUrl = request.getParameter("groupHandle");
                    PlanetGroupData group = planet.getGroup(feedUrl);
                    form.copyFrom(group, request.getLocale());
                }
                else
                {
                    form.doReset(mapping, request);
View Full Code Here

Examples of org.apache.roller.pojos.PlanetGroupData

                Roller roller = RollerFactory.getRoller();
                PlanetManager planet = roller.getPlanetManager();
                PlanetGroupForm form = (PlanetGroupForm)actionForm;
                if (form.getHandle() != null)
                {
                    PlanetGroupData group = planet.getGroup(form.getHandle());
                    planet.deleteGroup(group);
                    roller.flush();
                    // TODO: why release here?
                    roller.release();
                   
View Full Code Here

Examples of org.apache.roller.pojos.PlanetGroupData

                Roller roller = RollerFactory.getRoller();
                PlanetManager planet = roller.getPlanetManager();
                ActionErrors errors = validate(planet, form);
                if (errors.isEmpty())
                {
                    PlanetGroupData group = null;
                    if (form.getId() == null || form.getId().trim().length() == 0)
                    {
                        group = new PlanetGroupData();
                    }
                    else
                    {
                        group = planet.getGroupById(form.getId());
                    }               
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.