Examples of PingTargetManager


Examples of org.apache.roller.model.PingTargetManager

                              HttpServletRequest req, HttpServletResponse res)
        throws Exception
    {
        ActionForward forward = mapping.findForward(PING_SETUP_PAGE);
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
        WebsiteData website = rreq.getWebsite();
        try
        {
            if (!isAuthorized(rreq, website))
            {
                return mapping.findForward("access-denied");
            }

            BasePageModel pageModel =
                    new BasePageModel("pings.title", req, res, mapping);
            req.setAttribute("model",pageModel);
       
            List commonPingTargets = pingTargetMgr.getCommonPingTargets();
            req.setAttribute("commonPingTargets", commonPingTargets);

            Boolean allowCustomTargets = new Boolean(!PingConfig.getDisallowCustomTargets());
            req.setAttribute("allowCustomTargets", allowCustomTargets);

            List customPingTargets = allowCustomTargets.booleanValue() ?
                pingTargetMgr.getCustomPingTargets(website) : Collections.EMPTY_LIST;
            req.setAttribute("customPingTargets", customPingTargets);

            // Build isEnabled map (keyed by ping target id and values Boolean.TRUE/Boolean.FALSE)
            Map isEnabled = buildIsEnabledMap(rreq, commonPingTargets, customPingTargets);
            req.setAttribute("isEnabled", isEnabled);
View Full Code Here

Examples of org.apache.roller.model.PingTargetManager

    // TODO: Consider unifying with other RollerRequest methods
    // Private helper to get ping target specified by request
    private PingTargetData select(RollerRequest rreq) throws RollerException
    {
        String pingTargetId = rreq.getRequest().getParameter(RollerRequest.PINGTARGETID_KEY);
        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
        if (pingTargetId == null || pingTargetId.length() == 0)
        {
            throw new RollerException("Missing ping target id: " + pingTargetId);
        }

        PingTargetData pingTarget = pingTargetMgr.getPingTarget(pingTargetId);
        if (pingTarget == null)
        {
            throw new RollerException("No such ping target id: " + pingTargetId);
        }
        return pingTarget;
View Full Code Here

Examples of org.apache.roller.model.PingTargetManager

     * If custom ping targets have been disallowed, we just return the empty list.
     */
    protected List getPingTargets(RollerRequest rreq) throws RollerException
    {
        HttpServletRequest req = rreq.getRequest();
        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();

        Boolean allowCustomTargets = new Boolean(!PingConfig.getDisallowCustomTargets());
        req.setAttribute("allowCustomTargets", allowCustomTargets);

        List customPingTargets = allowCustomTargets.booleanValue() ?
            pingTargetMgr.getCustomPingTargets(rreq.getWebsite()) : Collections.EMPTY_LIST;

        return customPingTargets;
    }
View Full Code Here

Examples of org.apache.roller.weblogger.business.pings.PingTargetManager

    }
   
   
    public void myPrepare() {
       
        PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
       
        // load selected ping target, if possible
        if(getPingTargetId() != null) try {
            setPingTarget(pingTargetMgr.getPingTarget(getPingTargetId()));
        } catch (WebloggerException ex) {
            log.error("Error looking up ping target - "+getPingTargetId(), ex);
        }
       
        try {
            // load common ping targets list
            setCommonPingTargets(pingTargetMgr.getCommonPingTargets());
           
            // load custom ping targets list for weblog, if applicable
            if(!PingConfig.getDisallowCustomTargets()) {
                setCustomPingTargets(pingTargetMgr.getCustomPingTargets(getActionWeblog()));
            }
           
        } catch (WebloggerException ex) {
            log.error("Error loading ping target lists for weblog - "+getActionWeblog().getHandle(), ex);
            // TODO: i18n
View Full Code Here

Examples of org.apache.roller.weblogger.business.pings.PingTargetManager

        PingTarget testPing = new PingTarget();
        testPing.setName("testCommonPing");
        testPing.setPingUrl("http://localhost/testCommonPing");
       
        // store ping
        PingTargetManager pingMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
        pingMgr.savePingTarget(testPing);
       
        // flush to db
        WebloggerFactory.getWeblogger().flush();
       
        // query for it
        PingTarget ping = pingMgr.getPingTarget(testPing.getId());
       
        if(ping == null)
            throw new WebloggerException("error setting up ping target");
       
        return ping;
View Full Code Here

Examples of org.apache.roller.weblogger.business.pings.PingTargetManager

     * Convenience method for removing a ping target.
     */
    public static void teardownPingTarget(String id) throws Exception {
       
        // query for it
        PingTargetManager pingMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
        PingTarget ping = pingMgr.getPingTarget(id);
       
        // remove the ping
        pingMgr.removePingTarget(ping);
       
        // flush to db
        WebloggerFactory.getWeblogger().flush();
    }
View Full Code Here

Examples of org.apache.roller.weblogger.business.pings.PingTargetManager

        while(it.hasNext()) {
            this.strategy.remove((AutoPing) it.next());
        }
       
        // Remove the website's custom ping targets
        PingTargetManager pingTargetMgr = roller.getPingTargetManager();
        List pingtargets = pingTargetMgr.getCustomPingTargets(website);
        it = pingtargets.iterator();
        while(it.hasNext()) {
            this.strategy.remove((PingTarget) it.next());
        }
       
View Full Code Here

Examples of org.apache.roller.weblogger.business.pings.PingTargetManager

                }
            }
        }
       
        // add any auto enabled ping targets
        PingTargetManager pingTargetMgr = roller
        .getPingTargetManager();
        AutoPingManager autoPingMgr = roller
        .getAutopingManager();
       
        Iterator pingTargets = pingTargetMgr.getCommonPingTargets().iterator();
        PingTarget pingTarget = null;
        while(pingTargets.hasNext()) {
            pingTarget = (PingTarget) pingTargets.next();
           
            if(pingTarget.isAutoEnabled()) {
View Full Code Here

Examples of org.apache.roller.weblogger.business.pings.PingTargetManager

   
   
    public void loadPingTargets() {
       
        if(!PingConfig.getDisallowCustomTargets()) try {
            PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
            setPingTargets(pingTargetMgr.getCustomPingTargets(getActionWeblog()));
        } catch (WebloggerException ex) {
            log.error("Error loading common ping targets", ex);
            // TODO: i18n
            addError("Error loading common ping targets");
        }
View Full Code Here

Examples of org.apache.roller.weblogger.business.pings.PingTargetManager

    }
   
   
    public void loadPingTargets() {
        try {
            PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
            setPingTargets(pingTargetMgr.getCommonPingTargets());
        } catch (WebloggerException ex) {
            log.error("Error loading common ping targets", ex);
            // TODO: i18n
            addError("Error loading common ping targets");
        }
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.