Package org.apache.roller.pojos

Examples of org.apache.roller.pojos.PingTargetData


    /*
     * Create a new ping target (blank). Here we create a common ping target.
     */
    protected PingTargetData createPingTarget(RollerRequest rreq, PingTargetForm pingTargetForm) throws RollerException {
        return new PingTargetData(null, pingTargetForm.getName(), pingTargetForm.getPingUrl(), null, pingTargetForm.isAutoEnabled());
    }
View Full Code Here


    /*
     * Create a new ping target (blank). Here we create a custom ping target for the website.
     */
    protected PingTargetData createPingTarget(RollerRequest rreq, PingTargetForm pingTargetForm) throws RollerException {
        return new PingTargetData(null, pingTargetForm.getName(), pingTargetForm.getPingUrl(), rreq.getWebsite(), false);
    }
View Full Code Here

        // add any auto enabled ping targets
        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
        AutoPingManager autoPingMgr = RollerFactory.getRoller().getAutopingManager();
       
        Iterator pingTargets = pingTargetMgr.getCommonPingTargets().iterator();
        PingTargetData pingTarget = null;
        while(pingTargets.hasNext()) {
            pingTarget = (PingTargetData) pingTargets.next();
           
            if(pingTarget.isAutoEnabled()) {
                AutoPingData autoPing = new AutoPingData(null, pingTarget, newWeblog);
                autoPingMgr.saveAutoPing(autoPing);
            }
        }
    }
View Full Code Here

        }
       
        // Within that set of targets, fail if there is a target with the same name and that target doesn't
        // have the same id.
        for (Iterator i = brotherTargets.iterator(); i.hasNext();) {
            PingTargetData brother = (PingTargetData) i.next();
            // Fail if it has the same name but not the same id.
            if (brother.getName().equals(name) && (id == null || !brother.getId().equals(id))) {
                return false;
            }
        }
        // No conflict found
        return true;
View Full Code Here

            isEnabled.put(autoPing.getPingTarget().getId(), Boolean.TRUE);
        }
        // Somewhat awkward, but the two loops save building a separate combined list.
        // Add disabled common ones with FALSE
        for (Iterator i = commonPingTargets.iterator(); i.hasNext();) {
            PingTargetData pingTarget = (PingTargetData) i.next();
            if (isEnabled.get(pingTarget.getId()) == null) {
                isEnabled.put(pingTarget.getId(), Boolean.FALSE);
            }
        }
        // Add disabled custom ones with FALSE
        for (Iterator i = customPingTargets.iterator(); i.hasNext();) {
            PingTargetData pingTarget = (PingTargetData) i.next();
            if (isEnabled.get(pingTarget.getId()) == null) {
                isEnabled.put(pingTarget.getId(), Boolean.FALSE);
            }
        }
        return isEnabled;
    }
View Full Code Here

     * Enable a ping target.
     */
    public ActionForward enableSelected(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        AutoPingManager autoPingMgr = RollerFactory.getRoller().getAutopingManager();
        PingTargetData pingTarget = select(rreq);
        try {
            if (!isAuthorized(rreq, rreq.getWebsite())) {
                return mapping.findForward("access-denied");
            }
            AutoPingData autoPing = new AutoPingData(null, pingTarget, rreq.getWebsite());
View Full Code Here

     * Load delete confirmation view.
     */
    public ActionForward disableSelected(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        AutoPingManager autoPingMgr = RollerFactory.getRoller().getAutopingManager();
        PingTargetData pingTarget = select(rreq);
        try {
            if (!isAuthorized(rreq, rreq.getWebsite())) {
                return mapping.findForward("access-denied");
            }
            autoPingMgr.removeAutoPing(pingTarget, rreq.getWebsite());
View Full Code Here

     * Ping the selected target now.
     */
    public ActionForward pingSelectedNow(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        try {
            RollerRequest rreq = RollerRequest.getRollerRequest(req);
            PingTargetData pingTarget = select(rreq);
            WebsiteData website = rreq.getWebsite();
            try {
                if (!isAuthorized(rreq, website)) {
                    return mapping.findForward("access-denied");
                }
View Full Code Here

        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

            Matcher m = NESTED_BRACE_PAIR.matcher(thisTarget);
            if (m.matches() && m.groupCount() == 2) {
                String name = m.group(1).trim();
                String url = m.group(2).trim();
                logger.info("Creating common ping target '" + name + "' from configuration properties.");
                PingTargetData pingTarget = new PingTargetData(null, name, url, null, false);
                pingTargetMgr.savePingTarget(pingTarget);
            } else {
                logger.error("Unable to parse configured initial ping target '" + thisTarget + "'. Skipping this target. Check your setting of the property " + PINGS_INITIAL_COMMON_TARGETS_PROP);
            }
        }
View Full Code Here

TOP

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

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.