Examples of PlanetManager


Examples of org.apache.roller.model.PlanetManager

            return null;
        }
        try
        {
            response.setContentType("application/rss+xml;charset=utf-8");
            PlanetManager planet =
                RollerFactory.getRoller().getPlanetManager();
            if (request.getParameter("group") != null)
            {
                context.put("group",
                        planet.getGroup(request.getParameter("group")));
            }
            context.put("planet", planet);
            context.put("date", new Date());
            context.put("utilities", new Utilities());
           
View Full Code Here

Examples of org.apache.roller.model.PlanetManager

            HttpServletResponse response) throws IOException, ServletException {
        ActionForward forward = mapping.findForward("planetSubscriptions.page");
        try {
            if (RollerSession.getRollerSession(request).isGlobalAdminUser()) {
                Roller roller = RollerFactory.getRoller();
                PlanetManager planet = roller.getPlanetManager();
                PlanetSubscriptionFormEx form = (PlanetSubscriptionFormEx)actionForm;
                if (request.getParameter("feedUrl") != null) {
                    String feedUrl = request.getParameter("feedUrl");
                    PlanetSubscriptionData sub =
                            planet.getSubscription(feedUrl);
                    form.copyFrom(sub, request.getLocale());
                } else {
                    form.doReset(mapping, request);
                }
               
                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.model.PlanetManager

            HttpServletResponse response) throws IOException, ServletException {
        ActionForward forward = mapping.findForward("planetSubscriptions.page");
        try {
            if (RollerSession.getRollerSession(request).isGlobalAdminUser()) {
                Roller roller = RollerFactory.getRoller();
                PlanetManager planet = roller.getPlanetManager();
                PlanetSubscriptionFormEx form = (PlanetSubscriptionFormEx)actionForm;
               
                form.doReset(mapping, request);
               
                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.model.PlanetManager

        ActionForward forward = mapping.findForward("planetSubscriptions.page");
        try {
            //RollerRequest rreq = RollerRequest.getRollerRequest(request);
            if (RollerSession.getRollerSession(request).isGlobalAdminUser()) {
                Roller roller = RollerFactory.getRoller();
                PlanetManager planet = roller.getPlanetManager();
                PlanetSubscriptionFormEx form = (PlanetSubscriptionFormEx)actionForm;
                if (form.getId() != null) {
                    PlanetSubscriptionData sub =
                            planet.getSubscriptionById(form.getId());
                   
                    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();
                   
                    form.doReset(mapping, request);
View Full Code Here

Examples of org.apache.roller.model.PlanetManager

            ActionForm actionForm, HttpServletRequest request,
            HttpServletResponse response) throws IOException, ServletException {
        ActionForward forward = mapping.findForward("planetSubscriptions.page");
        try {
            Roller roller = RollerFactory.getRoller();
            PlanetManager planet = roller.getPlanetManager();
            PlanetSubscriptionFormEx form = (PlanetSubscriptionFormEx)actionForm;
           
            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());                       
                    }                   
                    form.setGroupHandle(groupHandle);
                    planet.saveSubscription(sub);
                    planet.saveGroup(targetGroup);
                    roller.flush();
                   
                    messages.add(null,
                            new ActionMessage("planetSubscription.success.saved"));
                    saveMessages(request, messages);
View Full Code Here

Examples of org.apache.roller.model.PlanetManager

        {
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            if (RollerSession.getRollerSession(request).isGlobalAdminUser())
            {
                Roller roller = RollerFactory.getRoller();
                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.model.PlanetManager

        {
            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            if (RollerSession.getRollerSession(request).isGlobalAdminUser())
            {
                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();
                   
                    form.doReset(mapping, request);
View Full Code Here

Examples of org.apache.roller.model.PlanetManager

            RollerRequest rreq = RollerRequest.getRollerRequest(request);
            if (RollerSession.getRollerSession(request).isGlobalAdminUser())
            {
                PlanetGroupForm form = (PlanetGroupForm)actionForm;
                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());
                    }               
                    form.copyTo(group, request.getLocale());
                    planet.saveGroup(group)
                    roller.flush();

                    ActionMessages messages = new ActionMessages();
                    messages.add(null,
                            new ActionMessage("planetGroups.success.saved"));
View Full Code Here

Examples of org.apache.roller.model.PlanetManager

            ActionMapping mapping) throws RollerException
        {
            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"))
View Full Code Here

Examples of org.apache.roller.model.PlanetManager

            {
                BasePageModel pageModel = new BasePageModel(
                    "planetConfig.pageTitle", request, response, mapping);
                request.setAttribute("model",pageModel);               
                Roller roller = RollerFactory.getRoller();
                PlanetManager planet = roller.getPlanetManager();
                PlanetConfigData config = planet.getConfiguration();
                PlanetConfigForm form = (PlanetConfigForm)actionForm;
                if (config != null)
                {
                    form.copyFrom(config, request.getLocale());
                }
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.