Package org.apache.roller.planet.business

Examples of org.apache.roller.planet.business.PlanetManager


     */
    public String delete() {
       
        if(getGroup() != null) {
            try {
                PlanetManager pmgr = PlanetFactory.getPlanet().getPlanetManager();
                pmgr.deleteGroup(getGroup());
                PlanetFactory.getPlanet().flush();
               
                addMessage("planetSubscription.success.deleted");
            } catch(Exception ex) {
                log.error("Error deleting planet group - "+getBean().getId());
View Full Code Here


    public Planet getPlanet() {
       
        if(planet == null && planetHandle != null) {
            try {
                PlanetManager mgr = PlanetFactory.getPlanet().getPlanetManager();
                planet = mgr.getPlanet(planetHandle);
            } catch (PlanetException ex) {
                log.error("Error looking up planet "+planetHandle, ex);
            }
        }
       
View Full Code Here

        log.debug("checking planet handle "+planetHandle);
       
        boolean isPlanet = false;
       
        try {
            PlanetManager mgr = PlanetFactory.getPlanet().getPlanetManager();
            Planet planet = mgr.getPlanet(planetHandle);
           
            if(planet != null) {
                isPlanet = true;
            }
        } catch(Exception ex) {
View Full Code Here

    public PlanetGroup getGroup() {
       
        if(group == null && groupHandle != null) {
            try {
                PlanetManager mgr = PlanetFactory.getPlanet().getPlanetManager();
                group = mgr.getGroup(getPlanet(), groupHandle);
            } catch (PlanetException ex) {
                log.error("Error looking up group "+groupHandle, ex);
            }
        }
       
View Full Code Here

            return null;
        }
       
        StringBuffer url = new StringBuffer();
       
        PlanetManager mgr = PlanetFactory.getPlanet().getPlanetManager();
       
        url.append(PlanetRuntimeConfig.getProperty("site.absoluteurl"));
        url.append("/").append(planet).append("/");
       
        return url.toString();
View Full Code Here

        // update subscription entries
        int entries = 0;
        Set<SubscriptionEntry> newEntries = updatedSub.getEntries();
        log.debug("newEntries.size() = " + newEntries.size());
        if (newEntries.size() > 0) try {
            PlanetManager pmgr = PlanetFactory.getPlanet().getPlanetManager();
           
            // clear out old entries
            pmgr.deleteEntries(sub);
           
            // add fresh entries
            sub.getEntries().clear();
            sub.addEntries(newEntries);
           
            // save and flush
            pmgr.saveSubscription(sub);
            PlanetFactory.getPlanet().flush();

            log.debug("Added entries");
            entries += newEntries.size();           
View Full Code Here

       
        long startTime = System.currentTimeMillis();
       
        try {
            // update all subscriptions in the system
            PlanetManager pmgr = PlanetFactory.getPlanet().getPlanetManager();
            updateSubscriptions(pmgr.getSubscriptions());
        } catch (PlanetException ex) {
            throw new UpdaterException("Error getting subscriptions list", ex);
        }
       
        long endTime = System.currentTimeMillis();
View Full Code Here

   
   
    // convenience method which handles updating any arbitrary collection of subs
    private void updateSubscriptions(Collection<Subscription> subscriptions) {
       
        PlanetManager pmgr = PlanetFactory.getPlanet().getPlanetManager();
       
        Iterator subs = subscriptions.iterator();
        while (subs.hasNext()) {
            Subscription sub = (Subscription)subs.next();
           
            try {
                // reattach sub.  sub gets detached as we iterate
                sub = pmgr.getSubscriptionById(sub.getId());
            } catch (PlanetException ex) {
                log.warn("Subscription went missing while doing update: "+ex.getMessage());
            }
           
            // this updates and saves
View Full Code Here

    private Collection planets = Collections.EMPTY_LIST;
   
   
    public String execute() {
        try {
            PlanetManager pMgr = PlanetFactory.getPlanet().getPlanetManager();
            List planets = pMgr.getPlanets();
            //Collections.sort(planets);
            setPlanets(planets);
        } catch(Exception e) {
            log.error("PlanetsList.error.general", e);
            return LIST;
View Full Code Here

        if(getPlanetid() != null && getPlanetid().length() > 0) {
            // delete a planet
            log.debug("Deleting Planet ... "+getPlanetid());
           
            try {
                PlanetManager pMgr = PlanetFactory.getPlanet().getPlanetManager();
                Planet planet = pMgr.getPlanetById(getPlanetid());
                if(planet != null) {
                    pMgr.deletePlanet(planet);
                    PlanetFactory.getPlanet().flush();
                }
               
                // delete succeeded, handle rest of request as usual
                setSuccess("PlanetsList.message.planetDeleteSucceeded", planet.getHandle());
View Full Code Here

TOP

Related Classes of org.apache.roller.planet.business.PlanetManager

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.