Package org.apache.roller.weblogger.business.pings

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


        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

     * 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

        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

                }
            }
        }
       
        // 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

   
   
    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

    }
   
   
    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

       
        if(getPingTarget() != null) {
            try {
                getPingTarget().setAutoEnabled(true);
               
                PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
                pingTargetMgr.savePingTarget(getPingTarget());
                WebloggerFactory.getWeblogger().flush();
            } catch (Exception ex) {
                getLogger().error("Error saving ping target", ex);
                // TODO: i18n
                addError("Error saving ping target.");
View Full Code Here

       
        if(getPingTarget() != null) {
            try {
                getPingTarget().setAutoEnabled(false);
               
                PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
                pingTargetMgr.savePingTarget(getPingTarget());
                WebloggerFactory.getWeblogger().flush();
            } catch (Exception ex) {
                getLogger().error("Error saving ping target", ex);
                // TODO: i18n
                addError("Error saving ping target.");
View Full Code Here

    }
   
   
    public void loadPingTargets() {
        try {
            PingTargetManager pingTargetMgr = WebloggerFactory.getWeblogger().getPingTargetManager();
            setPingTargets(pingTargetMgr.getCommonPingTargets());
        } catch (WebloggerException ex) {
            log.error("Error loading common ping targets", ex);
            addError("commonPingTargets.error.loading");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.roller.weblogger.business.pings.PingTargetManager

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.