Package org.apache.roller.pojos

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


                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

                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

                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

        {
            super("planetGroups.pagetitle", request, response, mapping);
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            Roller roller = RollerFactory.getRoller();
            PlanetManager planet = roller.getPlanetManager();           
            PlanetGroupData externalGroup = planet.getGroup("external");
            if (externalGroup != null)
            {
                Iterator allgroups = planet.getGroups().iterator();
                while (allgroups.hasNext())
                {
                    PlanetGroupData agroup = (PlanetGroupData)allgroups.next();
                    if (    !agroup.getHandle().equals("external")
                         && !agroup.getHandle().equals("all"))
                      {
                          groups.add(agroup);
                      }
                }
            }
View Full Code Here

     * @returns List of PlanetEntryData objects
     */
    public List getPlanetAggregation(String groupHandle, int max) throws Exception
    {
        List list = new ArrayList();
        PlanetGroupData group = planetManager.getGroup(groupHandle);
        if (group != null)
        {
            list = planetManager.getAggregation(group, max);
        }
        return list;
View Full Code Here

        /**
         * Get named group
         */
        public PlanetGroupData getGroup(String name) throws RollerException
        {
            PlanetGroupData group = null;
            try
            {
                Roller roller = RollerFactory.getRoller()
                group = roller.getPlanetManager().getGroup(name);
            }
View Full Code Here

        {
            List ret = new ArrayList();
            try
            {
                Roller roller = RollerFactory.getRoller();  
                PlanetGroupData group= roller.getPlanetManager().getGroup(name);
                ret = roller.getPlanetManager().getAggregation(group, num);
            }
            catch (RollerException e)
            {
                mLogger.error(e);
View Full Code Here

        {
            List ret = new ArrayList();
            try
            {
                Roller roller = RollerFactory.getRoller();
                PlanetGroupData group= roller.getPlanetManager().getGroup(name);
                ret = roller.getPlanetManager().getTopSubscriptions(group,num);
            }
            catch (RollerException e)
            {
                mLogger.error(e);
View Full Code Here

                {
                    form.copyTo(config, request.getLocale());
                    planet.saveConfiguration(config);
                    if (planet.getGroup("external") == null)
                    {
                        PlanetGroupData group = new PlanetGroupData();
                        group.setHandle("external");
                        group.setTitle("external");
                        planet.saveGroup(group);
                    }
                    roller.flush();
                    ActionMessages messages = new ActionMessages();
                    messages.add(null, new ActionMessage("planetConfig.success.saved"));
View Full Code Here

TOP

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

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.